about summary refs log tree commit diff
path: root/nixpkgs/pkgs/applications/editors/texmacs
diff options
context:
space:
mode:
Diffstat (limited to 'nixpkgs/pkgs/applications/editors/texmacs')
-rw-r--r--nixpkgs/pkgs/applications/editors/texmacs/common.nix68
-rw-r--r--nixpkgs/pkgs/applications/editors/texmacs/darwin.nix59
-rw-r--r--nixpkgs/pkgs/applications/editors/texmacs/darwin.patch29
-rw-r--r--nixpkgs/pkgs/applications/editors/texmacs/default.nix41
4 files changed, 197 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..ec2498aa69b9
--- /dev/null
+++ b/nixpkgs/pkgs/applications/editors/texmacs/common.nix
@@ -0,0 +1,68 @@
+{ stdenv, 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 = stdenv.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..dfb2e49e0c8d
--- /dev/null
+++ b/nixpkgs/pkgs/applications/editors/texmacs/darwin.nix
@@ -0,0 +1,59 @@
+{ 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 {
+  name = "TeXmacs-${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 "${netpbm}/bin:") +
+    (if imagemagick == null then "" else "${imagemagick}/bin:");
+
+  enableParallelBuilding = true;
+
+  meta = common.meta // {
+    platforms = stdenv.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..2c391cae517b
--- /dev/null
+++ b/nixpkgs/pkgs/applications/editors/texmacs/default.nix
@@ -0,0 +1,41 @@
+{ stdenv, callPackage,
+  fetchurl, guile_1_8, qt4, xmodmap, which, makeWrapper, freetype,
+  tex ? null,
+  aspell ? null,
+  ghostscriptX ? null,
+  extraFonts ? false,
+  chineseFonts ? false,
+  japaneseFonts ? false,
+  koreanFonts ? false }:
+
+let
+  pname = "TeXmacs";
+  version = "1.99.2";
+  common = callPackage ./common.nix {
+    inherit tex extraFonts chineseFonts japaneseFonts koreanFonts;
+  };
+in
+stdenv.mkDerivation {
+  name = "${pname}-${version}";
+
+  src = fetchurl {
+    url = "http://www.texmacs.org/Download/ftp/tmftp/source/TeXmacs-${version}-src.tar.gz";
+    sha256 = "0l48g9746igiaxw657shm8g3xxk565vzsviajlrxqyljbh6py0fs";
+  };
+
+  buildInputs = [ guile_1_8 qt4 makeWrapper ghostscriptX freetype ];
+  NIX_LDFLAGS = [ "-lz" ];
+
+  postInstall = "wrapProgram $out/bin/texmacs --suffix PATH : " +
+        (if ghostscriptX == null then "" else "${ghostscriptX}/bin:") +
+        (if aspell == null then "" else "${aspell}/bin:") +
+        (if tex == null then "" else "${tex}/bin:") +
+        "${xmodmap}/bin:${which}/bin";
+
+  inherit (common) postPatch;
+
+  meta = common.meta // {
+    maintainers = [ stdenv.lib.maintainers.roconnor ];
+    platforms = stdenv.lib.platforms.gnu ++ stdenv.lib.platforms.linux;  # arbitrary choice
+  };
+}