diff --git a/PEFTools/MakeImport.cc b/PEFTools/MakeImport.cc index d5d5eeb3e2..1996dc402f 100755 --- a/PEFTools/MakeImport.cc +++ b/PEFTools/MakeImport.cc @@ -215,7 +215,13 @@ void MakeImportLibrary(char *pefptr, size_t pefsize, fs::path dest, fs::path tmp bool MakeImportLibraryMulti(fs::path path, fs::path libname) { ResourceFile resFile; - assert(resFile.read(path.string())); + bool readSuccess = resFile.read(path.string()); + + if (!readSuccess) + { + std::cerr << "Could not read input file.\n"; + return false; + } std::vector data(resFile.data.begin(), resFile.data.end()); diff --git a/azure-pipelines.yml b/azure-pipelines.yml index b149f4bd4e..f7504897bf 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -1,10 +1,12 @@ trigger: - master + jobs: - job: Linux pool: vmImage: 'ubuntu-20.04' + timeoutInMinutes: 90 steps: - checkout: self submodules: true @@ -37,6 +39,7 @@ jobs: - job: macOS pool: vmImage: 'macOS-10.15' + timeoutInMinutes: 90 steps: - checkout: self submodules: true @@ -69,10 +72,9 @@ jobs: - checkout: self submodules: true - script: | - docker run -i --name nix -v`pwd`:/src nixos/nix:latest < /dev/null || echo 0` in 0) @@ -273,7 +274,7 @@ function setupPPCLibraries() echo "Building PowerPC import libraries..." for shlib in "${SHAREDLIBRARIES}/"*; do libname=`basename "$shlib"` - implib=lib${libname}.a + implib=lib${libname%.bin}.a printf " %30s => %-30s\n" ${libname} ${implib} MakeImport "$shlib" "$DEST/libppc/$implib" || true done @@ -288,7 +289,7 @@ function setupPPCLibraries() cp "$obj" "$DEST/libppc/" basename=`basename "${obj%.o}"` # and wrap it in a .a archive for convenience - lib="$PREFIX"/universal/libppc/lib$basename.a + lib="$DEST"/libppc/lib$basename.a rm -f "$lib" powerpc-apple-macos-ar cqs "$lib" "$obj" fi diff --git a/nix/samples.nix b/nix/samples.nix index e71bfaf15e..24f9ac71d7 100644 --- a/nix/samples.nix +++ b/nix/samples.nix @@ -11,6 +11,7 @@ pkgs: prevPkgs: { installPhase = '' mkdir $out cp *.bin $out/ + rm -f $out/*.code.bin $out/*.rsrc.bin ''; }) ({ dialog = ../Samples/Dialog; @@ -24,7 +25,7 @@ pkgs: prevPkgs: { } // lib.optionalAttrs (targetPlatform.cmakeSystemName == "Retro68") { systemextension = ../Samples/SystemExtension; launcher = ../Samples/Launcher; - }); + }) // { launchapplserver = self.launchapplserver; }; in runCommand "retro68.samples" { } '' mkdir -p $out/ @@ -40,7 +41,8 @@ pkgs: prevPkgs: { nativeBuildInputs = [ buildPackages.ninja buildPackages.cmake ]; installPhase = '' mkdir $out - cp *.bin $out/ + cp Server/*.bin $out/ + rm $out/*.code.bin $out/*.rsrc.bin ''; }; }); diff --git a/nix/universal.nix b/nix/universal.nix index b8e1239634..1f7df2856b 100644 --- a/nix/universal.nix +++ b/nix/universal.nix @@ -26,20 +26,31 @@ pkgs: prevPkgs: ConvertDiskImage $src decoded.dsk export HOME=. hmount decoded.dsk - mkdir -p CIncludes RIncludes lib68 + mkdir -p CIncludes RIncludes hcopy -t 'MPW-GM:MPW-GM:Interfaces&Libraries:Interfaces:CIncludes:*.h' CIncludes/ hcopy -t 'MPW-GM:MPW-GM:Interfaces&Libraries:Interfaces:RIncludes:*.r' RIncludes/ mkdir -p $out/include $out/RIncludes bash ${../prepare-headers.sh} CIncludes $out/include bash ${../prepare-rincludes.sh} RIncludes $out/RIncludes - hcopy -r 'MPW-GM:MPW-GM:Interfaces&Libraries:Libraries:Libraries:*.o' lib68 - . ${../interfaces-and-libraries.sh} + '' + (pkgs.lib.optionalString (pkgs.targetPlatform.cmakeSystemName == "Retro68") '' + mkdir -p lib68 + hcopy -r 'MPW-GM:MPW-GM:Interfaces&Libraries:Libraries:Libraries:*.o' lib68 M68KLIBRARIES=lib68 setup68KLibraries $out/ mv $out/lib68k $out/lib - ''; + '') + (pkgs.lib.optionalString (pkgs.targetPlatform.cmakeSystemName != "Retro68") '' + mkdir -p libppc peflibs + hcopy -r 'MPW-GM:MPW-GM:Interfaces&Libraries:Libraries:PPCLibraries:*.o' libppc + hcopy -m 'MPW-GM:MPW-GM:Interfaces&Libraries:Libraries:SharedLibraries:*' peflibs + PPCLIBRARIES=libppc + SHAREDLIBRARIES=peflibs + INTERFACELIB=peflibs/InterfaceLib.bin + + setupPPCLibraries $out/ + mv $out/libppc $out/lib + ''); }; }); } // prevPkgs.lib.optionalAttrs (prevPkgs.targetPlatform ? retro68) {