Initial drop of mostly-working containers
This commit is contained in:
47
scripts/build-deps.sh
Executable file
47
scripts/build-deps.sh
Executable file
@@ -0,0 +1,47 @@
|
||||
set -e
|
||||
|
||||
BASE_FFMPEG_ARGS="--enable-pic --enable-static --disable-shared --disable-all --enable-avcodec --enable-decoder=h264 --enable-decoder=hevc --enable-hwaccel=h264_vaapi --enable-hwaccel=hevc_vaapi --enable-hwaccel=h264_vdpau --enable-hwaccel=hevc_vdpau"
|
||||
|
||||
ARCH=`uname -m`
|
||||
echo "Building dependencies for $ARCH"
|
||||
if [ "$ARCH" == "armv7l" ]; then
|
||||
# We need to link against some Raspberry Pi userland binaries
|
||||
cd /opt/userland
|
||||
mkdir build
|
||||
cd build
|
||||
cmake -DARM64=0 -DVMCS_INSTALL_PREFIX=/usr ..
|
||||
make -j$(nproc)
|
||||
make install
|
||||
|
||||
# Enable MMAL decoders
|
||||
EXTRA_FFMPEG_ARGS="--enable-mmal --enable-decoder=h264_mmal"
|
||||
elif [ "$ARCH" == "aarch64" ]; then
|
||||
# We need to build libnvmpi
|
||||
cd /opt/jetson-ffmpeg
|
||||
mkdir build
|
||||
cd build
|
||||
cmake ..
|
||||
make -j$(nproc)
|
||||
make install
|
||||
|
||||
# We need to patch ffmpeg to add NVMPI support
|
||||
cd /opt/FFmpeg
|
||||
git apply /opt/jetson-ffmpeg/ffmpeg_nvmpi.patch
|
||||
|
||||
# Enable NVMPI decoders
|
||||
EXTRA_FFMPEG_ARGS="--enable-nvmpi --enable-decoder=h264_nvmpi --enable-decoder=hevc_nvmpi"
|
||||
elif [ "$ARCH" == "x86_64" ]; then
|
||||
# We need to install the NVDEC headers
|
||||
cd /opt/nv-codec-headers
|
||||
make install PREFIX=/usr
|
||||
|
||||
EXTRA_FFMPEG_ARGS="--enable-nvdec --enable-hwaccel=h264_nvdec --enable-hwaccel=hevc_nvdec"
|
||||
else
|
||||
echo "Unrecognized architecture: $ARCH"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
cd /opt/FFmpeg
|
||||
./configure $BASE_FFMPEG_ARGS $EXTRA_FFMPEG_ARGS
|
||||
make -j$(nproc)
|
||||
make install
|
||||
42
scripts/build-package.sh
Executable file
42
scripts/build-package.sh
Executable file
@@ -0,0 +1,42 @@
|
||||
set -e
|
||||
|
||||
# Check out the source
|
||||
[[ ! -z "$BRANCH" ]] || BRANCH="master"
|
||||
echo "Checking out $BRANCH"
|
||||
git clone --recursive --branch $BRANCH --depth 1 https://github.com/moonlight-stream/moonlight-qt.git
|
||||
cd moonlight-qt
|
||||
git show HEAD
|
||||
|
||||
# Grab the verson metadata
|
||||
VERSION=`cat app/version.txt`
|
||||
|
||||
# Create a build directory
|
||||
mkdir /opt/build
|
||||
|
||||
# Nuke the libs folder - not needed for Linux
|
||||
git rm -r libs
|
||||
git commit -m "Remove pre-built libraries"
|
||||
|
||||
# Generate source tarball
|
||||
scripts/generate-src.sh
|
||||
|
||||
# Move the tarball into the build directory
|
||||
mv build/source/MoonlightSrc-$VERSION.tar.gz /opt/build/moonlight_$VERSION.orig.tar.gz
|
||||
|
||||
# Extract the tarball into the appropriate directory
|
||||
cd /opt/build
|
||||
mkdir moonlight-$VERSION
|
||||
cd moonlight-$VERSION
|
||||
tar xvf ../moonlight_$VERSION.orig.tar.gz
|
||||
|
||||
# Copy the debian directory into the build directory
|
||||
cp -r /opt/debian .
|
||||
|
||||
# Build the package
|
||||
debuild -us -uc
|
||||
|
||||
# Copy the output to the out directory
|
||||
cp /opt/build/* /out
|
||||
|
||||
# Done!
|
||||
echo "Build successful!"
|
||||
Reference in New Issue
Block a user