1
- FROM ojkwon/arch-nvm-node:aa3f35d-node8 .9.1-npm5.6
1
+ FROM ojkwon/arch-nvm-node:801bb47-node-8 .9.1-npm5.6
2
2
MAINTAINER OJ Kwon <
[email protected] >
3
3
4
4
# Build time args
5
5
ARG BUILD_TARGET=""
6
+ ARG PROTOBUF_VERSION=""
6
7
7
8
# Upgrade system
8
9
RUN pacman --noconfirm -Syyu
@@ -32,26 +33,29 @@ RUN cd $TMPDIR && \
32
33
33
34
# END gcc--------------------------------
34
35
36
+ USER builder
37
+
35
38
# Initialize emcc
36
- RUN emcc
39
+ RUN emcc && emcc --version
37
40
38
- USER builder
41
+ # Install specific version of protobuf corresponding to protobuf-wasm.
42
+ RUN cd $TMPDIR && \
43
+ curl https://archive.archlinux.org/packages/p/protobuf/protobuf-$PROTOBUF_VERSION-1-x86_64.pkg.tar.xz > ./protobuf-$PROTOBUF_VERSION-1-x86_64.pkg.tar.xz && \
44
+ curl https://archive.archlinux.org/packages/p/protobuf/protobuf-$PROTOBUF_VERSION-1-x86_64.pkg.tar.xz.sig > ./protobuf-$PROTOBUF_VERSION-1-x86_64.pkg.tar.xz.sig && \
45
+ sudo pacman --noconfirm -U protobuf-$PROTOBUF_VERSION-1-x86_64.pkg.tar.xz
39
46
40
- # Install 3.1 version of protobuf via makepkg instead of latest, to align with
41
- # protobuf-emscripten. Also build emscripten-protobuf as well, place build under
42
- # /home/builder/temp/.libs
47
+ # Build emscripten-wasm as well to generate lib build will be placed build under `/home/builder/temp/.libs`
43
48
RUN if [[ "${BUILD_TARGET}" == "protobuf" ]]; then \
44
- echo "installing protobuf 3.1 dependency" && \
45
- mkdir $TMPDIR/proto31 && cd $TMPDIR/proto31 && \
46
- curl "https://git.archlinux.org/svntogit/packages.git/plain/trunk/PKGBUILD?h=packages/protobuf&id=fa8b9da391b26b6ace1941e9871a6416db74d67b" > ./PKGBUILD && \
47
- makepkg --skipchecksums && sudo pacman --noconfirm -U *.pkg.tar.xz && \
48
- cd $TMPDIR && git clone https://github.com/kwonoj/protobuf-emscripten && \
49
- cd $TMPDIR/protobuf-emscripten/3.1.0 && \
50
- sh autogen.sh && emconfigure ./configure && emmake make && \
51
- cp -r ./src/.libs $TMPDIR/ && \
52
- ls $TMPDIR/.libs; \
53
- fi
49
+ cd $TMPDIR && git clone https://github.com/google/protobuf && cd protobuf && git checkout v$PROTOBUF_VERSION &&\
50
+ cd $TMPDIR && git clone https://github.com/kwonoj/protobuf-wasm && \
51
+ cd $TMPDIR/protobuf-wasm && git checkout v$PROTOBUF_VERSION && cp *.patch $TMPDIR/protobuf && \
52
+ cd $TMPDIR/protobuf && git apply *.patch && \
53
+ git status && \
54
+ sh autogen.sh && emconfigure ./configure && emmake make && \
55
+ cp -r ./src/.libs $TMPDIR/ && \
56
+ ls $TMPDIR/.libs; \
57
+ fi
54
58
55
59
USER root
56
60
57
- CMD emcc --version
61
+ CMD emcc --version
0 commit comments