```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 ```
33 lines
1 KiB
Bash
33 lines
1 KiB
Bash
# Template file for 'spim'
|
|
pkgname=spim
|
|
version=8.0
|
|
revision=3
|
|
build_wrksrc=spim
|
|
build_style=configure
|
|
configure_script="./Configure"
|
|
make_install_target="install install-man"
|
|
hostmakedepends="flex"
|
|
short_desc="Self-contained simulator/debugger that runs MIPS32 programs"
|
|
maintainer="Toyam Cox <vaelatern@gmail.com>"
|
|
license="BSD-3-Clause"
|
|
homepage="http://spimsimulator.sourceforge.net/"
|
|
distfiles="http://pages.cs.wisc.edu/~larus/SPIM/spim-${version}.tar.gz"
|
|
checksum="6f205776cb9fa112729507008843b289012190ed3131cbd426c610a58387ee4b"
|
|
|
|
pre_configure() {
|
|
sed '/Copyright (c) 1990-2010, James R. Larus./,+26!d' README > LICENSE
|
|
vsed -i Makefile \
|
|
-e 's:CFLAGS =:CFLAGS +=:' \
|
|
-e 's:LDFLAGS =:LDFLAGS +=:' \
|
|
-e 's:CC = gcc:CC ?= gcc:' \
|
|
-e 's:EXCEPTION_DIR = .*:EXCEPTION_DIR = /usr/share/spim:' \
|
|
-e 's:spim.man:spim.1:'
|
|
# EXCEPTION_DIR affects DEFAULT_EXCEPTION_HANDLER in spim.c
|
|
}
|
|
|
|
do_install() {
|
|
vbin spim
|
|
vman ../Documentation/spim.man spim.1
|
|
vlicense LICENSE LICENSE.BSD
|
|
vinstall ../CPU/exceptions.s 644 /usr/share/spim/
|
|
}
|