diff options
author | Gabriel-Andrew Pollo-Guilbert | 2019-12-16 17:14:26 -0500 |
---|---|---|
committer | Gabriel-Andrew Pollo-Guilbert | 2019-12-16 17:14:26 -0500 |
commit | 8c846c35053b425fb2cb93880d6be3a2b5a15c0a (patch) | |
tree | 4c6c17754534d08317dd36d356a011ccbb2af971 | |
parent | 84c66fa9a3c0785df9fd07c32f157df108467520 (diff) | |
download | aur-8c846c35053b425fb2cb93880d6be3a2b5a15c0a.tar.gz |
Only package generator
-rw-r--r-- | .SRCINFO | 4 | ||||
-rw-r--r-- | PKGBUILD | 30 | ||||
-rw-r--r-- | protoc-gen-nanopb | 14 |
3 files changed, 36 insertions, 12 deletions
@@ -1,7 +1,7 @@ pkgbase = nanopb-git pkgdesc = Protocol Buffers with small code size pkgver = r912.0ffccc4 - pkgrel = 1 + pkgrel = 2 url = https://github.com/nanopb/nanopb arch = i686 arch = x86_64 @@ -9,7 +9,9 @@ pkgbase = nanopb-git makedepends = cmake makedepends = git source = git+https://github.com/nanopb/nanopb.git + source = protoc-gen-nanopb md5sums = SKIP + md5sums = 7a2b8dc8978e9cc38ec19cc080e3690d pkgname = nanopb-git @@ -1,15 +1,21 @@ _pkgname=nanopb pkgname=${_pkgname}-git pkgver=r912.0ffccc4 -pkgrel=1 +pkgrel=2 pkgdesc='Protocol Buffers with small code size' arch=('i686' 'x86_64') url=https://github.com/nanopb/nanopb license=('zlib') depends=() makedepends=('cmake' 'git') -source=('git+https://github.com/nanopb/nanopb.git') -md5sums=('SKIP') +source=( + 'git+https://github.com/nanopb/nanopb.git' + 'protoc-gen-nanopb' +) +md5sums=( + 'SKIP' + '7a2b8dc8978e9cc38ec19cc080e3690d' +) prepare() { mkdir -p "${srcdir}/${_pkgname}/build" @@ -24,16 +30,18 @@ pkgver() { build() { cd "${srcdir}/${_pkgname}/build" - cmake .. -DCMAKE_INSTALL_PREFIX=${pkgdir} + cmake .. make } package() { - cd "${srcdir}/${_pkgname}/build" - - make install - - mkdir -p "${pkgdir}/usr" - mv "${pkgdir}/include" "${pkgdir}/usr/include" - mv "${pkgdir}/lib" "${pkgdir}/usr/lib" + cd "${srcdir}/${_pkgname}" + + mkdir -p "${pkgdir}/usr/bin" + install -m755 "${srcdir}/protoc-gen-nanopb" "${pkgdir}/usr/bin" + + mkdir -p "${pkgdir}/usr/lib/python2.7/proto" + install -m755 "generator/nanopb_generator.py" "${pkgdir}/usr/lib/python2.7" + install -m644 "build/nanopb_pb2.py" "${pkgdir}/usr/lib/python2.7/proto" + touch "${pkgdir}/usr/lib/python2.7/proto/__init__.py" } diff --git a/protoc-gen-nanopb b/protoc-gen-nanopb new file mode 100644 index 000000000000..b56d18759eaa --- /dev/null +++ b/protoc-gen-nanopb @@ -0,0 +1,14 @@ +#!/bin/sh + +# This file is used to invoke nanopb_generator.py as a plugin +# to protoc on Linux and other *nix-style systems. +# Use it like this: +# protoc --plugin=protoc-gen-nanopb=..../protoc-gen-nanopb --nanopb_out=dir foo.proto +# +# Note that if you use the binary package of nanopb, the protoc +# path is already set up properly and there is no need to give +# --plugin= on the command line. + +MYPATH=/usr/lib/python2.7 +exec python2 "$MYPATH/nanopb_generator.py" --protoc-plugin + |