start of the libportage, first ebuild created

This commit is contained in:
neo
2026-08-01 17:54:33 +02:00
parent 4f14caba8d
commit 9a6b2d4761
5 changed files with 138 additions and 2 deletions
+1 -1
View File
@@ -2,4 +2,4 @@
default = "gitea" default = "gitea"
[registries.gitea] [registries.gitea]
index = "sparse+https://git.tcraft.me/api/packages/neo/cargo" # sparse index index = "sparse+https://git.tcraft.me/api/packages/neo/cargo/" # sparse index
Generated
+54
View File
@@ -59,6 +59,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "301b56658598e48f3648647ac6fc887be7e7108eddfa4e9b63fcf3ec58c0cadf" checksum = "301b56658598e48f3648647ac6fc887be7e7108eddfa4e9b63fcf3ec58c0cadf"
dependencies = [ dependencies = [
"clap_builder", "clap_builder",
"clap_derive",
] ]
[[package]] [[package]]
@@ -73,6 +74,18 @@ dependencies = [
"strsim", "strsim",
] ]
[[package]]
name = "clap_derive"
version = "4.6.4"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "d012d2b9d65aca7f18f4d9878a045bc17899bba951561ba5ec3c2ba1eed9a061"
dependencies = [
"heck",
"proc-macro2",
"quote",
"syn",
]
[[package]] [[package]]
name = "clap_lex" name = "clap_lex"
version = "1.1.0" version = "1.1.0"
@@ -85,6 +98,12 @@ version = "1.0.5"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "1d07550c9036bf2ae0c684c4297d503f838287c83c53686d05370d0e139ae570" checksum = "1d07550c9036bf2ae0c684c4297d503f838287c83c53686d05370d0e139ae570"
[[package]]
name = "heck"
version = "0.5.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "2304e00983f87ffb38b55b444b5e3b60a884b5d30c0fca7d82fe33449bbe55ea"
[[package]] [[package]]
name = "is_terminal_polyfill" name = "is_terminal_polyfill"
version = "1.70.2" version = "1.70.2"
@@ -103,6 +122,24 @@ version = "1.70.2"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "384b8ab6d37215f3c5301a95a4accb5d64aa607f1fcb26a11b5303878451b4fe" checksum = "384b8ab6d37215f3c5301a95a4accb5d64aa607f1fcb26a11b5303878451b4fe"
[[package]]
name = "proc-macro2"
version = "1.0.107"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "985e7ec9bb745e6ce6535b544d84d6cd6f7ad8bd711c398938ae983b91a766d9"
dependencies = [
"unicode-ident",
]
[[package]]
name = "quote"
version = "1.0.47"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "1fbf4db142a473a8d80c26bbf18454ed458bf8d26c8219c331daecfdbd079001"
dependencies = [
"proc-macro2",
]
[[package]] [[package]]
name = "ruport" name = "ruport"
version = "0.1.0" version = "0.1.0"
@@ -117,6 +154,23 @@ version = "0.11.1"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "7da8b5736845d9f2fcb837ea5d9e2628564b3b043a70948a3f0b778838c5fb4f" checksum = "7da8b5736845d9f2fcb837ea5d9e2628564b3b043a70948a3f0b778838c5fb4f"
[[package]]
name = "syn"
version = "3.0.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "53e9bae58849f64dfa4f5d5ae372c8341f7305f82a3868709269343628b659a3"
dependencies = [
"proc-macro2",
"quote",
"unicode-ident",
]
[[package]]
name = "unicode-ident"
version = "1.0.24"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "e6e4313cd5fcd3dad5cafa179702e2b244f760991f45397d14d4ebf38247da75"
[[package]] [[package]]
name = "utf8parse" name = "utf8parse"
version = "0.2.2" version = "0.2.2"
+1 -1
View File
@@ -98,7 +98,7 @@ path = "src/regendworld.rs"
required-features = ["drop-in"] required-features = ["drop-in"]
[dependencies] [dependencies]
clap = { version="4.6.5", features=["derive"] } clap = { version="4.6", features=["derive"] }
log = "0.4.33" log = "0.4.33"
[profile.release] [profile.release]
+30
View File
@@ -0,0 +1,30 @@
use std::{env, path::{Path,PathBuf}};
use std::io::Result;
fn getwcd() -> Result<PathBuf> {
let cwd = match env::current_dir() {
Ok(p) => p,
Err(_) => {
env::set_current_dir("/")?;
PathBuf::from("/")
}
};
Ok(cwd)
}
fn abssymlink(symlink: &Path, target: Option<PathBuf>) -> Result<PathBuf> {
let mut mylink = if target.is_some() {
target.unwrap()
} else {
std::fs::read_link(symlink)?
};
if !mylink.has_root() {
let mydir = mylink.parent().unwrap();
let link_name = mylink.clone();
mylink = Path::new(mydir).join(link_name);
}
Ok(mylink)
}
+52
View File
@@ -0,0 +1,52 @@
EAPI=8
DESCRIPTION="Rust port of the portage package manager system"
HOMEPAGE="https://tcraft.me/?topic=ruport"
SRC_URI="https://git.tcraft.me/neo/ruport.git"
IUSE="drop-in"
RUPORT_DROP-IN_BINS=(
target/release/ebuild
target/release/egencache
target/release/emerge
target/release/emerge-webrsync
target/release/emirrordist
target/release/glsa-check
target/release/gpkg-sign
target/release/portageq
target/release/quickpkg
)
RUPORT_DROP-IN_SBINS=(
target/release/archive-conf
target/release/dispatch-conf
target/release/emaint
target/release/env-update
target/release/etc-update
target/release/fixpackages
target/release/regendworld
)
src_compile() {
local cargo_flags=""
if use drop-in ; then
cargo_flags="--features=drop-in"
fi
cargo build --release ${cargo_flags}
}
src_install() {
dobin target/release/ruport
if use drop-in ; then
for pkg in RUPORT_DROP-IN_BINS ; do
dobin $pkg
done
for pkg in RUPORT_DROP-IN_SBINS ; do
dosbin $pkg
done
fi
}