about summary refs log tree commit diff
path: root/nixpkgs/pkgs/applications/editors/texmacs/default.nix
diff options
context:
space:
mode:
Diffstat (limited to 'nixpkgs/pkgs/applications/editors/texmacs/default.nix')
-rw-r--r--nixpkgs/pkgs/applications/editors/texmacs/default.nix14
1 files changed, 12 insertions, 2 deletions
diff --git a/nixpkgs/pkgs/applications/editors/texmacs/default.nix b/nixpkgs/pkgs/applications/editors/texmacs/default.nix
index 5d6c3687a0be..cf19ea5a8cca 100644
--- a/nixpkgs/pkgs/applications/editors/texmacs/default.nix
+++ b/nixpkgs/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
   '';