this repo has no description
1# Darling
2
3
4
5Darling is a runtime environment for macOS applications.
6
7Please note that most GUI applications will not run at the moment.
8
9## Download
10
11Packages for some distributions are available for download
12under [releases](https://github.com/darlinghq/darling/releases).
13
14## Build Instructions
15
16For build instructions, visit [Darling Docs](https://docs.darlinghq.org/build-instructions.html).
17
18### Prefixes
19
20Darling has support for DPREFIXes, which are very similar to WINEPREFIXes. They are virtual “chroot” environments with an macOS-like filesystem structure, where you can install software safely. The default DPREFIX location is `~/.darling`, but this can be changed by exporting an identically named environment variable. A prefix is automatically created and initialized on first use.
21
22Please note that we use `overlayfs` for creating prefixes, and so we cannot support putting prefix on a filesystem like NFS or eCryptfs. In particular, the default prefix location won't work if you have an encrypted home directory.
23
24### Hello world
25
26Let's start with a Hello world:
27
28````
29$ darling shell echo Hello world
30Hello world
31````
32
33Congratulations, you have printed Hello world through Darling's OS X system call emulation and runtime libraries.
34
35### Installing software
36
37You can install `.pkg` packages with the installer tool available inside shell. It is a somewhat limited cousin of OS X's installer:
38
39````
40$ darling shell
41Darling [~]$ installer -pkg mc-4.8.7-0.pkg -target /
42````
43
44The Midnight Commander package from the above example is [available for download](https://darling-misc.s3.eu-central-1.amazonaws.com/mc-4.8.7-0.pkg).
45
46You can uninstall and list packages with the `uninstaller` command.
47
48### Working with DMG images
49
50DMG images can be attached and detached from inside `darling shell` with `hdiutil`. This is how you can install Xcode along with its toolchain and SDKs (note that Xcode itself doesn't run yet):
51
52````
53Darling [~]$ hdiutil attach Xcode_7.2.dmg
54/Volumes/Xcode_7.2
55Darling [~]$ cp -r /Volumes/Xcode_7.2/Xcode.app /Applications
56Darling [~]$ export SDKROOT=/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.11.sdk
57Darling [~]$ echo 'void main() { puts("Hello world"); }' > helloworld.c
58Darling [~]$ /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang helloworld.c -o helloworld
59Darling [~]$ ./helloworld
60Hello world
61````
62
63Congratulations, you have just compiled and run your own Hello world application with Apple's toolchain.
64
65### Working with XIP archives
66
67Xcode is now distributed in `.xip` files. These can be installed using `unxip`:
68
69```
70cd /Applications
71unxip Xcode_11.3.xip
72```