1{
2 lib,
3 undmg,
4 makeWrapper,
5 fetchurl,
6 stdenvNoCC,
7}:
8
9stdenvNoCC.mkDerivation rec {
10 pname = "utm";
11 version = "4.6.5";
12
13 src = fetchurl {
14 url = "https://github.com/utmapp/UTM/releases/download/v${version}/UTM.dmg";
15 hash = "sha256-CzVgfgHi76BPRfF22HW0o4YTh4Bx7lU20qnMO2Sjwo0=";
16 };
17
18 nativeBuildInputs = [
19 undmg
20 makeWrapper
21 ];
22
23 sourceRoot = ".";
24 installPhase = ''
25 runHook preInstall
26
27 mkdir -p $out/Applications
28 cp -r *.app $out/Applications
29
30 mkdir -p $out/bin
31 for bin in $out/Applications/UTM.app/Contents/MacOS/*; do
32 # Symlinking `UTM` doesn't work; seems to look for files in the wrong
33 # place
34 makeWrapper $bin "$out/bin/$(basename $bin)"
35 done
36
37 runHook postInstall
38 '';
39
40 meta = {
41 description = "Full featured system emulator and virtual machine host for iOS and macOS";
42 longDescription = ''
43 UTM is a full featured system emulator and virtual machine host for iOS
44 and macOS. It is based off of QEMU. In short, it allows you to run
45 Windows, Linux, and more on your Mac, iPhone, and iPad.
46
47 Features:
48 - Full system emulation (MMU, devices, etc) using QEMU
49 - 30+ processors supported including x86_64, ARM64, and RISC-V
50 - VGA graphics mode using SPICE and QXL
51 - Text terminal mode
52 - USB devices
53 - JIT based acceleration using QEMU TCG
54 - Frontend designed from scratch for macOS 11 and iOS 11+ using the
55 latest and greatest APIs
56 - Create, manage, run VMs directly from your device
57 - Hardware accelerated virtualization using Hypervisor.framework and
58 QEMU
59 - Boot macOS guests with Virtualization.framework on macOS 12+
60
61 See https://docs.getutm.app/ for more information.
62 '';
63 homepage = "https://mac.getutm.app/";
64 changelog = "https://github.com/utmapp/utm/releases/tag/v${version}";
65 mainProgram = "UTM";
66 license = lib.licenses.asl20;
67 platforms = lib.platforms.darwin; # 11.3 is the minimum supported version as of UTM 4.
68 sourceProvenance = with lib.sourceTypes; [ binaryNativeCode ];
69 maintainers = with lib.maintainers; [
70 rrbutani
71 wegank
72 ];
73 };
74}