summaryrefslogtreecommitdiff
path: root/libre/abiword/PKGBUILD
blob: d96e2498a4b43b5cc8829d815097b6db822c7ac4 (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
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
# Maintainer (Arch): Jan de Groot <jgc@archlinux.org>
# Contributor (Arch): Giovanni Scafora <giovanni@archlinux.org>
# Contributor (Arch): Maël Lavault <moimael@neuf.fr>
# Contributor (Hyperbola): André Silva <emulatorman@hyperbola.info>
# Maintainer: Andreas Grapentin <andreas@grapentin.org>
# Contributor: Omar Vega Ramos <ovruni@gnu.org.pe>

pkgname=abiword

pkgver=3.0.2
pkgrel=8.parabola1
arch=(i686 x86_64 armv7h)

pkgdesc="Fully-featured word processor, without Google search engine and nonfree fonts support"
url="https://www.abisource.com"
license=(GPL)

depends=(fribidi wv goffice librsvg enchant desktop-file-utils
         redland libical gtk-update-icon-cache loudmouth libwpg libwps libwmf link-grammar
         gtkmathview aiksaurus libxslt libsoup libots libgsf psiconv)
makedepends=(pkgconfig asio boost gobject-introspection libwpd libwps python2-gobject python-gobject)
conflicts=(abiword-plugins abiword-libre)
replaces=(abiword-plugins abiword-libre)
options=(!makeflags)

source=(https://www.abisource.com/downloads/$pkgname/$pkgver/source/$pkgname-$pkgver.tar.gz
        abiword-3.0.0-librevenge.patch
        abiword-3.0.1-libwps-0.4.patch
        aiksaurus-plugin.m4
        command-plugin.m4
        python-override.patch
        bug13815.patch
        enchant-2.1.patch
        libical-deprecated.patch
        liberation-fonts.patch
        fix-flickering.patch)
sha256sums=('afbfd458fd02989d8b0c6362ba8a4c14686d89666f54cfdb5501bd2090cf3522'
            '77b52a3722096cec3bfbe4fff3802f51b6c9e0ff7aaa30028c29825fd4e6a65f'
            'f1375b2ab7af2959717cba0259ba546c8e75ef849e84263bdc253019e849cb2a'
            '5f80a2f94f9929cdba9809c5e1a87cd5d537a2518bb879bfb9eab51a71c8dac1'
            '2f26826e9d59d80dacd0dae4aceb815804eaa75954e47507a0897794f33e45be'
            'dba1e3265cd42589f17b41fea1a39c8aa4b83c7203b9d5944b578d0ff9c858be'
            '05f2544a177d6f58424af9045c26e82aca64938d0daf00f43f6b99a2abf64496'
            '444dc2aadea3c80310a509b690097541573f6d2652c573d04da66a0f385fcfb2'
            'fe6eec4129777117bbfd5fa12d02208e430c8a3b96a54dcf8574ce800f240489'
            '8a0b6e444e937924743f95c747cbe395a30fb8677a010e60c973b9039e258079'
            '4497da364256340ccd9a60c2fc858a6999f1b2ebc2dad5e6d297e7ab9cabccef')

prepare() {
  cd $pkgname-$pkgver

  # fix build with librevenge based import filters
  patch -Np0 -i $srcdir/abiword-3.0.0-librevenge.patch

  # Fix libwpd 0.4 detection
  patch -Np1 -i $srcdir/abiword-3.0.1-libwps-0.4.patch

  # Fix python override code to work with Python 3.x
  patch -Np1 -i $srcdir/python-override.patch

  # Fix black on black (FS#51667)
  # http://bugzilla.abisource.com/show_bug.cgi?id=13815
  patch -Np1 -i $srcdir/bug13815.patch

  # Replace nonfree fonts support to liberation fonts
  patch -Np1 -i $srcdir/liberation-fonts.patch

  # Replace deprecated enchant functions
  patch -Np1 -i $srcdir/enchant-2.1.patch

  # Replace deprecated libical functions
  patch -Np1 -i $srcdir/libical-deprecated.patch

  # Fix incessant flickering
  # https://bugzilla.abisource.com/show_bug.cgi?id=13791
  # https://sources.debian.org/patches/abiword/3.0.2-6/
  patch -Np1 -i $srcdir/fix-flickering.patch

  # Install missing m4 file
  install -m644 $srcdir/aiksaurus-plugin.m4 plugins/aiksaurus/plugin.m4
  install -m644 $srcdir/command-plugin.m4 plugins/command/plugin.m4

  # Generate m4 file for configure
  find plugins -name plugin.m4 | xargs cat > plugin-configure.m4

  # enchant-2 naming change
  sed -i 's/enchant >=/enchant-2 >=/' configure.ac

  libtoolize --force
  autoreconf -fi
}


build() {
  cd $pkgname-$pkgver

  # `--enable-plugins` has the complete list of plugins, except for
  # 'command', 'gda', 'google', and 'rsvg'.
  ./configure \
    --prefix=/usr \
    --enable-shared \
    --disable-static \
    --enable-clipart \
    --enable-templates \
    --enable-plugins="aiksaurus applix babelfish bmp clarisworks collab docbook \
                      eml epub freetranslation garble gdict gimp goffice grammar \
                      hancom hrtext iscii kword latex loadbindings mathview mht \
                      mif mswrite opendocument openwriter openxml opml ots paint \
                      passepartout pdb pdf presentation psion s5 sdw t602 urldict \
                      wikipedia wmf wml wordperfect wpg xslfo" \
    --enable-introspection

  sed -i -e 's/ -shared / -Wl,-O1,--as-needed\0/g' libtool

  make
}

package() {
  cd $pkgname-$pkgver

  make DESTDIR="$pkgdir" install

  cd src/gi-overrides
  sed -i 's/python -c/python2 -c/' Makefile

  make DESTDIR="$pkgdir" PYTHON=python2 install
}