From patchwork Fri Sep 21 22:28:36 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Samuel Martin X-Patchwork-Id: 185964 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from silver.osuosl.org (silver.osuosl.org [140.211.166.136]) by ozlabs.org (Postfix) with ESMTP id C23C92C007D for ; Sat, 22 Sep 2012 08:29:30 +1000 (EST) Received: from localhost (localhost [127.0.0.1]) by silver.osuosl.org (Postfix) with ESMTP id A476121F9A; Fri, 21 Sep 2012 22:29:29 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from silver.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id BFTunS6I7nyQ; Fri, 21 Sep 2012 22:29:23 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by silver.osuosl.org (Postfix) with ESMTP id BE00730E87; Fri, 21 Sep 2012 22:29:21 +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 100288F74A for ; Fri, 21 Sep 2012 22:29:07 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by whitealder.osuosl.org (Postfix) with ESMTP id 58F348430C for ; Fri, 21 Sep 2012 22:29:05 +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 HJV5YLR9DVwz for ; Fri, 21 Sep 2012 22:29:04 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from mail-wg0-f53.google.com (mail-wg0-f53.google.com [74.125.82.53]) by whitealder.osuosl.org (Postfix) with ESMTPS id B1533814DB for ; Fri, 21 Sep 2012 22:29:03 +0000 (UTC) Received: by mail-wg0-f53.google.com with SMTP id dr1so2423624wgb.10 for ; Fri, 21 Sep 2012 15:29:03 -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:x-mailer:in-reply-to:references; bh=S/yWTIm6xujfbfRwrZ7zDsydM4nPh4gtjf3InGKzoBI=; b=rSPIJu3rPxa2h0+8/UzmXdwS2/8I1vWiUqqWZIerdezO/mArE7kSN30S6t5JN9+4En F+8fUjhtmyO51yYDJZPX5y5ZLF4ZQiuth/9TmsyCjecGn++r86jv9yu6RgBHFeK5tNVW TmXqaFsoprrSecEpDkNnxchVcLWUG2FtPFtPIvPwvXX2p/rLiO1F9LzlTQBTgyAGbUGT qhvNnGucsta6hoMCIV9vSN/Hmchsr0RmPZBVwRy3OkN7P+OXBX5i6dKflffyXRCB5jnT FSGdrc4An6tmBDaun3NVesJ0uHtFJsT9t+xXuouzF4lCKF1lbdckF3F1gMIXN5PqSGpA ZySg== Received: by 10.180.91.169 with SMTP id cf9mr6327621wib.1.1348266543327; Fri, 21 Sep 2012 15:29:03 -0700 (PDT) Received: from localhost.localdomain (ivr94-4-82-229-165-48.fbx.proxad.net. [82.229.165.48]) by mx.google.com with ESMTPS id fb20sm346407wid.1.2012.09.21.15.29.01 (version=SSLv3 cipher=OTHER); Fri, 21 Sep 2012 15:29:02 -0700 (PDT) From: Samuel Martin To: buildroot@busybox.net Date: Sat, 22 Sep 2012 00:28:36 +0200 Message-Id: <1348266518-27665-5-git-send-email-s.martin49@gmail.com> X-Mailer: git-send-email 1.7.12.1 In-Reply-To: <1348266518-27665-1-git-send-email-s.martin49@gmail.com> References: <1348266518-27665-1-git-send-email-s.martin49@gmail.com> Subject: [Buildroot] [PATCH 4/6] newt: convert to generic-package infrastructure X-BeenThere: buildroot@busybox.net X-Mailman-Version: 2.1.14 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-bounces@busybox.net Signed-off-by: Samuel Martin diff --git a/package/newt/newt.mk b/package/newt/newt.mk index b10e4f8..9ec917c 100644 --- a/package/newt/newt.mk +++ b/package/newt/newt.mk @@ -3,80 +3,54 @@ # newt # ############################################################# -NEWT_SOURCE=newt-0.51.0.tar.bz2 -NEWT_CAT:=$(BZCAT) -NEWT_SITE=http://www.uclibc.org/ -NEWT_DIR=$(BUILD_DIR)/newt-0.51.0 -NEWT_VERSION=0.51.0 -NEWT_CFLAGS=-Os -g -fPIC - -$(DL_DIR)/$(NEWT_SOURCE): - $(call DOWNLOAD,$(NEWT_SITE)/$(NEWT_SOURCE)) - -$(NEWT_DIR)/.source: $(DL_DIR)/$(NEWT_SOURCE) - $(NEWT_CAT) $(DL_DIR)/$(NEWT_SOURCE) | tar -C $(BUILD_DIR) $(TAR_OPTIONS) - - touch $(NEWT_DIR)/.source - -$(NEWT_DIR)/.configured: $(NEWT_DIR)/.source - (cd $(NEWT_DIR); rm -rf config.cache; \ - $(TARGET_CONFIGURE_OPTS) \ - $(TARGET_CONFIGURE_ARGS) \ - CFLAGS="$(TARGET_CFLAGS) $(NEWT_CFLAGS)" \ - ./configure $(QUIET) \ - --target=$(GNU_TARGET_NAME) \ - --host=$(GNU_TARGET_NAME) \ - --build=$(GNU_HOST_NAME) \ - --prefix=/usr \ - --exec-prefix=/usr \ - --bindir=/usr/bin \ - --sbindir=/usr/sbin \ - --libdir=/lib \ - --libexecdir=/usr/lib \ - --sysconfdir=/etc \ - --datadir=/usr/share \ - --localstatedir=/var \ - --mandir=/usr/man \ - --infodir=/usr/info \ - $(DISABLE_NLS) \ - ) - touch $(NEWT_DIR)/.configured - -$(NEWT_DIR)/libnewt.so.$(NEWT_VERSION): $(NEWT_DIR)/.configured - $(MAKE1) CFLAGS="$(TARGET_CFLAGS) $(NEWT_CFLAGS)" CC="$(TARGET_CC)" -C $(NEWT_DIR) - touch -c $@ - -$(STAGING_DIR)/usr/lib/libnewt.a: $(NEWT_DIR)/libnewt.so.$(NEWT_VERSION) - cp -a $(NEWT_DIR)/libnewt.a $(STAGING_DIR)/usr/lib/ - cp -a $(NEWT_DIR)/newt.h $(STAGING_DIR)/usr/include/ - cp -a $(NEWT_DIR)/libnewt.so* $(STAGING_DIR)/usr/lib/ - (cd $(STAGING_DIR)/usr/lib; ln -fs libnewt.so.$(NEWT_VERSION) libnewt.so) - (cd $(STAGING_DIR)/usr/lib; ln -fs libnewt.so.$(NEWT_VERSION) libnewt.so.0.51) - touch -c $@ - -$(TARGET_DIR)/usr/lib/libnewt.so.$(NEWT_VERSION): $(STAGING_DIR)/usr/lib/libnewt.a +NEWT_VERSION = 0.51.0 +NEWT_SITE = http://www.uclibc.org/ +NEWT_SOURCE = newt-$(NEWT_VERSION).tar.bz2 +NEWT_LICENSE = GPLv2 +NEWT_LICENSE_FILES = COPYING +NEWT_INSTALL_STAGING = YES + +NEWT_DEPENDENCIES = slang + +NEWT_CONFIGURE_ENV = \ + $(TARGET_CONFIGURE_OPTS) \ + $(TARGET_CONFIGURE_ARGS) \ + CFLAGS="$(TARGET_CFLAGS)" + +NEWT_CONFIGURE_OPT = \ + --prefix=/usr \ + --exec-prefix=/usr \ + --bindir=/usr/bin \ + --sbindir=/usr/sbin \ + --libdir=/lib \ + --libexecdir=/usr/lib \ + --sysconfdir=/etc \ + --datadir=/usr/share \ + --localstatedir=/var \ + --mandir=/usr/man \ + --infodir=/usr/info \ + $(DISABLE_NLS) + +define NEWT_CONFIGURE_CMDS + ( cd $(@D) ; $(NEWT_CONFIGURE_ENV) ./configure $(NEWT_CONFIGURE_OPT) ) +endef + +define NEWT_BUILD_CMDS + $(MAKE1) CFLAGS="$(TARGET_CFLAGS)" CC="$(TARGET_CC)" -C $(@D) +endef + +define NEWT_INSTALL_STAGING_CMDS + $(STRIPCMD) $(STRIP_STRIP_UNNEEDED) $(@D)/libnewt.so.$(NEWT_VERSION) + $(INSTALL) -D -m644 $(@D)/newt.h $(STAGING_DIR)/usr/include/ + $(INSTALL) -D -m644 $(@D)/libnewt.a $(STAGING_DIR)/usr/lib/ + $(INSTALL) -D -m755 $(@D)/libnewt.so* $(STAGING_DIR)/usr/lib/ + ln -fs libnewt.so.$(NEWT_VERSION) $(STAGING_DIR)/usr/lib/libnewt.so + ln -fs libnewt.so.$(NEWT_VERSION) $(STAGING_DIR)/usr/lib/libnewt.so.0.51 +endef + +define NEWT_INSTALL_TARGET_CMDS + $(INSTALL) -d $(TARGET_DIR)/usr/include/ cp -a $(STAGING_DIR)/usr/lib/libnewt.so* $(TARGET_DIR)/usr/lib/ - -$(STRIPCMD) $(STRIP_STRIP_UNNEEDED) $(TARGET_DIR)/usr/lib/libnewt.so* - touch -c $@ - -newt-legal-info: - @$(call legal-warning-pkg,newt,legal-info not yet implemented) - -newt: slang $(TARGET_DIR)/usr/lib/libnewt.so.$(NEWT_VERSION) +endef -newt-source: $(DL_DIR)/$(NEWT_SOURCE) - -newt-clean: - rm -f $(TARGET_DIR)/usr/lib/libnewt.so* - -$(MAKE) -C $(NEWT_DIR) clean - -newt-dirclean: slang-dirclean - rm -rf $(NEWT_DIR) - -############################################################# -# -# Toplevel Makefile options -# -############################################################# -ifeq ($(BR2_PACKAGE_NEWT),y) -TARGETS+=newt -endif +$(eval $(generic-package))