@@ -1,5 +1,5 @@
1−{ stdenv, callPackage,
2− fetchurl, guile_1_8, qt4, xmodmap, which, makeWrapper, freetype,
1+{ lib, mkDerivation, callPackage, fetchurl, fetchpatch,
2+ guile_1_8, qtbase, xmodmap, which, freetype,
33 libjpeg,
44 sqlite,
55 tex ? null,
@@ -16,23 +16,30 @@
1616
1717let
1818 pname = "TeXmacs";
19− version = "1.99.11";
19+ version = "1.99.13";
2020 common = callPackage ./common.nix {
2121 inherit tex extraFonts chineseFonts japaneseFonts koreanFonts;
2222 };
2323in
24−stdenv.mkDerivation {
24+mkDerivation {
2525 name = "${pname}-${version}";
2626
2727 src = fetchurl {
2828 url = "https://www.texmacs.org/Download/ftp/tmftp/source/TeXmacs-${version}-src.tar.gz";
29− sha256 = "12bp0f34izzqimz49lfpgf4lyz3h45s9xbmk8v6zsawdjki76alg";
29+ sha256 = "Aq0cS47QqmFQHelxRjANeJlgXCXagnYRykpAq7wHqbQ=";
3030 };
3131
32− cmakeFlags = [
33− # Texmacs' cmake build as of writing defaults to Qt5,
34− # but we haven't updated to that yet.
35− "-DTEXMACS_GUI=Qt4"
32+ patches = [
33+ # Minor patch for Qt 5.15 support, should be included in next release.
34+ (fetchpatch {
35+ url = "https://github.com/texmacs/texmacs/commit/3cf56af92326b74538f5e943928199ba6e963d0b.patch";
36+ sha256 = "+OBQmnKgvQZZkLx6ea773Dwq0o7L92Sex/kcVUhmg6Q=";
37+ })
38+ # Fix returned version, lets hope they remember to bump the version next release.
39+ (fetchpatch {
40+ url = "https://github.com/texmacs/texmacs/commit/da5b67005d2fc31bb32ea1ead882c26af12d8cbb.patch";
41+ sha256 = "czMgdraQErrdvN83jY76P673L52BpQkDwntmKvF0Ykg=";
42+ })
3643 ];
3744
3845 enableParallelBuilding = true;
@@ -40,8 +47,7 @@ stdenv.mkDerivation {
4047 nativeBuildInputs = [ cmake pkgconfig ];
4148 buildInputs = [
4249 guile_1_8
43− qt4
44− makeWrapper
50+ qtbase
4551 ghostscriptX
4652 freetype
4753 libjpeg
@@ -51,18 +57,26 @@ stdenv.mkDerivation {
5157 ];
5258 NIX_LDFLAGS = "-lz";
5359
54− postInstall = "wrapProgram $out/bin/texmacs --suffix PATH : " +
55− (if ghostscriptX == null then "" else "${ghostscriptX}/bin:") +
56− (if aspell == null then "" else "${aspell}/bin:") +
57− (if tex == null then "" else "${tex}/bin:") +
58− (if git == null then "" else "${git}/bin:") +
59− (if python3 == null then "" else "${python3}/bin:") +
60− "${xmodmap}/bin:${which}/bin";
60+ qtWrapperArgs = [
61+ "--suffix" "PATH" ":" (lib.makeBinPath [
62+ xmodmap
63+ which
64+ ghostscriptX
65+ aspell
66+ tex
67+ git
68+ python3
69+ ])
70+ ];
71+
72+ postFixup = ''
73+ wrapQtApp $out/bin/texmacs
74+ '';
6175
6276 inherit (common) postPatch;
6377
6478 meta = common.meta // {
65− maintainers = [ stdenv.lib.maintainers.roconnor ];
66− platforms = stdenv.lib.platforms.gnu ++ stdenv.lib.platforms.linux; # arbitrary choice
79+ maintainers = [ lib.maintainers.roconnor ];
80+ platforms = lib.platforms.gnu ++ lib.platforms.linux; # arbitrary choice
6781 };
6882}