Add more build templates and automatic DYNAMIC_INIT

This commit is contained in:
Wildan Mubarok 2025-08-20 12:53:38 +00:00 committed by Jeremy Soller
parent 16785c25b0
commit 541e855d72
6 changed files with 63 additions and 43 deletions

View File

@ -15,12 +15,10 @@ dependencies = [
"shared-mime-info",
"zlib",
]
template = "custom"
script = """
DYNAMIC_INIT
cookbook_meson \
-Dbuiltin_loaders=all \
-Dgir=false \
-Dinstalled_tests=false \
-Dx11=false
"""
template = "meson"
mesonflags = [
"-Dbuiltin_loaders=all",
"-Dgir=false",
"-Dinstalled_tests=false",
"-Dx11=false",
]

View File

@ -4,24 +4,15 @@ blake3 = "a1b9e797a5058f5264d276805aef5643b7ea460916e491a0098ba32d87f1519e"
patches = ["redox.patch"]
[build]
dependencies = [
"libiconv",
"liborbital",
"libpng",
"pixman",
"sdl1",
"zlib",
dependencies = ["libiconv", "liborbital", "libpng", "pixman", "sdl1", "zlib"]
template = "cmake"
cmakeflags = [
"-DBUILD_QT=OFF",
"-DBUILD_SHARED=ON",
"-DBUILD_STATIC=OFF",
"-DUSE_SQLITE3=OFF",
"-DUSE_DEBUGGERS=OFF",
"-DBUILD_SDL=ON",
"-DSDL_VERSION=1.2",
"-DSDL_LIBRARY=-lSDL -lorbital",
]
template = "custom"
script = """
DYNAMIC_INIT
cookbook_cmake \
-DBUILD_QT=OFF \
-DBUILD_SHARED=ON \
-DBUILD_STATIC=OFF \
-DUSE_SQLITE3=OFF \
-DUSE_DEBUGGERS=OFF \
-DBUILD_SDL=ON \
-DSDL_VERSION="1.2" \
-DSDL_LIBRARY="-lSDL -lorbital"
"""

View File

@ -1,13 +1,10 @@
[source]
tar = "https://ftp.gnu.org/gnu/wget/wget-1.21.4.tar.gz"
[build]
template = "custom"
dependencies = [
"openssl1",
]
script = """
COOKBOOK_CONFIGURE_FLAGS+=(
--with-ssl=openssl
)
cookbook_configure
"""
template = "configure"
configureflags = [
"--with-ssl=openssl"
]

View File

@ -2,10 +2,8 @@
[source]
git = "https://github.com/Siriusmart/youtube-tui"
[build]
template = "custom"
template = "cargo"
cargoflags = "--no-default-features"
dependencies = [
"openssl1",
]
script = """
cookbook_cargo --no-default-features
"""

View File

@ -1014,6 +1014,17 @@ do
done
"#;
let flags_fn = |name, flags: &Vec<String>| {
format!(
"{name}+=(\n{}\n)\n",
flags
.iter()
.map(|s| format!(" \"{s}\""))
.collect::<Vec<String>>()
.join("\n")
)
};
//TODO: better integration with redoxer (library instead of binary)
//TODO: configurable target
//TODO: Add more configurability, convert scripts to Rust?
@ -1027,7 +1038,18 @@ done
package_path.as_deref().unwrap_or(".")
)
}
BuildKind::Configure => "cookbook_configure".to_owned(),
BuildKind::Configure { configureflags } => format!(
"DYNAMIC_INIT\n{}cookbook_configure",
flags_fn("COOKBOOK_CONFIGURE_FLAGS", configureflags),
),
BuildKind::Cmake { cmakeflags } => format!(
"DYNAMIC_INIT\n{}cookbook_cmake",
flags_fn("COOKBOOK_CMAKE_FLAGS", cmakeflags),
),
BuildKind::Meson { mesonflags } => format!(
"DYNAMIC_INIT\n{}cookbook_meson",
flags_fn("COOKBOOK_MESON_FLAGS", mesonflags),
),
BuildKind::Custom { script } => script.clone(),
BuildKind::None => "".to_owned(),
};

View File

@ -71,13 +71,27 @@ pub enum BuildKind {
Cargo {
#[serde(default)]
package_path: Option<String>,
#[serde(default)]
cargoflags: String,
},
/// Will build and install using configure and make
#[serde(rename = "configure")]
Configure,
Configure {
#[serde(default)]
configureflags: Vec<String>,
},
/// Will build and install using cmake
#[serde(rename = "cmake")]
Cmake {
#[serde(default)]
cmakeflags: Vec<String>,
},
/// Will build and install using meson
#[serde(rename = "meson")]
Meson {
#[serde(default)]
mesonflags: Vec<String>,
},
/// Will build and install using custom commands
#[serde(rename = "custom")]
Custom { script: String },