Buildroot Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [Buildroot] [PATCH 1/1] package/sysrepo: fix host/staging install steps
@ 2019-11-03  6:01 Heiko Thiery
  2019-11-04 21:38 ` Thomas Petazzoni
  2019-11-08 21:58 ` Thomas Petazzoni
  0 siblings, 2 replies; 20+ messages in thread
From: Heiko Thiery @ 2019-11-03  6:01 UTC (permalink / raw)
  To: buildroot

From: Heiko Thiery <heiko.thiery@kontron.com>

The sysrepoctl and sysrepocfg executables are used in install steps
of the package. Since there are hard-coded install pathes,
this leeds to wrong installation directories in host and staging
install steps.

Only sysrepoctl and sysrepocfg executables are needed from host build.
So build and install only the executables in this step.

The staging step only needs to install the library with the
corresponding files like the headers and the pkg-config.

Signed-off-by: Heiko Thiery <heiko.thiery@kontron.com>
---
 package/sysrepo/sysrepo.mk | 36 ++++++++++++++++++++++++++----------
 1 file changed, 26 insertions(+), 10 deletions(-)

diff --git a/package/sysrepo/sysrepo.mk b/package/sysrepo/sysrepo.mk
index 8676158a19..2d9d47c4f2 100644
--- a/package/sysrepo/sysrepo.mk
+++ b/package/sysrepo/sysrepo.mk
@@ -34,6 +34,18 @@ ifeq ($(BR2_TOOLCHAIN_HAS_LIBATOMIC),y)
 SYSREPO_CONF_OPTS += -DCMAKE_EXE_LINKER_FLAGS=-latomic
 endif
 
+define SYSREPO_INSTALL_STAGING_CMDS
+	mkdir -p $(STAGING_DIR)/usr/lib $(STAGING_DIR)/usr/include/sysrepo
+	$(INSTALL) -m 0644 -D $(@D)/libsysrepo.pc \
+		$(STAGING_DIR)/usr/lib/pkgconfig
+	$(INSTALL) -m 0644 -D $(@D)/src/libsysrepo.so* \
+		$(STAGING_DIR)/usr/lib
+	$(INSTALL) -m 0644 -D $(@D)/inc/sysrepo.h \
+		$(STAGING_DIR)/usr/include
+	$(INSTALL) -m 0644 -D $(@D)/inc/sysrepo/* \
+		$(STAGING_DIR)/usr/include/sysrepo/
+endef
+
 define SYSREPO_INSTALL_INIT_SYSV
 	$(INSTALL) -m 755 -D package/sysrepo/S50sysrepod \
 		$(TARGET_DIR)/etc/init.d/S50sysrepod
@@ -49,17 +61,21 @@ define SYSREPO_INSTALL_INIT_SYSTEMD
 		$(TARGET_DIR)/etc/systemd/system/multi-user.target.wants
 endef
 
+# Configure $(TARGET_DIR) pathes here because it is hardcoded in host
+# executables that used later for target install step
 HOST_SYSREPO_CONF_OPTS = \
-	-DGEN_PYTHON2_TESTS=OFF \
-	-DENABLE_TESTS=OFF \
-	-DGEN_CPP_BINDINGS=OFF \
-	-DGEN_LANGUAGE_BINDINGS=OFF \
-	-DGEN_PYTHON_BINDINGS=OFF \
-	-DCALL_TARGET_BINS_DIRECTLY=OFF \
-	-DBUILD_EXAMPLES=OFF \
-	-DBUILD_CPP_EXAMPLES=OFF \
-	-DREPOSITORY_LOC=$(HOST_DIR)/etc/sysrepo \
-	-DSUBSCRIPTIONS_SOCKET_DIR=$(HOST_DIR)/var/run/sysrepo-subscriptions
+	-DREPOSITORY_LOC=$(TARGET_DIR)/etc/sysrepo \
+	-DSUBSCRIPTIONS_SOCKET_DIR=$(TARGET_DIR)/var/run/sysrepo-subscriptions
+
+define HOST_SYSREPO_BUILD_CMDS
+	$(HOST_MAKE_ENV) $(MAKE) $(HOST_CONFIGURE_OPTS) -C $(@D) sysrepocfg
+	$(HOST_MAKE_ENV) $(MAKE) $(HOST_CONFIGURE_OPTS) -C $(@D) sysrepoctl
+endef
+
+define HOST_SYSREPO_INSTALL_CMDS
+	$(INSTALL) -D -m 755 $(@D)/src/sysrepocfg $(HOST_DIR)/usr/bin/
+	$(INSTALL) -D -m 755 $(@D)/src/sysrepoctl $(HOST_DIR)/usr/bin/
+endef
 
 $(eval $(cmake-package))
 $(eval $(host-cmake-package))
-- 
2.20.1

^ permalink raw reply related	[flat|nested] 20+ messages in thread

end of thread, other threads:[~2019-12-02  8:15 UTC | newest]

Thread overview: 20+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-11-03  6:01 [Buildroot] [PATCH 1/1] package/sysrepo: fix host/staging install steps Heiko Thiery
2019-11-04 21:38 ` Thomas Petazzoni
2019-11-05  8:03   ` Heiko Thiery
2019-11-05  8:09     ` Thomas Petazzoni
2019-11-05  8:19       ` Heiko Thiery
2019-11-08 21:58 ` Thomas Petazzoni
2019-11-10 16:00   ` Heiko Thiery
2019-11-11 13:53     ` Thomas Petazzoni
2019-11-11 14:07       ` Heiko Thiery
2019-11-11 14:27         ` Thomas Petazzoni
2019-11-11 14:35           ` Heiko Thiery
2019-11-11 14:40             ` Thomas Petazzoni
2019-11-11 14:43               ` Heiko Thiery
2019-11-11 14:59                 ` Thomas Petazzoni
2019-11-11 15:04                   ` Heiko Thiery
2019-11-11 15:12                     ` Thomas Petazzoni
2019-11-11 19:22                       ` Heiko Thiery
2019-11-12  7:53                         ` Heiko Thiery
2019-11-17  5:32                           ` Heiko Thiery
2019-12-02  8:15                             ` Heiko Thiery

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox