Skip to content

Commit

Permalink
Remove deployment
Browse files Browse the repository at this point in the history
  • Loading branch information
anacierdem authored and DragonMinded committed Nov 30, 2019
1 parent 46dbd48 commit 2f1014c
Show file tree
Hide file tree
Showing 10 changed files with 39 additions and 422 deletions.
21 changes: 4 additions & 17 deletions .travis.yml
@@ -1,11 +1,8 @@
language: node_js
language: C

services:
- docker

node_js:
- "node"

sudo: false

os:
Expand All @@ -15,16 +12,6 @@ install:
- npm install

script:
- npm run download
- npm run make
- npm run make install
- npm run make examples

deploy:
skip_cleanup: true
provider: script
script: npm config set '//registry.npmjs.org/:_authToken' "${NPM_TOKEN}" && echo "$DOCKER_PASSWORD" | docker login -u "$DOCKER_USERNAME" --password-stdin && npm publish
on:
branch: master
repo: anacierdem/libdragon
tags: true
- docker pull anacierdem/libdragon:toolchain
- docker run --name=libdragon -d --mount type=bind,source=$(pwd),target=/libdragon -w=/libdragon anacierdem/libdragon:toolchain tail -f /dev/null
- docker exec libdragon /bin/bash ./build.sh
17 changes: 3 additions & 14 deletions CHANGELOG.md
@@ -1,22 +1,11 @@
# Change Log

## [1.3.15] - 2019-01-11
### Changed

- `libdragon install` should skip CI checks.

## [1.3.14] - 2019-31-10
## [2.0.0]
### Changed

- Skip make install if no Makefile is found.
- Separated docker and deployment process.

## [1.3.12] - 2019-29-10
### Changed

- Reduce response time for NPM commands.
- Remove unnecessary console statements and double logs.

## [1.3.11] - 2019-29-10
## [1.3.15] - 2019-01-11
### Fixed

- Fix problem with wait ticks. They do not lock the system now.
Expand Down
14 changes: 0 additions & 14 deletions Dockerfile

This file was deleted.

117 changes: 15 additions & 102 deletions README.md
Expand Up @@ -4,96 +4,26 @@

This is a simple library for N64 that allows one to code using the gcc compiler suite and nothing else. No proprietary library is needed.

