void-packages/srcpkgs/openblas/template
Đoàn Trần Công Danh 2fd8d4df94 srcpkgs/o*: 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

51 lines
1.7 KiB
Bash

# Template file for 'openblas'
pkgname=openblas
version=0.3.13
revision=3
wrksrc="OpenBLAS-${version}"
build_style=gnu-makefile
make_build_args=" HOSTCC=gcc USE_OPENMP=1"
hostmakedepends="perl gcc-fortran"
makedepends="libgomp-devel"
short_desc="Basic Linear Algebra Subprograms based on GotoBLAS2"
maintainer="Julien Dehos <dehos@lisic.univ-littoral.fr>"
license="BSD-3-Clause"
homepage="https://www.openblas.net/"
changelog="https://raw.githubusercontent.com/xianyi/OpenBLAS/v${version}/Changelog.txt"
distfiles="https://github.com/xianyi/OpenBLAS/archive/v${version}.tar.gz"
checksum=79197543b17cc314b7e43f7a33148c308b0807cd6381ee77f77e15acf3e6459e
case "${XBPS_TARGET_MACHINE}" in
armv5*) make_build_args+=" TARGET=ARMV5" ;;
armv6*) make_build_args+=" TARGET=ARMV6" ;;
armv7*) make_build_args+=" TARGET=ARMV7" ;;
aarch64*) make_build_args+=" TARGET=ARMV8 DYNAMIC_ARCH=1" ;;
i686*) make_build_args+=" BINARY=32 TARGET=GENERIC DYNAMIC_ARCH=1" ;;
x86_64*) make_build_args+=" BINARY=64 TARGET=GENERIC DYNAMIC_ARCH=1" ;;
ppc64le*) make_build_args+=" TARGET=POWER8 DYNAMIC_ARCH=1" ;;
ppc64*) make_build_args+=" TARGET=PPC970MP" ;; # dynamic arch broken for <power6
ppc*) make_build_args+=" TARGET=PPCG4" ;;
mips*) broken="Not supported" ;;
*) broken="Add your CPU" ;;
esac
post_extract() {
vsed -i 's#OPENBLAS_INCLUDE_DIR := .*$#OPENBLAS_INCLUDE_DIR := $(PREFIX)/include/openblas#' Makefile.install
}
post_install() {
vlicense LICENSE
}
openblas-devel_package() {
depends="${sourcepkg}>=${version}_${revision}"
short_desc+=" - development files"
pkg_install() {
vmove usr/include/openblas
vmove usr/lib/cmake
vmove usr/lib/pkgconfig
vmove "usr/lib/*.a"
vmove usr/lib/libopenblas.so
}
}