diff options
Diffstat (limited to 'nixpkgs/pkgs/applications/editors/texmacs')
4 files changed, 224 insertions, 0 deletions
diff --git a/nixpkgs/pkgs/applications/editors/texmacs/common.nix b/nixpkgs/pkgs/applications/editors/texmacs/common.nix new file mode 100644 index 000000000000..e52d95f837df --- /dev/null +++ b/nixpkgs/pkgs/applications/editors/texmacs/common.nix @@ -0,0 +1,68 @@ +{ lib, fetchurl, tex, extraFonts, chineseFonts, japaneseFonts, koreanFonts }: +rec { + extraFontsSrc = fetchurl { + url = "ftp://ftp.texmacs.org/pub/TeXmacs/fonts/TeXmacs-extra-fonts-1.0-noarch.tar.gz"; + sha256 = "0hylgjmd95y9yahbblmawkkw0i71vb145xxv2xqrmff81301n6k7"; + }; + + fullFontsSrc = fetchurl { + url = "ftp://ftp.texmacs.org/pub/TeXmacs/fonts/TeXmacs-windows-fonts-1.0-noarch.tar.gz"; + sha256 = "1yxzjpqpm7kvx0ly5jmfpzlfhsh41b0ibn1v84qv6xy73r2vis2f"; + }; + + chineseFontsSrc = fetchurl { + url = "ftp://ftp.texmacs.org/pub/TeXmacs/fonts/TeXmacs-chinese-fonts.tar.gz"; + sha256 = "0yprqjsx5mfsaxr525mcm3xqwcadzxp14njm38ir1325baada2fp"; + }; + + japaneseFontsSrc = fetchurl { + url = "ftp://ftp.texmacs.org/pub/TeXmacs/fonts/TeXmacs-japanese-fonts.tar.gz"; + sha256 = "1dn6zvsa7gk59d61xicwpbapab3rm6kz48rp5w1bhmihxixw21jn"; + }; + + koreanFontsSrc = fetchurl { + url = "ftp://ftp.texmacs.org/pub/TeXmacs/fonts/TeXmacs-korean-fonts.tar.gz"; + sha256 = "07axg57mqm3jbnm4lawx0h3r2h56xv9acwzjppryfklw4c27f5hh"; + }; + + postPatch = (if tex == null then '' + gunzip < ${fullFontsSrc} | (cd TeXmacs && tar xvf -) + '' else if extraFonts then '' + gunzip < ${extraFontsSrc} | (cd TeXmacs && tar xvf -) + '' else "") + + (if chineseFonts then '' + gunzip < ${chineseFontsSrc} | (cd TeXmacs && tar xvf -) + '' else "") + + (if japaneseFonts then '' + gunzip < ${japaneseFontsSrc} | (cd TeXmacs && tar xvf -) + '' else "") + + (if koreanFonts then '' + gunzip < ${koreanFontsSrc} | (cd TeXmacs && tar xvf -) + '' else ""); + + + meta = { + description = "WYSIWYW editing platform with special features for scientists"; + longDescription = + '' GNU TeXmacs is a free wysiwyw (what you see is what you want) + editing platform with special features for scientists. The software + aims to provide a unified and user friendly framework for editing + structured documents with different types of content (text, + graphics, mathematics, interactive content, etc.). The rendering + engine uses high-quality typesetting algorithms so as to produce + professionally looking documents, which can either be printed out or + presented from a laptop. + + The software includes a text editor with support for mathematical + formulas, a small technical picture editor and a tool for making + presentations from a laptop. Moreover, TeXmacs can be used as an + interface for many external systems for computer algebra, numerical + analysis, statistics, etc. New presentation styles can be written + by the user and new features can be added to the editor using the + Scheme extension language. A native spreadsheet and tools for + collaborative authoring are planned for later. + ''; + homepage = "http://texmacs.org/"; + license = lib.licenses.gpl2Plus; + }; +} diff --git a/nixpkgs/pkgs/applications/editors/texmacs/darwin.nix b/nixpkgs/pkgs/applications/editors/texmacs/darwin.nix new file mode 100644 index 000000000000..ff090dd3259a --- /dev/null +++ b/nixpkgs/pkgs/applications/editors/texmacs/darwin.nix @@ -0,0 +1,60 @@ +{ lib, stdenv, callPackage, fetchurl, + guile_1_8, qt4, zlib, freetype, CoreFoundation, Cocoa, gettext, libiconv, ghostscript, + tex ? null, + aspell ? null, + netpbm ? null, + imagemagick ? null, + extraFonts ? false, + chineseFonts ? false, + japaneseFonts ? false, + koreanFonts ? false }: +let + version = "1.99.4"; + common = callPackage ./common.nix { + inherit tex extraFonts chineseFonts japaneseFonts koreanFonts; + }; +in +stdenv.mkDerivation { + pname = "TeXmacs"; + inherit version; + + src= fetchurl { + url = "http://www.texmacs.org/Download/ftp/tmftp/source/TeXmacs-${version}-src.tar.gz"; + sha256 = "1z8sj0xd1ncbl7ipzfsib6lmc7ahgvmiw61ln5zxm2l88jf7qc1a"; + }; + + patches = [ ./darwin.patch ]; + + buildInputs = [ guile_1_8.dev qt4 freetype CoreFoundation Cocoa gettext libiconv ghostscript ]; + + GUILE_CPPFLAGS="-D_THREAD_SAFE -I${guile_1_8.dev}/include -I${guile_1_8.dev}/include/guile "; + + NIX_LDFLAGS="${zlib}/lib/libz.dylib"; + + buildPhase = '' + substituteInPlace Makefile \ + --replace 'find -d $(MACOS_PACKAGE_TEXMACS)' 'find $(MACOS_PACKAGE_TEXMACS) -depth' \ + --replace '$(MACOS_PACKAGE_SRC)/bundle-libs.sh' 'true' + make MACOS_BUNDLE + ''; + + installPhase = '' + mkdir -p $out/Applications + cp -R ../distr/TeXmacs-${version}.app $out/Applications + ''; + + inherit (common) postPatch; + + postInstall = "wrapProgram $out/Applications/TeXmacs-${version}/Contents/MacOS/TeXmacs --suffix PATH : " + + "${ghostscript}/bin:" + + (if aspell == null then "" else "${aspell}/bin:") + + (if tex == null then "" else "${tex}/bin:") + + (if netpbm == null then "" else "${lib.getBin netpbm}/bin:") + + (if imagemagick == null then "" else "${imagemagick}/bin:"); + + enableParallelBuilding = true; + + meta = common.meta // { + platforms = lib.platforms.darwin; + }; +} diff --git a/nixpkgs/pkgs/applications/editors/texmacs/darwin.patch b/nixpkgs/pkgs/applications/editors/texmacs/darwin.patch new file mode 100644 index 000000000000..2cb33fbbef30 --- /dev/null +++ b/nixpkgs/pkgs/applications/editors/texmacs/darwin.patch @@ -0,0 +1,29 @@ +--- a/configure ++++ b/configure +@@ -7461,7 +7461,7 @@ $as_echo "final adjustments for cygwin host" >&6; } + CONFIG_QTPIPES="yes" + CONFIG_CXXFLAGS="-I${prefix}/include" + CONFIG_BSHARED="" +- CONFIG_BFLAGS="-framework Cocoa -framework IOKit" ++ CONFIG_BFLAGS="-framework Cocoa -framework IOKit -framework CoreFoundation" + CONFIG_BPATH="" + CONFIG_SO="dylib" + CONFIG_LIB_PATH="DYLD_LIBRARY_PATH" +@@ -8281,6 +8281,7 @@ _ASEOF + if $QMAKE ${additional_qmake_flags} ; then :; else + as_fn_error $? "Calling $QMAKE failed." "$LINENO" 5 + fi ++ echo "QMAKE_MACOSX_DEPLOYMENT_TARGET = 10.10" >> $pro_file + # Try to compile a simple Qt app. + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we can build a simple Qt app" >&5 + $as_echo_n "checking whether we can build a simple Qt app... " >&6; } +--- a/src/Plugins/Unix/unix_sys_utils.cpp ++++ b/src/Plugins/Unix/unix_sys_utils.cpp +@@ -17,6 +17,7 @@ + #include <spawn.h> + #include <unistd.h> + #include <sys/wait.h> ++#include <pthread.h> + + // for thread safe strings + #include <string> diff --git a/nixpkgs/pkgs/applications/editors/texmacs/default.nix b/nixpkgs/pkgs/applications/editors/texmacs/default.nix new file mode 100644 index 000000000000..d628eeadab6e --- /dev/null +++ b/nixpkgs/pkgs/applications/editors/texmacs/default.nix @@ -0,0 +1,67 @@ +{ lib, mkDerivation, callPackage, fetchurl, + guile_1_8, qtbase, xmodmap, which, freetype, + libjpeg, + sqlite, + tex ? null, + aspell ? null, + git ? null, + python3 ? null, + cmake, + pkg-config, + ghostscriptX ? null, + extraFonts ? false, + chineseFonts ? false, + japaneseFonts ? false, + koreanFonts ? false }: + +let + pname = "TeXmacs"; + version = "1.99.19"; + common = callPackage ./common.nix { + inherit tex extraFonts chineseFonts japaneseFonts koreanFonts; + }; +in +mkDerivation { + inherit pname version; + + src = fetchurl { + url = "https://www.texmacs.org/Download/ftp/tmftp/source/TeXmacs-${version}-src.tar.gz"; + sha256 = "1izwqb0z4gqiglv57mjswk6sjivny73kd2sxrf3nmj7wr12pn5m8"; + }; + + nativeBuildInputs = [ cmake pkg-config ]; + buildInputs = [ + guile_1_8 + qtbase + ghostscriptX + freetype + libjpeg + sqlite + git + python3 + ]; + NIX_LDFLAGS = "-lz"; + + qtWrapperArgs = [ + "--suffix" "PATH" ":" (lib.makeBinPath [ + xmodmap + which + ghostscriptX + aspell + tex + git + python3 + ]) + ]; + + postFixup = '' + wrapQtApp $out/bin/texmacs + ''; + + inherit (common) postPatch; + + meta = common.meta // { + maintainers = [ lib.maintainers.roconnor ]; + platforms = lib.platforms.gnu ++ lib.platforms.linux; # arbitrary choice + }; +} |