summarylogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--.SRCINFO4
-rw-r--r--PKGBUILD30
-rw-r--r--protoc-gen-nanopb14
3 files changed, 36 insertions, 12 deletions
diff --git a/.SRCINFO b/.SRCINFO
index 3bb4e97fc868..f83581a062ff 100644
--- a/.SRCINFO
+++ b/.SRCINFO
@@ -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
diff --git a/PKGBUILD b/PKGBUILD
index b69fc0f3c41c..677d4699d6e1 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -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
+