To make managing the toolcain easier, a docker container is used. Node.js is used to interact with the docker container for multi-platform support. You can inspect index.js if you prefer not to use node, but it makes things easier in general when working with docker.
See [docker wrapper](https://github.com/anacierdem/libdragon-docker) to quickly get libdragon up and running.

On a machine with node.js (>= 7.6) & docker you can simply do in this repository's root;

npm install

to install all necessary dependencies and;

npm run download

to download the toolchain image from docker repository. If you instead prefer to build it on your computer do;

npm run init

This will build and start the container and may take a while as it will initialize the docker container and build the toolchain from scratch.

Then you will be able to work on the files simultaneously with the container and any built binaries will be available in your workspace as it is mounted on the container.
You will need to share your working drive from docker UI for it to be able to access your workspace for Windows hosts.

You can also start / stop the docker container using;

npm start
npm stop

To build the examples do;

npm run make examples

Toolchain wrapper can also run make inside the container for you with the make command;

e.g to run clean all on root;

npm run make clean

The toolchain make command will be only run at the root-level. Additonal parameters are passed down to the make command. Also keep in mind that `--` is necessary for anything more complicated. For example use -C flag to make a directory instead;

npm run make -- -C your/path

Please note that the path should be unix-compatible, so you should not use auto completion on non-unix systems.

If you export `N64_BYTE_SWAP` environment variable with a value of true (`export N64_BYTE_SWAP=true`), you can generate byte-swapped `.v64` rom files. If this is not present the Makefiles will default to not swapped `.z64` files.

To use the toolchain's host make command with byte swap enabled, pass a make variable like so;

npm run make examples N64_BYTE_SWAP=true

You can also permanently set `BYTE_SWAP` for docker container in `index.js` and stop/start it for changes to take effect.

If you need more control over the toolchain container bash into it with;

docker exec -i -t libdragon /bin/bash

It is also possible to install libdragon as a global NPM module, making it possible to invoke it as;

libdragon download
libdragon init
libdragon start
libdragon stop
libdragon make [...params]

Keep in mind that the same docker container (with the default name of libdragon) will be used for the global and git cloned libdragon instances. Also successive `libdragon` commands can remove the old containers. **BE CAREFUL** containers are temporary assets in this context.

You can install libdragon as an NPM dependency by `npm install libdragon --save` in order to use docker in your other N64 projects. In this case, your project name will be used as the container name and this is shared among all NPM projects using that name. Again, your project's root is mounted on the docker image. Then above commands can only be used as NPM scripts in your package.json, such as;

"scripts": {
"init": "libdragon download",
"build": "libdragon make",
"clean": "libdragon make clean"
}
To get started from scratch, follow the following steps:

Finally, you can make an NPM package that a `libdragon` project can depend on. Just include a Makefile on the repository root with recipes for `all` and `install`. On the depending project, after installing libdragon and the dependency with `npm install [dep name]`, one can install libdragon dependencies on the current docker container using package.json scripts.
1. Create a directory and copy the build script there from the tools/ directory.
2. Read the comments in the build script to see what additional packages are needed.
3. Run ./build from the created directory, let it build and install the toolchain.
4. Install libpng-dev if not already installed.

For example this package.json;
*Below steps can also be executed by running `build.sh` at the top level.*

{
"name": "libdragonDependentProject",
"version": "1.0.0",
"description": "",
"scripts": {
"build": "libdragon make",
"clean": "libdragon make clean",
"prepare": "libdragon install"
},
"dependencies": {
"ed64": [version],
"libdragon": [version]
}
}
5. Make libdragon by typing 'make' at the top level.
6. Install libdragon by typing 'make install' at the top level.
7. Make the tools by typing 'make tools' at the top level.
8. Install the tools by typing 'make tools-install' at the top level.
9. Install libmikmod for the examples using it. See `build.sh` at the top level for details.
10. Compile the examples by typing 'make examples' at the top level.

will download the docker image, run it with the name `libdragonDependentProject` and run `make && make install` for ed64 upon running `npm install`. This is an experimental dependency management. To develop a dependency [this](https://github.com/anacierdem/libdragon-dependency) is a good starting point.
You are now ready to run the examples on your N64.
For more information, visit http://www.dragonminded.com/n64dev/

# RSP assembly

Expand All @@ -118,20 +48,3 @@ becomes;
Basically all operands are required and separated by commas.

While using these custom instructions, you should use `v0`-`v31`for naming vector registers and `s0`-`s31` for naming scalar registers.

# Original documentation for reference

To get started from scratch, follow the following steps:

1. Create a directory and copy the build script there from the tools/ directory.
2. Read the comments in the build script to see what additional packages are needed.
3. Run ./build from the created directory, let it build and install the toolchain.
4. Make libdragon by typing 'make' at the top level.
5. Install libdragon by typing 'make install' at the top level.
6. Install libpng-dev if not already installed.
7. Make the tools by typing 'make tools' at the top level.
8. Install the tools by typing 'make tools-install' at the top level.
9. Compile the examples by typing 'make examples' at the top level.

You are now ready to run the examples on your N64.
For more information, visit http://www.dragonminded.com/n64dev/
14 changes: 14 additions & 0 deletions build.sh
@@ -0,0 +1,14 @@
#!/bin/bash
make -j8 clean && \
make -j8 && \
make install && \
make -j8 tools && \
make tools-install && \
git clone https://github.com/networkfusion/libmikmod.git /tmp/libmikmod && \
pushd /tmp/libmikmod/n64 && \
git checkout 738b1e8b11b470360b1b919680d1d88429d9d174 && \
make -j8 && \
make install && \
popd && \
rm -rf /tmp/libmikmod && \
make -j8 examples

0 comments on commit 2f1014c

Please sign in to comment.