Skip to content

Commit

Permalink
firebird-emu: support darwin
Browse files Browse the repository at this point in the history
firebird-emu supports darwin, but the derivation has not been tested on macOS.

This commit adds darwin support to the derivation, with the necessary tweaks to support building for a darwin target.
Namely, adds a workaround for NixOS#19098, and adds a missing dependency, qtquickcontrols.

Also, adds a postInstall hook which moves the MacOS .app file to the Applications/ folder in the
store, enabling proper linking to /Applications or ~/Applications and appearance in Spotlight
and Launchpad.
  • Loading branch information
michaelhthomas authored and wegank committed Nov 17, 2023
1 parent e4df5bf commit 0de1f14
Showing 1 changed file with 21 additions and 7 deletions.
28 changes: 21 additions & 7 deletions pkgs/applications/emulators/firebird-emu/default.nix
Original file line number Diff line number Diff line change
@@ -1,6 +1,13 @@
{ mkDerivation, lib, fetchFromGitHub, qmake, qtbase, qtdeclarative }:

mkDerivation rec {
{ stdenv
, lib
, fetchFromGitHub
, qmake
, qtbase
, qtdeclarative
, qtquickcontrols
, wrapQtAppsHook
}:
stdenv.mkDerivation rec {
pname = "firebird-emu";
version = "1.6";

Expand All @@ -12,16 +19,23 @@ mkDerivation rec {
hash = "sha256-ZptjlnOiF+hKuKYvBFJL95H5YQuR99d4biOco/MVEmE=";
};

nativeBuildInputs = [ qmake ];
# work around https://github.com/NixOS/nixpkgs/issues/19098
env.NIX_CFLAGS_COMPILE = lib.optionalString (stdenv.cc.isClang && stdenv.isDarwin) "-fno-lto";

nativeBuildInputs = [ wrapQtAppsHook qmake ];

buildInputs = [ qtbase qtdeclarative qtquickcontrols ];

buildInputs = [ qtbase qtdeclarative ];
postInstall = lib.optionalString stdenv.hostPlatform.isDarwin ''
mkdir $out/Applications
mv $out/bin/${pname}.app $out/Applications/
'';

meta = {
homepage = "https://github.com/nspire-emus/firebird";
description = "Third-party multi-platform emulator of the ARM-based TI-Nspire™ calculators";
license = lib.licenses.gpl3;
maintainers = with lib.maintainers; [ pneumaticat ];
# Only tested on Linux, but likely possible to build on, e.g. macOS
platforms = lib.platforms.linux;
platforms = lib.platforms.unix;
};
}

0 comments on commit 0de1f14

Please sign in to comment.