mirror of
https://github.com/autc04/Retro68.git
synced 2025-01-09 02:32:32 +00:00
enable powerpc universal interfaces via nix
This commit is contained in:
parent
fdc7063870
commit
7f8f47ca66
@ -259,6 +259,7 @@ function setup68KLibraries()
|
|||||||
|
|
||||||
function setupPPCLibraries()
|
function setupPPCLibraries()
|
||||||
{
|
{
|
||||||
|
DEST=${1:-"$PREFIX/universal"}
|
||||||
mkdir -p "$DEST/libppc"
|
mkdir -p "$DEST/libppc"
|
||||||
case `ResInfo -n "$INTERFACELIB" 2> /dev/null || echo 0` in
|
case `ResInfo -n "$INTERFACELIB" 2> /dev/null || echo 0` in
|
||||||
0)
|
0)
|
||||||
@ -273,7 +274,7 @@ function setupPPCLibraries()
|
|||||||
echo "Building PowerPC import libraries..."
|
echo "Building PowerPC import libraries..."
|
||||||
for shlib in "${SHAREDLIBRARIES}/"*; do
|
for shlib in "${SHAREDLIBRARIES}/"*; do
|
||||||
libname=`basename "$shlib"`
|
libname=`basename "$shlib"`
|
||||||
implib=lib${libname}.a
|
implib=lib${libname%.bin}.a
|
||||||
printf " %30s => %-30s\n" ${libname} ${implib}
|
printf " %30s => %-30s\n" ${libname} ${implib}
|
||||||
MakeImport "$shlib" "$DEST/libppc/$implib" || true
|
MakeImport "$shlib" "$DEST/libppc/$implib" || true
|
||||||
done
|
done
|
||||||
@ -288,7 +289,7 @@ function setupPPCLibraries()
|
|||||||
cp "$obj" "$DEST/libppc/"
|
cp "$obj" "$DEST/libppc/"
|
||||||
basename=`basename "${obj%.o}"`
|
basename=`basename "${obj%.o}"`
|
||||||
# and wrap it in a .a archive for convenience
|
# 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"
|
rm -f "$lib"
|
||||||
powerpc-apple-macos-ar cqs "$lib" "$obj"
|
powerpc-apple-macos-ar cqs "$lib" "$obj"
|
||||||
fi
|
fi
|
||||||
|
@ -26,20 +26,31 @@ pkgs: prevPkgs:
|
|||||||
ConvertDiskImage $src decoded.dsk
|
ConvertDiskImage $src decoded.dsk
|
||||||
export HOME=.
|
export HOME=.
|
||||||
hmount decoded.dsk
|
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:CIncludes:*.h' CIncludes/
|
||||||
hcopy -t 'MPW-GM:MPW-GM:Interfaces&Libraries:Interfaces:RIncludes:*.r' RIncludes/
|
hcopy -t 'MPW-GM:MPW-GM:Interfaces&Libraries:Interfaces:RIncludes:*.r' RIncludes/
|
||||||
mkdir -p $out/include $out/RIncludes
|
mkdir -p $out/include $out/RIncludes
|
||||||
bash ${../prepare-headers.sh} CIncludes $out/include
|
bash ${../prepare-headers.sh} CIncludes $out/include
|
||||||
bash ${../prepare-rincludes.sh} RIncludes $out/RIncludes
|
bash ${../prepare-rincludes.sh} RIncludes $out/RIncludes
|
||||||
|
|
||||||
hcopy -r 'MPW-GM:MPW-GM:Interfaces&Libraries:Libraries:Libraries:*.o' lib68
|
|
||||||
|
|
||||||
. ${../interfaces-and-libraries.sh}
|
. ${../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
|
M68KLIBRARIES=lib68
|
||||||
setup68KLibraries $out/
|
setup68KLibraries $out/
|
||||||
mv $out/lib68k $out/lib
|
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) {
|
} // prevPkgs.lib.optionalAttrs (prevPkgs.targetPlatform ? retro68) {
|
||||||
|
Loading…
Reference in New Issue
Block a user