summary refs log tree commit diff
diff options
context:
space:
mode:
authorWeijia Wang <9713184+wegank@users.noreply.github.com>2023-11-17 21:46:39 +0100
committerGitHub <noreply@github.com>2023-11-17 21:46:39 +0100
commit82ab4ebbd9266ba21e729458169b00d9985b7fde (patch)
tree441ccd97d33ba6da4f77c9a53dbea30af1ac6bba
parentfb92c52539c78d6fff0ae8e6a2e9bf8b22704453 (diff)
parent0de1f14ac047352c7c051c8261458318c9da805d (diff)
downloadnixpkgs-82ab4ebbd9266ba21e729458169b00d9985b7fde.tar
nixpkgs-82ab4ebbd9266ba21e729458169b00d9985b7fde.tar.gz
nixpkgs-82ab4ebbd9266ba21e729458169b00d9985b7fde.tar.bz2
nixpkgs-82ab4ebbd9266ba21e729458169b00d9985b7fde.tar.lz
nixpkgs-82ab4ebbd9266ba21e729458169b00d9985b7fde.tar.xz
nixpkgs-82ab4ebbd9266ba21e729458169b00d9985b7fde.tar.zst
nixpkgs-82ab4ebbd9266ba21e729458169b00d9985b7fde.zip
Merge pull request #267909 from michaelhthomas/firebird-emu/darwin
firebird-emu: support darwin
-rw-r--r--pkgs/applications/emulators/firebird-emu/default.nix28
1 files changed, 21 insertions, 7 deletions
diff --git a/pkgs/applications/emulators/firebird-emu/default.nix b/pkgs/applications/emulators/firebird-emu/default.nix
index d117a93fba4..9fd99014616 100644
--- a/pkgs/applications/emulators/firebird-emu/default.nix
+++ b/pkgs/applications/emulators/firebird-emu/default.nix
@@ -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";
 
@@ -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;
   };
 }