File tree Expand file tree Collapse file tree 4 files changed +60
-1
lines changed
Expand file tree Collapse file tree 4 files changed +60
-1
lines changed Original file line number Diff line number Diff line change @@ -14,7 +14,7 @@ a limit of 5 layers per Lambda. You can also utilise the provided docker images
1414
1515
1616> ** Warning**
17- >
17+ >
1818> ** ARM64 is not supported yet with Bref v2.**
1919
2020
@@ -64,6 +64,7 @@ functions:
6464| gnupg | `${bref-extra:gnupg-php-81}` |
6565| GMP | `${bref-extra:gmp-php-81}` |
6666| gRPC | `${bref-extra:grpc-php-81}` |
67+ | h3 | `${bref-extra:h3-php-81}` |
6768| Igbinary | `${bref-extra:igbinary-php-81}` |
6869| Imagick | `${bref-extra:imagick-php-81}` |
6970| IMAP | `${bref-extra:imap-php-81}` |
Original file line number Diff line number Diff line change 1+ ARG PHP_VERSION
2+ ARG BREF_VERSION
3+ FROM bref/build-php-$PHP_VERSION:$BREF_VERSION AS ext
4+ ARG PHP_VERSION
5+
6+ # Prepare environment
7+ ENV H3_BUILD_DIR=${BUILD_DIR}/h3
8+ RUN mkdir -p ${H3_BUILD_DIR}
9+
10+ # Compile h3
11+ WORKDIR ${H3_BUILD_DIR}
12+ RUN git clone https://github.com/uber/h3.git && \
13+ cd h3 && \
14+ git checkout v3.7.2 && \
15+ cmake -DBUILD_SHARED_LIBS=ON . && \
16+ make -j "$(nproc)" && \
17+ make install
18+
19+ # Compile the php h3 extension
20+ WORKDIR ${H3_BUILD_DIR}/h3-php
21+ RUN curl -L https://github.com/abler98/h3-php/archive/refs/tags/v1.0.0.tar.gz -o h3.tar.gz && \
22+ tar xzf h3.tar.gz && \
23+ cd h3-php-1.0.0 && \
24+ phpize && \
25+ ./configure --with-h3 && \
26+ make && \
27+ make install
28+
29+ RUN cp `php-config --extension-dir`/h3.so /tmp/h3.so
30+ RUN strip --strip-debug /tmp/h3.so
31+ RUN echo 'extension=h3.so' > /tmp/ext.ini
32+
33+ RUN php /bref/lib-copy/copy-dependencies.php /tmp/h3.so /tmp/extension-libs
34+
35+ # Build the final image with just the files we need
36+ FROM scratch
37+
38+ # Copy things we installed to the final image
39+ COPY --from=ext /tmp/h3.so /opt/bref/extensions/h3.so
40+ COPY --from=ext /tmp/ext.ini /opt/bref/etc/php/conf.d/ext-h3.ini
41+ COPY --from=ext /tmp/extension-libs /opt/lib
Original file line number Diff line number Diff line change 1+ {
2+ "php" : [
3+ " 80" ,
4+ " 81" ,
5+ " 82" ,
6+ " 83"
7+ ]
8+ }
Original file line number Diff line number Diff line change 1+ <?php
2+
3+ if (!class_exists ($ class = \H3 \H3Index::class)) {
4+ echo sprintf ('FAIL: Class "%s" does not exist. ' , $ class ).PHP_EOL ;
5+ exit (1 );
6+ }
7+
8+
9+ exit (0 );
You can’t perform that action at this time.
0 commit comments