Skip to content

Commit

Permalink
Separate rs compile script
Browse files Browse the repository at this point in the history
  • Loading branch information
biglittlebigben committed Jan 11, 2024
1 parent 0a38cf2 commit bdc4fb2
Show file tree
Hide file tree
Showing 3 changed files with 35 additions and 1 deletion.
2 changes: 2 additions & 0 deletions build/gstreamer/Dockerfile-prod
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,10 @@ ENV DEBUG=false
ENV OPTIMIZATIONS=true

COPY compile /
COPY compile-rs /

RUN /compile
RUN /compile-rs

FROM ubuntu:23.10

Expand Down
2 changes: 1 addition & 1 deletion build/gstreamer/compile
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#!/bin/bash
set -euxo pipefail

for repo in gstreamer libnice gst-plugins-base gst-plugins-good gst-plugins-bad gst-plugins-ugly gst-plugins-rs gst-libav; do
for repo in gstreamer libnice gst-plugins-base gst-plugins-good gst-plugins-bad gst-plugins-ugly gst-libav; do
pushd $repo

opts="-D prefix=/usr"
Expand Down
32 changes: 32 additions & 0 deletions build/gstreamer/compile-rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
#!/bin/bash
set -euxo pipefail

for repo in gst-plugins-rs; do
pushd $repo

# strip binaries in debug mode
mv Cargo.toml Cargo.toml.old
sed s,'\[profile.release\]','[profile.release]\nstrip="debuginfo"', Cargo.toml.old > Cargo.toml

opts="-D prefix=/usr -D tests=disabled -D doc=disabled"

if [[ $DEBUG == 'true' ]]; then
if [[ $OPTIMIZATIONS == 'true' ]]; then
opts="$opts -D buildtype=debugoptimized"
else
opts="$opts -D buildtype=debug"
fi
else
opts="$opts -D buildtype=release -D b_lto=true"
fi

meson build $opts

# This is needed for other plugins to be built properly
ninja -C build install
# This is where we'll grab build artifacts from
DESTDIR=/compiled-binaries ninja -C build install
popd
done

gst-inspect-1.0

0 comments on commit bdc4fb2

Please sign in to comment.