Skip to content

Instantly share code, notes, and snippets.

@gogromat
Last active September 1, 2018 00:12

Revisions

  1. gogromat revised this gist Jan 12, 2015. 1 changed file with 2 additions and 0 deletions.
    2 changes: 2 additions & 0 deletions INSTALL_EM_DROPBOX.md
    Original file line number Diff line number Diff line change
    @@ -92,6 +92,8 @@ 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 emconfigure works

    Check if you have command **emconfigure**.
    If not, you need to manually add emscripten to the PATH

  2. gogromat revised this gist Jan 12, 2015. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion INSTALL_EM_DROPBOX.md
    Original file line number Diff line number Diff line change
    @@ -143,7 +143,7 @@ Better start it as a server:
    - **python -m SimpleHTTPServer**
    - in browser go to **localhost:8000/dropbox.html**

    Firefox is probably going to lag a lot, but it's better than Chrome which doesn't even
    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][dosbox].

  3. gogromat revised this gist Jan 12, 2015. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion INSTALL_EM_DROPBOX.md
    Original file line number Diff line number Diff line change
    @@ -126,7 +126,7 @@ 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**
    - following commands are better run in **bash** as **root** (do exactly as it is listed below)
    - **sudo -s**
    - **./autogen.sh**
    - **emconfigure ./configure**
  4. gogromat revised this gist Jan 11, 2015. 1 changed file with 2 additions and 0 deletions.
    2 changes: 2 additions & 0 deletions INSTALL_EM_DROPBOX.md
    Original file line number Diff line number Diff line change
    @@ -1,3 +1,5 @@
    # Install Em-Dosbox on Ubuntu 14.04

    # Part 1: Install emscripten & clang

    ## Install preprequisites
  5. gogromat revised this gist Dec 29, 2014. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion INSTALL_EM_DROPBOX.md
    Original file line number Diff line number Diff line change
    @@ -148,7 +148,7 @@ You can also follow the patches at em-dosbox project's [readme][dosbox].
    ## Packaging games

    Next is to change the PYTHON to 'python' inside of **src/packager.py**.
    This file tries to use emscripten file_packager and uses the mysterious **PYTHON** variable.
    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
  6. gogromat revised this gist Dec 29, 2014. 1 changed file with 1 addition and 0 deletions.
    1 change: 1 addition & 0 deletions INSTALL_EM_DROPBOX.md
    Original file line number Diff line number Diff line change
    @@ -156,6 +156,7 @@ Since script is going to fail, it's time to open it up and change it

    Now we are ready to try running some games!
    - As a test I recommend to download "Blocks from Hell" from [here][blocks].
    (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**
  7. gogromat revised this gist Dec 29, 2014. 1 changed file with 2 additions and 2 deletions.
    4 changes: 2 additions & 2 deletions INSTALL_EM_DROPBOX.md
    Original file line number Diff line number Diff line change
    @@ -1,4 +1,4 @@
    # Install emscripten & clang
    # Part 1: Install emscripten & clang

    ## Install preprequisites

    @@ -116,7 +116,7 @@ WARNING root: no input files
    - If it works, modify ~/.emscripten and Change NODE_... with "nodejs"


    ## Install em-dosbox
    # Part 2: Install em-dosbox

    After you are sure that **emcc** shows no errors or warnings, let's clone [em-dosbox][dosbox].
    You will need **automake** & **autoconf** packages installed
  8. gogromat revised this gist Dec 27, 2014. 1 changed file with 37 additions and 37 deletions.
    74 changes: 37 additions & 37 deletions INSTALL_EM_DROPBOX.md
    Original file line number Diff line number Diff line change
    @@ -6,7 +6,7 @@
    #Update the package lists
    sudo apt-get update
    # Install *gcc* (and related dependencies)
    # Install **gcc** (and related dependencies)
    sudo apt-get install build-essential
    # Install cmake
    @@ -34,22 +34,22 @@ I think you can install it from a package, but maybe you will need to compile it
    ### If installing from package

    I think this should do it:
    - *sudo apt-get install libsdl-image1.2-dev* *OR*
    - *sudo apt-get install libsdl1.2-dev libsdl1.2debian*
    - **sudo apt-get install libsdl-image1.2-dev** **OR**
    - **sudo apt-get install libsdl1.2-dev libsdl1.2debian**

    ### If compiling manually
    - Download *source code* from sdl website [here][sdl].
    - Download **source code** from sdl website [here][sdl].
    - Extract to folder of your liking
    - *cd* into it
    - **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.
    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:
    - **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!
    @@ -70,7 +70,7 @@ This should do the trick. Let's continue.

    - Grab source file from [here][emsdk]
    - Extract to folder of your liking
    - *cd* into it
    - **cd** into it

    ```
    # Fetch the latest registry of available tools.
    @@ -90,20 +90,20 @@ 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*.
    Check if you have command **emconfigure**.
    If not, you need to manually add emscripten to the PATH

    Add this to *~/.bashrc* :
    Add this to **~/.bashrc** :

    - *nano ~/.bashrc*
    - **nano ~/.bashrc**
    ```
    export EMSCRIPTEN=/PATH/TO/emsdk/emscripten/master
    export EMSCRIPTEN_ROOT=$EMSCRIPTEN:
    export PATH=$PATH:$EMSCRIPTEN:
    ```
    - *source ~/.bashrc*
    - **source ~/.bashrc**

    Check that *emcc* does not return any error.
    Check that **emcc** does not return any error.
    Ideally you should see the following:
    ```
    INFO root: (Emscripten: Running sanity checks)
    @@ -118,50 +118,50 @@ WARNING root: no input files

    ## Install em-dosbox

    After you are sure that *emcc* shows no errors or warnings, let's clone [em-dosbox][dosbox].
    You will need *automake* & *autoconf* packages installed
    After you are sure that **emcc** shows no errors or warnings, let's clone [em-dosbox][dosbox].
    You will need **automake** & **autoconf** packages installed

    - *sudo apt-get install autoconf*
    - **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*
    - *sudo -s*
    - *./autogen.sh*
    - *emconfigure ./configure*
    - *make*
    - **cd** into em-dosbox
    - following commands are better run in **bash** as **root**
    - **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
    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*
    - **cd** to **/src** folder
    - **python -m SimpleHTTPServer**
    - in browser go to **localhost:8000/dropbox.html**

    Firefox is probably going to lag a lot, 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][dosbox].

    ## Packaging games

    Next is to change the PYTHON to 'python' inside of *src/packager.py*.
    This file tries to use emscripten file_packager and uses the mysterious *PYTHON* variable.
    Next is to change the PYTHON to 'python' inside of **src/packager.py**.
    This file tries to use emscripten 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][blocks].
    - 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*
    - 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!

  9. gogromat created this gist Dec 27, 2014.
    171 changes: 171 additions & 0 deletions INSTALL_EM_DROPBOX.md
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,171 @@
    # Install emscripten & clang

    ## Install preprequisites

    ```
    #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
    ```

    ## Install sdl 1.2 library

    - 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.

    ### If installing from package

    I think this should do it:
    - *sudo apt-get install libsdl-image1.2-dev* *OR*
    - *sudo apt-get install libsdl1.2-dev libsdl1.2debian*

    ### If compiling manually
    - Download *source code* from sdl website [here][sdl].
    - 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


    ## Install emsdk

    - Grab source file from [here][emsdk]
    - 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"


    ## Install em-dosbox

    After you are sure that *emcc* shows no errors or warnings, let's clone [em-dosbox][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*
    - *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 a lot, 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][dosbox].

    ## Packaging games

    Next is to change the PYTHON to 'python' inside of *src/packager.py*.
    This file tries to use emscripten 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][blocks].
    - 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!

    [emsdk]: http://kripken.github.io/emscripten-site/docs/getting_started/downloads.html#sdk-downloads
    [dosbox]: https://github.com/dreamlayers/em-dosbox.git
    [sdl]: https://www.libsdl.org/download-1.2.php
    [blocks]: http://www.dosgamesarchive.com/file/blocks-from-hell/blocks/