Skip to content

Commit

Permalink
Support static builds
Browse files Browse the repository at this point in the history
  • Loading branch information
complexlogic committed Oct 7, 2023
1 parent fcfed5c commit f220cfd
Show file tree
Hide file tree
Showing 4 changed files with 49 additions and 22 deletions.
22 changes: 21 additions & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,7 @@ jobs:
run: cmake -S . -B build
-G "${{env.CMAKE_GENERATOR}}"
-DCMAKE_TOOLCHAIN_FILE="$VCPKG_ROOT/scripts/buildsystems/vcpkg.cmake"
-DVCPKG_MANIFEST_FEATURES="ffmpeg;libebur128;inih;"
-DVCPKG_OVERLAY_PORTS=build/overlays/ports
-DVCPKG_OVERLAY_TRIPLETS=config/vcpkg_triplets
-DVCPKG_TARGET_TRIPLET=${{env.VCPKG_TRIPLET}}
Expand Down Expand Up @@ -134,11 +135,19 @@ jobs:
docker_image: debian:bookworm
package_type: DEB
package_ext: .deb
vcpkg_features: fmt;

- name: Fedora
docker_image: fedora:38
package_type: RPM
package_ext: .rpm
vcpkg_features: fmt;

- name: Static
docker_image: debian:bullseye
package_type: TXZ
package_ext: .tar.xz
vcpkg_features: fmt;ffmpeg;libebur128;inih;

container:
image: ${{matrix.config.docker_image}}
Expand All @@ -162,6 +171,9 @@ jobs:
if [[ "${{matrix.config.name}}" == "Fedora" ]]; then
dnf install -y curl zip unzip tar git make pkg-config gcc-c++ fedora-packager rpmdevtools cmake libavcodec-free-devel libavformat-free-devel libswresample-free-devel libavutil-free-devel libebur128-devel inih-devel
fi
if [[ "${{matrix.config.name}}" == "Static" ]]; then
apt update && apt install -y curl zip unzip tar build-essential git cmake pkg-config python3
fi
- name: Setup vcpkg
uses: friendlyanon/setup-vcpkg@v1
Expand All @@ -170,11 +182,19 @@ jobs:
cache-key: vcpkg-${{matrix.config.name}}-${{env.VCPKG_COMMITISH}}
cache-restore-keys: vcpkg-${{matrix.config.name}}-${{env.VCPKG_COMMITISH}}

- name: Setup Overlays
uses: actions/checkout@v3
with:
repository: complexlogic/vcpkg
ref: refs/heads/rsgain
path: build/overlays

- name: Configure
run: cmake -S . -B build
-DCMAKE_TOOLCHAIN_FILE="$VCPKG_ROOT/scripts/buildsystems/vcpkg.cmake"
-DVCPKG_TARGET_TRIPLET=${{env.VCPKG_TRIPLET}}
-DVCPKG_MANIFEST_FEATURES="external-fmt;"
-DVCPKG_MANIFEST_FEATURES="${{matrix.config.vcpkg_features}}"
-DVCPKG_OVERLAY_PORTS=build/overlays/ports
-DCMAKE_BUILD_TYPE=${{env.CMAKE_BUILD_TYPE}}
-DCMAKE_INSTALL_PREFIX=/usr
-DPACKAGE=${{matrix.config.package_type}}
Expand Down
2 changes: 2 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -202,6 +202,8 @@ elseif (UNIX)
set(CPACK_RPM_PACKAGE_GROUP "Applications/Multimedia")
set(CPACK_RPM_PACKAGE_AUTOREQPROV 0)
set(CPACK_RPM_PACKAGE_REQUIRES "libavcodec-free >= 6, libavformat-free >= 6, libswresample-free >= 6, libavutil-free >= 6, libebur128, zlib, inih")
elseif (PACKAGE STREQUAL "TXZ")
set(CPACK_ARCHIVE_FILE_EXTENSION ".tar.xz")
endif ()
if (PACKAGE)
set(CPACK_PACKAGE_DESCRIPTION_SUMMARY ${PROJECT_DESCRIPTION})
Expand Down
3 changes: 3 additions & 0 deletions config/vcpkg.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,9 @@ FetchContent_MakeAvailable(vcpkg vcpkg_overlay)
set(VCPKG_OVERLAY_PORTS "${CMAKE_BINARY_DIR}/_deps/vcpkg_overlay-src/ports")

if (WIN32)
if (NOT VCPKG_MANIFEST_FEATURES)
set(VCPKG_MANIFEST_FEATURES ffmpeg libebur128 inih)
endif ()
if (NOT VCPKG_OVERLAY_TRIPLETS)
list(APPEND VCPKG_OVERLAY_TRIPLETS "${CMAKE_SOURCE_DIR}/config/vcpkg_triplets")
endif ()
Expand Down
44 changes: 23 additions & 21 deletions vcpkg.json
Original file line number Diff line number Diff line change
@@ -1,35 +1,37 @@
{
"dependencies": [
{
"name": "libebur128",
"platform": "windows"
},
"taglib",
{
"name": "ffmpeg",
"platform": "windows",
"default-features": false,
"features": ["avcodec", "avformat", "swresample", "fdk-aac"]
},
{
"name": "fdk-aac",
"platform": "windows",
"features": ["he-aac"]
},
{
"name": "inih",
"platform": "windows"
},
{
"name": "getopt",
"platform": "windows"
}
],
"features": {
"external-fmt": {
"fmt": {
"description": "Use the fmtlib library for formatting",
"dependencies": ["fmt"]
},
"ffmpeg": {
"description": "Build FFmpeg",
"dependencies": [
{
"name": "ffmpeg",
"default-features": false,
"features": ["avcodec", "avformat", "swresample", "fdk-aac"]
},
{
"name": "fdk-aac",
"features": ["he-aac"]
}
]
},
"libebur128": {
"description": "Build libebur128",
"dependencies": ["libebur128"]
},
"inih": {
"description": "Build inih",
"dependencies": ["inih"]
}

}
}

0 comments on commit f220cfd

Please sign in to comment.