quasselc: add new package
authorBen Rosser <redacted>
Tue, 1 Nov 2016 02:19:25 +0000 (22:19 -0400)
committerYousong Zhou <redacted>
Thu, 24 Nov 2016 02:11:50 +0000 (20:11 -0600)
quasselc is a library providing an API to access a Quassel core
in pure C. Quassel is a distributed IRC client where the core
can run independently of the interface(s). This library provides
a C API for programs that wish to implement the Quassel protocol.

Signed-off-by: Ben Rosser <redacted>
libs/quasselc/Makefile [new file with mode: 0644]
libs/quasselc/patches/001-respect-cflags-ldflags.patch [new file with mode: 0644]

diff --git a/libs/quasselc/Makefile b/libs/quasselc/Makefile
new file mode 100644 (file)
index 0000000..3f1d014
--- /dev/null
@@ -0,0 +1,64 @@
+#
+# Copyright (C) 2016 Ben Rosser <rosser.bjr@gmail.com>
+#
+# This is free software, licensed under the GNU General Public License v2.
+# See /LICENSE for more information.
+#
+
+include $(TOPDIR)/rules.mk
+
+PKG_NAME:=quasselc
+
+# quasselc upstream doesn't release versions (at least, at the moment),
+# so use commit date for PKG_VERSION and embed commit hash into PKG_RELEASE.
+PKG_VERSION:=2015-04-06
+PKG_SOURCE_VERSION:=fcd966966924e3d9af0954db56117e2f48767ea1
+PKG_RELEASE:=1.$(PKG_SOURCE_VERSION)
+
+PKG_LICENSE:=GPL-3.0+
+
+PKG_SOURCE_PROTO:=git
+PKG_SOURCE_URL:=https://github.com/phhusson/QuasselC
+PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)
+PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.bz2
+
+PKG_MAINTAINER:=Ben Rosser <rosser.bjr@gmail.com>
+
+PKG_INSTALL:=1
+
+include $(INCLUDE_DIR)/package.mk
+
+MAKE_FLAGS += prefix=$(STAGING_DIR)/usr libdir=$(STAGING_DIR)/usr/lib includedir=$(STAGING_DIR)/usr/include
+MAKE_INSTALL_FLAGS += prefix=/usr libdir=/usr/lib includedir=/usr/include
+
+define Package/quasselc
+    SECTION:=libs
+    CATEGORY:=Libraries
+    DEPENDS:=+glib2
+    SUBMENU:=Instant Messaging
+    URL:=https://github.com/phhusson/QuasselC
+    TITLE:=API to access a Quassel Core in pure C
+endef
+
+define Package/quasselc/description
+  An implementation of the Quassel protocol in pure C.
+endef
+
+define Build/InstallDev
+       $(INSTALL_DIR) $(1)/usr/include/quasselc
+       $(CP) $(PKG_INSTALL_DIR)/usr/include/quasselc/* $(1)/usr/include/quasselc/
+
+       $(INSTALL_DIR) $(1)/usr/lib
+       $(CP) $(PKG_INSTALL_DIR)/usr/lib/libquasselc.so* $(1)/usr/lib/
+       $(LN) libquasselc.so.0 $(1)/usr/lib/libquasselc.so
+
+       $(INSTALL_DIR) $(1)/usr/lib/pkgconfig
+       $(CP) $(PKG_INSTALL_DIR)/usr/lib/pkgconfig/quasselc.pc $(1)/usr/lib/pkgconfig/
+endef
+
+define Package/quasselc/install
+       $(INSTALL_DIR) $(1)/usr/lib
+       $(CP) $(PKG_INSTALL_DIR)/usr/lib/libquasselc.so* $(1)/usr/lib/
+endef
+
+$(eval $(call BuildPackage,quasselc))
diff --git a/libs/quasselc/patches/001-respect-cflags-ldflags.patch b/libs/quasselc/patches/001-respect-cflags-ldflags.patch
new file mode 100644 (file)
index 0000000..7ffbb80
--- /dev/null
@@ -0,0 +1,18 @@
+diff --git a/Makefile b/Makefile
+index 7994eea..b1f8d83 100644
+--- a/Makefile
++++ b/Makefile
+@@ -2,11 +2,11 @@ prefix ?= /usr/local
+ libdir ?= $(prefix)/lib
+ includedir ?= $(prefix)/include
+-CFLAGS:=-Wall -g -Wextra $(shell pkg-config glib-2.0 --cflags) -Wswitch-enum -std=gnu11 -O2 -fPIC
++CFLAGS+=-Wall -g -Wextra $(shell pkg-config glib-2.0 --cflags) -Wswitch-enum -std=gnu11 -fPIC
+ SO_VERSION = 0
+ VERSION = 0
+ INSTALL = install
+-LDLIBS:=$(shell pkg-config glib-2.0 --libs) -lz
++LDLIBS+=$(shell pkg-config glib-2.0 --libs) -lz
+ BOTLIBS := -Wl,-rpath,.
git clone https://git.99rst.org/PROJECT