Darling (software)
{{Short description|Open-source macOS compatibility layer}}
{{Infobox software
| name = Darling
| logo = Darling_project_logo.png
| screenshot = Darling HelloWordApp.png
| caption = A simple 'HelloWorld' Cocoa app demonstrated on macOS (left) and Linux (right)
| author = Luboš Doležel
| released =
| ver layout = simple
| latest release version =
| latest release date =
| latest preview version = 0.1.20220213
| latest preview date = {{Start date and age|df=yes|2022|02|13}}
| repo = [https://github.com/darlinghq/darling github.com/darlinghq/darling]
| operating system = Linux
| genre = Compatibility layer
| license = Various, primarily GPLv3
| website = {{URL|darlinghq.org}}
}}
Darling is a free and open-source macOS compatibility layer for Linux.{{Cite web |title=Darling {{!}} |url=https://www.darlinghq.org/ |archive-url=https://web.archive.org/web/20220616173802/https://www.darlinghq.org/ |archive-date=2022-06-16 |access-date=2022-06-17 |website=www.darlinghq.org}} It duplicates functions of macOS by providing alternative implementations of the libraries and frameworks that macOS programs call.{{Cite web |date=2020-10-05 |title=You Can Now Use 'Darling' to Run macOS Software on Linux {{!}} iPhone in Canada Blog |url=https://www.iphoneincanada.ca/news/how-to-run-macos-software-on-linux/ |url-status=live |archive-url=https://web.archive.org/web/20220617070452/https://www.iphoneincanada.ca/news/how-to-run-macos-software-on-linux/ |archive-date=2022-06-17 |access-date=2022-06-17 |language=en-US}} This method of duplication differs from other methods that might also be considered emulation,{{Cite web |last=González |first=Diego Germán |date=2021-10-31 |title=MacOS programs on Linux? With Darling it is possible. |url=https://www.linuxadictos.com/en/macos-programs-in-linux-with-darling-is-possible.html |access-date=2022-06-17 |website=Linux Adictos |language=en}} where macOS programs run in a virtual machine.{{cite web|url=https://arstechnica.com/information-technology/2013/08/os-x-apps-run-on-linux-with-wine-like-emulator-for-mac-software/|title=OS X apps run on Linux with Wine-like emulator for Mac software|publisher=Ars Technica|first1=Jon|last1=Brodkin|date=6 August 2013|access-date=23 January 2014}} Darling has been called the counterpart to WINE for running macOS apps.{{Cite news|url=https://www.infoworld.com/article/2839060/will-we-ever-be-able-to-run-os-x-apps-in-linux-with-darling.html|title=Will we ever be able to run OS X apps in Linux with Darling?|last=Lynch|first=Jim|work=InfoWorld|access-date=2018-07-23|language=en}}
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.{{Cite web |title=Darling Picks Up New Contributors For Its macOS Compatibility Layer On Linux |url=https://www.phoronix.com/scan.php?page=news_item&px=Darling-2019-New-Contribs |url-status=live |archive-url=https://web.archive.org/web/20220617065715/https://www.phoronix.com/scan.php?page=news_item&px=Darling-2019-New-Contribs |archive-date=2022-06-17 |access-date=2022-06-17 |website=www.phoronix.com |language=en}} Darling has the ability to extract Apple Disk Images.{{Cite web|title=Installing software - Darling Docs|url=https://docs.darlinghq.org/installing-software.html|access-date=2022-01-27|website=docs.darlinghq.org}}
The project aims to support iOS applications in the future.{{cite web|url=https://www.zdnet.com/article/os-x-apps-on-their-way-to-linux-courtesy-of-darling-project/ |title=OS X apps on their way to Linux courtesy of Darling project|publisher=ZDNet|first1=Nick|last1=Heath|date=15 July 2013|access-date=23 January 2014}}
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.{{cite web |last1=Bugaev |first1=Sergey |title=Mach-O linking and loading tricks |date=24 July 2018 |url=http://blog.darlinghq.org/2018/07/mach-o-linking-and-loading-tricks.html |access-date=12 January 2020}}
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.{{update inline|reason=not anymore https://blog.darlinghq.org/2023/08/21/progress-report-q2-2023/#goodbye-lkm|date=September 2023}} 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.{{cite web |title=Build Instructions |url=https://www.darlinghq.org/build-instructions/ |website=Darling |quote=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(). |access-date=2020-01-12 |archive-date=2020-01-21 |archive-url=https://web.archive.org/web/20200121072606/http://www.darlinghq.org/build-instructions/ |url-status=dead }} Some licensing issues exist {{citation needed|date=December 2023}} in the darling-mach module, as the team are adding GNU GPL modifications to the APSL kernel.{{cite web |title=Issue: Code from Apple under the APSL is incompatible with the GPL |url=https://github.com/darlinghq/darling/issues/542 |website=GitHub |access-date=12 January 2020}}{{Failed verification|date=December 2023}}
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. To fill in the gaps for many higher-level frameworks like Cocoa, Darling uses code from Cocotron, ApportableFoundation, and GNUstep.
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.{{Cite web|url=https://github.com/darlinghq/darling/blob/master/LICENSE|title = Darling| website=GitHub |date = 16 October 2021}}
External links
- https://www.darlinghq.org/
- https://github.com/darlinghq/darling