Skip to content

Commit

Permalink
[bndbuild] Fix vasm installation on Linux
Browse files Browse the repository at this point in the history
  • Loading branch information
Krusty/Benediction committed Nov 11, 2024
1 parent eceb4f9 commit 88ed2c8
Show file tree
Hide file tree
Showing 5 changed files with 18 additions and 4 deletions.
4 changes: 2 additions & 2 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion cpclib-runner/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ bon = "2.3"
directories = "5.0.1"
flate2 = "1.0.34"
glob.workspace = true
tar = "0.4.42"
tar = "0.4.43"
zip-extract = "=0.1.3"
rust-ini = "0.21.1"
scraper = "0.20.0"
Expand Down
8 changes: 8 additions & 0 deletions cpclib-runner/src/delegated.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ use std::rc::Rc;

use bon::Builder;
use cpclib_common::camino::{Utf8Path, Utf8PathBuf};
use cpclib_common::itertools::Itertools;
use directories::ProjectDirs;
use flate2::read::GzDecoder;
use scraper::{Html, Selector};
Expand Down Expand Up @@ -316,6 +317,7 @@ impl<E: EventObserver> Deref for PostInstall<E> {
#[derive(Clone)]
pub enum ArchiveFormat {
Raw,
Tar,
TarGz,
TarXz,
Zip,
Expand Down Expand Up @@ -395,10 +397,16 @@ impl<E: EventObserver> DelegateApplicationDescription<E> {
std::fs::create_dir_all(&dest).map_err(|e| e.to_string())?;
std::fs::write(self.exec_fname(), &buffer).map_err(|e| e.to_string())?;
},
ArchiveFormat::Tar => {
o.emit_stdout(">> Open tar archive");
let mut archive = Archive::new(input);
archive.unpack(dest.clone()).map_err(|e| e.to_string())?;
}
ArchiveFormat::TarGz => {
o.emit_stdout(">> Open targz archive");
let gz = GzDecoder::new(input);
let mut archive = Archive::new(gz);
archive.entries().unwrap().into_iter().for_each(|f| eprintln!("{:?}", f.unwrap().header()));
archive.unpack(dest.clone()).map_err(|e| e.to_string())?;
},
ArchiveFormat::TarXz => {
Expand Down
2 changes: 1 addition & 1 deletion cpclib-runner/src/runner/assembler/vasm.rs
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ impl DownloadableInformation for VasmVersion {
#[cfg(target_os = "macos")]
unimplemented!();
#[cfg(target_os = "linux")]
return ArchiveFormat::TarGz;
return ArchiveFormat::Tar; // XXX yep extension is wrong
}
}
}
Expand Down
6 changes: 6 additions & 0 deletions docs/bndbuild/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -949,6 +949,12 @@ Failure
Error while launching the command.
```


### Assembler: Vasm z80 oldstyle (vasm)

<http://sun.hasenbraten.de/vasm/release/vasm_6.html>


### Emulator-agnostic emulation (cpc,emu)

```
Expand Down

0 comments on commit 88ed2c8

Please sign in to comment.