diff --git a/pkgs/by-name/ph/phira-unwrapped/assets.patch b/pkgs/by-name/ph/phira-unwrapped/assets.patch index eeb26be0b563..9d3c034bb1ac 100644 --- a/pkgs/by-name/ph/phira-unwrapped/assets.patch +++ b/pkgs/by-name/ph/phira-unwrapped/assets.patch @@ -1,11 +1,11 @@ diff --git a/prpr/src/core.rs b/prpr/src/core.rs -index 7f9d4db..33c44bb 100644 +index 24589df..7101fde 100644 --- a/prpr/src/core.rs +++ b/prpr/src/core.rs -@@ -68,6 +68,14 @@ thread_local! { - } +@@ -72,6 +72,14 @@ thread_local! { pub fn init_assets() { + #[cfg(not(target_env = "ohos"))] + if let Ok(root_path) = std::env::var("PHIRA_ROOT") { + let path = std::path::Path::new(&root_path); + if path.exists() { diff --git a/pkgs/by-name/ph/phira-unwrapped/ffmpeg.patch b/pkgs/by-name/ph/phira-unwrapped/ffmpeg.patch index 70912ebdb111..a517f471722f 100644 --- a/pkgs/by-name/ph/phira-unwrapped/ffmpeg.patch +++ b/pkgs/by-name/ph/phira-unwrapped/ffmpeg.patch @@ -1,16 +1,19 @@ diff --git a/prpr-avc/Cargo.toml b/prpr-avc/Cargo.toml -index 257c575..bf35b10 100644 +index eea4b7b..134e02b 100644 --- a/prpr-avc/Cargo.toml +++ b/prpr-avc/Cargo.toml -@@ -9,3 +9,6 @@ edition = "2021" - sasa = { git = "https://github.com/Mivik/sasa", default-features = false } - thiserror = "1.0.56" - tracing = "0.1.37" -+ +@@ -9,6 +9,9 @@ edition = "2021" + thiserror = "2.0.18" + tracing = { workspace = true } + +[build-dependencies] +pkg-config = "0.3" ++ + [target.'cfg(target_env = "ohos")'.dependencies] + sasa = { workspace = true, default-features = false, features = ["ohos"] } + diff --git a/prpr-avc/build.rs b/prpr-avc/build.rs -index 961b032..6d0b714 100644 +index 961b032..eb2c684 100644 --- a/prpr-avc/build.rs +++ b/prpr-avc/build.rs @@ -1,10 +1,7 @@ @@ -28,26 +31,26 @@ index 961b032..6d0b714 100644 + } } diff --git a/prpr-avc/src/ffi.rs b/prpr-avc/src/ffi.rs -index 8218ef3..a2c7f6a 100644 +index c1060be..5dfcb6c 100644 --- a/prpr-avc/src/ffi.rs +++ b/prpr-avc/src/ffi.rs -@@ -6,7 +6,6 @@ pub const AV_SAMPLE_FMT_FLT: AVSampleFormat = 3; +@@ -10,7 +10,6 @@ pub const AV_ROUND_UP: AVRounding = 0; - pub const AV_ROUND_UP: AVRounding = 0; + pub const AVSEEK_FLAG_BACKWARD: i32 = 1; -#[link(name = "avformat", kind = "static")] extern "C" { pub fn avformat_alloc_context() -> *mut AVFormatContext; pub fn avformat_free_context(s: *mut AVFormatContext); -@@ -20,7 +19,6 @@ extern "C" { - pub fn av_read_frame(s: *mut AVFormatContext, pkt: *mut AVPacket) -> ::std::os::raw::c_int; +@@ -30,7 +29,6 @@ extern "C" { + ) -> ::std::os::raw::c_int; } -#[link(name = "avutil", kind = "static")] extern "C" { pub fn av_strerror(errnum: ::std::os::raw::c_int, errbuf: *mut ::std::os::raw::c_char, errbuf_size: usize) -> ::std::os::raw::c_int; pub fn av_frame_alloc() -> *mut AVFrame; -@@ -29,7 +27,6 @@ extern "C" { +@@ -39,7 +37,6 @@ extern "C" { pub fn av_rescale_rnd(a: i64, b: i64, c: i64, r: AVRounding) -> i64; } @@ -55,15 +58,15 @@ index 8218ef3..a2c7f6a 100644 extern "C" { pub fn avcodec_find_decoder(id: AVCodecID) -> *mut AVCodec; pub fn avcodec_alloc_context3(codec: *const AVCodec) -> *mut AVCodecContext; -@@ -43,7 +40,6 @@ extern "C" { - pub fn avcodec_default_get_format(s: *mut AVCodecContext, fmt: *const AVPixelFormat) -> AVPixelFormat; +@@ -54,7 +51,6 @@ extern "C" { + pub fn avcodec_flush_buffers(avctx: *mut AVCodecContext); } -#[link(name = "swscale", kind = "static")] extern "C" { pub fn sws_getContext( srcW: ::std::os::raw::c_int, -@@ -68,10 +64,9 @@ extern "C" { +@@ -79,10 +75,9 @@ extern "C" { ) -> ::std::os::raw::c_int; } @@ -76,7 +79,7 @@ index 8218ef3..a2c7f6a 100644 out_ch_layout: i64, out_sample_fmt: AVSampleFormat, out_sample_rate: ::std::os::raw::c_int, -@@ -80,7 +75,7 @@ extern "C" { +@@ -91,7 +86,7 @@ extern "C" { in_sample_rate: ::std::os::raw::c_int, log_offset: ::std::os::raw::c_int, log_ctx: *mut ::std::os::raw::c_void, @@ -86,7 +89,7 @@ index 8218ef3..a2c7f6a 100644 pub fn swr_get_delay(s: *const SwrContext, base: ::std::os::raw::c_int) -> i64; pub fn swr_convert( diff --git a/prpr-avc/src/swr.rs b/prpr-avc/src/swr.rs -index 7288a51..c00b874 100644 +index f2a18f8..9128ef6 100644 --- a/prpr-avc/src/swr.rs +++ b/prpr-avc/src/swr.rs @@ -5,8 +5,9 @@ pub struct SwrContext(OwnedPtr); @@ -106,7 +109,7 @@ index 7288a51..c00b874 100644 0, null_mut(), - )) -- .map(|ctx| Self(ctx)) +- .map(Self) - .ok_or(Error::AllocationFailed) + ); + if ret < 0 || raw.is_null() { diff --git a/pkgs/by-name/ph/phira-unwrapped/package.nix b/pkgs/by-name/ph/phira-unwrapped/package.nix index ee551e73766c..1daece210526 100644 --- a/pkgs/by-name/ph/phira-unwrapped/package.nix +++ b/pkgs/by-name/ph/phira-unwrapped/package.nix @@ -14,13 +14,16 @@ rustPlatform.buildRustPackage (finalAttrs: { pname = "phira-unwrapped"; - version = "0.6.7"; + version = "0.7.1"; + + __structuredAttrs = true; + strictDeps = true; src = fetchFromGitHub { owner = "TeamFlos"; repo = "phira"; tag = "v${finalAttrs.version}"; - hash = "sha256-4WIvLfKeh+quu7dHKMlUKt+NQnui2/txlFYZoU3voPA="; + hash = "sha256-bn1vRxL4O32Txna3RqafOzXISziDiL//S8NwiIK5c4M="; }; nativeBuildInputs = [ @@ -44,9 +47,6 @@ rustPlatform.buildRustPackage (finalAttrs: { # use dynamically linked ffmpeg instead of expecting static lib ./ffmpeg.patch - # error[E0554]: `#![feature]` may not be used on the stable release channel - ./stable-features.patch - # missing macro from tracing crate ./tracing.patch @@ -54,7 +54,7 @@ rustPlatform.buildRustPackage (finalAttrs: { ./assets.patch ]; - cargoHash = "sha256-6mRb3M56G20fA+px1cZyrGpel0v54qoVAQK2ZgTzkmI="; + cargoHash = "sha256-a+bQ5d9n18jrsgnqygBlMKWlu7KPU5tbQQSXRXE5zWY="; # The developer put assets necessary for this test in gitignore, so it cannot run. checkFlags = [ "--skip=test_parse_chart" ]; diff --git a/pkgs/by-name/ph/phira-unwrapped/stable-features.patch b/pkgs/by-name/ph/phira-unwrapped/stable-features.patch deleted file mode 100644 index 9aac943305b1..000000000000 --- a/pkgs/by-name/ph/phira-unwrapped/stable-features.patch +++ /dev/null @@ -1,10 +0,0 @@ -diff --git a/prpr/src/lib.rs b/prpr/src/lib.rs -index 15a139f..6b4e469 100644 ---- a/prpr/src/lib.rs -+++ b/prpr/src/lib.rs -@@ -1,5 +1,3 @@ --#![feature(local_key_cell_methods)] -- - pub mod bin; - pub mod config; - pub mod core; diff --git a/pkgs/by-name/ph/phira-unwrapped/tracing.patch b/pkgs/by-name/ph/phira-unwrapped/tracing.patch index d1366f439f73..af12320f72fd 100644 --- a/pkgs/by-name/ph/phira-unwrapped/tracing.patch +++ b/pkgs/by-name/ph/phira-unwrapped/tracing.patch @@ -1,17 +1,17 @@ diff --git a/phira-monitor/Cargo.toml b/phira-monitor/Cargo.toml -index 722a022..899b7db 100644 +index f706fb1..1af4ff4 100644 --- a/phira-monitor/Cargo.toml +++ b/phira-monitor/Cargo.toml -@@ -15,6 +15,7 @@ serde = { version = "*", features = ["derive"] } - serde_yaml = "*" +@@ -24,6 +24,7 @@ serde_json = { workspace = true } + serde_yaml = { workspace = true } tokio = { workspace = true } - uuid = { version = "1.4.0", features = ["v4"] } + uuid = { workspace = true, features = ["v4"] } +tracing = "0.1" - phira-mp-client = { git = "https://github.com/TeamFlos/phira-mp" } - phira-mp-common = { git = "https://github.com/TeamFlos/phira-mp" } + phira-mp-client = { workspace = true } + phira-mp-common = { workspace = true } diff --git a/phira-monitor/src/main.rs b/phira-monitor/src/main.rs -index 61bcfba..a4bf8af 100644 +index 809a7c4..e780566 100644 --- a/phira-monitor/src/main.rs +++ b/phira-monitor/src/main.rs @@ -14,6 +14,7 @@ use prpr::{ diff --git a/pkgs/by-name/ph/phira/package.nix b/pkgs/by-name/ph/phira/package.nix index 3fb1d9098adc..590eac607de1 100644 --- a/pkgs/by-name/ph/phira/package.nix +++ b/pkgs/by-name/ph/phira/package.nix @@ -6,10 +6,13 @@ phira-unwrapped, makeWrapper, libGL, + libx11, + libxi, + libxcursor, # A derivation or a path that contains a dir `assets`. overrideAssets ? fetchzip { - url = "https://github.com/TeamFlos/phira/releases/download/v${phira-unwrapped.version}/Phira-windows-v${phira-unwrapped.version}.zip"; - hash = "sha256-kgmIIIzg+wxyspQTyW1GucW0RVPfBhIRlK5DEGXK1Qs="; + url = "https://github.com/TeamFlos/phira/releases/download/v${phira-unwrapped.version}/Phira-windows-x86_64-v${phira-unwrapped.version}.zip"; + hash = "sha256-p0+o7q42caHqVWnHtgknYaCIJemG/9fNKF7pqTnRGE4="; stripRoot = false; meta.license = lib.licenses.unfree; }, @@ -29,14 +32,19 @@ symlinkJoin { cp -r ${overrideAssets}/assets $phira_root wrapper_options=( - ${lib.optionalString stdenv.hostPlatform.isLinux "--suffix LD_LIBRARY_PATH : ${lib.makeLibraryPath [ libGL ]}"} + ${lib.optionalString stdenv.hostPlatform.isLinux "--suffix LD_LIBRARY_PATH : ${ + lib.makeLibraryPath [ + libGL + libx11 + libxi + libxcursor + ] + }"} --run ' export PHIRA_ROOT=''${PHIRA_ROOT-"''${XDG_DATA_HOME-"$HOME/.local/share"}/phira"} - if [[ ! -d "$PHIRA_ROOT/assets" ]]; then - mkdir -p "$PHIRA_ROOT" - cp -r "'$phira_root/assets'" "$PHIRA_ROOT" - chmod -R +w "$PHIRA_ROOT/assets" - fi + mkdir -p "$PHIRA_ROOT" + cp -L -r --update=none "'$phira_root/assets'" "$PHIRA_ROOT" + chmod -R +w "$PHIRA_ROOT/assets" ' )