From patchwork Sun Nov 3 06:01:14 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Heiko Thiery X-Patchwork-Id: 1188504 Return-Path: X-Original-To: incoming-buildroot@patchwork.ozlabs.org Delivered-To: patchwork-incoming-buildroot@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=busybox.net (client-ip=140.211.166.137; helo=fraxinus.osuosl.org; envelope-from=buildroot-bounces@busybox.net; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="EC2T0acV"; dkim-atps=neutral Received: from fraxinus.osuosl.org (smtp4.osuosl.org [140.211.166.137]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 475QKm6hBkz9sP3 for ; Sun, 3 Nov 2019 17:01:32 +1100 (AEDT) Received: from localhost (localhost [127.0.0.1]) by fraxinus.osuosl.org (Postfix) with ESMTP id F21E189E4F; Sun, 3 Nov 2019 06:01:28 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from fraxinus.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id Mqepds4_YWJW; Sun, 3 Nov 2019 06:01:27 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by fraxinus.osuosl.org (Postfix) with ESMTP id 9953E89D43; Sun, 3 Nov 2019 06:01:27 +0000 (UTC) X-Original-To: buildroot@lists.busybox.net Delivered-To: buildroot@osuosl.org Received: from fraxinus.osuosl.org (smtp4.osuosl.org [140.211.166.137]) by ash.osuosl.org (Postfix) with ESMTP id 9D08F1BF5F6 for ; Sun, 3 Nov 2019 06:01:25 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by fraxinus.osuosl.org (Postfix) with ESMTP id 995C189D43 for ; Sun, 3 Nov 2019 06:01:25 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from fraxinus.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 8ywJ2CgwG34r for ; Sun, 3 Nov 2019 06:01:24 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from mail-wm1-f66.google.com (mail-wm1-f66.google.com [209.85.128.66]) by fraxinus.osuosl.org (Postfix) with ESMTPS id F265789D42 for ; Sun, 3 Nov 2019 06:01:23 +0000 (UTC) Received: by mail-wm1-f66.google.com with SMTP id f3so1677552wmc.5 for ; Sat, 02 Nov 2019 23:01:23 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=Bbdw3PcvAcxbOaHoT/dYhRlkgO3TPmjLsEEqDW6K95M=; b=EC2T0acV2zROXMc9k/KbPRif0F5yqMPNIB6pKy8RtrjKes06J+cI+s5GfRp7oMOgwt JPrvOfvJ+0kjgAXsgxvDvIBk5yqCDi1qpKsVPpEg5bwkUFY9i+yI+y8lpK62JCgmsV8P N3YTCeMyBuFqS12Uu+GBu98uwZr1spedTOLzuXvHTqDP2334TzzjfqhsgFh764bbLAwF T468P8LhGAE2zYpubSmUuLaVrAlTzker2tQKUKlPtt8hFKCxEMtEU4lkhPAwfxnE6lyM mYQGhuhS00BLUk1azCxIHwm5XqLjJHXFNaPVQueRHAkmPwfFEQQlBChtLYbgOd5eRkBa 3hGA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=Bbdw3PcvAcxbOaHoT/dYhRlkgO3TPmjLsEEqDW6K95M=; b=a2SpqXfD6Q19c7JooIa6X6FWKcWpOH0eW5ISG5URspELYXyAK4XkWDaWsXDGxmIlPz zslyFS5jTUK66rFFTYnN4cukn+wrpemeIZU2JF6cAbOJgnnjPTChJY8QpP1zm1+dQ6Eb p68LHpGD/4tfHZe280XHziLjUp7ClLVKeYtGU9gsGvyPUK6+O+JRjhSJDFIGzMHxb0n6 USUg2oqBbmrz2TT4iGu0nMncKnF/xJC6oiFzgs82vCwT72FlbQ4+1l4u/OXUQcaksa5M 4TLaQEfTbVJpym26hEiO2NgKwjOlZxPkR+YCsD6jDES9FB43Sgj22drl7PlTNjEEDfRK G1Cw== X-Gm-Message-State: APjAAAWvCDd019/9cjwC4s36sMp/kXoL9YCmS0uslDsybHS+X57fjZpf +0sUnIyh++Dww/HCfcThp5eLp2Bx X-Google-Smtp-Source: APXvYqy8q5ahwRu8sSNZ8E8JcyVGPor5FdnDzTVofH6rbOS8YiV/eCiG3H1LyBJVjtbauEhMjQZpYA== X-Received: by 2002:a05:600c:21d9:: with SMTP id x25mr13803751wmj.50.1572760882125; Sat, 02 Nov 2019 23:01:22 -0700 (PDT) Received: from hthiery01.sab.local ([213.135.10.150]) by smtp.gmail.com with ESMTPSA id v16sm13878576wrc.84.2019.11.02.23.01.20 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 02 Nov 2019 23:01:21 -0700 (PDT) From: Heiko Thiery To: buildroot@buildroot.org Date: Sun, 3 Nov 2019 07:01:14 +0100 Message-Id: <20191103060113.4884-1-heiko.thiery@gmail.com> X-Mailer: git-send-email 2.20.1 MIME-Version: 1.0 Subject: [Buildroot] [PATCH 1/1] package/sysrepo: fix host/staging install steps X-BeenThere: buildroot@busybox.net X-Mailman-Version: 2.1.29 Precedence: list List-Id: Discussion and development of buildroot List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Heiko Thiery Errors-To: buildroot-bounces@busybox.net Sender: "buildroot" From: Heiko Thiery 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 --- 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))