void-packages/srcpkgs/stlink/template
Đoàn Trần Công Danh 4b97cd2fb4 srcpkgs/s*: 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

42 lines
1.2 KiB
Bash

# Template file for 'stlink'
pkgname=stlink
version=1.6.1
revision=1
build_style=cmake
configure_args="-DSTLINK_UDEV_RULES_DIR=/usr/lib/udev/rules.d -DSTLINK_MODPROBED_DIR=/usr/lib/modprobe.d
-DSTLINK_LIBRARY_PATH=/usr/lib"
hostmakedepends="pkg-config"
makedepends="libusb-devel gtk+3-devel"
short_desc="STM32 discovery line Linux programmer"
maintainer="bra1nwave <bra1nwave@protonmail.com>"
license="BSD-3-Clause"
homepage="https://github.com/texane/stlink"
changelog="https://raw.githubusercontent.com/texane/stlink/master/CHANGELOG.md"
distfiles="${homepage}/archive/v${version}.tar.gz"
checksum=ca9a640f84c3e2c9873bd51759594bc05c00cdf6e1f21b434ae2c0e7985433d8
post_install() {
vlicense LICENSE.md LICENSE
vdoc README.md README
}
stlink-devel_package() {
short_desc+=" - development files"
depends="${sourcepkg}>=${version}_${revision}"
pkg_install() {
vmove usr/include
vmove "usr/lib/*.so"
vmove "usr/lib/*.a"
vmove usr/lib/pkgconfig
}
}
stlink-gtk_package() {
short_desc+=" - GTK+3 frontend"
depends="${sourcepkg}>=${version}_${revision} hicolor-icon-theme desktop-file-utils"
pkg_install() {
vmove usr/share/applications/stlink-gui.desktop
vmove usr/share/icons/hicolor/scalable/apps/stlink-gui.svg
vmove "usr/bin/stlink-gui*"
}
}