gs: update README to use fixed versions

Use specific versions, instead of relying on 'master'.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/1246>
This commit is contained in:
Floris 2021-10-25 18:52:24 +02:00 committed by GStreamer Marge Bot
parent 14368c6457
commit 6d447acef5

View File

@ -1,5 +1,4 @@
# Install the Google Cloud Storage dependencies. # Install the Google Cloud Storage dependencies.
``` ```
sudo apt-get install \ sudo apt-get install \
cmake \ cmake \
@ -7,69 +6,89 @@ sudo apt-get install \
libgrpc++-dev \ libgrpc++-dev \
libprotobuf-dev \ libprotobuf-dev \
protobuf-compiler-grpc \ protobuf-compiler-grpc \
nlohmann-json3-dev flex bison pkg-config \
curl
``` ```
# Build the Google Cloud Storage library # Build the Google Cloud Storage library
``` ```
git clone https://github.com/google/crc32c.git export cmake_prefix=/usr/local
cd crc32c && git checkout -b 1.1.1
mkdir build && cd build mkdir crc32c
cmake .. \ cd crc32c
curl -sSL https://github.com/google/crc32c/archive/1.1.2.tar.gz | \
tar -xzf - --strip-components=1
cmake -S . -B build \
-GNinja \ -GNinja \
-DCMAKE_INSTALL_PREFIX:PATH=~/dev/gstreamer/prefix \ -DCMAKE_INSTALL_PREFIX:PATH=$cmake_prefix \
-DCMAKE_INSTALL_LIBDIR:PATH=lib \ -DCMAKE_INSTALL_LIBDIR:PATH=lib \
-DBUILD_SHARED_LIBS=YES \ -DBUILD_SHARED_LIBS=YES \
-DCRC32C_USE_GLOG=NO \ -DCRC32C_USE_GLOG=NO \
-DCRC32C_BUILD_TESTS=NO \ -DCRC32C_BUILD_TESTS=NO \
-DCRC32C_BUILD_BENCHMARKS=NO -DCRC32C_BUILD_BENCHMARKS=NO
ninja && ninja install cmake --build build --target install
cd ../.. cd ..
git clone https://github.com/abseil/abseil-cpp.git mkdir abseil-cpp
cd abseil-cpp && git checkout master cd abseil-cpp
mkdir build && cd build curl -sSL https://github.com/abseil/abseil-cpp/archive/20210324.2.tar.gz | \
cmake .. \ tar -xzf - --strip-components=1 && \
sed -i 's/^#define ABSL_OPTION_USE_\(.*\) 2/#define ABSL_OPTION_USE_\1 0/' "absl/base/options.h"
cmake -S . -B build \
-GNinja \ -GNinja \
-DBUILD_TESTING=NO \ -DBUILD_TESTING=NO \
-DCMAKE_INSTALL_PREFIX:PATH=~/dev/gstreamer/prefix \ -DCMAKE_INSTALL_PREFIX:PATH=$cmake_prefix \
-DCMAKE_INSTALL_LIBDIR:PATH=lib \ -DCMAKE_INSTALL_LIBDIR:PATH=lib \
-DBUILD_SHARED_LIBS=YES -DBUILD_SHARED_LIBS=YES
ninja && ninja install cmake --build build --target install
cd ../.. cd ..
git clone https://github.com/googleapis/google-cloud-cpp.git # Nlohman/json
cd google-cloud-cpp && git checkout -b v1.31.1 mkdir json
mkdir build && cd build cd json
cmake .. \ curl -sSL https://github.com/nlohmann/json/archive/v3.10.4.tar.gz | \
tar -xzf - --strip-components=1
cmake \
-DCMAKE_BUILD_TYPE=Release \
-DBUILD_SHARED_LIBS=yes \
-DBUILD_TESTING=OFF \
-H. -Bcmake-out/nlohmann/json && \
cmake --build cmake-out/nlohmann/json --target install -- -j ${NCPU} && \
ldconfig
cd ..
mkdir google-cloud-cpp
cd google-cloud-cpp
curl -sSL https://github.com/googleapis/google-cloud-cpp/archive/v1.31.1.tar.gz | \
tar --strip-components=1 -zxf -
cmake -S . -B build \
-GNinja \ -GNinja \
-DCMAKE_INSTALL_PREFIX:PATH=~/dev/gstreamer/prefix \ -DCMAKE_BUILD_TYPE=Debug \
-DCMAKE_CXX_STANDARD=14 \
-DCMAKE_INSTALL_PREFIX:PATH=$cmake_prefix \
-DCMAKE_INSTALL_LIBDIR:PATH=lib \ -DCMAKE_INSTALL_LIBDIR:PATH=lib \
-DBUILD_SHARED_LIBS=YES \ -DBUILD_SHARED_LIBS=YES \
-DBUILD_TESTING=NO \ -DBUILD_TESTING=NO \
-DGOOGLE_CLOUD_CPP_ENABLE=storage -DGOOGLE_CLOUD_CPP_ENABLE=storage
ninja && ninja install cmake --build build --target install -- -v
cd ../.. cd ..
``` ```
# Running the gs elements locally # Running the gs elements locally
When running from the command line or in a container running locally, simply When running from the command line or in a container running locally, simply set the credentials by exporting
set the credentials by exporting GOOGLE_APPLICATION_CREDENTIALS. If you are GOOGLE_APPLICATION_CREDENTIALS. If you are not familiar with this environment variable, check the documentation
not familiar with this environment variable, check the documentation
https://cloud.google.com/docs/authentication/getting-started https://cloud.google.com/docs/authentication/getting-started
Note that you can restrict a service account to the role Storage Admin or Note that you can restrict a service account to the role Storage Admin or Storage Object Creator instead of the Project
Storage Object Creator instead of the Project Owner role from the above Owner role from the above documentation.
documentation.
# Running the gs elements in Google Cloud Run # Running the gs elements in Google Cloud Run
Add the Storage Object Viewer role to the service account assigned to the Add the Storage Object Viewer role to the service account assigned to the Cloud Run service where gssrc runs. For gssink
Cloud Run service where gssrc runs. For gssink add the role Storage Object add the role Storage Object Creator. Then just set the service-account-email property on the element.
Creator. Then just set the service-account-email property on the element.
# Running the gs elements in Google Cloud Kubernetes # Running the gs elements in Google Cloud Kubernetes
You need to set GOOGLE_APPLICATION_CREDENTIALS in the container and ship the You need to set GOOGLE_APPLICATION_CREDENTIALS in the container and ship the json file to which the environment variable
json file to which the environment variable points to. points to.