diff --git a/recipes/dev/gdk-pixbuf/recipe.toml b/recipes/dev/gdk-pixbuf/recipe.toml index afa8bff2..7ae9aa5c 100644 --- a/recipes/dev/gdk-pixbuf/recipe.toml +++ b/recipes/dev/gdk-pixbuf/recipe.toml @@ -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", +] diff --git a/recipes/emulators/mgba/recipe.toml b/recipes/emulators/mgba/recipe.toml index 5a4d65ae..b61b7bd0 100644 --- a/recipes/emulators/mgba/recipe.toml +++ b/recipes/emulators/mgba/recipe.toml @@ -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" -""" diff --git a/recipes/net/download/wget/recipe.toml b/recipes/net/download/wget/recipe.toml index dd4f52e6..fb2d6ab4 100644 --- a/recipes/net/download/wget/recipe.toml +++ b/recipes/net/download/wget/recipe.toml @@ -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" +] diff --git a/recipes/wip/net/download/youtube-tui/recipe.toml b/recipes/wip/net/download/youtube-tui/recipe.toml index 83406f0e..5306f25d 100644 --- a/recipes/wip/net/download/youtube-tui/recipe.toml +++ b/recipes/wip/net/download/youtube-tui/recipe.toml @@ -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 -""" diff --git a/src/bin/cook.rs b/src/bin/cook.rs index 4002f712..6d37332d 100644 --- a/src/bin/cook.rs +++ b/src/bin/cook.rs @@ -1014,6 +1014,17 @@ do done "#; + let flags_fn = |name, flags: &Vec| { + format!( + "{name}+=(\n{}\n)\n", + flags + .iter() + .map(|s| format!(" \"{s}\"")) + .collect::>() + .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(), }; diff --git a/src/recipe.rs b/src/recipe.rs index 4341551d..e6252811 100644 --- a/src/recipe.rs +++ b/src/recipe.rs @@ -71,13 +71,27 @@ pub enum BuildKind { Cargo { #[serde(default)] package_path: Option, - #[serde(default)] cargoflags: String, }, /// Will build and install using configure and make #[serde(rename = "configure")] - Configure, + Configure { + #[serde(default)] + configureflags: Vec, + }, + /// Will build and install using cmake + #[serde(rename = "cmake")] + Cmake { + #[serde(default)] + cmakeflags: Vec, + }, + /// Will build and install using meson + #[serde(rename = "meson")] + Meson { + #[serde(default)] + mesonflags: Vec, + }, /// Will build and install using custom commands #[serde(rename = "custom")] Custom { script: String },