summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 64346a10269d43e2d5d7fe39743640a8f53aea3f (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
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
# Maintainer: Alexander Rødseth <rodseth@gmail.com>

pkgname=qemacs
pkgver=0.3.3
pkgrel=2
pkgdesc='Quick version of Emacs'
license=('LGPL2.1')
arch=('x86_64' 'i686')
url='http://bellard.org/qemacs/'
depends=('libxv')
conflicts=('qemacs-cvs')
provides=('qemacs')
makedepends=('texi2html' 'setconf')
install="$pkgname.install"
source=("http://bellard.org/$pkgname/$pkgname-$pkgver.tar.gz")
sha256sums=('2ffba66a44783849282199acfcc08707debc7169394a8fd0902626222f27df94')

prepare() {
  cd "$pkgname-$pkgver"

  # Patch a few compilation errors
  sed -i 's:static QEDisplay:QEDisplay:' tty.c
  sed -i 's:static QECharset:QECharset:' charset.c
  sed -i 's/ found:/ found: return q - buf_out;/g' unicode_join.c
  sed -i 's:static QEDisplay:QEDisplay:' x11.c

  # Stop doing ELF-acrobatics
  sed -i 's:GNUC:NOP:' qe.c

  # Configure
  ./configure --prefix=$pkgdir/usr --disable-png

  # Remove the blank line
  sed -i '/^$/d' config.mak
  # Remove the line with only "
  sed -i '/^"$/d' config.h
  # Add a " after 0.3.1
  sed -i 's:\.1:\.1":' config.h
  # Set the configuration path
  sed -i "/CONFIG_QE/d" config.h
  echo '#define CONFIG_QE_PREFIX "/usr"' >> config.h

  # Disable -Wall and -Werror (won't compile with gcc otherwise)
  setconf Makefile CFLAGS "-fno-strict-aliasing -g $CFLAGS"
}

build() {
  cd "$pkgname-$pkgver"

  # Compile
  make -C libqhtml
  make
}

package() {
  cd "$pkgname-$pkgver"

  # Binaries
  mkdir -p "$pkgdir/usr/bin"
  mkdir -p "$pkgdir/usr/share/qe"
  mkdir -p "$pkgdir/usr/man/man1"
  make --silent install

  # Manual
  mkdir -p "$pkgdir/usr/share/man"
  mv "$pkgdir/usr/man/man1" "$pkgdir/usr/share/man/man1"
  rmdir "$pkgdir/usr/man"
  ln -s "/usr/share/man/man1/qe.1.gz" "$pkgdir/usr/share/man/man1/qemacs.1.gz"

  # Configuration
  install -Dm644 config.eg "$pkgdir/usr/share/qe/config.eg"

  # Documentation
  mkdir -p "$pkgdir/usr/share/doc/$pkgname"
  install -Dm644 qe-doc.html "$pkgdir/usr/share/doc/$pkgname/qemacs.html"
  install -Dm644 config.eg "$pkgdir/usr/share/doc/$pkgname/sample-config"
  # util.c is mentioned in config.qe
  install -Dm644 util.c "$pkgdir/usr/share/doc/$pkgname/util.c"

  # License
  install -Dm644 COPYING "$pkgdir/usr/share/licenses/$pkgname/COPYING"
}

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