about summary refs log tree commit diff
path: root/pkgs/applications/editors
diff options
context:
space:
mode:
authorWeijia Wang <9713184+wegank@users.noreply.github.com>2023-12-12 20:21:55 +0100
committerWeijia Wang <9713184+wegank@users.noreply.github.com>2023-12-12 20:21:55 +0100
commit13a1d1919e72b739d848fdbfcb058922e1c7f686 (patch)
tree8f1fe301c2d5253f6fc3958548e52da5429a1a6c /pkgs/applications/editors
parent9c264295e1e5d1f10804c0e762b1fca1bf33264b (diff)
texmacs: build as bundle on darwin
Diffstat (limited to 'pkgs/applications/editors')
-rw-r--r--pkgs/applications/editors/texmacs/default.nix14
1 files changed, 12 insertions, 2 deletions
diff --git a/pkgs/applications/editors/texmacs/default.nix b/pkgs/applications/editors/texmacs/default.nix
index 5d6c3687a0be1..cf19ea5a8cca1 100644
--- a/pkgs/applications/editors/texmacs/default.nix
+++ b/pkgs/applications/editors/texmacs/default.nix
@@ -45,7 +45,6 @@ stdenv.mkDerivation {
     pkg-config
     wrapQtAppsHook
     xdg-utils
-  ] ++ lib.optionals (!stdenv.isDarwin) [
     cmake
   ];
 
@@ -63,8 +62,19 @@ stdenv.mkDerivation {
     qtmacextras
   ];
 
+  cmakeFlags = lib.optionals stdenv.isDarwin [
+    (lib.cmakeFeature "TEXMACS_GUI" "Qt")
+    (lib.cmakeFeature "CMAKE_INSTALL_PREFIX" "./TeXmacs.app/Contents/Resources")
+  ];
+
   env.NIX_LDFLAGS = "-lz";
 
+  postInstall = lib.optionalString stdenv.isDarwin ''
+    mkdir -p $out/{Applications,bin}
+    mv TeXmacs.app $out/Applications/
+    makeWrapper $out/Applications/TeXmacs.app/Contents/MacOS/TeXmacs $out/bin/texmacs
+  '';
+
   qtWrapperArgs = [
     "--suffix" "PATH" ":" (lib.makeBinPath [
       xmodmap
@@ -77,7 +87,7 @@ stdenv.mkDerivation {
     ])
   ];
 
-  postFixup = ''
+  postFixup = lib.optionalString (!stdenv.isDarwin) ''
     wrapQtApp $out/bin/texmacs
   '';