2019-08-11 11:14:08 +02:00
# Description: LibreOffice is a powerful office suite
# URL: https://www.libreoffice.org/
# Maintainer: Tim Biermann, tbier at posteo dot de
2022-01-17 17:31:53 +01:00
# Depends on: abseil-cpp box2d clucene coin-or-mp fakeroot fontforge gpgme graphite2 gst-plugins-base hyphen icu libabw libcdr libcuckoo libe-book libepubgen libetonyek libexttextcat libfreehand libmspub libmwaw libmythes libnumbertext libodfgen liborcus libpagemaker libpaper libqrcodegen libqxp libstaroffice libtommath libvisio libwpg libwps libzmf lpsolve mariadb neon nss openjpeg2 python3-lxml redland sane unzip xmlsec xorg-libxcomposite zip
2021-08-15 21:59:52 +02:00
# Optional: cups kio openldap qt5 valgrind
2019-08-11 11:14:08 +02:00
name=libreoffice
2022-03-19 01:51:18 +01:00
version=7.3.2.1
2019-08-11 11:14:08 +02:00
release=1
2022-01-17 17:31:53 +01:00
pdfiumversion=4699
2020-06-12 18:26:51 +02:00
source=(https://downloadarchive.documentfoundation.org/libreoffice/old/$version/src/$name-$version.tar.xz
2019-08-11 11:14:08 +02:00
https://downloadarchive.documentfoundation.org/libreoffice/old/$version/src/$name-dictionaries-$version.tar.xz
https://dev-www.libreoffice.org/extern/185d60944ea767075d27247c3162b3bc-unowinreg.dll
https://dev-www.libreoffice.org/src/0168229624cfac409e766913506961a8-ucpp-1.3.2.tar.gz
2020-07-06 19:00:49 +02:00
https://dev-www.libreoffice.org/src/dtoa-20180411.tgz
2021-07-18 15:05:29 +02:00
#https://dev-www.libreoffice.org/src/skia-m90-45c57e116ee0ce214bdf78405a4762722e4507d9.tar.xz
2021-05-22 14:20:20 +02:00
https://dev-www.libreoffice.org/src/pdfium-$pdfiumversion.tar.bz2
2021-08-15 21:59:52 +02:00
#https://dev-www.libreoffice.org/src/libcmis-0.5.2.tar.xz
2022-01-17 17:31:53 +01:00
makefile.in.patch)
2019-08-11 11:14:08 +02:00
2021-08-15 21:59:52 +02:00
# unpack_source() {{{
2019-08-11 11:14:08 +02:00
unpack_source() {
2021-07-18 15:05:29 +02:00
mkdir $SRC/tarballs
2019-08-11 11:14:08 +02:00
for file in ${source[@]}; do
case ${file##*/} in
libreoffice-*.tar.xz)
2021-07-18 15:05:29 +02:00
echo "Unpacking $(get_filename $file)"
2019-08-11 11:14:08 +02:00
bsdtar -p -o -C $SRC -xf $(get_filename $file) ;;
2021-07-18 15:05:29 +02:00
185d60944ea767075d27247c3162b3bc-unowinreg.dll|\
pdfium-$pdfiumversion.tar.bz2|\
dtoa-20180411.tgz|\
skia-m90-45c57e116ee0ce214bdf78405a4762722e4507d9.tar.xz|\
2021-08-15 21:59:52 +02:00
libcmis-0.5.2.tar.xz|\
2019-08-11 11:14:08 +02:00
0168229624cfac409e766913506961a8-ucpp-1.3.2.tar.gz)
2021-07-18 15:05:29 +02:00
echo "Moving $(get_filename $file) to $SRC/tarballs"
2020-07-06 19:00:49 +02:00
cp $(get_filename $file) $SRC/tarballs ;;
2019-08-11 11:14:08 +02:00
*)
cp $(get_filename $file) $SRC ;;
esac
done
}
2021-08-15 21:59:52 +02:00
# }}}
2019-08-11 11:14:08 +02:00
build() {
2021-08-15 21:59:52 +02:00
# fail the build if dependencies are not met {{{
2021-07-18 15:05:29 +02:00
ls /usr/include/harfbuzz/hb-icu.h || (printf '\e[1;31m%-6s\e[m\n' "you need to install icu, then rebuild harfbuzz for libreoffice to work, quitting.." ; exit 1)
ls /usr/lib/pkgconfig/xmlsec1-nss.pc || (printf '\e[1;31m%-6s\e[m\n' "you need to install nss, then rebuild xmlsec for libreoffice to work, quitting.." ; exit 1)
2021-08-15 21:59:52 +02:00
# }}}
2021-07-18 15:05:29 +02:00
2019-08-11 11:14:08 +02:00
cd $name-$version
2020-07-06 19:00:49 +02:00
patch -Np1 -i $SRC/makefile.in.patch
2021-09-19 12:23:02 +02:00
2021-08-15 21:59:52 +02:00
# optionals {{{
prt-get isinst cups && PKGMK_LIBREOFFICE+=" --enable-cups" || PKGMK_LIBREOFFICE+=" --disable-cups"
prt-get isinst kio && PKGMK_LIBREOFFICE+=" --enable-kde5 --enable-gtk3-kde5"
prt-get isinst openldap || PKGMK_LIBREOFFICE+=' --disable-ldap'
prt-get isinst qt5 && PKGMK_LIBREOFFICE+=" --enable-qt5" || PKGMK_LIBREOFFICE+=" --disable-qt5"
prt-get isinst valgrind && PKGMK_LIBREOFFICE+=" --with-valgrind"
# }}}
2019-08-11 11:14:08 +02:00
local build_date=$(date +%Y%m%d)
./autogen.sh $PKGMK_LIBREOFFICE \
--with-parallelism=${JOBS-1} \
--prefix=/usr \
--with-external-tar="$SRC/tarballs" \
2019-10-28 09:55:46 +01:00
--enable-{build-opensymbol,dbus,firebird-sdbc=no,gtk3,introspection=yes,release-build,odk,openssl,pdfium,python=system} \
2019-08-11 11:14:08 +02:00
--with-{lang="",package-format=archive,myspell-dicts,parallelism} \
--with-extra-buildid="$(crux | awk '{ print $1 " " $3 }') ${build_date}" \
--with-package-version="$version" \
--with-system-{headers,libs} \
--with-external-dict-dir=/usr/share/hunspell \
--with-external-hyph-dir=/usr/share/hypen \
--with-external-thes-dir=/usr/share/mythes \
--without-{doxygen,fonts,gssapi,help,helppack-integration,java,system-firebird} \
2021-08-15 21:59:52 +02:00
--disable-{avahi,ccache,cmis,dconf,dependency-tracking,extension-update,fetch-external,firebird-sdbc} \
--disable-{poppler,postgresql-sdbc,report-builder,sdremote-bluetooth,skia,werror,zxing}
2019-08-11 11:14:08 +02:00
touch {sources.ver,src.downloaded}
echo "lo_sources_ver=${version}" > sources.ver
2021-07-18 15:05:29 +02:00
make
2019-08-11 11:14:08 +02:00
pushd workdir/installation/LibreOffice/archive/install/en-US
tar xf *.tar.gz
popd
make DESTDIR=$PKG distro-pack-install
install -dm755 $PKG/usr/etc/libreoffice
install -m644 $PKG/usr/lib/libreoffice/program/{bootstraprc,sofficerc} \
$PKG/usr/etc/libreoffice/
install -m644 $PKG/usr/lib/libreoffice/share/psprint/psprint.conf \
$PKG/usr/etc/libreoffice/
# install dummy links to make them found by lo
cd $PKG/usr/lib/libreoffice/program/
ln -vsrf $PKG/usr/etc/libreoffice/{bootstraprc,sofficerc} .
2021-08-15 21:59:52 +02:00
# cleanup {{{
2019-08-11 11:14:08 +02:00
rm -r $PKG/usr/share/libreoffice/sdk
rm -r $PKG/usr/lib/libreoffice/sdk
rm -r $PKG/usr/share/doc
find $PKG -iname "*readme*" -exec rm -fr '{}' \+
2021-08-15 21:59:52 +02:00
# }}}
2019-08-11 11:14:08 +02:00
}