Skip to content

Commit

Permalink
CI/AppImage: Build shrunk ffmpeg for media capture
Browse files Browse the repository at this point in the history
  • Loading branch information
stenzek committed Sep 3, 2024
1 parent 6357d95 commit b162063
Show file tree
Hide file tree
Showing 5 changed files with 345 additions and 7 deletions.
14 changes: 9 additions & 5 deletions .github/workflows/rolling-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -213,22 +213,26 @@ jobs:
sudo scripts/retry.sh apt-get -y install \
build-essential clang-17 cmake curl extra-cmake-modules git libasound2-dev libcurl4-openssl-dev libdbus-1-dev libdecor-0-dev libegl-dev libevdev-dev \
libfontconfig-dev libfreetype-dev libfuse2 libgtk-3-dev libgudev-1.0-dev libharfbuzz-dev libinput-dev libopengl-dev libpipewire-0.3-dev libpulse-dev \
libssl-dev libudev-dev libwayland-dev libx11-dev libx11-xcb-dev libxcb1-dev libxcb-composite0-dev libxcb-cursor-dev libxcb-damage0-dev libxcb-glx0-dev \
libxcb-icccm4-dev libxcb-image0-dev libxcb-keysyms1-dev libxcb-present-dev libxcb-randr0-dev libxcb-render0-dev libxcb-render-util0-dev libxcb-shape0-dev \
libxcb-shm0-dev libxcb-sync-dev libxcb-util-dev libxcb-xfixes0-dev libxcb-xinput-dev libxcb-xkb-dev libxext-dev libxkbcommon-x11-dev libxrandr-dev lld-17 \
llvm-17 nasm ninja-build patchelf pkg-config zlib1g-dev
libssl-dev libudev-dev libva-dev libwayland-dev libx11-dev libx11-xcb-dev libxcb1-dev libxcb-composite0-dev libxcb-cursor-dev libxcb-damage0-dev \
libxcb-glx0-dev libxcb-icccm4-dev libxcb-image0-dev libxcb-keysyms1-dev libxcb-present-dev libxcb-randr0-dev libxcb-render0-dev libxcb-render-util0-dev \
libxcb-shape0-dev libxcb-shm0-dev libxcb-sync-dev libxcb-util-dev libxcb-xfixes0-dev libxcb-xinput-dev libxcb-xkb-dev libxext-dev libxkbcommon-x11-dev \
libxrandr-dev lld-17 llvm-17 nasm ninja-build patchelf pkg-config zlib1g-dev
- name: Cache Dependencies
id: cache-deps
uses: actions/[email protected]
with:
path: ~/deps
key: deps ${{ hashFiles('scripts/deps/build-dependencies-linux.sh') }}
key: deps ${{ hashFiles('scripts/deps/build-dependencies-linux.sh', 'scripts/deps/build-ffmpeg-linux.sh') }}

- name: Build Dependencies
if: steps.cache-deps.outputs.cache-hit != 'true'
run: scripts/deps/build-dependencies-linux.sh "$HOME/deps"

- name: Build FFmpeg
if: steps.cache-deps.outputs.cache-hit != 'true'
run: scripts/deps/build-ffmpeg-linux.sh "$HOME/deps"

- name: Initialize build tag
run: |
echo '#pragma once' > src/scmversion/tag.h
Expand Down
3 changes: 3 additions & 0 deletions CMakeModules/FindFFMPEG.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ function (_ffmpeg_find component headername)
"lib${component}/${headername}"
PATHS
"${FFMPEG_ROOT}/include"
"${CMAKE_PREFIX_PATH}/include"
~/Library/Frameworks
/Library/Frameworks
/usr/local/include
Expand All @@ -60,6 +61,8 @@ function (_ffmpeg_find component headername)
"${component}"
PATHS
"${FFMPEG_ROOT}/lib"
"${CMAKE_PREFIX_PATH}/lib"
"${CMAKE_PREFIX_PATH}/lib64"
~/Library/Frameworks
/Library/Frameworks
/usr/local/lib
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -160,12 +160,12 @@ Requirements:

Ubuntu/Debian package names:
```
build-essential clang cmake curl extra-cmake-modules git libasound2-dev libcurl4-openssl-dev libdbus-1-dev libdecor-0-dev libegl-dev libevdev-dev libfontconfig-dev libfreetype-dev libgtk-3-dev libgudev-1.0-dev libharfbuzz-dev libinput-dev libopengl-dev libpipewire-0.3-dev libpulse-dev libssl-dev libudev-dev libwayland-dev libx11-dev libx11-xcb-dev libxcb1-dev libxcb-composite0-dev libxcb-cursor-dev libxcb-damage0-dev libxcb-glx0-dev libxcb-icccm4-dev libxcb-image0-dev libxcb-keysyms1-dev libxcb-present-dev libxcb-randr0-dev libxcb-render0-dev libxcb-render-util0-dev libxcb-shape0-dev libxcb-shm0-dev libxcb-sync-dev libxcb-util-dev libxcb-xfixes0-dev libxcb-xinput-dev libxcb-xkb-dev libxext-dev libxkbcommon-x11-dev libxrandr-dev lld llvm nasm ninja-build pkg-config zlib1g-dev
autoconf automake build-essential clang cmake curl extra-cmake-modules git libasound2-dev libcurl4-openssl-dev libdbus-1-dev libdecor-0-dev libegl-dev libevdev-dev libfontconfig-dev libfreetype-dev libgtk-3-dev libgudev-1.0-dev libharfbuzz-dev libinput-dev libopengl-dev libpipewire-0.3-dev libpulse-dev libssl-dev libudev-dev libwayland-dev libx11-dev libx11-xcb-dev libxcb1-dev libxcb-composite0-dev libxcb-cursor-dev libxcb-damage0-dev libxcb-glx0-dev libxcb-icccm4-dev libxcb-image0-dev libxcb-keysyms1-dev libxcb-present-dev libxcb-randr0-dev libxcb-render0-dev libxcb-render-util0-dev libxcb-shape0-dev libxcb-shm0-dev libxcb-sync-dev libxcb-util-dev libxcb-xfixes0-dev libxcb-xinput-dev libxcb-xkb-dev libxext-dev libxkbcommon-x11-dev libxrandr-dev libtool lld llvm nasm ninja-build pkg-config zlib1g-dev
```

Fedora package names:
```
alsa-lib-devel brotli-devel clang cmake dbus-devel egl-wayland-devel extra-cmake-modules fontconfig-devel gcc-c++ gtk3-devel libavcodec-free-devel libavformat-free-devel libavutil-free-devel libcurl-devel libdecor-devel libevdev-devel libICE-devel libinput-devel libSM-devel libswresample-free-devel libswscale-free-devel libX11-devel libXau-devel libxcb-devel libXcomposite-devel libXcursor-devel libXext-devel libXfixes-devel libXft-devel libXi-devel libxkbcommon-devel libxkbcommon-x11-devel libXpresent-devel libXrandr-devel libXrender-devel lld llvm make mesa-libEGL-devel mesa-libGL-devel nasm ninja-build openssl-devel patch pcre2-devel perl-Digest-SHA pipewire-devel pulseaudio-libs-devel systemd-devel wayland-devel xcb-util-cursor-devel xcb-util-devel xcb-util-errors-devel xcb-util-image-devel xcb-util-keysyms-devel xcb-util-renderutil-devel xcb-util-wm-devel xcb-util-xrm-devel zlib-devel
alsa-lib-devel autoconf automake brotli-devel clang cmake dbus-devel egl-wayland-devel extra-cmake-modules fontconfig-devel gcc-c++ gtk3-devel libavcodec-free-devel libavformat-free-devel libavutil-free-devel libcurl-devel libdecor-devel libevdev-devel libICE-devel libinput-devel libSM-devel libswresample-free-devel libswscale-free-devel libX11-devel libXau-devel libxcb-devel libXcomposite-devel libXcursor-devel libXext-devel libXfixes-devel libXft-devel libXi-devel libxkbcommon-devel libxkbcommon-x11-devel libXpresent-devel libXrandr-devel libXrender-devel libtool lld llvm make mesa-libEGL-devel mesa-libGL-devel nasm ninja-build openssl-devel patch pcre2-devel perl-Digest-SHA pipewire-devel pulseaudio-libs-devel systemd-devel wayland-devel xcb-util-cursor-devel xcb-util-devel xcb-util-errors-devel xcb-util-image-devel xcb-util-keysyms-devel xcb-util-renderutil-devel xcb-util-wm-devel xcb-util-xrm-devel zlib-devel
```

#### Building
Expand Down
5 changes: 5 additions & 0 deletions scripts/appimage/make-appimage.sh
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,11 @@ APPDIRNAME=DuckStation.AppDir
STRIP=strip

declare -a MANUAL_LIBS=(
"libavcodec.so.61"
"libavformat.so.61"
"libavutil.so.59"
"libswscale.so.8"
"libswresample.so.5"
"libdiscord-rpc.so"
"libfreetype.so.6"
"libshaderc_shared.so"
Expand Down
Loading

0 comments on commit b162063

Please sign in to comment.