2023-11-16 04:20:00 +00:00
|
|
|
{ lib, stdenv, callPackage, fetchurl,
|
|
|
|
guile_1_8, xmodmap, which, freetype,
|
2020-04-24 23:36:52 +00:00
|
|
|
libjpeg,
|
|
|
|
sqlite,
|
2023-11-16 04:20:00 +00:00
|
|
|
texliveSmall ? null,
|
2020-04-24 23:36:52 +00:00
|
|
|
aspell ? null,
|
|
|
|
git ? null,
|
|
|
|
python3 ? null,
|
|
|
|
cmake,
|
2021-02-05 17:12:51 +00:00
|
|
|
pkg-config,
|
2023-11-16 04:20:00 +00:00
|
|
|
wrapQtAppsHook,
|
|
|
|
xdg-utils,
|
|
|
|
qtbase,
|
|
|
|
qtsvg,
|
|
|
|
qtmacextras,
|
2020-04-24 23:36:52 +00:00
|
|
|
ghostscriptX ? null,
|
|
|
|
extraFonts ? false,
|
|
|
|
chineseFonts ? false,
|
|
|
|
japaneseFonts ? false,
|
|
|
|
koreanFonts ? false }:
|
|
|
|
|
|
|
|
let
|
2023-11-16 04:20:00 +00:00
|
|
|
pname = "texmacs";
|
|
|
|
version = "2.1.2";
|
2020-04-24 23:36:52 +00:00
|
|
|
common = callPackage ./common.nix {
|
2023-11-16 04:20:00 +00:00
|
|
|
inherit extraFonts chineseFonts japaneseFonts koreanFonts;
|
|
|
|
tex = texliveSmall;
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
in
|
2023-11-16 04:20:00 +00:00
|
|
|
stdenv.mkDerivation {
|
2021-02-05 17:12:51 +00:00
|
|
|
inherit pname version;
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2021-02-05 17:12:51 +00:00
|
|
|
src = fetchurl {
|
|
|
|
url = "https://www.texmacs.org/Download/ftp/tmftp/source/TeXmacs-${version}-src.tar.gz";
|
2023-11-16 04:20:00 +00:00
|
|
|
hash = "sha256-Ds9gxOwMYSttEWrawgxLHGxHyMBvt8WmyPIwBP2g/CM=";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
2023-11-16 04:20:00 +00:00
|
|
|
postPatch = common.postPatch + ''
|
|
|
|
substituteInPlace configure \
|
|
|
|
--replace "-mfpmath=sse -msse2" ""
|
|
|
|
'';
|
|
|
|
|
|
|
|
nativeBuildInputs = [
|
|
|
|
guile_1_8
|
|
|
|
pkg-config
|
|
|
|
wrapQtAppsHook
|
|
|
|
xdg-utils
|
|
|
|
cmake
|
|
|
|
];
|
|
|
|
|
2020-04-24 23:36:52 +00:00
|
|
|
buildInputs = [
|
|
|
|
guile_1_8
|
2020-10-20 17:27:49 +00:00
|
|
|
qtbase
|
2023-11-16 04:20:00 +00:00
|
|
|
qtsvg
|
2020-04-24 23:36:52 +00:00
|
|
|
ghostscriptX
|
|
|
|
freetype
|
|
|
|
libjpeg
|
|
|
|
sqlite
|
|
|
|
git
|
|
|
|
python3
|
2023-11-16 04:20:00 +00:00
|
|
|
] ++ lib.optionals stdenv.isDarwin [
|
|
|
|
qtmacextras
|
2020-04-24 23:36:52 +00:00
|
|
|
];
|
2023-11-16 04:20:00 +00:00
|
|
|
|
2024-01-02 11:29:13 +00:00
|
|
|
cmakeFlags = lib.optionals stdenv.isDarwin [
|
|
|
|
(lib.cmakeFeature "TEXMACS_GUI" "Qt")
|
|
|
|
(lib.cmakeFeature "CMAKE_INSTALL_PREFIX" "./TeXmacs.app/Contents/Resources")
|
|
|
|
];
|
|
|
|
|
2023-11-16 04:20:00 +00:00
|
|
|
env.NIX_LDFLAGS = "-lz";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2024-01-02 11:29:13 +00:00
|
|
|
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
|
|
|
|
'';
|
|
|
|
|
2020-10-20 17:27:49 +00:00
|
|
|
qtWrapperArgs = [
|
|
|
|
"--suffix" "PATH" ":" (lib.makeBinPath [
|
|
|
|
xmodmap
|
|
|
|
which
|
|
|
|
ghostscriptX
|
|
|
|
aspell
|
2023-11-16 04:20:00 +00:00
|
|
|
texliveSmall
|
2020-10-20 17:27:49 +00:00
|
|
|
git
|
|
|
|
python3
|
|
|
|
])
|
|
|
|
];
|
|
|
|
|
2024-01-02 11:29:13 +00:00
|
|
|
postFixup = lib.optionalString (!stdenv.isDarwin) ''
|
2020-10-20 17:27:49 +00:00
|
|
|
wrapQtApp $out/bin/texmacs
|
|
|
|
'';
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
meta = common.meta // {
|
2020-10-20 17:27:49 +00:00
|
|
|
maintainers = [ lib.maintainers.roconnor ];
|
2023-11-16 04:20:00 +00:00
|
|
|
platforms = lib.platforms.all;
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
}
|