Skip to content

Commit

Permalink
get v8js to build
Browse files Browse the repository at this point in the history
  • Loading branch information
noogen committed May 11, 2019
1 parent 545bb7a commit f492bb9
Show file tree
Hide file tree
Showing 41 changed files with 2,374 additions and 6,110 deletions.
31 changes: 23 additions & 8 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -19,21 +19,36 @@ RUN cd /tmp \
mcrypt pwgen language-pack-en-base libicu-dev g++ cpp libglib2.0-dev incron libcouchbase-dev libcouchbase2-libevent \
libc6 libcurl3 libgcc1 libgssapi-krb5-2 liblttng-ust0 libssl1.0.0 libstdc++6 libunwind8 libuuid1 zlib1g \
php-pear php-xml php7.3-dev php7.3-xml php7.2-dev php7.2-xml php7.1-dev php7.1-xml \
&& rsync --update -ahp --progress /opt/libv8-6.8/ /usr/local/ \
&& rsync --update -ahp --progress /opt/libv8-7.4/ /usr/local/ \
&& systemctl disable incron \
&& echo 'root' >> /etc/incron.allow \
&& dpkg --configure -a \
&& pecl channel-update pecl.php.net \
&& /usr/bin/switch-php.sh "7.1" \
&& pecl -d php_suffix=7.1 install -f --alldeps pcs igbinary couchbase imagick v8 v8js \
&& pecl -d php_suffix=7.1 install -f --alldeps pcs igbinary couchbase imagick \
&& git clone https://github.com/phpv8/v8js.git /tmp/v8js \
&& cd /tmp/v8js \
&& git checkout php7 && phpize7.1 \
&& ./configure LDFLAGS="-lstdc++" --with-v8js=/opt/libv8-7.4 \
&& make all test install \
&& mkdir -p /mytmp/20160303 && rsync -ahp /usr/lib/php/20160303/ /mytmp/20160303/ \
&& rm -rf /tmp/* \
&& /usr/bin/switch-php.sh "7.3" \
&& pecl -d php_suffix=7.3 install -f --alldeps pcs igbinary couchbase imagick v8 \
&& rm -rf /tmp/*
RUN /usr/bin/switch-php.sh "7.3" \
&& pecl -d php_suffix=7.3 install -f --alldeps pcs igbinary couchbase imagick \
&& git clone https://github.com/phpv8/v8js.git /tmp/v8js \
&& cd /tmp/v8js \
&& git checkout php7 && phpize7.3 \
&& ./configure LDFLAGS="-lstdc++" --with-v8js=/opt/libv8-7.4 \
&& make all test install \
&& mkdir -p /mytmp/20180731 && rsync -ahp /usr/lib/php/20180731/ /mytmp/20180731/ \
&& rm -rf /tmp/* \
&& /usr/bin/switch-php.sh "7.2" \
&& pecl -d php_suffix=7.2 install -f --alldeps pcs igbinary couchbase imagick v8 v8js \
&& rm -rf /tmp/*
RUN /usr/bin/switch-php.sh "7.2" \
&& pecl -d php_suffix=7.2 install -f --alldeps pcs igbinary couchbase imagick \
&& git clone https://github.com/phpv8/v8js.git /tmp/v8js \
&& cd /tmp/v8js \
&& git checkout php7 && phpize7.2 \
&& ./configure LDFLAGS="-lstdc++" --with-v8js=/opt/libv8-7.4 \
&& make all test install \
&& rsync -ahp /mytmp/20160303/ /usr/lib/php/20160303/ \
&& rsync -ahp /mytmp/20180731/ /usr/lib/php/20180731/ \
&& rm -rf /mytmp \
Expand Down
49 changes: 34 additions & 15 deletions FULL.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ Because full build of v8 takes too long causing docker hub to cancel build, we h

```
FROM phusion/baseimage:0.10.2 as v8builder
ENV V8_VERSION=6.8.275.32
ENV V8_VERSION=7.4.288.21
RUN apt-get update && \
apt-get install -y \
build-essential \
Expand All @@ -12,27 +12,46 @@ RUN apt-get update && \
libglib2.0-dev \
libxml2 \
python && \
cd /tmp && \
git clone https://chromium.googlesource.com/chromium/tools/depot_tools.git && \
export PATH=`pwd`/depot_tools:"$PATH" && \
fetch v8 && \
cd v8 && \
git checkout $V8_VERSION && \
gclient sync && \
tools/dev/v8gen.py -vv x64.release -- is_component_build=true && \
ninja -C out.gn/x64.release/
&& cd /tmp \
\
&& git clone https://chromium.googlesource.com/chromium/tools/depot_tools.git --progress --verbose \
&& export PATH="$PATH:/tmp/depot_tools" \
\
&& fetch v8 \
&& cd v8 \
&& git checkout 7.4.195 \
&& gclient sync \
\
&& tools/dev/v8gen.py -vv x64.release -- \
binutils_path=\"/usr/bin\" \
target_os=\"linux\" \
target_cpu=\"x64\" \
v8_target_cpu=\"x64\" \
v8_use_external_startup_data=false \
is_official_build=true \
is_component_build=true \
is_cfi=false \
is_clang=false \
use_custom_libcxx=false \
use_sysroot=false \
use_gold=false \
use_allocator_shim=false \
treat_warnings_as_errors=false \
symbol_level=0 \
\
&& ninja -C out.gn/x64.release/
FROM phusion/baseimage:0.10.2
LABEL maintainer="noogen <friends@niiknow.org>"
ENV DEBIAN_FRONTEND=noninteractive \
LC_ALL=en_US.UTF-8 LANG=en_US.UTF-8 LANGUAGE=en_US.UTF-8 TERM=xterm container=docker
COPY --from=v8builder /tmp/v8/out.gn/x64.release/lib*.so /opt/libv8-6.8/lib/
COPY --from=v8builder /tmp/v8/out.gn/x64.release/*_blob.bin /opt/libv8-6.8/lib/
COPY --from=v8builder /tmp/v8/out.gn/x64.release/icudtl.dat /opt/libv8-6.8/lib/
COPY --from=v8builder /tmp/v8/include /opt/libv8-6.8/include
COPY --from=v8builder /tmp/v8/out.gn/x64.release/lib*.so /opt/libv8-7.4/lib/
COPY --from=v8builder /tmp/v8/out.gn/x64.release/*_blob.bin /opt/libv8-7.4/lib/
COPY --from=v8builder /tmp/v8/out.gn/x64.release/icudtl.dat /opt/libv8-7.4/lib/
COPY --from=v8builder /tmp/v8/include /opt/libv8-7.4/include
COPY rootfs/. /
RUN cd /tmp \
# install rsync and other things, and before install v8js push the lib
&& rsync --update -ahp --progress /opt/libv8-6.8/ /usr/local/ \
&& rsync --update -ahp --progress /opt/libv8-7.4/ /usr/local/ \
# additional things
```
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ For convienience, sshd is enabled by default; just don't expose docker port 22 i
4. couchbase and couchdb

## Note
1.4.0 - removed v8 now that we can build v8js in all versions of php
1.3.0 - add php 7.3 build. Everything works except pecl v8js for php7.3 build. Note: Use the alternative pecl v8 module for php7.3 if you need v8 for while waiting for php7.3 v8js pecl updates.

1.2.1 - update v8js build. Remove things that can be defer later.
Expand Down
29 changes: 0 additions & 29 deletions rootfs/opt/libv8-6.8/include/PRESUBMIT.py

This file was deleted.

Binary file removed rootfs/opt/libv8-6.8/lib/libc++.so
Binary file not shown.
Binary file removed rootfs/opt/libv8-6.8/lib/libicui18n.so
Binary file not shown.
Binary file removed rootfs/opt/libv8-6.8/lib/libicuuc.so
Binary file not shown.
Binary file removed rootfs/opt/libv8-6.8/lib/libv8.so
Binary file not shown.
Binary file removed rootfs/opt/libv8-6.8/lib/libv8_libbase.so
Binary file not shown.
Binary file removed rootfs/opt/libv8-6.8/lib/libv8_libplatform.so
Binary file not shown.
Loading

0 comments on commit f492bb9

Please sign in to comment.