Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

libphonenumber: fix build #11031

Merged
merged 1 commit into from
Sep 27, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 7 additions & 2 deletions projects/libphonenumber/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ RUN apt-get update && apt-get install -y autoconf automake \
libicu-dev libboost-dev libboost-thread-dev libboost-system-dev \
libgflags-dev libgoogle-glog-dev libssl-dev \
protobuf-compiler libtool wget default-jre icu-devtools

RUN apt-get install -y libgtest-dev && \
cd /usr/src/googletest/googletest && \
mkdir build && \
Expand All @@ -34,8 +35,12 @@ RUN apt-get install -y libgtest-dev && \
ln -sn /usr/local/lib/googletest/libgtest.a /lib/x86_64-linux-gnu/libgtest.a
RUN wget https://github.com/unicode-org/icu/releases/download/release-66-rc/icu4c-66rc-src.tgz && \
tar xzvf icu4c-66rc-src.tgz
RUN git clone https://github.com/google/protobuf.git
RUN git clone https://github.com/google/protobuf.git && \
cd protobuf && \
git checkout tags/v3.14.0
RUN git clone https://github.com/google/libphonenumber
RUN git clone --depth=1 https://github.com/abseil/abseil-cpp
RUN git clone https://github.com/abseil/abseil-cpp && \
cd abseil-cpp && \
git checkout 273292d

COPY build.sh $SRC/
9 changes: 5 additions & 4 deletions projects/libphonenumber/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -30,13 +30,13 @@ fi

cd $SRC/abseil-cpp
mkdir build && cd build
cmake -DCMAKE_POSITION_INDEPENDENT_CODE=ON ../ && make && make install
cmake -DCMAKE_POSITION_INDEPENDENT_CODE=ON ../ && make -j$(nproc) && make install
ldconfig

# Build Protobuf
mkdir $SRC/protobuf-install
cd $SRC/protobuf-install
cmake $SRC/protobuf -Dprotobuf_BUILD_TESTS=OFF -DABSL_ROOT_DIR=$SRC/abseil-cpp
cmake $SRC/protobuf/cmake -Dprotobuf_BUILD_TESTS=OFF -DABSL_ROOT_DIR=$SRC/abseil-cpp
make -j$(nproc)
make install
cp $SRC/protobuf/src/google/protobuf/*.inc /usr/local/include/google/protobuf/
Expand Down Expand Up @@ -76,14 +76,15 @@ sed -i 's/# Safeguarding/find_package(absl REQUIRED) # Safeguarding/g' CMakeList
mkdir build
cd build
cmake -DUSE_BOOST=OFF -DBUILD_GEOCODER=OFF \
-DBUILD_STATIC_LIB=ON -DBUILD_SHARED_LIBS=OFF \
-DPROTOBUF_LIB="/src/protobuf-install/libprotobuf.a" \
-DBUILD_STATIC_LIB=ON \
-DBUILD_TESTING=OFF \
-DICU_UC_INCLUDE_DIR=$SRC/icu/source/comon \
-DICU_UC_LIB=$DEPS_PATH/lib/libicuuc.a \
-DICU_I18N_INCLUDE_DIR=$SRC/icu/source/i18n/ \
-DICU_I18N_LIB=$DEPS_PATH/lib/libicui18n.a \
../
make
make -j$(nproc)

# Build our fuzzer
$CXX -I$SRC/libphonenumber/cpp/src $CXXFLAGS -o phonefuzz.o -c ../test/phonenumbers/fuzz_phone.cc
Expand Down
Loading