Hello, This patch adds the Protobuf library into feeds/packages.
Protobuf ( http://code.google.com/p/protobuf/ ) is a way of encoding structured data in an efficient yet extensible format. Google uses Protocol Buffers for almost all of its internal RPC protocols and file formats. It's vaguely similar to rpcgen, in a (wicked) way, but for C++/python or Java (Here in OpenWRT only C++ is built) I've tested it on Atheros and BCM63xx plateforms, on OpenWRT trunk. Note: I'm *not* very happy with my work on this: Building this package create the "protoc" tool to create some C++ files. But since it is cross-compiling, of course the protoc tool that is build is made for the target. So, later during the build, when the protoc tool is invoked on the host the compilation failed, since it's not able to execute this binary file. The solution I have now is to force the user to have the protobuf package installed on its development host, and force its usage by passing a ./configure option. Rather unacceptable.... So I'm taking any advice or exemple concerning this problem, and I will create a second version of this patch to correct this behaviour. Thanks.
diff --git a/libs/protobuf/Makefile b/libs/protobuf/Makefile new file mode 100644 index 0000000..0741c3b --- /dev/null +++ b/libs/protobuf/Makefile @@ -0,0 +1,53 @@ +# +# Copyright (C) 2007 OpenWrt.org +# +# This is free software, licensed under the GNU General Public License v2. +# See /LICENSE for more information. +# + +include $(TOPDIR)/rules.mk + +PKG_NAME:=protobuf +PKG_VERSION:=2.4.1 +PKG_RELEASE:=1 + +PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2 +PKG_SOURCE_URL:=http://protobuf.googlecode.com/files +PKG_MD5SUM:=ed436802019c9e1f40cc750eaf78f318 + +include $(INCLUDE_DIR)/package.mk + +define Package/protobuf + SECTION:=libs + CATEGORY:=Libraries + TITLE:=A structured data encoding library + URL:=http://code.google.com/p/protobuf/ + DEPENDS:=+zlib + MAINTAINER:=Obinou <obcons...@gmail.com> +endef + +define Package/protobuf/description + Protocol Buffers are a way of encoding structured data in an efficient + yet extensible format. Google uses Protocol Buffers for almost all + of its internal RPC protocols and file formats. +endef + +CONFIGURE_ARGS += --prefix=/usr --with-protoc=/usr/bin/protoc + +define Build/Compile + $(MAKE) -C $(PKG_BUILD_DIR) + $(MAKE) -C $(PKG_BUILD_DIR) DESTDIR="$(PKG_INSTALL_DIR)" install +endef + +define Build/InstallDev + $(MAKE) -C $(PKG_BUILD_DIR) DESTDIR="$(1)" install +endef + +define Package/protobuf/install + $(INSTALL_DIR) $(1)/usr/lib + $(CP) $(PKG_INSTALL_DIR)/usr/lib/libprotoc.so* $(1)/usr/lib + $(CP) $(PKG_INSTALL_DIR)/usr/lib/libprotobuf-lite.so* $(1)/usr/lib + $(CP) $(PKG_INSTALL_DIR)/usr/lib/libprotobuf.so* $(1)/usr/lib +endef + +$(eval $(call BuildPackage,protobuf))
_______________________________________________ openwrt-devel mailing list openwrt-devel@lists.openwrt.org https://lists.openwrt.org/mailman/listinfo/openwrt-devel