217 lines
8.4 KiB
Bash
217 lines
8.4 KiB
Bash
# Template file for 'libreoffice'
|
|
pkgname=libreoffice
|
|
version=5.4.2.2
|
|
revision=2
|
|
build_style=gnu-configure
|
|
configure_args="--disable-werror"
|
|
nocross=yes
|
|
|
|
#
|
|
# XXX: mit-krb5-devel nasm firebird3 hamcrest iwyu ogl-math
|
|
# Missing, required libraries are downloaded and built internally
|
|
#
|
|
hostmakedepends="automake libtool pkg-config bison flex gperf icu
|
|
perl-Archive-Zip hyphen openldap sane ucpp unzip zip wget"
|
|
makedepends="apr-devel gst-plugins-base1-devel gtk+-devel gtk+3-devel
|
|
libatomic_ops-devel librsvg-devel nss-devel python3-devel libgcrypt-devel
|
|
gpgmepp-devel poppler-cpp-devel postgresql-libs-devel redland-devel
|
|
liborcus-devel lpsolve-devel unixodbc-devel libXt-devel neon-devel
|
|
avahi-libs-devel hunspell-devel hyphen-devel libabw-devel libcdr-devel
|
|
CoinMP-devel libbluetooth-devel libcmis-devel libe-book-devel libfreehand-devel
|
|
libexttextcat-devel libgltf-devel libldap-devel libmspub-devel libmwaw-devel
|
|
glew-devel glyphy-devel gst-plugins-base1-devel libodfgen-devel
|
|
libpagemaker-devel libvisio-devel libetonyek-devel libwpg-devel telepathy-glib-devel
|
|
libwps-devel glm mdds0 mythes-devel opencollada-devel sane-devel vigra-devel vlc-devel"
|
|
depends="hyphen openldap sane"
|
|
short_desc="Productivity suite, formerly OpenOffice.org"
|
|
maintainer="Jürgen Buchmüller <pullmoll@t-online.de>"
|
|
license="LGPL-3"
|
|
homepage="http://www.libreoffice.org/"
|
|
|
|
# Additional zip archives
|
|
_ooop_fonts_md5hash=a10aa597411643326e27d7fc128af12d
|
|
_ooop_fonts_version=2.9.0.0
|
|
_ooop_gallery_md5hash=af9314c5972d95a5d6da23ffad818f68
|
|
_ooop_gallery_version=2.8.0.0
|
|
_ooop_samples_md5hash=a6bccacf44914969e6e7b2f8faf4132c
|
|
_ooop_samples_version=2.7.0.0
|
|
_ooop_templates_md5hash=1be202fbbbc13f10592a98f70a4a87fb
|
|
_ooop_templates_version=2.9.0.0
|
|
# Extra gallery, samples and templates
|
|
_ooopurl="http://ooo.itc.hu/oxygenoffice/download/libreoffice"
|
|
# Source, dictionary, help and translations
|
|
_baseurl="http://download.documentfoundation.org/${pkgname}/src/${version%.*}"
|
|
|
|
distfiles="
|
|
${_baseurl}/${pkgname}-${version}.tar.xz
|
|
${_baseurl}/${pkgname}-dictionaries-${version}.tar.xz
|
|
${_baseurl}/${pkgname}-help-${version}.tar.xz
|
|
${_baseurl}/${pkgname}-translations-${version}.tar.xz
|
|
${_ooopurl}/${_ooop_fonts_md5hash}-OOOP-fonts-pack-${_ooop_fonts_version}.zip
|
|
${_ooopurl}/${_ooop_gallery_md5hash}-OOOP-gallery-pack-${_ooop_gallery_version}.zip
|
|
${_ooopurl}/${_ooop_samples_md5hash}-OOOP-samples-pack-${_ooop_samples_version}.zip
|
|
${_ooopurl}/${_ooop_templates_md5hash}-OOOP-templates-pack-${_ooop_templates_version}.zip
|
|
"
|
|
checksum="
|
|
2fda4a8c446786a3afff2cf1b07b818c45c9dcd136bfae1f3191b0b1565ba675
|
|
36ee07e62c62383af7e3f742f85ea446450d1ccb3ff587829beca5b006029636
|
|
5fc740dbe77876b96ed731f0a6ce793925a9a4a4ba983b5a3506ab24beb73057
|
|
d0eb02a65ffd164d8a9c287ef8b3e0d4db9b45979f72f496a6693ed5c39158d2
|
|
cf21b8a0a58c0f0af562869846ce2af4c68b13a7178b9b74ee7be7480a87c84c
|
|
c95f6c398e81ee7def378e51e4c7b5bdeba526f28ff281e79ca3795e6d467159
|
|
1834aa0632499134f98ce85057d6d67604b9ed3b7efa7f13e76046f5886a3a2d
|
|
c31a4b1ab988a6b016654cc91e9652727cbb0fcbe9b09ee4b3d93b57a57901e0
|
|
"
|
|
skip_extraction="
|
|
${pkgname}-dictionaries-${version}.tar.xz
|
|
${pkgname}-help-${version}.tar.xz
|
|
${pkgname}-translations-${version}.tar.xz
|
|
${_ooop_fonts_md5}-OOOP-fonts-pack-${_ooop_fonts_ver}.zip
|
|
${_ooop_gallery_md5}-OOOP-gallery-pack-${_ooop_gallery_ver}.zip
|
|
${_ooop_samples_md5}-OOOP-samples-pack-${_ooop_samples_ver}.zip
|
|
${_ooop_templates_md5}-OOOP-templates-pack-${_ooop_templates_ver}.zip
|
|
"
|
|
|
|
build_options="java"
|
|
desc_option_java="Enable Java support"
|
|
|
|
if [ -z "$CROSS_BUILD" ]; then
|
|
# mariadbclient can't currently be cross compiled
|
|
makedepends+=" libmariadbclient-devel"
|
|
fi
|
|
|
|
case "$XBPS_TARGET_MACHINE" in
|
|
i686*) # Broken unit tests
|
|
CXXFLAGS+=" -DDISABLE_CVE_TESTS=1"
|
|
makedepends+=" clucene-devel"
|
|
;;
|
|
*-musl) # use shipped clucene, because CLucene/analysis/cjk/CJKAnalyzer.h
|
|
# is missing in the musl clucene-devel files
|
|
;;
|
|
*) build_options_default="java"
|
|
makedepends+=" apache-ant openjdk "
|
|
makedepends+=" clucene-devel"
|
|
;;
|
|
esac
|
|
|
|
post_fetch() {
|
|
local srcdistdir=${XBPS_SRCDISTDIR}/${pkgname}-${version} pkg
|
|
mkdir -p ${wrksrc}/external/tarballs
|
|
for pkg in \
|
|
${pkgname}-dictionaries-${version}.tar.xz \
|
|
${pkgname}-help-${version}.tar.xz \
|
|
${pkgname}-translations-${version}.tar.xz \
|
|
${_ooop_fonts_md5hash}-OOOP-fonts-pack-${_ooop_fonts_version}.zip \
|
|
${_ooop_gallery_md5hash}-OOOP-gallery-pack-${_ooop_gallery_version}.zip \
|
|
${_ooop_samples_md5hash}-OOOP-samples-pack-${_ooop_samples_version}.zip \
|
|
${_ooop_templates_md5hash}-OOOP-templates-pack-${_ooop_templates_version}.zip; do
|
|
ln -sf ${srcdistdir}/${pkg} ${wrksrc}/external/tarballs/
|
|
done
|
|
}
|
|
|
|
pre_configure() {
|
|
sed -e "/gzip -f/d" \
|
|
-e "s|.1.gz|.1|g" \
|
|
-i bin/distro-install-desktop-integration
|
|
sed -e "/distro-install-file-lists/d" -i Makefile.in
|
|
chmod +x bin/unpack-sources
|
|
mkdir -p external/firebird
|
|
# Add musl patch
|
|
cp ${FILESDIR}/musl-os_utils_h.patch external/firebird/
|
|
sed -i external/firebird/UnpackedTarball_firebird.mk \
|
|
-e's;\(.*external/firebird\)/libc++.patch\(.*\)$;\1/libc++.patch\2\n\1/musl-os_utils_h.patch\2;'
|
|
|
|
case "$XBPS_TARGET_MACHINE" in
|
|
i686*) # Don't run broken tests
|
|
sed -i "/CppunitTest_sw_ooxmlexport9/d" sw/Module_sw.mk
|
|
make_build_args="build-nocheck"
|
|
;;
|
|
esac
|
|
}
|
|
|
|
do_configure() {
|
|
local incdir="${XBPS_CROSS_BASE}/usr/include"
|
|
|
|
# Separate autogen.sh and configure because we need
|
|
# to patch configure for musl support
|
|
NOCONFIGURE=1 ./autogen.sh
|
|
|
|
# Add linux-musl* as host OS to lines containing linux-gnu*
|
|
sed -i configure -e 's;linux-gnu\*;linux-gnu*|linux-musl*;g'
|
|
|
|
configure_args+=" --with-vendor='VoidLinux'"
|
|
configure_args+=" --with-help"
|
|
configure_args+=" --with-alloc=system"
|
|
configure_args+=" --without-system-dicts"
|
|
configure_args+=" --disable-odk"
|
|
configure_args+=" --enable-python=system"
|
|
configure_args+=" --enable-gtk3"
|
|
configure_args+=" --enable-vlc"
|
|
configure_args+=" --disable-dependency-tracking"
|
|
configure_args+=" --enable-release-build=yes"
|
|
configure_args+=" --disable-dconf"
|
|
# New strategy: enable all libs and headers, then disable what's missing
|
|
configure_args+=" --with-system-libs"
|
|
configure_args+=" --with-system-headers"
|
|
case "$XBPS_TARGET_MACHINE" in
|
|
i686*|*-musl)
|
|
# Can't use system clucence
|
|
configure_args+=" --without-system-clucene"
|
|
;;
|
|
x86_64) configure_args+=" --enable-ext-mariadb-connector"
|
|
configure_args+=" --enable-ext-ct2n"
|
|
configure_args+=" --enable-ext-numbertext"
|
|
configure_args+=" --enable-ext-nlpsolver"
|
|
configure_args+=" --enable-ext-languagetool"
|
|
;;
|
|
esac
|
|
|
|
if [ "$build_option_java" ]; then
|
|
configure_args+=" --with-java"
|
|
configure_args+=" --with-jdk-home=/usr/lib/jvm/openjdk"
|
|
configure_args+=" --without-junit"
|
|
else
|
|
configure_args+=" --without-java"
|
|
fi
|
|
configure_args+=" --with-tls=nss"
|
|
# xmlsec1-nss is missing, thus don't use system-xmlsec
|
|
configure_args+=" --without-system-xmlsec"
|
|
configure_args+=" --without-system-libzmf"
|
|
configure_args+=" --without-system-libstaroffice"
|
|
configure_args+=" --without-system-mysql-cppconn"
|
|
# libreoffice want's firebird3
|
|
configure_args+=" --without-system-firebird"
|
|
configure_args+=" --without-system-libtommath"
|
|
configure_args+=" --without-system-jfreereport"
|
|
configure_args+=" --without-system-apache-commons"
|
|
configure_args+=" --without-system-beanshell"
|
|
configure_args+=" --with-myspell-dicts"
|
|
configure_args+=" --with-system-icu-for-build=yes"
|
|
configure_args+=" --with-external-hyph-dir=${XBPS_CROSS_BASE}/usr/share/hyphen"
|
|
configure_args+=" --with-parallelism=${XBPS_MAKEJOBS}"
|
|
|
|
# In theory we could use --with-lang=ALL but building the package then takes ages.
|
|
OPENCOLLADA_CFLAGS="-I${incdir}/opencollada/COLLADABaseUtils -I${incdir}/opencollada/COLLADAFramework -I${incdir}/opencollada/COLLADASaxFrameworkLoader -I${incdir}/opencollada/COLLADAStreamWriter -I${incdir}/opencollada/GeneratedSaxParser" \
|
|
OPENCOLLADA_LIBS="-L${XBPS_CROSS_BASE}/usr/lib -lGeneratedSaxParser -lMathMLSolver -lOpenCOLLADABaseUtils -lOpenCOLLADAFramework -lOpenCOLLADASaxFrameworkLoader -lOpenCOLLADAStreamWriter -lUTF -lbuffer -lftoa" \
|
|
./configure ${configure_args} --with-lang='en-US de es fr it pl pt'
|
|
}
|
|
|
|
do_build() {
|
|
make build
|
|
}
|
|
|
|
do_install() {
|
|
local f
|
|
|
|
make DESTDIR="${DESTDIR}" PREFIXDIR="/usr" distro-pack-install
|
|
|
|
mkdir -p ${INSTDIR}/share/appdata
|
|
cp -p sysui/desktop/appstream-appdata/*.xml ${INSTDIR}/share/appdata/
|
|
|
|
# Remove unwanted libreoffice packaging files from the root directory
|
|
rm -f ${DESTDIR}/gid_Module*
|
|
|
|
# Remove useless directory usr/lib32
|
|
rm -rf ${DESTDIR}/usr/lib32
|
|
}
|