diff options
-rw-r--r-- | .SRCINFO | 20 | ||||
-rw-r--r-- | PKGBUILD | 75 |
2 files changed, 95 insertions, 0 deletions
diff --git a/.SRCINFO b/.SRCINFO new file mode 100644 index 000000000000..7d2db40a3777 --- /dev/null +++ b/.SRCINFO @@ -0,0 +1,20 @@ +pkgbase = parsergen + pkgdesc = LR1/GLR parser generator into Modern C++ code which must be built with bux library + pkgver = VERSION + pkgrel = 1 + url = https://github.com/buck-yeh/parsergen.git + arch = x86_64 + license = MIT + makedepends = cmake + makedepends = make + makedepends = gcc + makedepends = git + makedepends = binutils + makedepends = fakeroot + makedepends = sed + makedepends = gawk + depends = fmt + optdepends = bux: To build the generated code with + +pkgname = parsergen + diff --git a/PKGBUILD b/PKGBUILD new file mode 100644 index 000000000000..a20321f28def --- /dev/null +++ b/PKGBUILD @@ -0,0 +1,75 @@ +# This is an example PKGBUILD file. Use this as a start to creating your own, +# and remove these comments. For more information, see 'man PKGBUILD'. +# NOTE: Please fill out the license field for your package! If it is unknown, +# then please put 'unknown'. + +# Maintainer: Buck Yeh <buck.yeh at gmail dot com> +pkgname=parsergen +pkgver=VERSION +pkgrel=1 +epoch= +pkgdesc='LR1/GLR parser generator into Modern C++ code which must be built with bux library' +arch=('x86_64') +url='https://github.com/buck-yeh/parsergen.git' +license=('MIT') +groups=() +depends=('fmt') +makedepends=('cmake' 'make' 'gcc' 'git' 'binutils' 'fakeroot' 'sed' 'gawk') +checkdepends=() +optdepends=('bux: To build the generated code with') +provides=() +conflicts=() +replaces=() +backup=() +options=() +install= +changelog= +source=() #"$pkgname-$pkgver.tar.gz") +noextract=() +md5sums=() +validpgpkeys=() + +prepare() { + rm -Rf "$pkgname" + mkdir -p "$pkgname" + cd "$pkgname" || return 1 + git clone -b main --single-branch $url . +} + +pkgver() { + cd "$pkgname" || return 1 + _ret= + for i in $(sed -n ' +s/^ *VERSION_MAJOR *= *\([0-9][0-9]*\).*/\1/p +s/^ *VERSION_MINOR *= *\([0-9][0-9]*\).*/.\1/p +s/^ *VERSION_RELEASE *= *\([0-9][0-9]*\).*/.\1/p +' ParserGen/main.cpp); do _ret="$_ret$i"; done + echo "$_ret" + } + +build() { + cd "$pkgname" || return 1 + cmake . + make -j +} + +check() { + cd "$pkgname" || return 1 + for i in ParserGen/parsergen ParserGen/grammarstrip ScannerGen/scannergen; do + if [[ ! -x "$i" ]]; then + return 1 + fi + done + if [[ ! -f ScannerGen/RE_Suite.txt ]]; then + return 1 + fi +} + +package() { + cd "$pkgname" || return 1 + mkdir -p "$pkgdir/usr/bin" + mkdir -p "$pkgdir/usr/share/$pkgname" + for i in ParserGen/parsergen ParserGen/grammarstrip ScannerGen/scannergen; do cp "$i" "$pkgdir/usr/bin/"; done + cp ScannerGen/RE_Suite.txt "$pkgdir/usr/share/$pkgname/" + install -Dm644 LICENSE "$pkgdir/usr/share/licenses/$pkgname/LICENSE" +} |