Add shared library for musl-libc (#3143)
Summary: Add the jni library for musl-libc, specifically for incorporating into Alpine based docker images. The classifier is `musl64`. I have signed the CLA electronically. Pull Request resolved: https://github.com/facebook/rocksdb/pull/3143 Differential Revision: D18719372 fbshipit-source-id: 6189d149310b6436d6def7d808566b0234b23313main
parent
d9314a9214
commit
8ae149eba1
@ -0,0 +1,70 @@ |
||||
#!/usr/bin/env bash |
||||
# Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved. |
||||
|
||||
set -e |
||||
|
||||
# update Alpine with latest versions |
||||
echo '@edge http://nl.alpinelinux.org/alpine/edge/main' >> /etc/apk/repositories |
||||
echo '@community http://nl.alpinelinux.org/alpine/edge/community' >> /etc/apk/repositories |
||||
apk update |
||||
apk upgrade |
||||
|
||||
# install CA certificates |
||||
apk add ca-certificates |
||||
|
||||
# install build tools |
||||
apk add \ |
||||
build-base \ |
||||
coreutils \ |
||||
file \ |
||||
git \ |
||||
perl \ |
||||
automake \ |
||||
autoconf \ |
||||
cmake |
||||
|
||||
# install tool dependencies for building RocksDB static library |
||||
apk add \ |
||||
curl \ |
||||
bash \ |
||||
wget \ |
||||
tar \ |
||||
openssl |
||||
|
||||
# install RocksDB dependencies |
||||
apk add \ |
||||
snappy snappy-dev \ |
||||
zlib zlib-dev \ |
||||
bzip2 bzip2-dev \ |
||||
lz4 lz4-dev \ |
||||
zstd zstd-dev \ |
||||
linux-headers \ |
||||
jemalloc jemalloc-dev |
||||
|
||||
# install OpenJDK7 |
||||
apk add openjdk7 \ |
||||
&& apk add java-cacerts \ |
||||
&& rm /usr/lib/jvm/java-1.7-openjdk/jre/lib/security/cacerts \ |
||||
&& ln -s /etc/ssl/certs/java/cacerts /usr/lib/jvm/java-1.7-openjdk/jre/lib/security/cacerts |
||||
|
||||
# cleanup |
||||
rm -rf /var/cache/apk/* |
||||
|
||||
# puts javac in the PATH |
||||
export JAVA_HOME=/usr/lib/jvm/java-1.7-openjdk |
||||
export PATH=/usr/lib/jvm/java-1.7-openjdk/bin:$PATH |
||||
|
||||
# gflags from source |
||||
cd /tmp &&\ |
||||
git clone -b v2.0 --single-branch https://github.com/gflags/gflags.git &&\ |
||||
cd gflags &&\ |
||||
./configure --prefix=/usr && make && make install &&\ |
||||
rm -rf /tmp/* |
||||
|
||||
|
||||
# build rocksdb |
||||
cd /rocksdb |
||||
make jclean clean |
||||
PORTABLE=1 make -j8 rocksdbjavastatic |
||||
cp /rocksdb/java/target/librocksdbjni-* /rocksdb-build |
||||
cp /rocksdb/java/target/rocksdbjni-* /rocksdb-build |
@ -0,0 +1,18 @@ |
||||
#!/usr/bin/env bash |
||||
# Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved. |
||||
|
||||
set -e |
||||
#set -x |
||||
|
||||
# just in-case this is run outside Docker |
||||
mkdir -p /rocksdb-local-build |
||||
|
||||
rm -rf /rocksdb-local-build/* |
||||
cp -r /rocksdb-host/* /rocksdb-local-build |
||||
cd /rocksdb-local-build |
||||
|
||||
make clean-not-downloaded |
||||
PORTABLE=1 make rocksdbjavastatic |
||||
|
||||
cp java/target/librocksdbjni-linux*.so java/target/rocksdbjni-*-linux*.jar /rocksdb-java-target |
||||
|
Loading…
Reference in new issue