From patchwork Mon Feb 1 23:31:00 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ludovic Guegan X-Patchwork-Id: 576745 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from hemlock.osuosl.org (smtp2.osuosl.org [140.211.166.133]) by ozlabs.org (Postfix) with ESMTP id B1DD5140BFB for ; Tue, 2 Feb 2016 10:31:23 +1100 (AEDT) Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b=N8mhbK10; dkim-atps=neutral Received: from localhost (localhost [127.0.0.1]) by hemlock.osuosl.org (Postfix) with ESMTP id 589F895AA2; Mon, 1 Feb 2016 23:31:22 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from hemlock.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id ZxK0tj-YQENY; Mon, 1 Feb 2016 23:31:19 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by hemlock.osuosl.org (Postfix) with ESMTP id 20AFA959E7; Mon, 1 Feb 2016 23:31:18 +0000 (UTC) X-Original-To: buildroot@lists.busybox.net Delivered-To: buildroot@osuosl.org Received: from whitealder.osuosl.org (smtp1.osuosl.org [140.211.166.138]) by ash.osuosl.org (Postfix) with ESMTP id 5119E1C0BE0 for ; Mon, 1 Feb 2016 23:31:14 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by whitealder.osuosl.org (Postfix) with ESMTP id 570B98C419 for ; Mon, 1 Feb 2016 23:31:21 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from whitealder.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 3+HdnhuG2MCb for ; Mon, 1 Feb 2016 23:31:21 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from mail-wm0-f65.google.com (mail-wm0-f65.google.com [74.125.82.65]) by whitealder.osuosl.org (Postfix) with ESMTPS id EC8348C3FB for ; Mon, 1 Feb 2016 23:31:20 +0000 (UTC) Received: by mail-wm0-f65.google.com with SMTP id r129so11326169wmr.0 for ; Mon, 01 Feb 2016 15:31:13 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=/8jVMPxihudNXZpxxqz1AHyFYQAJiliQbjP1oYYQ++I=; b=N8mhbK10H0JjvS/eLmTF9QcWoZXB4hC6/NRNmHjvq5Y4wVNOVLTIpTgILRVTg0fN2p mQfyNwHa+I5g6wXYYFxb5yQ/k12++tWCx2wU40LnxDZmJrG8Gt7isHxC4GYSGYE+/MJ1 xh+hF6gT8RxtkAU9oJhME4fhjnLCk9xu1r7WKTX/J5wYNYRA21uOGz+7Hc5LTTqQTiye iOIvU7hZFPz5pE9sxDN0Y5gYQL553NjeI9hZepkDLSP1iUxPtYfKv7KJsyKAsMiCRlkS xyJ5K9vCm+1I8hiEaI7JOTVVQBDr3kkWbEg9wgFcQQPq3gzRLUxYPBu7l7HF1qhj5EH9 xpqg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=/8jVMPxihudNXZpxxqz1AHyFYQAJiliQbjP1oYYQ++I=; b=gfkn8nRBWk5v7yMVgbz0w5d/QiuWZ8EhlNI1/ZVhoOB8jkIJeKbmqpg751TIK9G6XA wdIDop+O99UL27yTRyL77l736l9YACKtoEKxTDj3xNxtpFDyy/YrgZuRs0IESvC/WOT9 5axPxfBGOamBMscVmkmuSiBfyl+WCrz4Q1r+/pQhuzQhz3RHk0ceT6PzkR+WnDjuzXc7 M9chK5PNSw2ACBqb+RrRkj0lubZDtuUcdWhviN3vh4rDH9H2D940phosq3kPCA6yOXAv uiZ+5RtYlnSI0UL+PuE6mRXdhueC44TtfC13b3G6W06gtYKfn2SKLOS5XUI4wtjscdgb +p4Q== X-Gm-Message-State: AG10YOR5AkG/3g79zS20N9JWcjZdTlRqsDacx+ANRZVEOnEKy0tlnMFEaK0Lh7lYCGEB+g== X-Received: by 10.194.23.232 with SMTP id p8mr29545630wjf.80.1454369472604; Mon, 01 Feb 2016 15:31:12 -0800 (PST) Received: from localhost.localdomain (cha75-2-78-192-16-191.fbxo.proxad.net. [78.192.16.191]) by smtp.gmail.com with ESMTPSA id t76sm130619wmd.13.2016.02.01.15.31.11 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 01 Feb 2016 15:31:11 -0800 (PST) From: Ludovic Guegan To: buildroot@busybox.net Date: Tue, 2 Feb 2016 00:31:00 +0100 Message-Id: <1454369465-4804-4-git-send-email-ludovic.guegan@gmail.com> X-Mailer: git-send-email 2.7.0 In-Reply-To: <1454369465-4804-1-git-send-email-ludovic.guegan@gmail.com> References: <1454369465-4804-1-git-send-email-ludovic.guegan@gmail.com> Cc: Ludovic Guegan Subject: [Buildroot] [PATCH 3/8 RFC] package/pkg-generic.mk: allow custom extract directory X-BeenThere: buildroot@busybox.net X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: Discussion and development of buildroot List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: buildroot-bounces@busybox.net Sender: "buildroot" Signed-off-by: Ludovic Guegan --- docs/manual/adding-packages-generic.txt | 3 +++ package/pkg-generic.mk | 12 ++++++++++-- 2 files changed, 13 insertions(+), 2 deletions(-) diff --git a/docs/manual/adding-packages-generic.txt b/docs/manual/adding-packages-generic.txt index b7817e3..b7442a7 100644 --- a/docs/manual/adding-packages-generic.txt +++ b/docs/manual/adding-packages-generic.txt @@ -444,6 +444,9 @@ different steps of the build process. tarball with a non-standard organization, this variable allows to override the package infrastructure default behavior. +* +LIBFOO_EXTRACT_DIR+ can be set to change the directory where the + package is extracted. + * +LIBFOO_CONFIGURE_CMDS+ lists the actions to be performed to configure the package before its compilation. diff --git a/package/pkg-generic.mk b/package/pkg-generic.mk index 1e024d3..3051551 100644 --- a/package/pkg-generic.mk +++ b/package/pkg-generic.mk @@ -128,7 +128,7 @@ $(BUILD_DIR)/%/.stamp_extracted: @$(call step_start,extract) @$(call MESSAGE,"Extracting") $(foreach hook,$($(PKG)_PRE_EXTRACT_HOOKS),$(call $(hook))$(sep)) - $(Q)mkdir -p $(@D) + $(Q)mkdir -p $(@D) $($(PKG)_EXTRACT_DIR) $($(PKG)_EXTRACT_CMDS) # some packages have messed up permissions inside $(Q)chmod -R +rw $(@D) @@ -396,6 +396,14 @@ $(2)_BASE_NAME = $(1)-$$($(2)_VERSION) $(2)_DL_DIR = $$(DL_DIR)/$$($(2)_BASE_NAME) $(2)_DIR = $$(BUILD_DIR)/$$($(2)_BASE_NAME) +ifndef $(2)_EXTRACT_DIR + ifdef $(3)_EXTRACT_DIR + $(2)_EXTRACT_DIR = $$($(3)_EXTRACT_DIR) + else + $(2)_EXTRACT_DIR ?= $$($(3)_DIR) + endif +endif + ifndef $(2)_SUBDIR ifdef $(3)_SUBDIR $(2)_SUBDIR = $$($(3)_SUBDIR) @@ -525,7 +533,7 @@ $(2)_TARGET_DIRCLEAN = $$($(2)_DIR)/.stamp_dircleaned $(2)_EXTRACT_CMDS ?= \ $$(if $$($(2)_SOURCE),$$(INFLATE$$(suffix $$($(2)_SOURCE))) $$(DL_DIR)/$$($(2)_SOURCE) | \ $$(TAR) --strip-components=$$($(2)_STRIP_COMPONENTS) \ - -C $$($(2)_DIR) \ + -C $$($(2)_EXTRACT_DIR) \ $$(foreach x,$$($(2)_EXCLUDES),--exclude='$$(x)' ) \ $$(TAR_OPTIONS) -)