mirror of
https://github.com/NixOS/nixpkgs.git
synced 2026-07-06 17:13:24 -05:00
alvr: use ffmpeg_6 with patches from alvr
This commit is contained in:
parent
e606755ad2
commit
a15689bc0d
2 changed files with 47 additions and 13 deletions
38
pkgs/by-name/al/alvr/ffmpeg.nix
Normal file
38
pkgs/by-name/al/alvr/ffmpeg.nix
Normal file
|
|
@ -0,0 +1,38 @@
|
|||
{
|
||||
lib,
|
||||
ffmpeg_6,
|
||||
alvr,
|
||||
}:
|
||||
|
||||
(ffmpeg_6.override {
|
||||
version = "6.0";
|
||||
hash = "sha256-RVbgsafIbeUUNXmUbDQ03ZN42oaUo0njqROo7KOQgv0=";
|
||||
|
||||
withHardcodedTables = false;
|
||||
|
||||
withHtmlDoc = false;
|
||||
withManPages = false;
|
||||
withPodDoc = false;
|
||||
withTxtDoc = false;
|
||||
withDocumentation = false;
|
||||
}).overrideAttrs
|
||||
(old: {
|
||||
# apply our own ffmpeg patches, but skip texinfo-7.1.patch as it does not apply to 6.0.
|
||||
# apply upstream patches for ALVR as well.
|
||||
patches =
|
||||
(lib.filter (p: !(lib.hasSuffix "texinfo-7.1.patch" (baseNameOf (toString p)))) old.patches)
|
||||
++ [
|
||||
(alvr.src + "/alvr/xtask/patches/0001-Add-AV_VAAPI_DRIVER_QUIRK_HEVC_ENCODER_ALIGN_64_16-f.patch")
|
||||
(alvr.src + "/alvr/xtask/patches/0001-av1-encode-backport.patch")
|
||||
(alvr.src + "/alvr/xtask/patches/0001-clip-constants-used-with-shift-instr.patch")
|
||||
(alvr.src + "/alvr/xtask/patches/0001-guid-conftest.patch")
|
||||
(alvr.src + "/alvr/xtask/patches/0001-lavu-hwcontext_vulkan-Fix-importing-RGBx-frames-to-C.patch")
|
||||
(alvr.src + "/alvr/xtask/patches/0001-update-rc-modes.patch")
|
||||
(alvr.src + "/alvr/xtask/patches/0001-vaapi_encode-Add-filler_data-option.patch")
|
||||
(alvr.src + "/alvr/xtask/patches/0001-vaapi_encode-Allow-to-dynamically-change-bitrate-and.patch")
|
||||
(alvr.src + "/alvr/xtask/patches/0001-vaapi_encode-Enable-global-header.patch")
|
||||
(alvr.src + "/alvr/xtask/patches/0001-vaapi_encode_h265-Set-vui_parameters_present_flag.patch")
|
||||
];
|
||||
|
||||
doCheck = false;
|
||||
})
|
||||
|
|
@ -4,6 +4,7 @@
|
|||
fetchFromGitHub,
|
||||
replaceVars,
|
||||
nix-update-script,
|
||||
callPackage,
|
||||
pkg-config,
|
||||
autoAddDriverRunpath,
|
||||
alsa-lib,
|
||||
|
|
@ -11,7 +12,7 @@
|
|||
brotli,
|
||||
bzip2,
|
||||
celt,
|
||||
ffmpeg_7,
|
||||
ffmpeg-alvr ? callPackage ./ffmpeg.nix { },
|
||||
gmp,
|
||||
jack2,
|
||||
lame,
|
||||
|
|
@ -42,6 +43,7 @@
|
|||
}:
|
||||
rustPlatform.buildRustPackage (finalAttrs: {
|
||||
pname = "alvr";
|
||||
|
||||
version = "20.14.1";
|
||||
|
||||
src = fetchFromGitHub {
|
||||
|
|
@ -56,20 +58,11 @@ rustPlatform.buildRustPackage (finalAttrs: {
|
|||
|
||||
patches = [
|
||||
(replaceVars ./fix-finding-libs.patch {
|
||||
ffmpeg = lib.getDev ffmpeg_7;
|
||||
ffmpeg = lib.getDev ffmpeg-alvr;
|
||||
x264 = lib.getDev x264;
|
||||
})
|
||||
];
|
||||
|
||||
postPatch = ''
|
||||
substituteInPlace alvr/server_openvr/cpp/platform/linux/EncodePipelineVAAPI.cpp \
|
||||
--replace-fail 'FF_PROFILE_H264_MAIN' 'AV_PROFILE_H264_MAIN' \
|
||||
--replace-fail 'FF_PROFILE_H264_BASELINE' 'AV_PROFILE_H264_BASELINE' \
|
||||
--replace-fail 'FF_PROFILE_H264_HIGH' 'AV_PROFILE_H264_HIGH' \
|
||||
--replace-fail 'FF_PROFILE_HEVC_MAIN' 'AV_PROFILE_HEVC_MAIN' \
|
||||
--replace-fail 'FF_PROFILE_AV1_MAIN' 'AV_PROFILE_AV1_MAIN'
|
||||
'';
|
||||
|
||||
env = {
|
||||
NIX_CFLAGS_COMPILE = toString [
|
||||
"-lbrotlicommon"
|
||||
|
|
@ -107,7 +100,7 @@ rustPlatform.buildRustPackage (finalAttrs: {
|
|||
brotli
|
||||
bzip2
|
||||
celt
|
||||
ffmpeg_7
|
||||
ffmpeg-alvr
|
||||
gmp
|
||||
jack2
|
||||
lame
|
||||
|
|
@ -153,7 +146,10 @@ rustPlatform.buildRustPackage (finalAttrs: {
|
|||
ln -s $out/lib $out/lib64
|
||||
'';
|
||||
|
||||
passthru.updateScript = nix-update-script { };
|
||||
passthru = {
|
||||
inherit ffmpeg-alvr;
|
||||
updateScript = nix-update-script { };
|
||||
};
|
||||
|
||||
meta = {
|
||||
description = "Stream VR games from your PC to your headset via Wi-Fi";
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue