summaryrefslogtreecommitdiff
path: root/libreoffice/Pkgfile
blob: b72bfe3bf17fa2694453c65b81574c8475e68631 (plain)
    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: box2d clucene coin-or-mp fakeroot fontforge gpgme graphite2 gst-plugins-base hyphen libabw libcdr 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 openjpeg2 python3-lxml redland sane unzip xmlsec zip xorg-libxcomposite
    5 # Optional: cups kio openldap qt5 valgrind
    6 
    7 name=libreoffice
    8 version=7.2.1.2
    9 release=1
   10 pdfiumversion=4500
   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 pdfium-use-system-libopenjpeg.diff)
   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   # https://sources.debian.org/patches/libreoffice/1:7.1.4%7Erc1-1/pdfium-use-system-libopenjpeg.diff/
   54   patch -Np1 -i $SRC/pdfium-use-system-libopenjpeg.diff
   55 
   56   # optionals {{{
   57   prt-get isinst cups && PKGMK_LIBREOFFICE+=" --enable-cups" || PKGMK_LIBREOFFICE+=" --disable-cups"
   58   prt-get isinst kio && PKGMK_LIBREOFFICE+=" --enable-kde5 --enable-gtk3-kde5"
   59   prt-get isinst openldap || PKGMK_LIBREOFFICE+=' --disable-ldap'
   60   prt-get isinst qt5 && PKGMK_LIBREOFFICE+=" --enable-qt5" || PKGMK_LIBREOFFICE+=" --disable-qt5"
   61   prt-get isinst valgrind && PKGMK_LIBREOFFICE+=" --with-valgrind"
   62   # }}}
   63 
   64   local build_date=$(date +%Y%m%d)
   65   ./autogen.sh $PKGMK_LIBREOFFICE \
   66     --with-parallelism=${JOBS-1} \
   67     --prefix=/usr \
   68     --with-external-tar="$SRC/tarballs" \
   69     --enable-{build-opensymbol,dbus,firebird-sdbc=no,gtk3,introspection=yes,release-build,odk,openssl,pdfium,python=system} \
   70     --with-{lang="",package-format=archive,myspell-dicts,parallelism} \
   71     --with-extra-buildid="$(crux | awk '{ print $1 " " $3 }') ${build_date}" \
   72     --with-package-version="$version" \
   73     --with-system-{headers,libs} \
   74     --with-external-dict-dir=/usr/share/hunspell \
   75     --with-external-hyph-dir=/usr/share/hypen \
   76     --with-external-thes-dir=/usr/share/mythes \
   77     --without-{doxygen,fonts,gssapi,help,helppack-integration,java,system-firebird} \
   78     --disable-{avahi,ccache,cmis,dconf,dependency-tracking,extension-update,fetch-external,firebird-sdbc} \
   79     --disable-{poppler,postgresql-sdbc,report-builder,sdremote-bluetooth,skia,werror,zxing}
   80 
   81   touch {sources.ver,src.downloaded}
   82   echo "lo_sources_ver=${version}" > sources.ver
   83   make
   84 
   85   pushd workdir/installation/LibreOffice/archive/install/en-US
   86   tar xf *.tar.gz
   87   popd
   88 
   89   make DESTDIR=$PKG distro-pack-install
   90 
   91   install -dm755 $PKG/usr/etc/libreoffice
   92   install -m644 $PKG/usr/lib/libreoffice/program/{bootstraprc,sofficerc} \
   93     $PKG/usr/etc/libreoffice/
   94   install -m644 $PKG/usr/lib/libreoffice/share/psprint/psprint.conf \
   95     $PKG/usr/etc/libreoffice/
   96 
   97   # install dummy links to make them found by lo
   98   cd $PKG/usr/lib/libreoffice/program/
   99   ln -vsrf $PKG/usr/etc/libreoffice/{bootstraprc,sofficerc} .
  100 
  101   # cleanup {{{
  102   rm -r $PKG/usr/share/libreoffice/sdk
  103   rm -r $PKG/usr/lib/libreoffice/sdk
  104   rm -r $PKG/usr/share/doc
  105   find $PKG -iname "*readme*" -exec rm -fr '{}' \+
  106   # }}}
  107 }

Generated by cgit