summaryrefslogtreecommitdiff
path: root/libreoffice/Pkgfile
blob: 45331eb3eacd336e575c0ef314ad18beb48a5f4a (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   bison.patch)
   21 
   22 # unpack_source() {{{
   23 unpack_source() {
   24   mkdir $SRC/tarballs
   25   for file in ${source[@]}; do
   26     case ${file##*/} in
   27       libreoffice-*.tar.xz)
   28         echo "Unpacking $(get_filename $file)"
   29         bsdtar -p -o -C $SRC -xf $(get_filename $file) ;;
   30       185d60944ea767075d27247c3162b3bc-unowinreg.dll|\
   31       pdfium-$pdfiumversion.tar.bz2|\
   32       dtoa-20180411.tgz|\
   33       skia-m90-45c57e116ee0ce214bdf78405a4762722e4507d9.tar.xz|\
   34       libcmis-0.5.2.tar.xz|\
   35       0168229624cfac409e766913506961a8-ucpp-1.3.2.tar.gz)
   36         echo "Moving $(get_filename $file) to $SRC/tarballs"
   37         cp $(get_filename $file) $SRC/tarballs ;;
   38       *)
   39         cp $(get_filename $file) $SRC ;;
   40     esac
   41   done
   42 }
   43 # }}}
   44 
   45 build() {
   46   # fail the build if dependencies are not met {{{
   47   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)
   48   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)
   49   # }}}
   50 
   51   cd $name-$version
   52 
   53   patch -Np1 -i $SRC/makefile.in.patch
   54   patch -Np1 -i $SRC/bison.patch
   55 
   56   # https://sources.debian.org/patches/libreoffice/1:7.1.4%7Erc1-1/pdfium-use-system-libopenjpeg.diff/
   57   patch -Np1 -i $SRC/pdfium-use-system-libopenjpeg.diff
   58 
   59   # optionals {{{
   60   prt-get isinst cups && PKGMK_LIBREOFFICE+=" --enable-cups" || PKGMK_LIBREOFFICE+=" --disable-cups"
   61   prt-get isinst kio && PKGMK_LIBREOFFICE+=" --enable-kde5 --enable-gtk3-kde5"
   62   prt-get isinst openldap || PKGMK_LIBREOFFICE+=' --disable-ldap'
   63   prt-get isinst qt5 && PKGMK_LIBREOFFICE+=" --enable-qt5" || PKGMK_LIBREOFFICE+=" --disable-qt5"
   64   prt-get isinst valgrind && PKGMK_LIBREOFFICE+=" --with-valgrind"
   65   # }}}
   66 
   67   local build_date=$(date +%Y%m%d)
   68   ./autogen.sh $PKGMK_LIBREOFFICE \
   69     --with-parallelism=${JOBS-1} \
   70     --prefix=/usr \
   71     --with-external-tar="$SRC/tarballs" \
   72     --enable-{build-opensymbol,dbus,firebird-sdbc=no,gtk3,introspection=yes,release-build,odk,openssl,pdfium,python=system} \
   73     --with-{lang="",package-format=archive,myspell-dicts,parallelism} \
   74     --with-extra-buildid="$(crux | awk '{ print $1 " " $3 }') ${build_date}" \
   75     --with-package-version="$version" \
   76     --with-system-{headers,libs} \
   77     --with-external-dict-dir=/usr/share/hunspell \
   78     --with-external-hyph-dir=/usr/share/hypen \
   79     --with-external-thes-dir=/usr/share/mythes \
   80     --without-{doxygen,fonts,gssapi,help,helppack-integration,java,system-firebird} \
   81     --disable-{avahi,ccache,cmis,dconf,dependency-tracking,extension-update,fetch-external,firebird-sdbc} \
   82     --disable-{poppler,postgresql-sdbc,report-builder,sdremote-bluetooth,skia,werror,zxing}
   83 
   84   touch {sources.ver,src.downloaded}
   85   echo "lo_sources_ver=${version}" > sources.ver
   86   make
   87 
   88   pushd workdir/installation/LibreOffice/archive/install/en-US
   89   tar xf *.tar.gz
   90   popd
   91 
   92   make DESTDIR=$PKG distro-pack-install
   93 
   94   install -dm755 $PKG/usr/etc/libreoffice
   95   install -m644 $PKG/usr/lib/libreoffice/program/{bootstraprc,sofficerc} \
   96     $PKG/usr/etc/libreoffice/
   97   install -m644 $PKG/usr/lib/libreoffice/share/psprint/psprint.conf \
   98     $PKG/usr/etc/libreoffice/
   99 
  100   # install dummy links to make them found by lo
  101   cd $PKG/usr/lib/libreoffice/program/
  102   ln -vsrf $PKG/usr/etc/libreoffice/{bootstraprc,sofficerc} .
  103 
  104   # cleanup {{{
  105   rm -r $PKG/usr/share/libreoffice/sdk
  106   rm -r $PKG/usr/lib/libreoffice/sdk
  107   rm -r $PKG/usr/share/doc
  108   find $PKG -iname "*readme*" -exec rm -fr '{}' \+
  109   # }}}
  110 }

Generated by cgit