| # Maintainer: @naveen521kk on Github, Naveen M K <naveen@syrusdark.website> |
| |
| _realname=texlive-metapost |
| pkgbase=mingw-w64-${_realname} |
| pkgname="${MINGW_PACKAGE_PREFIX}-${_realname}" |
| pkgver=2021.20210519 |
| _revnr=${pkgver#2021.} |
| pkgrel=2 |
| pkgdesc="TeX Live - MetaPost and Metafont packages (mingw-w64)" |
| license=('GPL') |
| arch=('any') |
| mingw_arch=('mingw32' 'mingw64' 'ucrt64' 'clang64') |
| depends=( |
| "${MINGW_PACKAGE_PREFIX}-texlive-core" |
| ) |
| groups=( |
| "${MINGW_PACKAGE_PREFIX}-texlive-full" |
| "${MINGW_PACKAGE_PREFIX}-texlive-scheme-context" |
| "${MINGW_PACKAGE_PREFIX}-texlive-scheme-full" |
| "${MINGW_PACKAGE_PREFIX}-texlive-scheme-gust" |
| "${MINGW_PACKAGE_PREFIX}-texlive-scheme-medium" |
| "${MINGW_PACKAGE_PREFIX}-texlive-scheme-small" |
| "${MINGW_PACKAGE_PREFIX}-texlive-scheme-tetex" |
| ) |
| url='http://tug.org/texlive/' |
| source=("${_realname}-${_revnr}.tar.xz::https://github.com/msys2/msys2-texlive/releases/download/${_revnr}/${_realname}-${_revnr}.tar.xz" |
| "${_realname}-extra-files.tar.xz::https://github.com/msys2/msys2-texlive/releases/download/${_revnr}/${_realname}-extra-files.tar.xz") |
| options=('!emptydirs') |
| sha256sums=( |
| "abfc5cf572b8ca84206a035496abd85947019090313690111c7aa452e5da7e18" |
| "bb584404a647a0c449646e61397e14efe6354bf4b914f5d7c1dee61b69fea9f2" |
| ) |
| |
| build() { |
| for p in *.tar.xz; do |
| bsdtar -xf $p |
| echo $p |
| done |
| rm -rf {tlpkg,doc,source} || true |
| } |
| |
| copy_file_message() { |
| local from="$1" |
| local to="$2" |
| msg2 "Copying $from to $to" |
| cp $from $to |
| } |
| |
| package() { |
| msg "Installing Package" |
| |
| # Install packages. |
| install -m755 -d "${pkgdir}${MINGW_PREFIX}/var/lib/texmf/msys2/installedpkgs" |
| sed -i '/^#/d' CONTENTS |
| install -m644 CONTENTS "${pkgdir}${MINGW_PREFIX}/var/lib/texmf/msys2/installedpkgs/${pkgname}_${_revnr}.pkgs" |
| install -m644 ${_realname}.maps "${pkgdir}${MINGW_PREFIX}/var/lib/texmf/msys2/installedpkgs/" |
| install -m644 ${_realname}.fmts "${pkgdir}${MINGW_PREFIX}/var/lib/texmf/msys2/installedpkgs/" |
| |
| # language files for hooks |
| sed -i 's/\% test//' ${_realname}.dat |
| install -m644 ${_realname}.dat "${pkgdir}${MINGW_PREFIX}/var/lib/texmf/msys2/installedpkgs/" |
| |
| sed -i 's/-- test//' ${_realname}.dat.lua |
| install -m644 ${_realname}.dat.lua "${pkgdir}${MINGW_PREFIX}/var/lib/texmf/msys2/installedpkgs/" |
| |
| sed -i 's/\% test//' ${_realname}.def |
| install -m644 ${_realname}.def "${pkgdir}${MINGW_PREFIX}/var/lib/texmf/msys2/installedpkgs/" |
| |
| install -m755 -d "${pkgdir}${MINGW_PREFIX}/share" |
| wanteddirs=$(for d in *; do test -d $d && [[ $d != texmf* ]] && echo $d; done) || true |
| for dir in $wanteddirs; do |
| find $dir -type d -exec install -d -m755 "${pkgdir}${MINGW_PREFIX}"/share/texmf-dist/'{}' \; |
| find $dir -type f -exec install -m644 '{}' "${pkgdir}${MINGW_PREFIX}"/share/texmf-dist/'{}' \; |
| done |
| |
| if [[ -d texmf-dist ]]; then |
| find texmf-dist -type d -exec install -d -m755 "${pkgdir}${MINGW_PREFIX}"/share/'{}' \; |
| find texmf-dist -type f -exec install -m644 '{}' "${pkgdir}${MINGW_PREFIX}"/share/'{}' \; |
| fi |
| if [[ -d "$pkgdir"/share/texmf-dist/scripts ]]; then |
| find "${pkgdir}${MINGW_PREFIX}"/share/texmf-dist/scripts -type f -exec chmod a+x '{}' \; |
| fi |
| install -d -m755 "${pkgdir}${MINGW_PREFIX}/etc/texmf/chktex/" |
| |
| |
| msg "Creating Launchers." |
| # get the list from |
| # this should be in source. |
| # remove comment |
| sed -i 's/# This file contains linked scripts list for the package.//' "${srcdir}/${_realname}.scripts" |
| # remove useless files |
| sed -i /.*readme.*/d "${srcdir}/${_realname}.scripts" |
| |
| . "${srcdir}/${_realname}.scripts" |
| install -m755 -d "${pkgdir}${MINGW_PREFIX}"/bin |
| for _script in ${linked_scripts}; do |
| _scriptbase=$(basename $_script) |
| _scriptbase=${_scriptbase%.*} |
| install -D -m755 ${MINGW_PREFIX}/bin/runscript.exe "${pkgdir}${MINGW_PREFIX}/bin/${_scriptbase}.exe" |
| done |
| |
| } |