desktoToDarwinBundle

This hook takes freedesktop {file}*.desktop files, and converts them to equivalent Darwin {file}*.app bundles.

This hook runs in the {command}fixup phase of the stdenv build process.

There are no variables to control or disable this hook.

Examples

Example

Using desktopToDarwinBundle

{
  stdenv,
  emptyDirectory,
  copyDesktopItems,
  desktopToDarwinBundle,
  sqlite,
}:
stdenv.mkDerivation (finalAttrs: {
  pname = "some-cross-platform-project";
  version = "1.0";

  src = emptyDirectory;

  nativeBuildInputs = [
    # Registers hook for copying freedesktop icons
    copyDesktopItems
    # Register this hook converting freedesktop files to Darwin bundles
    desktopToDarwinBundle
  ];

  buildInputs = [
    sqlite
  ];

  buildFlags = [
    "production"
  ];

  desktopItems = [
    # Copy the included desktop file from the source
    "assets/crossPlat.desktop"
  ];

  postInstall = ''
    install -Dm444 assets/crossPlat.svg "$out/share/icons/hicolor/scalable/apps/crossPlat.svg"
  '';

  meta = {
    mainProgram = "crossPlat";
    description = "runs on Darwin and Linux";
  };
})