From owner-svn-ports-head@FreeBSD.ORG Wed Feb 25 05:55:11 2015 Return-Path: Delivered-To: svn-ports-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id AD696CB5; Wed, 25 Feb 2015 05:55:11 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 8DFE590F; Wed, 25 Feb 2015 05:55:11 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t1P5tBtv088700; Wed, 25 Feb 2015 05:55:11 GMT (envelope-from truckman@FreeBSD.org) Received: (from truckman@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t1P5tAgr088698; Wed, 25 Feb 2015 05:55:10 GMT (envelope-from truckman@FreeBSD.org) Message-Id: <201502250555.t1P5tAgr088698@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: truckman set sender to truckman@FreeBSD.org using -f From: Don Lewis Date: Wed, 25 Feb 2015 05:55:10 +0000 (UTC) To: ports-committers@freebsd.org, svn-ports-all@freebsd.org, svn-ports-head@freebsd.org Subject: svn commit: r379874 - in head/editors/openoffice-devel: . files X-SVN-Group: ports-head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-ports-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the ports tree for head List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 25 Feb 2015 05:55:11 -0000 Author: truckman Date: Wed Feb 25 05:55:10 2015 New Revision: 379874 URL: https://svnweb.freebsd.org/changeset/ports/379874 QAT: https://qat.redports.org/buildarchive/r379874/ Log: Fix build breakage when libreoffice is installed. The problem is that libreoffice installs its own copy of unopkg in ${PREFIX}/bin and that the openoffice build attempts to use this copy of unopkg instead of the openoffice version which is in subdirectory of ${WRKSRC}. The reason is that the openoffice build expects to find its own copy of unopkg by depending on having "." in its $PATH, but its $PATH has ${PREFIX}/bin before ".". Openoffice attempts to do the right thing by first constructing $PATH by prepending "." and a small number of other directories where it stashes executables used during the build to the value of $PATH that it inherits from the environment. Things go wrong when it tries to add the paths for ${CC}, perl, and java to $PATH. If $PATH has /usr/bin before ${PREFIX}/bin, the openoffice build finds the perl symlink in /usr/bin before it finds perl in ${PREFIX}/bin, so it prepends ${PREFIX}/bin to $PATH to try to ensure that the correct version of perl will be found first. This moves ${PREFIX}/bin earlier in $PATH than ".". The operation to put the path to ${CC} in $PATH has a different problem. It uses the variable COMPATH for this, which is the dirname of the patch to $CC, with the trailing /bin stripped off. That results in /usr/local being added to $PATH, which is nonsensical, though mostly harmless. There are three fixes here: * Always keep the parts of $PATH for the directories under ${WRKSRC}, including "." at the beginning of the path. * Ignore symlinks to executables when deciding to prepend a directory to the path. * Append "/bin" when using COMPATH so that the result points to the directory where ${CC} actually resides. There is actually another variable CC_PATH, but it has an extra trailing "/", so it doesn't match ${PREFIX}/bin. Differential Revision: https://reviews.freebsd.org/D1958 Reviewed by: pfg Approved by: mat (mentor) Added: head/editors/openoffice-devel/files/patch-set_soenv.in (contents, props changed) Modified: head/editors/openoffice-devel/Makefile Modified: head/editors/openoffice-devel/Makefile ============================================================================== --- head/editors/openoffice-devel/Makefile Wed Feb 25 05:37:41 2015 (r379873) +++ head/editors/openoffice-devel/Makefile Wed Feb 25 05:55:10 2015 (r379874) @@ -280,7 +280,7 @@ do-build: cd ${WRKSUBDIR} ; ${PRINTF} "main=active\n" >> source_config cd ${WRKSUBDIR} ; ${PRINTF} "extras=active\n" >> source_config cd ${WRKSRC} ; ./bootstrap - cd ${WRKSRC} ; ${SETENV} "LANG=C" "LC_ALL=C" ${BASH} -c "source ${FREEBSD_ENV_SET} ; cd instsetoo_native/util ; build.pl --all -P${MAKE_JOBS_NUMBER} -- -P${MAKE_JOBS_NUMBER}" + cd ${WRKSRC} ; ${SETENV} "LANG=C" "LC_ALL=C LC_TIME=it_IT.ISO8859-15" ${BASH} -c "source ${FREEBSD_ENV_SET} ; cd instsetoo_native/util ; build.pl --all -P${MAKE_JOBS_NUMBER} -- -P${MAKE_JOBS_NUMBER}" do-install: cd ${WRKSRC}/instsetoo_native/unxfbsd?.pro/Apache_OpenOffice/archive/install/${LOCALIZED_LANG}/ ; ${LS} *.tar.?z > ${WRKDIR}/INSTALLFILES Added: head/editors/openoffice-devel/files/patch-set_soenv.in ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/editors/openoffice-devel/files/patch-set_soenv.in Wed Feb 25 05:55:10 2015 (r379874) @@ -0,0 +1,79 @@ +--- set_soenv.in.orig 2015-01-17 23:35:07.000000000 -0800 ++++ set_soenv.in 2015-02-23 16:02:44.000000000 -0800 +@@ -359,7 +359,7 @@ + elsif ( $platform =~ m/freebsd/ ) + { $BIG_SVX = "TRUE"; + $COM = "GCC"; +- $COMPATH = '@COMPATH@'; ++ $COMPATH = '@COMPATH@' . '/bin'; + $CVER = "C300"; + $GUI = "UNX"; + $GUIBASE = "unx"; +@@ -2617,26 +2617,37 @@ + my @originalPairs = @_; + my @pairs = @originalPairs; + my @Path = split /$ps/, $oldPath; ++ my @buildPath; ++ my @sysPath; ++ my $elem; ++ ++ for $elem (@Path) { ++ if ($elem eq '.' || $elem =~ m'^$SOLARENV/' || ++ $elem =~ m'/solenv/') { ++ push @buildPath, $elem; ++ } else { ++ push @sysPath, $elem; ++ } ++ } + + while (@pairs) { + my $path = shift @pairs; + my $cmd = shift @pairs; + my $to_append = 1; +- my $elem; + + if (! -x "$path/$cmd") { + AddWarning ("Missing executable $path/$cmd\n"); + } + +- for $elem (@Path) { ++ for $elem (@sysPath) { + if ($elem eq $path) { + # print "Hit duplicate path in path; break\n"; + $to_append = 0; + last; + } +- if (-f "$elem/$cmd") { ++ if (-f "$elem/$cmd" && ! -l "$elem/$cmd") { + # print "Element already in path ...\n"; +- unshift @Path, $path; ++ unshift @sysPath, $path; + $to_append = 0; + last; + } else { +@@ -2644,7 +2655,7 @@ + } + } + if ($to_append) { +- push @Path, $path; ++ push @sysPath, $path; + } + } + +@@ -2654,14 +2665,14 @@ + my $cmd = shift @pairs; + my $realpath; + +- $realpath = PathLookup ($cmd, @Path); ++ $realpath = PathLookup ($cmd, @sysPath); + if (!($realpath eq $path)) { + AddWarning ("Path conflict for executables " . + "$path/$cmd against $realpath"); + } + } + +- return join $ps, CleanupPath (@Path); ++ return join $ps, @buildPath, CleanupPath (@sysPath); + } + + #------------------------------------------------------------