Compare commits
No commits in common. "f376ca6402bcaa279579a52001ed2414eef22dc5" and "c75191e0969cde19363775c0c20f7c1cc3b0f664" have entirely different histories.
f376ca6402
...
c75191e096
|
@ -12,19 +12,14 @@ RUN DEBIAN_FRONTEND=noninteractive apt install -y bash \
|
||||||
automake \
|
automake \
|
||||||
make
|
make
|
||||||
|
|
||||||
RUN cd /opt && git clone https://github.com/boostorg/boost.git boost
|
RUN cd /opt && wget https://github.com/boostorg/boost/archive/refs/tags/boost-1.37.0.tar.gz
|
||||||
RUN cd /opt/boost && git submodule update --init --recursive
|
RUN cd /opt && tar -xf boost-1.37.0.tar.gz
|
||||||
|
|
||||||
RUN cd /opt/boost && ./bootstrap.sh
|
RUN mkdir -p /opt/libboost
|
||||||
|
RUN cd /opt && ls
|
||||||
|
RUN cd /opt/boost-boost-1.37.0 && emconfigure ./configure --prefix=/opt/libboost
|
||||||
|
|
||||||
RUN cd /opt/boost && ./b2 -j4 toolset=emscripten \
|
RUN cd /opt/boost-boost-1.37.0 && emmake make install -j CPPFLAGS="-s USE_PTHREADS=1" cxxflags="-s USE_PTHREADS=1"
|
||||||
cflags="-s USE_PTHREADS=1" cxxflags="-s USE_PTHREADS=1" \
|
|
||||||
--prefix=/opt/libboost \
|
|
||||||
--build-dir=/opt/libboost_build \
|
|
||||||
link=static \
|
|
||||||
variant=release \
|
|
||||||
threading=single \
|
|
||||||
runtime-link=static
|
|
||||||
|
|
||||||
WORKDIR /usr/src/
|
WORKDIR /usr/src/
|
||||||
|
|
||||||
|
|
|
@ -0,0 +1,26 @@
|
||||||
|
FROM emscripten/emsdk:latest
|
||||||
|
|
||||||
|
RUN DEBIAN_FRONTEND=noninteractive apt update
|
||||||
|
|
||||||
|
RUN DEBIAN_FRONTEND=noninteractive apt install -y \
|
||||||
|
bash \
|
||||||
|
libz-dev \
|
||||||
|
libpng-dev \
|
||||||
|
libjpeg-dev \
|
||||||
|
libtiff-dev \
|
||||||
|
libopenexr-dev \
|
||||||
|
autoconf \
|
||||||
|
automake \
|
||||||
|
make
|
||||||
|
|
||||||
|
RUN cd /opt && git clone --recursive https://github.com/boostorg/boost.git
|
||||||
|
|
||||||
|
RUN echo "using emscripten : : em++ ;" > ~/user-config.jam
|
||||||
|
|
||||||
|
RUN mkdir -p /opt/libboost_build
|
||||||
|
RUN mkdir -p /opt/libboost
|
||||||
|
|
||||||
|
RUN cd /opt/boost && ./bootstrap.sh --with-libraries=all --with-toolset=emscripten
|
||||||
|
|
||||||
|
RUN cd /opt/boost && ./b2 -j4 toolset=emscripten --test-config=/opt/user-config.jam --prefix=/opt/libboost --build-dir=/opt/libboost_build link=static variant=release address-model=64 architecture=x86
|
||||||
|
|
|
@ -0,0 +1,22 @@
|
||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
FROM emscripten/emsdk:latest
|
||||||
|
|
||||||
|
RUN DEBIAN_FRONTEND=noninteractive apt update
|
||||||
|
|
||||||
|
RUN DEBIAN_FRONTEND=noninteractive apt install -y \
|
||||||
|
bash \
|
||||||
|
libz-dev \
|
||||||
|
libpng-dev \
|
||||||
|
libjpeg-dev \
|
||||||
|
libtiff-dev \
|
||||||
|
libopenexr-dev \
|
||||||
|
autoconf \
|
||||||
|
automake \
|
||||||
|
make \
|
||||||
|
libboost-all-dev
|
||||||
|
|
||||||
|
WORKDIR /usr/src/
|
||||||
|
|
||||||
|
ENV POVRAY_VERSION=3.7-stable
|
||||||
|
RUN cd /usr/src/ && git clone --depth 1 --branch $POVRAY_VERSION https://github.com/POV-Ray/povray povray
|
|
@ -0,0 +1,3 @@
|
||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
sudo docker build . -t povray_wasm
|
|
@ -0,0 +1,73 @@
|
||||||
|
#!/bin/bash -x
|
||||||
|
|
||||||
|
EMAIL="himattmcwilliams@gmail.com"
|
||||||
|
NAME="Matt McWilliams"
|
||||||
|
BOOST_ROOT="/lib/x86_64-linux-gnu/"
|
||||||
|
#Build dir?
|
||||||
|
#BOOST_ROOT=/opt/libboost/lib
|
||||||
|
|
||||||
|
# https://jeromewu.github.io/build-ffmpeg-webassembly-version-part-3-v0.1/
|
||||||
|
# altered for povray
|
||||||
|
|
||||||
|
# verify Emscripten version
|
||||||
|
emcc -v > build.log
|
||||||
|
|
||||||
|
cd unix/
|
||||||
|
|
||||||
|
sh prebuild.sh
|
||||||
|
|
||||||
|
# configure povray
|
||||||
|
CFLAGS="-pthread -DBOOST_THREAD_USE_LIB -s USE_BOOST_HEADERS=1"
|
||||||
|
LDFLAGS="$CFLAGS -s INITIAL_MEMORY=33554432" # 33554432 bytes = 32 MB
|
||||||
|
CONFIG_ARGS=(
|
||||||
|
--arch=x86_32 # use x86_32 to achieve minimal architectural optimization
|
||||||
|
--enable-cross-compile # enable cross compile
|
||||||
|
--disable-x86asm # disable x86 asm
|
||||||
|
--disable-inline-asm # disable inline asm
|
||||||
|
--disable-stripping # disable stripping
|
||||||
|
--disable-programs # disable programs build (incl. ffplay, ffprobe & ffmpeg)
|
||||||
|
--disable-doc # disable doc
|
||||||
|
--extra-cflags="$CFLAGS"
|
||||||
|
--extra-cxxflags="$CFLAGS"
|
||||||
|
--extra-ldflags="$LDFLAGS"
|
||||||
|
--nm="llvm-nm -g"
|
||||||
|
--ar=emar
|
||||||
|
--as=llvm-as
|
||||||
|
--ranlib=llvm-ranlib
|
||||||
|
--cc=emcc
|
||||||
|
--cxx=em++
|
||||||
|
--objcc=emcc
|
||||||
|
--dep-cc=emcc
|
||||||
|
)
|
||||||
|
|
||||||
|
ARGS=(
|
||||||
|
LIBS="-lboost_system -lboost_thread -lboost_date_time"
|
||||||
|
COMPILED_BY="$NAME <$EMAIL>"
|
||||||
|
CC=emcc
|
||||||
|
CXX=em++
|
||||||
|
CFLAGS="$CFLAGS"
|
||||||
|
CXXFLAGS="$CFLAGS"
|
||||||
|
LDFLAGS="$LDFLAGS"
|
||||||
|
--host=wasm32
|
||||||
|
)
|
||||||
|
|
||||||
|
BOOST_ROOT=$BOOST_ROOT emconfigure ./configure "${ARGS[@]}"
|
||||||
|
|
||||||
|
# build dependencies
|
||||||
|
emmake make -j2
|
||||||
|
|
||||||
|
exit
|
||||||
|
|
||||||
|
# build ffmpeg.wasm
|
||||||
|
mkdir -p wasm/dist
|
||||||
|
ARGS=(
|
||||||
|
-I. -I./fftools
|
||||||
|
-Llibavcodec -Llibavdevice -Llibavfilter -Llibavformat -Llibavresample -Llibavutil -Llibpostproc -Llibswscale -Llibswresample
|
||||||
|
-Qunused-arguments
|
||||||
|
-o wasm/dist/ffmpeg.js fftools/ffmpeg_opt.c fftools/ffmpeg_filter.c fftools/ffmpeg_hw.c fftools/cmdutils.c fftools/ffmpeg.c
|
||||||
|
-lavdevice -lavfilter -lavformat -lavcodec -lswresample -lswscale -lavutil -lm
|
||||||
|
-s USE_SDL=2 # use SDL2
|
||||||
|
-s USE_PTHREADS=1 # enable pthreads support
|
||||||
|
-s INITIAL_MEMORY=33554432 # 33554432 bytes = 32 MB
|
||||||
|
)
|
||||||
|
emcc "${ARGS[@]}"
|
|
@ -44,7 +44,7 @@ cd unix/
|
||||||
./prebuild.sh
|
./prebuild.sh
|
||||||
cd ../
|
cd ../
|
||||||
|
|
||||||
BOOST_ROOT=$BOOST_ROOT ./configure "${ARGS[@]}"
|
BOOST_ROOT=$BOOST_ROOT emconfigure ./configure "${ARGS[@]}"
|
||||||
|
|
||||||
#emmake make -j CPPFLAGS="${CPPFLAGS}"
|
#emmake make -j CPPFLAGS="${CPPFLAGS}"
|
||||||
#make install
|
#make install
|
|
@ -5,4 +5,4 @@ bash ./build_docker.sh
|
||||||
sudo docker run \
|
sudo docker run \
|
||||||
-v $PWD:/usr/src/build \
|
-v $PWD:/usr/src/build \
|
||||||
povray_wasm \
|
povray_wasm \
|
||||||
sh -c 'cd /usr/src/povray && cp ../build/build.sh build.sh && bash build.sh'
|
sh -c 'cd /usr/src/povray && cp ../build/build_ubuntu.sh build.sh && bash build.sh'
|
|
@ -1,3 +0,0 @@
|
||||||
#!/bin/bash
|
|
||||||
|
|
||||||
sudo docker build -t povray_wasm --rm .
|
|
Loading…
Reference in New Issue