Add texmacsDarwin

This commit is contained in:
Jake Waksbaum 2017-11-20 17:29:37 -05:00
parent 1d6f3ea265
commit 41991e09ad
5 changed files with 182 additions and 75 deletions

View file

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

View file

@ -0,0 +1,59 @@
{ stdenv, callPackage, fetchurl, makeWrapper,
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;
};
}

View file

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

View file

@ -1,41 +1,21 @@
{stdenv, fetchurl, guile_1_8, qt4, zlib, xmodmap, which, makeWrapper, freetype,
tex ? null,
aspell ? null,
ghostscriptX ? null,
extraFonts ? false,
chineseFonts ? false,
japaneseFonts ? false,
koreanFonts ? false }:
{ stdenv, callPackage,
fetchurl, guile_1_8, qt4, zlib, xmodmap, which, makeWrapper, freetype,
tex ? null,
aspell ? null,
ghostscriptX ? null,
extraFonts ? false,
chineseFonts ? false,
japaneseFonts ? false,
koreanFonts ? false }:
let
let
pname = "TeXmacs";
version = "1.99.2";
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";
common = callPackage ./common.nix {
inherit tex extraFonts chineseFonts japaneseFonts koreanFonts;
};
in
stdenv.mkDerivation rec {
stdenv.mkDerivation {
name = "${pname}-${version}";
src = fetchurl {
@ -45,56 +25,21 @@ stdenv.mkDerivation rec {
buildInputs = [ guile_1_8 qt4 makeWrapper ghostscriptX freetype ];
patchPhase = (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 "");
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;
postFixup = ''
bin="$out/libexec/TeXmacs/bin/texmacs.bin"
rpath=$(patchelf --print-rpath "$bin")
patchelf --set-rpath "$rpath:${zlib.out}/lib" "$bin"
'';
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;
meta = common.meta // {
maintainers = [ stdenv.lib.maintainers.roconnor ];
platforms = stdenv.lib.platforms.gnu; # arbitrary choice
};

View file

@ -4656,10 +4656,16 @@ with pkgs;
telepresence = callPackage ../tools/networking/telepresence { };
texmacs = callPackage ../applications/editors/texmacs {
tex = texlive.combined.scheme-small;
extraFonts = true;
};
texmacs = if stdenv.isDarwin
then callPackage ../applications/editors/texmacs/darwin.nix {
inherit (darwin.apple_sdk.frameworks) CoreFoundation Cocoa;
tex = texlive.combined.scheme-small;
extraFonts = true;
} else callPackage ../applications/editors/texmacs/default.nix {
tex = texlive.combined.scheme-small;
extraFonts = true;
};
texmaker = callPackage ../applications/editors/texmaker { };