texmacs: build as bundle on darwin

This commit is contained in:
Weijia Wang 2023-12-12 20:21:55 +01:00
parent 9c264295e1
commit 13a1d1919e

View file

@ -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
'';