Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
# Starting with Ubuntu 18.04.3 (LTS) x64
# I'm using a local VMwareFusion vm instead of Docker or something because I want to be able to test with a video device.
# New install
# (not shown) make account, enable ssh, add vm to /etc/hosts
ssh vm
apt-get update
sudo apt install git
git clone
sudo apt install g++ \
scons \
libsdl2-dev \
libpng-dev \
libjpeg-dev \
libgl1-mesa-dev \
libglew-dev \
libopenal-dev \
(this is from readme-developer.txt in the repo)
cd endless-sky
# Ok so the project works when compiled normally.
git clone
cd emsdk
./emsdk install latest
./emsdk activate latest
source ./
# Now to start changing things in the SConstruct file
# hardcode emscripten as CXX compiler
env['CXX'] = 'em++'
# use SDL
env['CXXFLAGS'] = '-s USE_SDL=2'
# At this point I start iterating on a new command, I'll port the changes back once I figure them out
em++ -o build/release/ImageBuffer.o -c -s USE_SDL=2 -s SDL2_IMAGE_FORMATS='["png", "jpg"]' -std=c++11 -Wall -O3 source/ImageBuffer.cpp
# Fix some errors
# bool / boolean
- jpeg_read_header(&cinfo, true);
+ jpeg_read_header(&cinfo, boolean(true));
# can't find JCS_EXT_BGRA
# Just for now, I bet I still see SOMETHING if I take the alpha channel out?
- cinfo.out_color_space = JCS_EXT_BGRA;
+ cinfo.out_color_space = JCS_BG_RGB;
# source/ImageBuffer.cpp is compiling now, so let's keep going!
# Running scons gives our next error:
# source/Music.cpp:17:10: fatal error: 'mad.h' file not found
# I wonder what mad is? looks like mpeg stuff
# I don't see this on, is that the full list?
# I think I'm supposed to build it with emconfigure / make install, then change the linker path or something?
# Maybe it's time to go back to reading the emscripten tutorial.
# New command to iterate on: (this reproduces the error)
em++ -o build/release/Music.o -c -s USE_SDL=2 -s SDL2_IMAGE_FORMATS='["png", "jpg"]' -std=c++11 -Wall -O3 source/Music.cpp
apt install curl
curl '' --output libmad.tar.gz
tar xzf libmad.tar.gz
cd libmad-0.15.1b/
curl '' --output libmad.diff.gz
gunzip libmad.diff.gz
patch -i libmad.diff
emconfigure ./configure
emmake make
# Lots of errors!
# clang-11: error: unknown argument: '-fforce-mem'
# clang-11: error: unknown argument: '-fthread-jumps'
# clang-11: error: unknown argument: '-fcse-follow-jumps'
# clang-11: error: unknown argument: '-fcse-skip-blocks'
# clang-11: error: unknown argument: '-fregmove'
# I wonder what to do about these. I think I should do more research in case there is a port somewhere out there.
# It looks like there is maybe? Something about SDL_mixer and a flag for libmad?
# I'm stopping for now, but I think I'm already where I got to last year when I tried to do this!
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment