From patchwork Mon Mar 9 16:24:23 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Samuel Martin X-Patchwork-Id: 448095 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from whitealder.osuosl.org (whitealder.osuosl.org [140.211.166.138]) by ozlabs.org (Postfix) with ESMTP id 20EC6140187 for ; Tue, 10 Mar 2015 03:27:02 +1100 (AEDT) Authentication-Results: ozlabs.org; dkim=fail reason="verification failed; unprotected key" header.d=gmail.com header.i=@gmail.com header.b=b8/ZTqVT; dkim-adsp=none (unprotected policy); dkim-atps=neutral Received: from localhost (localhost [127.0.0.1]) by whitealder.osuosl.org (Postfix) with ESMTP id AFD21917A5; Mon, 9 Mar 2015 16:27:01 +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 jPxwCl+2qUo9; Mon, 9 Mar 2015 16:27:01 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by whitealder.osuosl.org (Postfix) with ESMTP id D274391811; Mon, 9 Mar 2015 16:27:00 +0000 (UTC) X-Original-To: buildroot@lists.busybox.net Delivered-To: buildroot@osuosl.org Received: from whitealder.osuosl.org (whitealder.osuosl.org [140.211.166.138]) by ash.osuosl.org (Postfix) with ESMTP id AD10E1C26F6 for ; Mon, 9 Mar 2015 16:26:59 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by whitealder.osuosl.org (Postfix) with ESMTP id A5DA6917AD for ; Mon, 9 Mar 2015 16:26:59 +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 SGqXoNJllCGR for ; Mon, 9 Mar 2015 16:26:59 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from mail-we0-f172.google.com (mail-we0-f172.google.com [74.125.82.172]) by whitealder.osuosl.org (Postfix) with ESMTPS id E8946917A5 for ; Mon, 9 Mar 2015 16:26:58 +0000 (UTC) Received: by wesk11 with SMTP id k11so5702898wes.13 for ; Mon, 09 Mar 2015 09:26:57 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id; bh=pl7XSGFbnkz4FP5piRgPC/6H1stC/K08oX3Zuse4m0k=; b=b8/ZTqVT9F5Psjrjc/kbnH+O7WmeyeX+WMfM2wDvv0Y+7VlsxhO0h5iYHvL1izUQVl VyTPGfYXxQU9QffrjrbDhweESCxnIyUj2VmfdVGbMzjGHmceANX53WfxHfiPGHGriU12 Et+RcFYOohIL+Jk5Tijo4VRTRLEEL91WsYwRHZhpHMxJyWBHUpRVepKW7nSxPsPeom2E GGHC4j+JB6ibIBsvTN0BtyTWDW+VuNK9PZo2UISFCVlzQb+rzkLZdqYrQO5J89HSJ7k6 Aoi3DzvISUpb4hNYYO7ZEhWFk4eIzEiUQZS3wvwRz9Rtg7dueE8vayiSJyx7L1x63isI f+zw== X-Received: by 10.180.97.106 with SMTP id dz10mr60828180wib.33.1425918417528; Mon, 09 Mar 2015 09:26:57 -0700 (PDT) Received: from smartin-de.aldebaran.lan ([195.190.86.18]) by mx.google.com with ESMTPSA id w8sm28916015wja.4.2015.03.09.09.26.56 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 09 Mar 2015 09:26:56 -0700 (PDT) From: Samuel Martin To: buildroot@buildroot.net Date: Mon, 9 Mar 2015 17:24:23 +0100 Message-Id: <1425918264-1912-1-git-send-email-s.martin49@gmail.com> X-Mailer: git-send-email 2.1.0 Subject: [Buildroot] [PATCH 1/2] target-finalize: generate all *.pyc 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" This patch generates all *.pyc files from *.py located in /usr/python*/site-packages, before stripping the rootfs. This prevents modules from packages that do not compile the *.py files from disappearing. Reported-by: Yegor Yefremov Cc: Yegor Yefremov Signed-off-by: Samuel Martin Tested-by: Yegor Yefremov --- Makefile | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/Makefile b/Makefile index af043a3..ec0b923 100644 --- a/Makefile +++ b/Makefile @@ -564,6 +564,11 @@ $(TARGETS_ROOTFS): target-finalize target-finalize: $(TARGETS) @$(call MESSAGE,"Finalizing target directory") +ifneq ($(BR2_PACKAGE_PYTHON)$(BR2_PACKAGE_PYTHON3),) + PYTHONPATH="$(PYTHON_PATH)" \ + $(HOST_DIR)/usr/bin/python -c "import compileall; \ + compileall.compile_dir('$(TARGET_DIR)/usr/lib/python$(PYTHON_VERSION_MAJOR)/site-packages')" +endif $(foreach hook,$(TARGET_FINALIZE_HOOKS),$($(hook))$(sep)) rm -rf $(TARGET_DIR)/usr/include $(TARGET_DIR)/usr/share/aclocal \ $(TARGET_DIR)/usr/lib/pkgconfig $(TARGET_DIR)/usr/share/pkgconfig \