mirror of https://github.com/encounter/nod-rs.git
Fix checks & build
This commit is contained in:
parent
07bb8ccc1d
commit
f82d8b9f17
|
@ -135,7 +135,7 @@ jobs:
|
||||||
sudo apt-get -y install ${{ matrix.packages }}
|
sudo apt-get -y install ${{ matrix.packages }}
|
||||||
- name: Install cargo-zigbuild
|
- name: Install cargo-zigbuild
|
||||||
if: matrix.build == 'zigbuild'
|
if: matrix.build == 'zigbuild'
|
||||||
run: pip install ziglang==0.10.1.post1 cargo-zigbuild==0.17.0
|
run: pip install ziglang==0.11.0 cargo-zigbuild==0.18.3
|
||||||
- name: Setup Rust toolchain
|
- name: Setup Rust toolchain
|
||||||
uses: dtolnay/rust-toolchain@nightly
|
uses: dtolnay/rust-toolchain@nightly
|
||||||
with:
|
with:
|
||||||
|
|
|
@ -6,7 +6,7 @@ use std::{
|
||||||
mem::size_of,
|
mem::size_of,
|
||||||
};
|
};
|
||||||
|
|
||||||
use sha1::{digest, Digest, Sha1};
|
use sha1::{Digest, Sha1};
|
||||||
use zerocopy::{big_endian::*, AsBytes, FromBytes, FromZeroes};
|
use zerocopy::{big_endian::*, AsBytes, FromBytes, FromZeroes};
|
||||||
|
|
||||||
use crate::{
|
use crate::{
|
||||||
|
|
|
@ -2,8 +2,6 @@
|
||||||
|
|
||||||
use std::fmt;
|
use std::fmt;
|
||||||
|
|
||||||
use crate::{streams::ReadStream, Result};
|
|
||||||
|
|
||||||
pub(crate) mod block;
|
pub(crate) mod block;
|
||||||
pub(crate) mod ciso;
|
pub(crate) mod ciso;
|
||||||
pub(crate) mod iso;
|
pub(crate) mod iso;
|
||||||
|
@ -22,19 +20,6 @@ pub(crate) type KeyBytes = [u8; 16];
|
||||||
/// Magic bytes
|
/// Magic bytes
|
||||||
pub(crate) type MagicBytes = [u8; 4];
|
pub(crate) type MagicBytes = [u8; 4];
|
||||||
|
|
||||||
/// Abstraction over supported disc file formats.
|
|
||||||
pub trait DiscIO: Send + Sync {
|
|
||||||
/// Opens a new read stream for the disc file(s).
|
|
||||||
/// Generally does _not_ need to be used directly.
|
|
||||||
fn open(&self) -> Result<Box<dyn ReadStream + '_>>;
|
|
||||||
|
|
||||||
/// Returns extra metadata included in the disc file format, if any.
|
|
||||||
fn meta(&self) -> Result<DiscMeta> { Ok(DiscMeta::default()) }
|
|
||||||
|
|
||||||
/// If None, the file format does not store the original disc size. (e.g. WBFS, NFS)
|
|
||||||
fn disc_size(&self) -> Option<u64>;
|
|
||||||
}
|
|
||||||
|
|
||||||
#[derive(Debug, Clone, Copy, PartialEq, Eq, Default)]
|
#[derive(Debug, Clone, Copy, PartialEq, Eq, Default)]
|
||||||
pub enum Format {
|
pub enum Format {
|
||||||
/// Raw ISO
|
/// Raw ISO
|
||||||
|
|
|
@ -40,7 +40,7 @@ fn main() {
|
||||||
|
|
||||||
let out_dir = env::var("OUT_DIR").unwrap();
|
let out_dir = env::var("OUT_DIR").unwrap();
|
||||||
let dest_path = Path::new(&out_dir).join("parsed-dats.bin");
|
let dest_path = Path::new(&out_dir).join("parsed-dats.bin");
|
||||||
let mut f = BufWriter::new(File::create(&dest_path).unwrap());
|
let mut f = BufWriter::new(File::create(dest_path).unwrap());
|
||||||
|
|
||||||
// Parse dat files
|
// Parse dat files
|
||||||
let mut entries = Vec::<(GameEntry, String)>::new();
|
let mut entries = Vec::<(GameEntry, String)>::new();
|
||||||
|
|
|
@ -452,7 +452,7 @@ fn convert_and_verify(in_file: &Path, out_file: Option<&Path>, md5: bool) -> Res
|
||||||
}
|
}
|
||||||
|
|
||||||
let redump_entry = if let (Some(crc32), Some(sha1)) = (crc32, sha1) {
|
let redump_entry = if let (Some(crc32), Some(sha1)) = (crc32, sha1) {
|
||||||
redump::find_by_hashes(crc32, sha1.into())
|
redump::find_by_hashes(crc32, sha1)
|
||||||
} else {
|
} else {
|
||||||
None
|
None
|
||||||
};
|
};
|
||||||
|
|
|
@ -47,7 +47,7 @@ pub fn find_by_hashes(crc32: u32, sha1: [u8; 20]) -> Option<GameResult> {
|
||||||
#[repr(C, align(4))]
|
#[repr(C, align(4))]
|
||||||
struct Aligned<T: ?Sized>(T);
|
struct Aligned<T: ?Sized>(T);
|
||||||
|
|
||||||
const DATA: &'static Aligned<[u8]> =
|
const DATA: &Aligned<[u8]> =
|
||||||
&Aligned(*include_bytes!(concat!(env!("OUT_DIR"), "/parsed-dats.bin")));
|
&Aligned(*include_bytes!(concat!(env!("OUT_DIR"), "/parsed-dats.bin")));
|
||||||
|
|
||||||
// Keep in sync with build.rs
|
// Keep in sync with build.rs
|
||||||
|
|
Loading…
Reference in New Issue