void-packages/srcpkgs/tidy5/template
Đoàn Trần Công Danh 4f75cf25fd srcpkgs/t*: convert patches to -Np1
```sh
git grep -l '^patch_args=-Np0' "srcpkgs/$1*/template" |
while read template; do
	for p in ${template%/template}/patches/*; do
		sed -i '
			\,^[+-][+-][+-] /dev/null,b
			/^[*-]\+ [0-9]\+\(,[0-9]\+\)\? [*-]\+$/b
			s,^[*][*][*] ,&a/,
			/^--- /{
				s,\(^--- \)\(./\)*,\1a/,
				s,[.-][Oo][Rr][Ii][Gg]\([	/]\),\1,
				s/[.-][Oo][Rr][Ii][Gg]$//
				s/[.]patched[.]\([^.]\)/.\1/
				h
			}
			/^+++ -/{
				g
				s/^--- a/+++ b/
				b
			}
			s,\(^+++ \)\(./\)*,\1b/,
		' "$p"
	done
	sed -i '/^patch_args=/d' $template
done
```
2021-06-20 13:17:29 +07:00

58 lines
1.3 KiB
Bash

# Template file for 'tidy5'
pkgname=tidy5
version=5.7.28
revision=1
_reponame=tidy-html5
wrksrc="${_reponame}-${version}"
build_style=cmake
configure_args="-DTIDY_CONSOLE_SHARED=ON"
cmake_builddir=build/cmake
hostmakedepends="libxslt"
short_desc="Tool to tidy down your HTML/HTML5 code to a clean style"
maintainer="Leah Neukirchen <leah@vuxu.org>"
license="W3C"
homepage="http://www.htacg.org/${_reponame}/"
distfiles="https://github.com/htacg/${_reponame}/archive/${version}.tar.gz"
checksum=5caa2c769204f506e24ea4986a45abe23f71d14f0fe968314f20065f342ffdba
provides="tidy-${version}_${revision}"
replaces="tidy>0"
pre_configure() {
# the $(man) target requires tidy5 to run on the host
ln -s ${cmake_builddir}/tidy
if [ -n "$CROSS_BUILD" ]; then
rm -f tidy
cd ${cmake_builddir}
env - PATH=/usr/bin cmake -DBUILD_SHARED_LIB:BOOL=FALSE ${wrksrc}
make ${makejobs} tidy
cp tidy ${wrksrc}
cd ${wrksrc}
rm -rf ${cmake_builddir}
fi
}
post_install() {
vlicense README/LICENSE.md LICENSE
ln -s tidy ${DESTDIR}/usr/bin/tidy5
}
libtidy5_package() {
short_desc+=" - library files"
pkg_install() {
vmove usr/lib/*.so.*
}
}
libtidy5-devel_package() {
depends="libtidy5>=${version}_${revision}"
short_desc+=" - development files"
pkg_install() {
vmove usr/include
vmove usr/lib/*.a
vmove usr/lib/*.so
vmove usr/lib/pkgconfig
}
}