desktop/texmacs/PKGBUILD
2018-12-30 18:19:42 +01:00

81 lines
2.5 KiB
Bash

pkgname=texmacs
pkgver=1.99.8
pkgrel=1
pkgdesc="WYSIWYG Qt4 editor and graphical frontend to various CASes"
arch=('x86_64')
url='http://texmacs.org/'
screenshot="http://www.texmacs.org/tmweb/images/texmacs-1.png"
license=('GPL3')
depends=('qt' 'texlive-core' 'guile1.8' 'cairo' 'freetype2' 'imlib2'
'perl' 'python2' 'libxext' 'sqlite3'
'desktop-file-utils' 'shared-mime-info')
makedepends=('ghostscript')
optdepends=('gawk: conversion of some files'
'transfig: convert images using fig2ps')
provides=('texmacs')
conflicts=('texmacs-qt')
install=${pkgname}.install
options=('!emptydirs')
source=("http://www.texmacs.org/Download/ftp/tmftp/source/TeXmacs-$pkgver-src.tar.gz")
sha512sums=('4d2702e22d1a48f07c8a01fb60bd88a0f40fb4bf8cd931e8e8fc2936495fa4e9ed59680313a28ca4d1e2b383829dd428b917ce4ca4d17a0b18e3b1c236796c4e')
prepare() {
cd "${srcdir}/TeXmacs-${pkgver}-src"
sed -i 's/env python/env python2/' \
plugins/{mathematica/bin/realpath.py,python/bin/tm_python,sage/bin/tm_sage} \
TeXmacs/misc/inkscape_extension/texmacs_reedit.py
sed -i 's/"python"/"python2"/' plugins/python/progs/init-python.scm
sed -i '/^LDPATH/d' src/makefile.in
autoreconf -vi
sed -i -e 's/guile18-config/guile-config1.8/g' configure
sed -i -e 's/guile18/guile1.8/g' configure
sed -i -e 's|#include <libguile18.h>|#include <guile/gh.h>|g' src/Scheme/Guile/guile_tm.hpp
# Don't generate icon-cache and mime-database (namcap tells that they should not be in a package)
sed -i '/update-mime-database/d' Makefile.in
sed -i '/gtk-update-icon-cache/d' Makefile.in
sed -i '\/icons\/gnome 2>\/dev\/null/d' Makefile.in
find -name '.*.d' -o -name '.*.cpp' -exec rm {} \;
}
build() {
cd "${srcdir}/TeXmacs-${pkgver}-src"
export QMAKE=qmake
export MOC=moc
export UIC=uic
export LDFLAGS=-lz
./configure \
--prefix=/usr \
--enable-pdf-renderer \
--enable-optimize \
--with-imlib2 \
--enable-guile2=no \
--with-qt
make
# --with-freetype
# --with-sqlite3=yes
}
package() {
cd "${srcdir}/TeXmacs-${pkgver}-src"
make DESTDIR=${pkgdir} install
cp ${pkgdir}/usr/share/icons/gnome/scalable/apps/TeXmacs.svg \
${pkgdir}/usr/share/pixmaps/texmacs.svg
rm ${pkgdir}/usr/share/pixmaps/TeXmacs.xpm
sed -i s!Icon=TeXmacs!Icon=texmacs! \
${pkgdir}/usr/share/applications/texmacs.desktop
# fix fig2ps script
sed -i 's|${prefix}|/usr|' "${pkgdir}/usr/bin/fig2ps"
msg "set environment variables"
sed -i s!"@CONFIG_LIB_PATH@"!"LD_LIBRARY_PATH"!g $pkgdir/usr/bin/$pkgname
}