Skip to contentSkip to conversation

package/libloki: new package

PATCH New Romain Naour 2 participants 2 messages May 6, 2017 – May 11, 2017

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 package/libloki: new package

From: Corentin GUILLEVIC <[email protected]>

A C++ library of designs, containing flexible implementations of common design patterns and idioms.

---
 DEVELOPERS                                         |  3 +
 package/Config.in                                  |  1 +
 ...stall-to-a-specific-location-using-DESTDI.patch | 65 ++++++++++++++++++++++
 package/libloki/0002-use-ln-snf.patch              | 31 +++++++++++
 package/libloki/Config.in                          | 12 ++++
 package/libloki/libloki.hash                       |  5 ++
 package/libloki/libloki.mk                         | 44 +++++++++++++++
 7 files changed, 161 insertions(+)
 create mode 100644 package/libloki/0001-allow-to-install-to-a-specific-location-using-DESTDI.patch
 create mode 100644 package/libloki/0002-use-ln-snf.patch
 create mode 100644 package/libloki/Config.in
 create mode 100644 package/libloki/libloki.hash
 create mode 100644 package/libloki/libloki.mk
DEVELOPERS +3 -0
index 8fbb69a..df47636 100644
@@ -361,6 +361,9 @@ F:	package/policycoreutils/
 F:	package/sepolgen/
 F:	package/ustr/
 
+N:	Corentin GUILLEVIC <[email protected]>
+F:	package/libloki/
+
 N:	C?dric Ch?pied <[email protected]>
 F:	package/znc/
 
package/Config.in +1 -0
index d57813c..a5e71ef 100644
@@ -1385,6 +1385,7 @@ menu "Other"
 	source "package/libical/Config.in"
 	source "package/libite/Config.in"
 	source "package/liblinear/Config.in"
+	source "package/libloki/Config.in"
 	source "package/libnpth/Config.in"
 	source "package/libnspr/Config.in"
 	source "package/libpfm4/Config.in"
package/libloki/0001-allow-to-install-to-a-specific-location-using-DESTDI.patch new file +65 -0

65 lines not on this page · raw message

package/libloki/0002-use-ln-snf.patch new file +31 -0
new file mode 100644
index 0000000..5b73d7f
@@ -0,0 +1,31 @@
+From 7fcaa080ef3fddb3f7dcfaf2984bc397d7c9e96c Mon Sep 17 00:00:00 2001
+From: Romain Naour <[email protected]>
+Date: Sat, 29 Apr 2017 22:27:26 +0200
+Subject: [PATCH] use ln -snf
+
+Otherwise the install step fail due to existing symlink.
+
+'libloki.so': File exists
+
+Signed-off-by: Romain Naour <[email protected]>
+Sigend-off-by: Corentin GUILLEVIC <[email protected]>
+---
+ src/Makefile | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/src/Makefile b/src/Makefile
+index 054285e..2c169ab 100644
+--- a/src/Makefile
++++ b/src/Makefile
+@@ -80,7 +80,7 @@ install-static: $(RESULT_DIR)$(STATIC_LIB)
+ install-shared: $(RESULT_DIR)$(SHARED_LIB_VERSIONED)
+ 	mkdir -p $(DESTDIR)$(prefix)/lib
+ 	$(INSTALL_DATA) $(RESULT_DIR)$(SHARED_LIB_VERSIONED) $(DESTDIR)$(prefix)/lib
+-	cd $(DESTDIR)$(prefix)/lib; ln -s $(SHARED_LIB_VERSIONED) $(SHARED_LIB_BASE)
++	cd $(DESTDIR)$(prefix)/lib; ln -snf $(SHARED_LIB_VERSIONED) $(SHARED_LIB_BASE)
+ 
+ %.lo : %.cpp
+ 	$(CXX) -c $(CXXFLAGS) -fPIC $(CPPFLAGS) -o $@ $<
+-- 
+2.9.3
+
package/libloki/Config.in new file +12 -0
new file mode 100644
index 0000000..7e9816b
@@ -0,0 +1,12 @@
+config BR2_PACKAGE_LIBLOKI
+	bool "libloki"
+	depends on BR2_INSTALL_LIBSTDCPP
+	depends on BR2_TOOLCHAIN_HAS_THREADS
+	help
+	  A C++ library of designs, containing flexible implementations
+	  of common design patterns and idioms.
+
+	  http://sourceforge.net/projects/loki-lib
+
+comment "libloki needs a toolchain w/ C++, threads"
+	depends on !BR2_INSTALL_LIBSTDCPP || !BR2_TOOLCHAIN_HAS_THREADS
package/libloki/libloki.hash new file +5 -0
new file mode 100644
index 0000000..52d67c8
@@ -0,0 +1,5 @@
+# From https://sourceforge.net/projects/loki-lib/files/Loki/Loki%200.1.7
+md5 33a24bcbb99fa2ec8fcbbab65649f3f6 loki-0.1.7.tar.bz2
+sha1 006c630217b1e1fd33015dc0597d2d743d8ee4e3 loki-0.1.7.tar.bz2
+# locally computed
+sha256 07553754f6be2738559947db69b0718512665bf4a34015fa3a875b6eb1111198 loki-0.1.7.tar.bz2
package/libloki/libloki.mk new file +44 -0

44 lines not on this page · raw message

Signature · 1 line
2.9.3
#1 lore raw

PATCH 1/1 package/libloki: new package

Hello,

package/libloki/libloki.mk line 42

Quoted 10 lines · Romain Naour
package/libloki/libloki.mk new file +10 -0
+# install to TARGET_DIR only the shared library
+ifeq ($(BR2_STATIC_LIBS),)
+define LIBLOKI_INSTALL_STAGING_SHARED_LIB
+	$(MAKE) -C $(@D)/src DESTDIR=$(TARGET_DIR) $(LIBLOKI_INSTALL_TARGETS)
+endef
+endif
+
+define LIBLOKI_INSTALL_TARGET_CMDS
+	$(LIBLOKI_INSTALL_STAGING_SHARED_LIB)
+endef

This was a bit unnecessarily complicated, calling:

	$(MAKE) -C $(@D)/src DESTDIR=$(TARGET_DIR) $(LIBLOKI_INSTALL_TARGETS)

unconditionally is just fine. Yes for static libraries, it means they will be installed in $(TARGET_DIR), but they are anyway removed in the target-finalize step. So in such situations, I do prefer to keep a simple .mk file.

Committed to next with this fixed. Thanks!

Thomas

Signature · 3 lines
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux and Kernel engineering
http://free-electrons.com