make all samples work with nix
This commit is contained in:
parent
80392999cc
commit
f16fdd6463
|
@ -136,7 +136,11 @@ pkgs: prevPkgs:
|
||||||
set(MAKE_PEF "${pkgs.buildPackages.retro68.tools}/bin/MakePEF" )
|
set(MAKE_PEF "${pkgs.buildPackages.retro68.tools}/bin/MakePEF" )
|
||||||
|
|
||||||
include(${../cmake/add_application.cmake})
|
include(${../cmake/add_application.cmake})
|
||||||
'';
|
'' + (pkgs.lib.optionalString (systemName == "RetroCarbon") ''
|
||||||
|
set(CMAKE_EXE_LINKER_FLAGS_INIT "-carbon")
|
||||||
|
set(CMAKE_SHARED_LINKER_FLAGS_INIT "-carbon")
|
||||||
|
add_definitions( -DTARGET_API_MAC_CARBON=1 )
|
||||||
|
'');
|
||||||
};
|
};
|
||||||
hook = pkgs.writeTextFile {
|
hook = pkgs.writeTextFile {
|
||||||
name = "retro68.setup_hook";
|
name = "retro68.setup_hook";
|
||||||
|
|
|
@ -47,7 +47,7 @@
|
||||||
};
|
};
|
||||||
carbon = {
|
carbon = {
|
||||||
system = "powerpc-carbon";
|
system = "powerpc-carbon";
|
||||||
config = "powerpc-apple-carbon";
|
config = "powerpc-apple-macos";
|
||||||
libc = "retro68";
|
libc = "retro68";
|
||||||
parsed = {
|
parsed = {
|
||||||
cpu = {
|
cpu = {
|
||||||
|
|
|
@ -8,42 +8,28 @@ pkgs: prevPkgs: {
|
||||||
src = path;
|
src = path;
|
||||||
nativeBuildInputs = [ buildPackages.ninja buildPackages.cmake ];
|
nativeBuildInputs = [ buildPackages.ninja buildPackages.cmake ];
|
||||||
buildInputs = [ retro68.console ];
|
buildInputs = [ retro68.console ];
|
||||||
buildCommand = ''
|
installPhase = ''
|
||||||
mkdir build
|
mkdir $out
|
||||||
cd build
|
cp *.bin $out/
|
||||||
cmake $src -G Ninja
|
'';
|
||||||
ninja
|
|
||||||
mkdir -p $out/Applications
|
|
||||||
mkdir -p $out/Applications/.finf
|
|
||||||
mkdir -p $out/Applications/.rsrc
|
|
||||||
|
|
||||||
cp *.APPL $out/Applications
|
|
||||||
cp .finf/*.APPL $out/Applications/.finf
|
|
||||||
cp .rsrc/*.APPL $out/Applications/.rsrc
|
|
||||||
for f in *.APPL; do
|
|
||||||
cp $'' + ''
|
|
||||||
{f%.APPL}.bin $out/Applications
|
|
||||||
done
|
|
||||||
'';
|
|
||||||
}) ({
|
}) ({
|
||||||
dialog = ../Samples/Dialog;
|
dialog = ../Samples/Dialog;
|
||||||
helloworld = ../Samples/HelloWorld;
|
helloworld = ../Samples/HelloWorld;
|
||||||
mpwtool = ../Samples/MPWTool;
|
|
||||||
raytracer = ../Samples/Raytracer;
|
raytracer = ../Samples/Raytracer;
|
||||||
#systemextension = ../Samples/SystemExtension;
|
} // lib.optionalAttrs (targetPlatform.cmakeSystemName != "RetroCarbon") {
|
||||||
|
mpwtool = ../Samples/MPWTool;
|
||||||
wdef = ../Samples/WDEF;
|
wdef = ../Samples/WDEF;
|
||||||
} // lib.optionalAttrs (targetPlatform.cmakeSystemName != "Retro68") {
|
} // lib.optionalAttrs (targetPlatform.cmakeSystemName != "Retro68") {
|
||||||
sharedlibrary = ../Samples/SharedLibrary;
|
sharedlibrary = ../Samples/SharedLibrary;
|
||||||
} // lib.optionalAttrs (targetPlatform.cmakeSystemName == "Retro68") {
|
} // lib.optionalAttrs (targetPlatform.cmakeSystemName == "Retro68") {
|
||||||
|
systemextension = ../Samples/SystemExtension;
|
||||||
launcher = ../Samples/Launcher;
|
launcher = ../Samples/Launcher;
|
||||||
});
|
});
|
||||||
in runCommand "retro68.samples" { } ''
|
in runCommand "retro68.samples" { } ''
|
||||||
mkdir -p $out/Applications
|
mkdir -p $out/
|
||||||
mkdir -p $out/Applications/.rsrc
|
|
||||||
mkdir -p $out/Applications/.finf
|
|
||||||
|
|
||||||
${lib.concatMapStrings (x: ''
|
${lib.concatMapStrings (x: ''
|
||||||
cp -r ${lib.escapeShellArg x}/Applications $out/
|
cp -r ${lib.escapeShellArg x}/*.bin $out/
|
||||||
'') (builtins.attrValues individualSamples)}
|
'') (builtins.attrValues individualSamples)}
|
||||||
'' // individualSamples;
|
'' // individualSamples;
|
||||||
|
|
||||||
|
@ -54,14 +40,7 @@ pkgs: prevPkgs: {
|
||||||
nativeBuildInputs = [ buildPackages.ninja buildPackages.cmake ];
|
nativeBuildInputs = [ buildPackages.ninja buildPackages.cmake ];
|
||||||
installPhase = ''
|
installPhase = ''
|
||||||
mkdir $out
|
mkdir $out
|
||||||
mkdir -p $out/Applications
|
cp *.bin $out/
|
||||||
mkdir -p $out/Applications/.finf
|
|
||||||
mkdir -p $out/Applications/.rsrc
|
|
||||||
|
|
||||||
cp Server/LaunchAPPLServer.APPL $out/Applications
|
|
||||||
cp Server/.finf/LaunchAPPLServer.APPL $out/Applications/.finf
|
|
||||||
cp Server/.rsrc/LaunchAPPLServer.APPL $out/Applications/.rsrc
|
|
||||||
cp Server/LaunchAPPLServer.bin $out/Applications
|
|
||||||
'';
|
'';
|
||||||
};
|
};
|
||||||
});
|
});
|
||||||
|
|
Loading…
Reference in New Issue