#Update the package lists
sudo apt-get update
# Install **gcc** (and related dependencies)
sudo apt-get install build-essential
# Install cmake
sudo apt-get install cmake
# Install Python (by default is bundled with Ubuntu)
sudo apt-get install python2.7
# Install node.js
sudo apt-get install nodejs
# Install Java
sudo apt-get install default-jre
# Install git (optional)
sudo apt-get install git-core
- Only install ~1.2+, NOT SDL 2+. Otherwise it won't work :s
I think you can install it from a package, but maybe you will need to compile it.
I think this should do it:
- sudo apt-get install libsdl-image1.2-dev OR
- sudo apt-get install libsdl1.2-dev libsdl1.2debian
- Download source code from sdl website here.
- Extract to folder of your liking
- cd into it
- sudo ./configure
If you use Ubuntu x32 you can probably proceed at running make and make install at this point. If you use Ubuntu x64 you would probably need to fix x11 video reference at this point. Somehow it does not work, so the steps are the following:
- cd /src/video/x11
- nano +166 SDL_x11sym.h (because it is around line 166)
- add #if 0 and #endif wrapper around this part:
#if 0 <- add this!
#ifdef LONG64
SDL_X11_MODULE(IO_32BIT)
SDL_X11_SYM(int,_XData32,(Display *dpy,register long *data,unsigned len),(dpy,data,len),return)
SDL_X11_SYM(void,_XRead32,(Display *dpy,register long *data,long len),(dpy,data,len),)
#endif
#endif <- add this!
This should do the trick. Let's continue.
- sudo make
- sudo make install
- Grab source file from here
- Extract to folder of your liking
- cd into it
# Fetch the latest registry of available tools.
./emsdk update
# Download and install the latest SDK tools.
./emsdk install latest
# Set up the compiler configuration to point to the "latest" SDK.
./emsdk activate latest
# Linux/Mac OS X only: Set the current Emscripten path
source ./emsdk_env.sh
Now it is time to see if you have any prerequisites missing, lol. If prerequisites are missing (like Java, or node), then the path will be missing essential binaries.
Check if you have command emconfigure. If not, you need to manually add emscripten to the PATH
Add this to ~/.bashrc :
- nano ~/.bashrc
export EMSCRIPTEN=/PATH/TO/emsdk/emscripten/master
export EMSCRIPTEN_ROOT=$EMSCRIPTEN:
export PATH=$PATH:$EMSCRIPTEN:
- source ~/.bashrc
Check that emcc does not return any error. Ideally you should see the following:
INFO root: (Emscripten: Running sanity checks)
WARNING root: no input files
## Point node to nodejs
- Error ex. "Node is missing, blah blah blah".
- Make sure you have node installed. Test it with "nodejs"
- If it works, modify ~/.emscripten and Change NODE_... with "nodejs"
After you are sure that emcc shows no errors or warnings, let's clone em-dosbox. You will need automake & autoconf packages installed
- sudo apt-get install autoconf
- git clone https://github.com/dreamlayers/em-dosbox.git
- cd into em-dosbox
- following commands are better run in bash as root (do exactly as it is listed below)
- sudo -s
- ./autogen.sh
- emconfigure ./configure
- make
If you are lucky, the horror of installation is almost over. In /src/ you should see dosbox.html and dosbox.js files
Now you can try opening dosbox.html in your browser. Better start it as a server: "Remember that the same origin policy prevent access to data files in some browsers when using file:// URLs."
- cd to /src folder
- python -m SimpleHTTPServer
- in browser go to localhost:8000/dropbox.html
Firefox is probably going to lag, but it's better than Chrome which doesn't even load for some reason :s. You can also follow the patches at em-dosbox project's readme.
Next is to change the PYTHON to 'python' inside of src/packager.py. This file tries to use emscripten's file_packager and uses the mysterious PYTHON variable. Since script is going to fail, it's time to open it up and change it
- nano /src/packager.py
- change PYTHON to 'python'
Now we are ready to try running some games!
- As a test I recommend to download "Blocks from Hell" from here. (Do it from under Linux, otherwise it downloads some weird installer)
- place blocks into the /src/ folder so it becomes /src/blocks.
- cd to /src
- Now switch to root in bash: sudo -s
- Run ./packager.py blocks blocks.exe
- It should create blocks.html file
- Go to localhost:8000/blocks.html
If you are lucky, you will be able to play Blocks from Hell! w00t!
Hello!
Stopped in step "Part 2: Install em-dosbox", specifically on "make" command. The "terminal" spits out the following log: http://pastebin.com/GwudhAy5 .
Before command "make" is performed "emconfigure ./configure", then the system alerted "emconfigure is missing, try to install emscripten by apt-get", then I did this. After this manipulation, "emconfigure ./configure" was executed, that it log http://pastebin.com/9sa8X0Pu .
Any idea how to fix a bug with "make"?
PS. Sorry for my eng :)