summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 149d47bc19f961684cb0e87d622fe0a384f0449c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
# Maintainer: Hammer <topo20@protonmail.com>

pkgname=texmacs-guile3-git
_pkgname=texmacs
pkgver=2.1.4_r13451.4c6097b19
pkgrel=1
pkgdesc="Free scientific text editor, inspired by TeX and GNU Emacs. WYSIWYG
editor and CAS-interface. Pulled from github.com/hammerfunctor/texmacs"
arch=('x86_64')
url="http://www.texmacs.org/"
license=('GPL3')
depends=('perl' 'guile' 'texlive-basic' 'python' 'libxext' 'freetype2'
	 'qt5-svg' 'hicolor-icon-theme' 'gawk' 'python-lxml')
optdepends=('transfig: convert images using fig2ps'
            'ghostscript: rendering ps files'
            'imagemagick: convert images'
            'aspell: spell checking'
            'inkscape: svg convertion')
makedepends=('ghostscript' 'cmake' 'git' 'gcc')
source=("${_pkgname}::git+https://github.com/hammerfunctor/texmacs")
sha256sums=('SKIP')
options=('!emptydirs' '!strip')
provides=('texmacs')
conflicts=('texmacs')
LANG=C

pkgver() {
  cd "${srcdir}/${_pkgname}"
  printf "%s.%s.%s_r%s.%s" \
         $(awk -F '\"' '/set \(VERSION_MAJOR / {print $2}' CMakeLists.txt) \
         $(awk -F '\"' '/set \(VERSION_MINOR / {print $2}' CMakeLists.txt) \
         $(awk -F '\"' '/set \(VERSION_BUILD / {print $2}' CMakeLists.txt) \
         $(git rev-list --count HEAD) \
         $(git rev-parse --short HEAD)
}

prepare() {
  cd "${srcdir}/${_pkgname}"
  #sed -e 's/-Wno-deprecated-register//' -i src/CMakeLists.txt # Remove wrong flag on Linux

  # replace function (... start end . delta) by (range-list*-1 start end . delta) to supress warning
  for f in $(grep -l "(\\.\\.\\." $(find . -iname "*.scm")); do
    sed -i -e "s/(\\.\\.\\./(range-list*-1/" $f
  done
}

build() {
  cd "${srcdir}/${_pkgname}"

  #export CC=/usr/bin/clang
  #export CXX=/usr/bin/clang++
  cmake -Bbuild \
        -DCMAKE_BUILD_TYPE=Release \
        -DCMAKE_INSTALL_PREFIX=/usr \
        -DBUILD_PRIO_GUILE3=YES
  cd build && make -j8
}

package() {
  cd "${srcdir}/${_pkgname}/build"
  make DESTDIR="$pkgdir" install

  # fix fig2ps script
  #sed -i 's|${prefix}|/usr|' "$pkgdir"/usr/bin/fig2ps
  # fix FS#37518
  #sed -i '/^Path=/d' "$pkgdir"/usr/share/applications/texmacs.desktop
}

# vim:set ts=2 sw=2 et: