Skip to content

Commit

Permalink
ffplayout: bump to 0.20.0
Browse files Browse the repository at this point in the history
  • Loading branch information
licy183 committed Nov 17, 2023
1 parent b3d162b commit e626599
Show file tree
Hide file tree
Showing 3 changed files with 44 additions and 30 deletions.
54 changes: 25 additions & 29 deletions tur/ffplayout/0001-fix-hardcoded-paths.patch
Original file line number Diff line number Diff line change
@@ -1,36 +1,23 @@
--- a/ffplayout-api/src/main.rs
+++ b/ffplayout-api/src/main.rs
@@ -41,8 +41,8 @@
}

fn public_path() -> &'static str {
- if Path::new("/usr/share/ffplayout/public/").is_dir() {
- return "/usr/share/ffplayout/public/";
+ if Path::new("@TERMUX_PREFIX@/share/ffplayout/public/").is_dir() {
+ return "@TERMUX_PREFIX@/share/ffplayout/public/";
}

if Path::new("./public/").is_dir() {
--- a/ffplayout-api/src/utils/channels.rs
+++ b/ffplayout-api/src/utils/channels.rs
@@ -21,7 +21,7 @@
return Err(ServiceError::BadRequest("Bad service name!".to_string()));
}

- if !target_channel.config_path.starts_with("/etc/ffplayout") {
+ if !target_channel.config_path.starts_with("@TERMUX_PREFIX@/etc/ffplayout") {
+ if !target_channel.config_path.starts_with("/data/data/com.termux/files/usr/etc/ffplayout") {
return Err(ServiceError::BadRequest("Bad config path!".to_string()));
}

@@ -32,7 +32,7 @@
};

let mut config =
- PlayoutConfig::new(Some("/usr/share/ffplayout/ffplayout.yml.orig".to_string()));
+ PlayoutConfig::new(Some("@TERMUX_PREFIX@/share/ffplayout/ffplayout.yml.orig".to_string()));
let mut config = PlayoutConfig::new(Some(PathBuf::from(
- "/usr/share/ffplayout/ffplayout.yml.orig",
+ "@TERMUX_PREFIX@/share/ffplayout/ffplayout.yml.orig",
)));

config.general.stat_file = format!(".ffp_{channel_name}",);

--- a/ffplayout-api/src/utils/control.rs
+++ b/ffplayout-api/src/utils/control.rs
@@ -183,7 +183,7 @@
Expand All @@ -44,24 +31,33 @@

--- a/ffplayout-api/src/utils/mod.rs
+++ b/ffplayout-api/src/utils/mod.rs
@@ -75,7 +75,7 @@
}
@@ -146,7 +146,7 @@
}
}

pub fn db_path() -> Result<String, Box<dyn std::error::Error>> {
- let sys_path = Path::new("/usr/share/ffplayout/db");
+ let sys_path = Path::new("@TERMUX_PREFIX@/share/ffplayout/db");
let mut db_path = "./ffplayout.db".to_string();
let mut db_path = "./ffplayout.db";

if sys_path.is_dir() && !sys_path.writable() {
@@ -83,7 +83,7 @@
@@ -154,7 +154,7 @@
}

if sys_path.is_dir() && sys_path.writable() {
- db_path = "/usr/share/ffplayout/db/ffplayout.db".to_string();
+ db_path = "@TERMUX_PREFIX@/share/ffplayout/db/ffplayout.db".to_string();
- db_path = "/usr/share/ffplayout/db/ffplayout.db";
+ db_path = "@TERMUX_PREFIX@/share/ffplayout/db/ffplayout.db";
} else if Path::new("./assets").is_dir() {
db_path = "./assets/ffplayout.db".to_string();
db_path = "./assets/ffplayout.db";
}
@@ -163,7 +163,7 @@
}

pub fn public_path() -> PathBuf {
- let path = PathBuf::from("/usr/share/ffplayout/public/");
+ let path = PathBuf::from("@TERMUX_PREFIX@/share/ffplayout/public/");

if path.is_dir() {
return path;
--- a/ffplayout-api/src/db/handles.rs
+++ b/ffplayout-api/src/db/handles.rs
@@ -104,7 +104,7 @@
Expand All @@ -75,15 +71,15 @@
};
--- a/lib/src/utils/config.rs
+++ b/lib/src/utils/config.rs
@@ -318,7 +318,7 @@
@@ -353,7 +353,7 @@
impl PlayoutConfig {
/// Read config from YAML file, and set some extra config values.
pub fn new(cfg_path: Option<String>) -> Self {
pub fn new(cfg_path: Option<PathBuf>) -> Self {
- let mut config_path = PathBuf::from("/etc/ffplayout/ffplayout.yml");
+ let mut config_path = PathBuf::from("@TERMUX_PREFIX@/etc/ffplayout/ffplayout.yml");

if let Some(cfg) = cfg_path {
config_path = PathBuf::from(cfg);
config_path = cfg;
@@ -336,7 +336,7 @@
Ok(file) => file,
Err(_) => {
Expand Down
18 changes: 18 additions & 0 deletions tur/ffplayout/0002-use-pre-generated-html.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
--- a/ffplayout-api/build.rs
+++ b/ffplayout-api/build.rs
@@ -1,13 +1,8 @@
-use static_files::NpmBuild;
+use static_files::resource_dir;

fn main() -> std::io::Result<()> {
if !cfg!(debug_assertions) {
- NpmBuild::new("../ffplayout-frontend")
- .install()?
- .run("generate")?
- .target("../ffplayout-frontend/.output/public")
- .change_detection()
- .to_resource_dir()
+ resource_dir("../ffplayout-frontend/.output/public")
.build()
} else {
Ok(())
2 changes: 1 addition & 1 deletion tur/ffplayout/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ TERMUX_PKG_HOMEPAGE=https://ffplayout.github.io
TERMUX_PKG_DESCRIPTION="Rust and ffmpeg based playout"
TERMUX_PKG_LICENSE="GPL-3.0"
TERMUX_PKG_MAINTAINER="@termux-user-repository"
TERMUX_PKG_VERSION=0.19.1
TERMUX_PKG_VERSION=0.20.0
TERMUX_PKG_SRCURL=git+https://github.com/ffplayout/ffplayout
TERMUX_PKG_BUILD_IN_SRC=true
TERMUX_PKG_AUTO_UPDATE=true
Expand Down

0 comments on commit e626599

Please sign in to comment.