1 # Description: LibreOffice is a powerful office suite
2 # URL: https://www.libreoffice.org/
3 # Maintainer: Tim Biermann, tbier at posteo dot de
4 # Depends on: abseil-cpp box2d clucene dragonbox fakeroot fontforge graphite2 gst-plugins-base hyphen icu libabw libcdr libcmis libcuckoo libe-book libepubgen libetonyek libexttextcat libfixmath libfreehand libmspub libmwaw libmythes libnumbertext libodfgen liborcus libpagemaker libqrcodegen libqxp libstaroffice libtommath libvisio libwpg libwps libzmf neon nss openjpeg2 paper redland unzip xmlsec xorg-libxcomposite zip
5 # Optional: avahi coin-or-mp cups gpgme kio lpsolve mariadb openldap postgresql python3-lxml qt5 sane valgrind
6
7 name=libreoffice
8 version=7.5.0.1
9 release=1
10 pdfiumversion=5408
11 source=(https://downloadarchive.documentfoundation.org/libreoffice/old/$version/src/$name-$version.tar.xz
12 https://downloadarchive.documentfoundation.org/libreoffice/old/$version/src/$name-dictionaries-$version.tar.xz
13 https://dev-www.libreoffice.org/extern/185d60944ea767075d27247c3162b3bc-unowinreg.dll
14 https://dev-www.libreoffice.org/src/0168229624cfac409e766913506961a8-ucpp-1.3.2.tar.gz
15 https://dev-www.libreoffice.org/src/dtoa-20180411.tgz
16 #https://dev-www.libreoffice.org/src/skia-m90-45c57e116ee0ce214bdf78405a4762722e4507d9.tar.xz
17 https://dev-www.libreoffice.org/src/pdfium-$pdfiumversion.tar.bz2
18 #https://dev-www.libreoffice.org/src/libcmis-0.5.2.tar.xz
19 makefile.in.patch)
20
21 # unpack_source() {{{
22 unpack_source() {
23 mkdir $SRC/tarballs
24 for file in ${source[@]}; do
25 case ${file##*/} in
26 libreoffice-*.tar.xz)
27 echo "Unpacking $(get_filename $file)"
28 bsdtar -p -o -C $SRC -xf $(get_filename $file) ;;
29 185d60944ea767075d27247c3162b3bc-unowinreg.dll|\
30 pdfium-$pdfiumversion.tar.bz2|\
31 dtoa-20180411.tgz|\
32 skia-m90-45c57e116ee0ce214bdf78405a4762722e4507d9.tar.xz|\
33 libcmis-0.5.2.tar.xz|\
34 0168229624cfac409e766913506961a8-ucpp-1.3.2.tar.gz)
35 echo "Moving $(get_filename $file) to $SRC/tarballs"
36 cp $(get_filename $file) $SRC/tarballs ;;
37 *)
38 cp $(get_filename $file) $SRC ;;
39 esac
40 done
41 }
42 # }}}
43
44 build() {
45 # fail the build if dependencies are not met {{{
46 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)
47 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)
48 # }}}
49
50 cd $name-$version
51
52 patch -Np1 -i $SRC/makefile.in.patch
53 sed -i 's:application/pdf;::g' sysui/desktop/menus/draw.desktop
54 sed -i 's:text/plain;::g' sysui/desktop/menus/writer.desktop
55 sed -i 's:dragonbox-1.0.0:dragonbox:g' configure.ac
56
57 prt-get isinst gpgme && export ac_cv_lib_gpgmepp_progress_callback=yes
58 # optionals {{{
59 prt-get isinst avahi && PKGMK_LIBREOFFICE+=' --enable-avahi' || PKGMK_LIBREOFFICE+=' --disable-avahi'
60 #prt-get isinst box2d && PKGMK_LIBREOFFICE+=' --with-system-box2d' || PKGMK_LIBREOFFICE+=' --without-system-box2d'
61 #prt-get isinst ccache && PKGMK_LIBREOFFICE+=' --enable-ccache' || PKGMK_LIBREOFFICE+=' --disable-ccache'
62 prt-get isinst ccache && export PATH="$(echo ${PATH} | awk -v RS=: -v ORS=: '/ccache/ {next} {print}' | sed 's/:*$//')"
63 prt-get isinst ccache && export CCACHE_CPP2=1
64 #prt-get isinst clucene && PKGMK_LIBREOFFICE+=' --with-system-clucene' || PKGMK_LIBREOFFICE+=' --without-system-clucene'
65 prt-get isinst coin-or-mp && PKGMK_LIBREOFFICE+=' --with-system-coinmp' || PKGMK_LIBREOFFICE+=' --disable-coinmp'
66 prt-get isinst cups && PKGMK_LIBREOFFICE+=' --enable-cups' || PKGMK_LIBREOFFICE+=' --disable-cups'
67 prt-get isinst gpgme && PKGMK_LIBREOFFICE+=' --enable-gpgmepp' || PKGMK_LIBREOFFICE+=' --disable-gpgmepp'
68 prt-get isinst dconf && PKGMK_LIBREOFFICE+=' --enable-dconf' || PKGMK_LIBREOFFICE+=' --disable-dconf'
69 #prt-get isinst gtk4 && PKGMK_LIBREOFFICE+=' --enable-gtk4'
70 prt-get isinst kio && PKGMK_LIBREOFFICE+=' --enable-kde5 --enable-gtk3-kde5'
71 #prt-get isinst libstaroffice && PKGMK_LIBREOFFICE+=' --with-system-libstaroffice' || PKGMK_LIBREOFFICE+=' --without-system-libstaroffice'
72 #prt-get isinst libtommath && PKGMK_LIBREOFFICE+= ' --with-system-libtommath' || PKGMK_LIBREOFFICE+=' --without-system-libtommath'
73 prt-get isinst lpsolve && PKGMK_LIBREOFFICE+=' --enable-lpsolve' || PKGMK_LIBREOFFICE+=' --disable-lpsolve'
74 prt-get isinst mariadb || PKGMK_LIBREOFFICE+=' --disable-mariadb-sdbc'
75 prt-get isinst openldap || PKGMK_LIBREOFFICE+=' --disable-ldap'
76 prt-get isinst postgresql || PKGMK_LIBREOFFICE+=' --disable-postgresql-sdbc'
77 prt-get isinst python3-lxml || PKGMK_LIBREOFFICE+=' --without-lxml'
78 prt-get isinst qt5 && PKGMK_LIBREOFFICE+=' --enable-qt5' || PKGMK_LIBREOFFICE+=' --disable-qt5'
79 #prt-get isinst qt6-base && PKGMK_LIBREOFFICE+=' --enable-qt6' || PKGMK_LIBREOFFICE+=' --disable-qt6'
80 prt-get isinst sane && PKGMK_LIBREOFFICE+=' --with-system-sane' || PKGMK_LIBREOFFICE+=' --without-system-sane'
81 prt-get isinst valgrind && PKGMK_LIBREOFFICE+=' --with-valgrind'
82 # }}}
83
84 local build_date=$(date +%Y%m%d)
85 NOCONFIGURE=1 ./autogen.sh
86 ./configure $PKGMK_LIBREOFFICE \
87 --with-parallelism=${JOBS-1} \
88 --prefix=/usr \
89 --with-external-tar="$SRC/tarballs" \
90 --enable-{build-opensymbol,dbus,firebird-sdbc=no,gtk3,introspection=yes} \
91 --enable-{ld=gold,odk,openssl,pdfium,python=system,release-build} \
92 --with-{lang="",package-format=archive,myspell-dicts} \
93 --with-extra-buildid="$(crux | awk '{ print $1 " " $3 }') ${build_date}" \
94 --with-package-version="$version" \
95 --with-system-{headers,libs} \
96 --with-external-dict-dir=/usr/share/hunspell \
97 --with-external-hyph-dir=/usr/share/hypen \
98 --with-external-thes-dir=/usr/share/mythes \
99 --without-{doxygen,fonts,gssapi,help,helppack-integration,java,system-firebird} \
100 --disable-{ccache,cmis,dependency-tracking,extension-update,fetch-external,firebird-sdbc} \
101 --disable-{online-update,poppler,report-builder,sdremote-bluetooth,skia,werror,zxing}
102
103 touch {sources.ver,src.downloaded}
104 echo "lo_sources_ver=${version}" > sources.ver
105 make
106
107 pushd workdir/installation/LibreOffice/archive/install/en-US
108 tar xf *.tar.gz
109 popd
110
111 make DESTDIR=$PKG distro-pack-install
112
113 install -dm755 $PKG/usr/etc/libreoffice
114 install -m644 $PKG/usr/lib/libreoffice/program/{bootstraprc,sofficerc} \
115 $PKG/usr/etc/libreoffice/
116 install -m644 $PKG/usr/lib/libreoffice/share/psprint/psprint.conf \
117 $PKG/usr/etc/libreoffice/
118
119 # install dummy links to make them found by lo
120 cd $PKG/usr/lib/libreoffice/program/
121 ln -vsrf $PKG/usr/etc/libreoffice/{bootstraprc,sofficerc} .
122
123 # cleanup {{{
124 rm -r $PKG/usr/share/{doc,libreoffice/sdk}
125 rm -r $PKG/usr/lib/libreoffice/sdk
126 find $PKG -iname "*readme*" -exec rm -fr '{}' \+
127 # }}}
128 }
|