Skip to content

Commit

Permalink
Merge pull request #205 from Fuco1/feature/add-docker-environment
Browse files Browse the repository at this point in the history
Add docker development environment
  • Loading branch information
Wilfred committed Jun 12, 2017
2 parents 06b8c13 + a432de5 commit 80bb25b
Show file tree
Hide file tree
Showing 4 changed files with 54 additions and 8 deletions.
1 change: 1 addition & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
*
19 changes: 19 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
FROM ubuntu:xenial

RUN apt-get update && apt-get install -y \
automake \
build-essential \
curl \
libgif-dev \
libgnutls-dev \
libgtk-3-dev \
libjpeg-dev \
libncurses5-dev \
libtiff-dev \
libxml2-dev \
libxpm-dev \
texinfo

ENV PATH "/root/.cargo/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin"

RUN curl https://sh.rustup.rs -o rustup.sh && sh rustup.sh --default-toolchain nightly -y && rustup default nightly
30 changes: 22 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -143,21 +143,35 @@ more Emacs-y.

1. You will need [Rust installed](https://www.rust-lang.org/en-US/install.html). If you're on macOS, you will need Rust
nightly.

2. You will need a C compiler and toolchain. On Linux, you can do
something like `apt-get install build-essential automake`. On
macOS, you'll need Xcode.

3. You will need some C libraries. On Linux, you can install
everything you need with:

apt-get install texinfo libjpeg-dev libtiff-dev \
libgif-dev libxpm-dev libgtk-3-dev libgnutls-dev \
libncurses5-dev libxml2-dev

On macOS, you'll need libxml2 (via `xcode-select --install`) and
gnutls (via `brew install gnutls`).


#### Dockerized development environment

If you don't want to bother with the above setup you can use the provided docker environment. Make sure you have [docker](https://www.docker.com/) 1.12+ and [docker-compose](https://github.com/docker/compose) 1.8+ available.

To spin up the environment run

``` shell
docker-compose up -d
```

First time you run this command docker will build the image. After that any subsequent startups will happen in less than a second.

The working directory with remacs will be mount under the same path in the container so editing the files on your host machine will automatically be reflected inside the container. To build remacs use the steps from [Building Remacs](#building-remacs) prefixed with `docker-compose exec remacs`, this will ensure the commands are executed inside the container.

### Building Remacs

```
Expand Down Expand Up @@ -246,9 +260,9 @@ $ gcc -Ilib -E src/dummy.c > dummy_exp.c
This gives us a file that ends with:
``` c
static struct Lisp_Subr
static struct Lisp_Subr
# 3 "src/dummy.c" 3 4
_Alignas
_Alignas
# 3 "src/dummy.c"
(8) Snumberp = { { PVEC_SUBR << PSEUDOVECTOR_AREA_BITS }, { .a1 = Fnumberp }, 1, 1, "numberp", 0, 0}; Lisp_Object Fnumberp
Expand All @@ -267,7 +281,7 @@ a `numberp` function that does the actual work, then `defun!` handles
these definitions for us:

``` rust
// This is the function that gets called when
// This is the function that gets called when
// we call numberp in elisp.
fn numberp(object: LispObject) -> LispObject {
if lisp::NUMBERP(object) {
Expand Down
12 changes: 12 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
version: '2'

services:
remacs:
build: .
image: remacs-build:latest
working_dir: ${PWD}
tty: true
# Unfortunately dumping doesn't work without this
privileged: true
volumes:
- .:${PWD}

0 comments on commit 80bb25b

Please sign in to comment.