Skip to content

Commit

Permalink
Update dwarfs-universal
Browse files Browse the repository at this point in the history
Update mksquashfs
Update unsquashfs
Update squashfuse
Refactoring
  • Loading branch information
VHSgunzo committed Nov 22, 2024
1 parent 147561b commit f8c45f2
Show file tree
Hide file tree
Showing 4 changed files with 101 additions and 133 deletions.
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "uruntime"
version = "0.0.5"
version = "0.0.6"
readme = "README.md"
license = "MIT"
repository = "https://github.com/VHSgunzo/uruntime"
Expand Down
2 changes: 0 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,6 @@ See [Build step in ci.yml](https://github.com/VHSgunzo/uruntime/blob/main/.githu
--runtime-squashfuse [ARGS] Launch squashfuse
--runtime-unsquashfs [ARGS] Launch unsquashfs
--runtime-mksquashfs [ARGS] Launch mksquashfs
--runtime-tar [ARGS] Launch tar
--runtime-dwarfs [ARGS] Launch dwarfs
--runtime-dwarfsck [ARGS] Launch dwarfsck
--runtime-mkdwarfs [ARGS] Launch mkdwarfs
Expand Down Expand Up @@ -119,7 +118,6 @@ See [Build step in ci.yml](https://github.com/VHSgunzo/uruntime/blob/main/.githu
--appimage-squashfuse [ARGS] Launch squashfuse
--appimage-unsquashfs [ARGS] Launch unsquashfs
--appimage-mksquashfs [ARGS] Launch mksquashfs
--appimage-tar [ARGS] Launch tar
--appimage-dwarfs [ARGS] Launch dwarfs
--appimage-dwarfsck [ARGS] Launch dwarfsck
--appimage-mkdwarfs [ARGS] Launch mkdwarfs
Expand Down
19 changes: 8 additions & 11 deletions build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,15 +17,12 @@ fn main() {

let assets_path = project_path.join(format!("assets-{arch}"));
let assets_path_link = project_path.join("assets");
let upx = assets_path.join("upx");

let assets = IndexMap::from([
("upx", format!("https://bin.ajam.dev/{arch}/upx")),
("tar", format!("https://bin.ajam.dev/{arch}/Baseutils/tar/tar")),
("squashfuse", format!("https://bin.ajam.dev/{arch}/squashfuse")),
("unsquashfs", format!("https://bin.ajam.dev/{arch}/Baseutils/squashfstools/unsquashfs")),
("mksquashfs", format!("https://bin.ajam.dev/{arch}/Baseutils/squashfstools/mksquashfs")),
("dwarfs-universal-upx", format!("https://github.com/mhx/dwarfs/releases/download/v0.10.1/dwarfs-universal-0.10.1-Linux-{arch}-clang")),
("squashfuse-upx", format!("https://github.com/VHSgunzo/squashfuse-static/releases/download/v0.5.2.r6.g4289904/squashfuse-{arch}-upx")),
("unsquashfs-upx", format!("https://github.com/VHSgunzo/squashfs-tools-static/releases/download/v4.6.r569.gc732a99/unsquashfs-{arch}-upx")),
("mksquashfs-upx", format!("https://github.com/VHSgunzo/squashfs-tools-static/releases/download/v4.6.r569.gc732a99/mksquashfs-{arch}-upx")),
("dwarfs-universal-upx", format!("https://github.com/VHSgunzo/dwarfs-universal-artifacts/releases/download/v0.10.1-153-gab3e199f79/dwarfs-universal-Linux-{arch}-clang-O2")),
]);

if !assets_path.exists() {
Expand All @@ -44,23 +41,23 @@ fn main() {
"--insecure",
"-L", assets.get(asset).unwrap(),
"-o", asset_path.to_str().unwrap()
]).output().unwrap_or_else(|_| panic!("Failed to execute curl: {asset}"));
]).output().unwrap_or_else(|err| panic!("Failed to execute curl: {err}: {asset}"));

if !output.status.success() {
eprintln!("Failed to get asset: {}", String::from_utf8_lossy(&output.stderr));
exit(1)
}

set_permissions(&asset_path, Permissions::from_mode(0o755))
.unwrap_or_else(|_| panic!("Unable to set permissions: {asset}"));
.unwrap_or_else(|err| panic!("Unable to set permissions: {err}: {asset}"));
}

if !asset.ends_with("upx") && !asset_upx_path.exists() {
let output = Command::new(&upx).args([
let output = Command::new("upx").args([
"--force-overwrite", "-9", "--best",
asset_path.to_str().unwrap(), "-o",
asset_upx_path.to_str().unwrap()
]).output().unwrap_or_else(|_| panic!("Failed to execute upx: {asset}"));
]).output().unwrap_or_else(|err| panic!("Failed to execute upx: {err}: {asset}"));

if !output.status.success() {
eprintln!("Failed to upx asset: {}", String::from_utf8_lossy(&output.stderr));
Expand Down
Loading

0 comments on commit f8c45f2

Please sign in to comment.