summaryrefslogtreecommitdiff
path: root/libreoffice/Pkgfile
blob: 80ea9cc317ad8c0ce5226333a32be802f465915b (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: abseil-cpp box2d clucene fakeroot fontforge graphite2 gst-plugins-base hyphen icu libabw libcdr libcuckoo libe-book libepubgen libetonyek libexttextcat 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.3.4.2
    9 release=1
   10 pdfiumversion=4699
   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   # optionals {{{
   56   prt-get isinst avahi && PKGMK_LIBREOFFICE+=' --enable-avahi' || PKGMK_LIBREOFFICE+=' --disable-avahi'
   57   #prt-get isinst box2d && PKGMK_LIBREOFFICE+=' --with-system-box2d' || PKGMK_LIBREOFFICE+=' --without-system-box2d'
   58   #prt-get isinst ccache && PKGMK_LIBREOFFICE+=' --enable-ccache' || PKGMK_LIBREOFFICE+=' --disable-ccache'
   59   prt-get isinst ccache && export CCACHE_CPP2=1
   60   #prt-get isinst clucene && PKGMK_LIBREOFFICE+=' --with-system-clucene' || PKGMK_LIBREOFFICE+=' --without-system-clucene'
   61   prt-get isinst coin-or-mp && PKGMK_LIBREOFFICE+=' --with-system-coinmp' || PKGMK_LIBREOFFICE+=' --disable-coinmp'
   62   prt-get isinst cups && PKGMK_LIBREOFFICE+=' --enable-cups' || PKGMK_LIBREOFFICE+=' --disable-cups'
   63   prt-get isinst gpgme && PKGMK_LIBREOFFICE+=' --enable-gpgmepp' || PKGMK_LIBREOFFICE+=' --disable-gpgmepp'
   64   prt-get isinst dconf && PKGMK_LIBREOFFICE+=' --enable-dconf' || PKGMK_LIBREOFFICE+=' --disable-dconf'
   65   #prt-get isinst gtk4 && PKGMK_LIBREOFFICE+=' --enable-gtk4'
   66   prt-get isinst kio && PKGMK_LIBREOFFICE+=' --enable-kde5 --enable-gtk3-kde5'
   67   #prt-get isinst libstaroffice && PKGMK_LIBREOFFICE+=' --with-system-libstaroffice' || PKGMK_LIBREOFFICE+=' --without-system-libstaroffice'
   68   #prt-get isinst libtommath && PKGMK_LIBREOFFICE+= ' --with-system-libtommath' || PKGMK_LIBREOFFICE+=' --without-system-libtommath'
   69   prt-get isinst lpsolve && PKGMK_LIBREOFFICE+=' --enable-lpsolve' || PKGMK_LIBREOFFICE+=' --disable-lpsolve'
   70   prt-get isinst mariadb || PKGMK_LIBREOFFICE+=' --disable-mariadb-sdbc'
   71   prt-get isinst openldap || PKGMK_LIBREOFFICE+=' --disable-ldap'
   72   prt-get isinst postgresql || PKGMK_LIBREOFFICE+=' --disable-postgresql-sdbc'
   73   prt-get isinst python3-lxml || PKGMK_LIBREOFFICE+=' --without-lxml'
   74   prt-get isinst qt5 && PKGMK_LIBREOFFICE+=' --enable-qt5' || PKGMK_LIBREOFFICE+=' --disable-qt5'
   75   #prt-get isinst qt6-base && PKGMK_LIBREOFFICE+=' --enable-qt6' || PKGMK_LIBREOFFICE+=' --disable-qt6'
   76   prt-get isinst sane && PKGMK_LIBREOFFICE+=' --with-system-sane' || PKGMK_LIBREOFFICE+=' --without-system-sane'
   77   prt-get isinst valgrind && PKGMK_LIBREOFFICE+=' --with-valgrind'
   78   # }}}
   79 
   80   local build_date=$(date +%Y%m%d)
   81   NOCONFIGURE=1 ./autogen.sh
   82   ./configure $PKGMK_LIBREOFFICE \
   83     --with-parallelism=${JOBS-1} \
   84     --prefix=/usr \
   85     --with-external-tar="$SRC/tarballs" \
   86     --enable-{build-opensymbol,dbus,firebird-sdbc=no,gtk3,introspection=yes} \
   87     --enable-{ld=gold,lto,odk,openssl,pdfium,python=system,release-build} \
   88     --with-{lang="",package-format=archive,myspell-dicts} \
   89     --with-extra-buildid="$(crux | awk '{ print $1 " " $3 }') ${build_date}" \
   90     --with-package-version="$version" \
   91     --with-system-{headers,libs} \
   92     --with-external-dict-dir=/usr/share/hunspell \
   93     --with-external-hyph-dir=/usr/share/hypen \
   94     --with-external-thes-dir=/usr/share/mythes \
   95     --without-{doxygen,fonts,gssapi,help,helppack-integration,java,system-firebird} \
   96     --disable-{ccache,cmis,dependency-tracking,extension-update,fetch-external,firebird-sdbc} \
   97     --disable-{online-update,poppler,report-builder,sdremote-bluetooth,skia,werror,zxing}
   98 
   99   touch {sources.ver,src.downloaded}
  100   echo "lo_sources_ver=${version}" > sources.ver
  101   make
  102 
  103   pushd workdir/installation/LibreOffice/archive/install/en-US
  104   tar xf *.tar.gz
  105   popd
  106 
  107   make DESTDIR=$PKG distro-pack-install
  108 
  109   install -dm755 $PKG/usr/etc/libreoffice
  110   install -m644 $PKG/usr/lib/libreoffice/program/{bootstraprc,sofficerc} \
  111     $PKG/usr/etc/libreoffice/
  112   install -m644 $PKG/usr/lib/libreoffice/share/psprint/psprint.conf \
  113     $PKG/usr/etc/libreoffice/
  114 
  115   # install dummy links to make them found by lo
  116   cd $PKG/usr/lib/libreoffice/program/
  117   ln -vsrf $PKG/usr/etc/libreoffice/{bootstraprc,sofficerc} .
  118 
  119   # cleanup {{{
  120   rm -r $PKG/usr/share/{doc,libreoffice/sdk}
  121   rm -r $PKG/usr/lib/libreoffice/sdk
  122   find $PKG -iname "*readme*" -exec rm -fr '{}' \+
  123   # }}}
  124 }

Generated by cgit