From 13a1d1919e72b739d848fdbfcb058922e1c7f686 Mon Sep 17 00:00:00 2001 From: Weijia Wang <9713184+wegank@users.noreply.github.com> Date: Tue, 12 Dec 2023 20:21:55 +0100 Subject: [PATCH] texmacs: build as bundle on darwin --- pkgs/applications/editors/texmacs/default.nix | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/pkgs/applications/editors/texmacs/default.nix b/pkgs/applications/editors/texmacs/default.nix index 5d6c3687a0be..cf19ea5a8cca 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 '';