331.5. abiword-3.0.8
AbiWord word processor — reads and writes Word, OpenDocument, RTF and HTML
| Version | 3.0.8, release 3 |
| Shelf | office — Office suites, word processors, spreadsheets, presentations, accounting and finance, and office-format import libraries |
| Phase | 44_apps (Applications), 314 of 422 in build order |
| Licence | GPL-2.0-or-later |
| Homepage | https://gitlab.gnome.org/World/AbiWord |
| Build time | 17.6 SBU |
| Installed size | 15.3 MiB in 250 files |
| Recipe | ports/core/office/abiword/kpkgbuild |
About
AbiWord is a GTK 3 word processor with its own .abw format and import and export plugins for Word, OpenDocument, RTF, HTML, WordPerfect, EPUB, LaTeX and others. Word documents are read through wv, and charts embedded in a document are drawn by goffice.
Sources
abiword-3.0.8.tar.gz(11.0 MiB)
sha2567c490e46f0a6143f84d5c7e3fed246f34486ad70cd55f162c792827607cd7e9a
upstream: https://gitlab.gnome.org/World/AbiWord/-/archive/release-3.0.8/AbiWord-release-3.0.8.tar.gz
archive copy: sources-3/office--abiword-3.0.8.tar.gz
Dependencies
Depends on: autoconf, autoconf-archive, automake, libtool, pkgconf, glib, gtk3, cairo, pango, librsvg, libgsf, wv, fribidi, enchant, libxml2, libxslt, libjpeg-turbo, libpng, zlib, libX11, goffice, boost, readline, librevenge, libwpd, libwpg, libwps, poppler.
Required by: no port names it.
Optional, off in KDOS
These switches in build.sh turn off a feature whose library is a port here. The recipe may turn each off on purpose, or because the library was not yet a port when the recipe was written; this list cannot tell which.
--without-libical, line 29: libical
Patches
build.sh applies these; kpkg applies nothing by itself.
clipboard-targets.patch— Offer only the clipboard formats a copy holds, without the exporter's NULThe RTF and text buffers lose the NUL IE_Exp::copyToBuffer ends them with, so a pasted text carries no U+0000. Each copy empties the internal copy of its selection first, and CLIPBOARD is offered in the formats that copy holds instead of every format AbiWord reads, so a text copy offers no image type with no data behind it.
enchant-2-pkgconfig.patch— makesconfigure.acask pkg-config forenchant-2 >= 2.0.0instead ofenchant >= 1.2.0, the module name Enchant 2 installs.enchant.patch— moves the spell checker to the Enchant 2 API:enchant_dict_free_string_list,enchant_dict_addandenchant_dict_is_addedin place of the Enchant 1 callsenchant_dict_free_suggestions,enchant_dict_add_to_personalandenchant_dict_is_in_session, which Enchant 2 does not have.musl-1.2.3.patch— writes(char) 0in place of(char) NULLinxap_Dialog.cpp. musl definesNULLasnullptrin C++, which cannot be cast tochar.
clipboard-targets.patch fixes what a copy puts on the clipboard. The RTF and text buffers that IE_Exp::copyToBuffer fills end in a NUL, which upstream hands to the clipboard as part of the data, so a terminal pastes a U+0000 and warns about hidden control characters; the patch drops it from those two. The ODT buffer is a zip whose last bytes are legitimately zero, so it is passed whole. Upstream also offers every format AbiWord can read, seventeen image types among them, whatever was copied, and Klipper then stores an empty image entry for a text copy; the patched copy empties its internal copy first and offers the formats that copy holds. It is to be offered upstream as a merge request to World/AbiWord.
Installation
From the repository root, inside the build container, this is the line kdosbuild runs for the port:
script/chroot/exec.sh bash -c 'source script/phases/44_apps/phase.env && kpkg install abiword'
What kpkg does
kpkg runs these steps, in this order, as root inside the chroot. The port directory is /ports/core/office/abiword.
1. Verify every declared source. Each file a sha256 = line names, found in the port directory or in /var/cache/kpkg/sources, must hash to its line; a mismatch stops the build before anything is unpacked.
cd /ports/core/office/abiword
echo '7c490e46f0a6143f84d5c7e3fed246f34486ad70cd55f162c792827607cd7e9a abiword-3.0.8.tar.gz' | sha256sum -c -
2. Unpack. The work directory is emptied and the first source is unpacked into $SRC with its top directory stripped; any later tarball lands unstripped beside it in $SRC_ROOT, and a file that is not a tarball is copied into $SRC.
SRC_ROOT=/var/cache/kpkg/work/abiword
SRC=$SRC_ROOT/abiword-3.0.8
PKG=$SRC_ROOT/pkg
rm -rf "$SRC_ROOT"
mkdir -p "$SRC" "$PKG"
tar --no-same-permissions --warning=no-unknown-keyword -xf abiword-3.0.8.tar.gz -C "$SRC" --strip-components=1
Every config.guess and config.sub older than automake’s is then replaced with automake’s, so a configure script recognises the musl target.
3. Build. build.sh is sourced in a subshell under set -e, from $SRC, with name, version, release and the five paths PKGNAME, PORT_SRC, SRC_ROOT, SRC and PKG set as shell variables. Its body, verbatim:
patch -p1 -i "$PORT_SRC/enchant-2-pkgconfig.patch"
patch -p1 -i "$PORT_SRC/enchant.patch"
patch -p1 -i "$PORT_SRC/musl-1.2.3.patch"
patch -p1 -i "$PORT_SRC/clipboard-targets.patch"
./autogen-common.sh
autoreconf -fi
./configure --prefix=/usr --sysconfdir=/etc --libdir=/usr/lib \
--disable-static \
--enable-spell \
--enable-print \
--enable-plugins="applix bmp clarisworks command docbook eml epub gimp goffice hancom hrtext iscii kword latex loadbindings mht mif mswrite opendocument openwriter openxml opml paint passepartout pdb pdf presentation s5 sdw t602 wml wordperfect wpg xslfo" \
--with-goffice \
--with-gio \
--without-gnomevfs \
--without-redland \
--without-evolution-data-server \
--without-libical \
--without-champlain \
--disable-introspection
make
make DESTDIR=$PKG install
cat > "$PKG/usr/share/applications/abiword.desktop" <<'DESKTOP'
[Desktop Entry]
Type=Application
Name=AbiWord
GenericName=Word Processor
Comment=Compose, edit and view documents
TryExec=abiword
Exec=abiword %U
Icon=abiword
Terminal=false
StartupNotify=true
Categories=Office;WordProcessor;GTK;
MimeType=application/x-abiword;
Keywords=word;processor;document;doc;rtf;odt;abiword;
DESKTOP
chmod 644 "$PKG/usr/share/applications/abiword.desktop"
find "$PKG/usr/share/abiword-${version%.*}/strings" -name '*.strings' ! -name 'en*' -delete
The switches, and why each is set:
--enable-spell,--enable-print— Spell checking, through enchant, and printing. Printing is upstream’s default; left to itself, configure turns spell checking on only when it finds Enchant.--enable-plugins— The plugin list is explicit, so a plugin whose library is missing fails configure instead of silently dropping a file format. Left out arecollab,google,wikipedia,urldictandgdict, which only reach network services;grammar,aiksaurus,mathview,ots,gda,psionandwmf, whose libraries are not ports;garble, a tool that scrambles a document’s text for sending in a bug report; andrsvg(see Notes).--with-goffice— Link the system goffice instead of the copy of parts of it that AbiWord carries ingoffice-bits.--with-gio— Use GIO for file access.--without-gnomevfs— No gnome-vfs, which configure considers only for the GTK 2 front end.--without-redland,--without-evolution-data-server,--without-libical,--without-champlain— No RDF semantic items: Redland stores a document’s RDF metadata, and Evolution Data Server, libical and libchamplain give the contact, calendar-event and map views of it. Redland, Evolution Data Server and libchamplain are not ports; configure would pick up libical if it were left to probe.--disable-introspection— Generate no GObject introspection data. It is upstream’s default.
The common switches of each build system are explained in the Flag glossary.
4. Package. kpkg removes libtool archives, the info directory index, mimeinfo.cache and every fonts.dir from $PKG, copies the source’s licence files into /usr/share/licenses/abiword, prunes what the image does not ship, lints the tree and rolls it reproducibly:
tar --sort=name --format=gnu --numeric-owner --owner=0 --group=0 \
--mtime=@$SOURCE_DATE_EPOCH \
--use-compress-program='xz -9 -T0 --block-size=32MiB --no-adjust' \
-cf abiword-3.0.8-3.tar.xz -C "$PKG" .
5. Adopt. kpkgadd installs the package’s files over the root, refusing a path another package owns, records the file list in /var/lib/kpkg/db/abiword, and runs the triggers its paths call for.
Contents
Installed programs: abiword.
Installed libraries: libabiword-3.0.so.
Installed directories: /usr/include/abiword-3.0, /usr/lib/abiword-3.0, /usr/share/abiword-3.0, /usr/share/licenses/abiword.
Short descriptions
abiword |
flexible cross-platform word processor |
abiword-3.0.pc |
AbiWord word processing library |
Notes
The source is a git archive of the release tag with no generated configure. autogen-common.sh writes the plugin lists that configure.ac includes, and autoreconf -fi generates the rest; enchant-2-pkgconfig.patch has to be applied before autoreconf, or the generated configure asks pkg-config for the Enchant 1 module, which Enchant 2 does not install, and --enable-spell stops configure.
SVG needs no plugin: the GTK front end draws SVG through librsvg itself, and configure leaves the rsvg plugin unconfigured with GTK, so naming it would build it with no compiler flags.
build.sh replaces upstream’s desktop entry with one whose MimeType names AbiWord’s own format only. LibreOffice is the word processor that claims the shared office types (Word, OpenDocument, RTF, WordPerfect); a second claim would open them in whichever entry sorted first.
Every interface translation is a .strings file that is installed whatever configure is told, so all but the English ones are deleted from the package.