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 5 , gitUpdater 6 6 , cmake 7 7 , python3 8 + , withDynarec ? stdenv.hostPlatform.isAarch64 9 + , runCommand 10 + , hello-x86_64 11 + , box64 8 12 }: 13 + 14 + # Currently only supported on ARM 15 + assert withDynarec -> stdenv.hostPlatform.isAarch64; 9 16 10 17 stdenv.mkDerivation rec { 11 18 pname = "box64"; ··· 33 40 ]; 34 41 35 42 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 - ); 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 + ]; 47 51 48 52 installPhase = '' 49 53 runHook preInstall 54 + 50 55 install -Dm 0755 box64 "$out/bin/box64" 56 + 51 57 runHook postInstall 52 58 ''; 53 59 54 60 doCheck = true; 55 61 56 - checkPhase = '' 57 - runHook preCheck 58 - ctest 59 - runHook postCheck 60 - ''; 61 - 62 62 doInstallCheck = true; 63 63 64 64 installCheckPhase = '' 65 65 runHook preInstallCheck 66 + 67 + echo Checking if it works 66 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 + 67 73 runHook postInstallCheck 68 74 ''; 69 75 70 - passthru.updateScript = gitUpdater { 71 - rev-prefix = "v"; 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 + ''; 72 87 }; 73 88 74 89 meta = with lib; { 75 90 homepage = "https://box86.org/"; 76 91 description = "Lets you run x86_64 Linux programs on non-x86_64 Linux systems"; 77 92 license = licenses.mit; 78 - maintainers = with maintainers; [ gador ]; 79 - platforms = [ "x86_64-linux" "aarch64-linux" ]; 93 + maintainers = with maintainers; [ gador OPNA2608 ]; 94 + platforms = [ "x86_64-linux" "aarch64-linux" "riscv64-linux" "powerpc64le-linux" ]; 80 95 }; 81 96 }
+6 -1
pkgs/top-level/all-packages.nix
··· 2028 2028 wxGTK = wxGTK32; 2029 2029 }; 2030 2030 2031 - box64 = callPackage ../applications/emulators/box64 { }; 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 + }; 2032 2037 2033 2038 caprice32 = callPackage ../applications/emulators/caprice32 { }; 2034 2039