perl-HTML-Tagset: new package

Signed-off-by: Naveen M K <naveen@syrusdark.website>
This commit is contained in:
Naveen M K
2021-04-18 01:16:32 +05:30
parent 7596a16565
commit 53954b6bbf
2 changed files with 55 additions and 0 deletions

View File

@@ -0,0 +1,36 @@
# Maintainer: @naveen521kk on Github, Naveen M K <naveen@syrusdark.website>
_realname=HTML-Tagset
pkgbase=mingw-w64-perl-${_realname}
pkgname=("${MINGW_PACKAGE_PREFIX}-perl-${_realname}")
pkgver=3.20
pkgrel=1
pkgdesc="data tables useful in parsing HTML (mingw-w64)"
arch=('any')
url="https://metacpan.org/release/${_realname}"
groups=("${MINGW_PACKAGE_PREFIX}-perl-modules")
depends=(
"${MINGW_PACKAGE_PREFIX}-perl"
)
options=('!emptydirs')
makedepends=("${MINGW_PACKAGE_PREFIX}-python")
license=(unknown)
source=(
"https://cpan.metacpan.org/authors/id/P/PE/PETDANCE/${_realname}-${pkgver}.tar.gz"
"patchmakefile.py"
)
sha512sums=('b53c099a96b493c3d03c51fcf3d58dd3b830069583f2d07477175ea234c43e91a0b380c82a71126f971faf2768e832af34967d08d899db7653d65613d6530072'
'd7ec5ba4a3d75f674f4028e8a53bc4177ab71a379bc63affebf910e1d5a0e491b6642318218b55ddc4d90e0125d61e4b97626782af57d44522bcb5543fb21cb2')
build() {
cd "$srcdir/${_realname}-${pkgver}"
PERL_MM_USE_DEFAULT=1 perl Makefile.PL
export pkgdir=$pkgdir
python $srcdir/patchmakefile.py
mingw32-make
}
package() {
cd "$srcdir/${_realname}-${pkgver}"
mingw32-make DESTDIR="${pkgdir}/" install
}

View File

@@ -0,0 +1,19 @@
import re
import os
from pathlib import Path
prefix = "\\".join(os.getenv('MINGW_PREFIX','C:\\msys64\\mingw64').split('/')[:-1]) + '\\'
prefix = prefix.replace('\\','\\\\') # needed for regex
pkgdir = os.getenv("pkgdir").replace('/','\\')
reg = re.compile(f'(?P<key>INSTALL(\S*)) = {prefix}(?P<value>\S*)')
def do(a: re.Match):
return f"{a.group('key')} = {a.group('value')}"
with open('Makefile') as f:
c = f.read()
c = reg.sub(do,c)
with open('Makefile','w') as f:
f.write(c)