Skip to content

Commit f7961a1

Browse files
authored
Merge pull request #13 from kwonoj/feat-3.5.5-1
feat(protobuf): bump up protobuf to 3.5.1.1
2 parents 857abbe + d4e802f commit f7961a1

File tree

2 files changed

+22
-18
lines changed

2 files changed

+22
-18
lines changed

.travis.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ script:
2020
# set docker tag based on last commit short sha.
2121
- DOCKER_TAG=$DOCKER_REPO:${COMMIT}-$BUILD_TARGET
2222
- tput setaf 2; echo building docker image tagged as $DOCKER_TAG
23-
- sudo docker build --tag $DOCKER_TAG --build-arg BUILD_TARGET=$BUILD_TARGET .
23+
- sudo docker build --tag $DOCKER_TAG --build-arg BUILD_TARGET=$BUILD_TARGET --build-arg PROTOBUF_VERSION=3.5.1.1 .
2424
- |
2525
if [[ ! -z "${TRAVIS_TAG}" ]]; then
2626
tput setaf 2; echo this build is tagged versioned build, pushing into registry

Dockerfile

Lines changed: 21 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
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
22
MAINTAINER OJ Kwon <[email protected]>
33

44
# Build time args
55
ARG BUILD_TARGET=""
6+
ARG PROTOBUF_VERSION=""
67

78
# Upgrade system
89
RUN pacman --noconfirm -Syyu
@@ -32,26 +33,29 @@ RUN cd $TMPDIR && \
3233

3334
# END gcc--------------------------------
3435

36+
USER builder
37+
3538
# Initialize emcc
36-
RUN emcc
39+
RUN emcc && emcc --version
3740

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
3946

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`
4348
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
5458

5559
USER root
5660

57-
CMD emcc --version
61+
CMD emcc --version

0 commit comments

Comments
 (0)