From owner-freebsd-ports-bugs@FreeBSD.ORG Tue Jun 24 13:50:03 2008 Return-Path: Delivered-To: freebsd-ports-bugs@hub.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6AD8D1065676 for ; Tue, 24 Jun 2008 13:50:03 +0000 (UTC) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:4f8:fff6::28]) by mx1.freebsd.org (Postfix) with ESMTP id 4FFB58FC0C for ; Tue, 24 Jun 2008 13:50:03 +0000 (UTC) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (gnats@localhost [127.0.0.1]) by freefall.freebsd.org (8.14.2/8.14.2) with ESMTP id m5ODo2Xj084187 for ; Tue, 24 Jun 2008 13:50:02 GMT (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.14.2/8.14.1/Submit) id m5ODo2G9084186; Tue, 24 Jun 2008 13:50:02 GMT (envelope-from gnats) Resent-Date: Tue, 24 Jun 2008 13:50:02 GMT Resent-Message-Id: <200806241350.m5ODo2G9084186@freefall.freebsd.org> Resent-From: FreeBSD-gnats-submit@FreeBSD.org (GNATS Filer) Resent-To: freebsd-ports-bugs@FreeBSD.org Resent-Reply-To: FreeBSD-gnats-submit@FreeBSD.org, Eygene Ryabinkin Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id CD8FA1065670 for ; Tue, 24 Jun 2008 13:49:28 +0000 (UTC) (envelope-from rea-fbsd@codelabs.ru) Received: from 0.mx.codelabs.ru (0.mx.codelabs.ru [144.206.177.45]) by mx1.freebsd.org (Postfix) with ESMTP id 85A668FC26 for ; Tue, 24 Jun 2008 13:49:28 +0000 (UTC) (envelope-from rea-fbsd@codelabs.ru) Received: from void.codelabs.ru (void.codelabs.ru [144.206.177.25]) by 0.mx.codelabs.ru with esmtps (TLSv1:CAMELLIA256-SHA:256) id 1KB8tj-000EAR-Ad; Tue, 24 Jun 2008 17:49:27 +0400 Message-Id: <20080624134927.0DBDD1AF41E@void.codelabs.ru> Date: Tue, 24 Jun 2008 17:49:26 +0400 (MSD) From: Eygene Ryabinkin To: FreeBSD-gnats-submit@FreeBSD.org X-Send-Pr-Version: 3.113 Cc: flz@FreeBSD.org Subject: ports/124935: [patch] fix build of ports-mgmt/pkg_install on 4.x X-BeenThere: freebsd-ports-bugs@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: Eygene Ryabinkin List-Id: Ports bug reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 24 Jun 2008 13:50:03 -0000 >Number: 124935 >Category: ports >Synopsis: [patch] fix build of ports-mgmt/pkg_install on 4.x >Confidential: no >Severity: serious >Priority: medium >Responsible: freebsd-ports-bugs >State: open >Quarter: >Keywords: >Date-Required: >Class: sw-bug >Submitter-Id: current-users >Arrival-Date: Tue Jun 24 13:50:02 UTC 2008 >Closed-Date: >Last-Modified: >Originator: Eygene Ryabinkin >Release: FreeBSD 7.0-STABLE i386 >Organization: Code Labs >Environment: FreeBSD XXX 4.11-STABLE FreeBSD 4.11-STABLE #1: Tue Sep 26 13:27:24 MSD 2006 root@XXX:/home/cvsup/obj/home/cvsup/src/sys/XXX i386 >Description: ports-mgmt/pkg_install does not build on 4.11: - source code has one mixed code and variable declaration; - source relies on the presence of getopt library, but it is not yet in 4.x. >How-To-Repeat: Check out latest port and try to build it on 4.11 (or, generally, on 4.x). >Fix: The attached patch resolves these issues: it changes the place of variable declaration and enables the port to link against devel/libgnugetopt for FreeBSD < 500000. --- 20080530-fix-4.x-build.patch begins here --- diff -urN ./Makefile ../pkg_install/Makefile --- ./Makefile Tue Jun 24 17:31:43 2008 +++ ../pkg_install/Makefile Tue Jun 24 17:39:46 2008 @@ -31,6 +31,14 @@ MAKE_ARGS= -DNO_OBJ -DNO_CRYPT -DNO_OPENSSL .endif +# Getopt library is not the part of 4.x, so we're using GNU getopt +# instead. +.if ${OSVERSION} < 500000 +CFLAGS+= -I${PREFIX}/include +MAKE_ARGS+= LDFLAGS="-L${PREFIX}/lib -lgnugetopt" +LIB_DEPENDS+= gnugetopt.1:${PORTSDIR}/devel/libgnugetopt +.endif + pre-configure: @${SED} -e 's,%%PREFIX%%,${PREFIX},g' \ -e 's,%%MANPREFIX%%,${MANPREFIX},g' \ diff -urN ./files/patch-lib::match.c ../pkg_install/files/patch-lib::match.c --- ./files/patch-lib::match.c Thu Jan 1 03:00:00 1970 +++ ../pkg_install/files/patch-lib::match.c Tue Jun 24 17:34:13 2008 @@ -0,0 +1,12 @@ +--- lib/match.c.orig Tue Jun 24 09:38:13 2008 ++++ lib/match.c Tue Jun 24 09:38:20 2008 +@@ -299,8 +299,8 @@ + + /* Resolve origins into package names, retaining the sequence */ + for (i = 0; origins[i] != NULL; i++) { +- matches = realloc(matches, (i + 1) * sizeof(*matches)); + struct store *store = NULL; ++ matches = realloc(matches, (i + 1) * sizeof(*matches)); + store = storecreate(store); + + for (j = 0; installed[j] != NULL; j++) { --- 20080530-fix-4.x-build.patch ends here --- >Release-Note: >Audit-Trail: >Unformatted: