Software:Darling

From HandWiki
Short description: Open-source macOS compatibility layer
Darling
Darling project logo.png
Darling HelloWordApp.png
A simple 'HelloWorld' Cocoa app demonstrated on macOS (left) and Linux (right)
Original author(s)Luboš Doležel
Preview release
0.1.20220213 / 13 February 2022; 2 years ago (2022-02-13)
Repositorygithub.com/darlinghq/darling
Operating systemLinux
TypeCompatibility layer
LicenseVarious, primarily GPLv3
Websitedarlinghq.org

Darling is a free and open-source macOS compatibility layer for Linux.[1] It duplicates functions of macOS by providing alternative implementations of the libraries and frameworks that macOS programs call.[2] This method of duplication differs from other methods that might also be considered emulation,[3] where macOS programs run in a virtual machine.[4] Darling has been called the counterpart to WINE for running macOS apps.[5]

The project started in the summer of 2012 and builds on a previous project, named maloader, which was discontinued due to a lack of time. The layer has been shown to work with many console apps, such as Midnight Commander, The Unarchiver, Python, etc. on the layer, but it also has basic support for graphical applications based on the Cocoa framework.[6][1] Darling has the ability to extract Apple Disk Images.[7]

The project aims to support iOS applications in the future.[8]

Architecture

At the entry of the Darling system is a loader for Mach-O binaries, the executable format for Apple's operating systems. Darling's predecessor, maloader, presented a maximalist approach to the problem by trying to replicate everything that Apple's dynamic library loader dyld does. This proved to be hard, and since a 2017 "Mach-O transition" Darling has been using a lightweight loader just enough to launch the open-source Apple dyld instead.[9]

To provide the macOS binaries with a kernel, Darling uses a modified XNU kernel (with an APSL license) wrapped into a Linux kernel module with a GPL license.[needs update] It is not the same as including GPL code in APSL software, and the APSL license allows for linking from code with a different license (in this case GPL). The module handles the typical job of a Mach kernel, mainly Ports IPC handling.[10] Some licensing issues exist [citation needed] in the darling-mach module, as the team are adding GNU GPL modifications to the APSL kernel.[11][failed verification]

Higher than the kernel is the root environment. Darling, like WINE, supports chroot prefixes, implemented using the Linux overlayfs (as opposed to path translation in WINE). PID, IPC, and UTS namespaces are used to create a container for the Darwin system inside.

The frameworks and system libraries in Darling are, to the best possible extent, based on source code released by Apple. The Mach-O transition allows these frameworks to be built more easily, because they are now built as the Mach-O format they were intended for.[9] To fill in the gaps for many higher-level frameworks like Cocoa, Darling uses code from Cocotron, ApportableFoundation, and GNUstep.[1]

License

The larger Darling system is based on many external components which use various licenses, all of which are open-source. The primary license is GPLv3.[12]

External links

References

  1. 1.0 1.1 1.2 "Darling |". https://www.darlinghq.org/. 
  2. "You Can Now Use 'Darling' to Run macOS Software on Linux | iPhone in Canada Blog" (in en-US). 2020-10-05. https://www.iphoneincanada.ca/news/how-to-run-macos-software-on-linux/. 
  3. González, Diego Germán (2021-10-31). "MacOS programs on Linux? With Darling it is possible." (in en). https://www.linuxadictos.com/en/macos-programs-in-linux-with-darling-is-possible.html. 
  4. Brodkin, Jon (6 August 2013). "OS X apps run on Linux with Wine-like emulator for Mac software". Ars Technica. https://arstechnica.com/information-technology/2013/08/os-x-apps-run-on-linux-with-wine-like-emulator-for-mac-software/. 
  5. Lynch, Jim. "Will we ever be able to run OS X apps in Linux with Darling?" (in en). InfoWorld. https://www.infoworld.com/article/2839060/will-we-ever-be-able-to-run-os-x-apps-in-linux-with-darling.html. 
  6. "Darling Picks Up New Contributors For Its macOS Compatibility Layer On Linux" (in en). https://www.phoronix.com/scan.php?page=news_item&px=Darling-2019-New-Contribs. 
  7. "Installing software - Darling Docs". https://docs.darlinghq.org/installing-software.html. 
  8. Heath, Nick (15 July 2013). "OS X apps on their way to Linux courtesy of Darling project". ZDNet. http://www.zdnet.com/os-x-apps-on-their-way-to-linux-courtesy-of-darling-project-7000018051/. 
  9. 9.0 9.1 Bugaev, Sergey. "Mach-O linking and loading tricks". http://blog.darlinghq.org/2018/07/mach-o-linking-and-loading-tricks.html. 
  10. "Build Instructions". https://www.darlinghq.org/build-instructions/. "Darling uses a kernel module to provide certain OS X specific features, mainly Mach Ports IPC. No OS X application can be run without this module, since Libc requires Mach Ports for its initialization and even for very basic things such as sleep()." 
  11. "Issue: Code from Apple under the APSL is incompatible with the GPL". https://github.com/darlinghq/darling/issues/542. 
  12. "Darling". 16 October 2021. https://github.com/darlinghq/darling/blob/master/LICENSE.