enable powerpc universal interfaces via nix

This commit is contained in:
Wolfgang Thaller 2022-01-17 00:17:02 +01:00
parent fdc7063870
commit 7f8f47ca66
2 changed files with 18 additions and 6 deletions

View File

@ -259,6 +259,7 @@ function setup68KLibraries()
function setupPPCLibraries()
{
DEST=${1:-"$PREFIX/universal"}
mkdir -p "$DEST/libppc"
case `ResInfo -n "$INTERFACELIB" 2> /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

View File

@ -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) {