lol

Merge pull request #206790 from OPNA2608/add/box64_more_targets

authored by

Sandro and committed by
GitHub
59e9ca3a eb63255e

+42 -22
+36 -21
pkgs/applications/emulators/box64/default.nix
··· 5 , gitUpdater 6 , cmake 7 , python3 8 }: 9 10 stdenv.mkDerivation rec { 11 pname = "box64"; ··· 33 ]; 34 35 cmakeFlags = [ 36 - "-DNOGIT=1" 37 - ] ++ ( 38 - if stdenv.hostPlatform.system == "aarch64-linux" then 39 - [ 40 - "-DARM_DYNAREC=ON" 41 - ] 42 - else [ 43 - "-DLD80BITS=1" 44 - "-DNOALIGN=1" 45 - ] 46 - ); 47 48 installPhase = '' 49 runHook preInstall 50 install -Dm 0755 box64 "$out/bin/box64" 51 runHook postInstall 52 ''; 53 54 doCheck = true; 55 56 - checkPhase = '' 57 - runHook preCheck 58 - ctest 59 - runHook postCheck 60 - ''; 61 - 62 doInstallCheck = true; 63 64 installCheckPhase = '' 65 runHook preInstallCheck 66 $out/bin/box64 -v 67 runHook postInstallCheck 68 ''; 69 70 - passthru.updateScript = gitUpdater { 71 - rev-prefix = "v"; 72 }; 73 74 meta = with lib; { 75 homepage = "https://box86.org/"; 76 description = "Lets you run x86_64 Linux programs on non-x86_64 Linux systems"; 77 license = licenses.mit; 78 - maintainers = with maintainers; [ gador ]; 79 - platforms = [ "x86_64-linux" "aarch64-linux" ]; 80 }; 81 }
··· 5 , gitUpdater 6 , cmake 7 , python3 8 + , withDynarec ? stdenv.hostPlatform.isAarch64 9 + , runCommand 10 + , hello-x86_64 11 + , box64 12 }: 13 + 14 + # Currently only supported on ARM 15 + assert withDynarec -> stdenv.hostPlatform.isAarch64; 16 17 stdenv.mkDerivation rec { 18 pname = "box64"; ··· 40 ]; 41 42 cmakeFlags = [ 43 + "-DNOGIT=ON" 44 + "-DARM_DYNAREC=${if withDynarec then "ON" else "OFF"}" 45 + "-DRV64=${if stdenv.hostPlatform.isRiscV64 then "ON" else "OFF"}" 46 + "-DPPC64LE=${if stdenv.hostPlatform.isPower64 && stdenv.hostPlatform.isLittleEndian then "ON" else "OFF"}" 47 + ] ++ lib.optionals stdenv.hostPlatform.isx86_64 [ 48 + "-DLD80BITS=ON" 49 + "-DNOALIGN=ON" 50 + ]; 51 52 installPhase = '' 53 runHook preInstall 54 + 55 install -Dm 0755 box64 "$out/bin/box64" 56 + 57 runHook postInstall 58 ''; 59 60 doCheck = true; 61 62 doInstallCheck = true; 63 64 installCheckPhase = '' 65 runHook preInstallCheck 66 + 67 + echo Checking if it works 68 $out/bin/box64 -v 69 + 70 + echo Checking if Dynarec option was respected 71 + $out/bin/box64 -v | grep ${lib.optionalString (!withDynarec) "-v"} Dynarec 72 + 73 runHook postInstallCheck 74 ''; 75 76 + passthru = { 77 + updateScript = gitUpdater { 78 + rev-prefix = "v"; 79 + }; 80 + tests.hello = runCommand "box64-test-hello" { 81 + nativeBuildInputs = [ box64 hello-x86_64 ]; 82 + } '' 83 + # There is no actual "Hello, world!" with any of the logging enabled, and with all logging disabled it's hard to 84 + # tell what problems the emulator has run into. 85 + BOX64_NOBANNER=0 BOX64_LOG=1 box64 ${hello-x86_64}/bin/hello --version | tee $out 86 + ''; 87 }; 88 89 meta = with lib; { 90 homepage = "https://box86.org/"; 91 description = "Lets you run x86_64 Linux programs on non-x86_64 Linux systems"; 92 license = licenses.mit; 93 + maintainers = with maintainers; [ gador OPNA2608 ]; 94 + platforms = [ "x86_64-linux" "aarch64-linux" "riscv64-linux" "powerpc64le-linux" ]; 95 }; 96 }
+6 -1
pkgs/top-level/all-packages.nix
··· 2028 wxGTK = wxGTK32; 2029 }; 2030 2031 - box64 = callPackage ../applications/emulators/box64 { }; 2032 2033 caprice32 = callPackage ../applications/emulators/caprice32 { }; 2034
··· 2028 wxGTK = wxGTK32; 2029 }; 2030 2031 + box64 = callPackage ../applications/emulators/box64 { 2032 + hello-x86_64 = if stdenv.hostPlatform.isx86_64 then 2033 + hello 2034 + else 2035 + pkgsCross.gnu64.hello; 2036 + }; 2037 2038 caprice32 = callPackage ../applications/emulators/caprice32 { }; 2039