Bug 183513 - [PATCH] cad/feappv: post-patch target makes matches that can never be true
Summary: [PATCH] cad/feappv: post-patch target makes matches that can never be true
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: Normal Affects Only Me
Assignee: John Marino
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-10-31 07:20 UTC by John Marino
Modified: 2013-11-18 10:10 UTC (History)
0 users

See Also:


Attachments
file.diff (555 bytes, patch)
2013-10-31 07:20 UTC, John Marino
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description John Marino 2013-10-31 07:20:00 UTC
The post-patch target tries to replace several lines in ${WRKSRC}/makefile.in.  The problem that sed will never match some of the replaces.

Specially, sed assumes FFOPTFLAG and CCOPTFLAG start at the beginning of the line.  Perhaps it did in a previous version, but now it doesn't.

In order for these flags to be defined, the attached patch to makefile.in has to be added.  It removes the whitespace in Makefile.in, allowing the post-patch target to work.

An alternative approach is to modify the post-patch target to not start at the beginning of the line, but this will also change the commented version (which in the end, doesn't really matter as there is makefile.in.bak with the original version as a result)

Fix: Patch attached with submission follows:
Comment 1 Edwin Groothuis freebsd_committer freebsd_triage 2013-10-31 07:20:08 UTC
State Changed
From-To: open->feedback

Awaiting maintainers feedback (via the GNATS Auto Assign Tool)
Comment 2 Edwin Groothuis freebsd_committer freebsd_triage 2013-10-31 07:20:08 UTC
Maintainer of cad/feappv,

Please note that PR ports/183513 has just been submitted.

If it contains a patch for an upgrade, an enhancement or a bug fix
you agree on, reply to this email stating that you approve the patch
and a committer will take care of it.

The full text of the PR can be found at:
    http://www.freebsd.org/cgi/query-pr.cgi?pr=ports/183513

-- 
Edwin Groothuis via the GNATS Auto Assign Tool
edwin@FreeBSD.org
Comment 3 Anton Shterenlikht 2013-10-31 12:57:36 UTC
I can't reproduce the problem.
On ia64 10.0-CURRENT, I get:

# make clean extract
===>  Cleaning for feappv-3.1_3
===>  Found saved configuration for feappv-3.1_3
===>   feappv-3.1_3 depends on file: /usr/local/sbin/pkg - found
===> Fetching all distfiles required by feappv-3.1_3 for building
===>  Extracting for feappv-3.1_3
=> SHA256 Checksum OK for feappv31/feappv31.zip.
=> SHA256 Checksum OK for feappv31/manual.pdf.
===>   feappv-3.1_3 depends on file: /usr/local/bin/unzip - found
# make patch
===>  Patching for feappv-3.1_3
# make post-patch
# grep "^  .*OPT" work/ver31/makefile.in
  FFOPTFLAG = -O3 -ftree-vectorize -Wall
  CCOPTFLAG = -O3 -ftree-vectorize -Wall
# 

Then build/install proceed fine.

Please give more info on the error and your system.

Anton
Comment 4 freebsd.contact 2013-11-06 09:45:13 UTC
Anton,
I am not following your thought-process on why you need to "reproduce" this.

I said, "The post-patch target never makes a match".

All it requires is visual inspection of Makefile.in to verify this.  It
is impossible to match it because the pattern doesn't start at the
beginning of a line which sed requires, is that not obvious?

Why do you require more to see this error?

A successful build doesn't prove the port is correct, only that it can
build on that platform without the CFLAGS that the port makefile defines.

Please review the post-patch target instructions and the patch target
(Makefile.in) and I think the error will become clear to you.

Thanks,
John
Comment 5 freebsd.contact 2013-11-06 10:06:21 UTC
By the way, your example proves even proves that this is broken.

CCOPTFLAG is supposed to be changed to the contents of CFLAGS, which is
"-I${LOCALBASE}/include" per the port's makefile.

The fact that it remained as "-O3 -ftree-vectorize -Wall" proves that
the substitution didn't take place.  That's what it's already defined as
in Makefile.in.

John
Comment 6 John Marino freebsd_committer freebsd_triage 2013-11-12 10:03:14 UTC
Responsible Changed
From-To: freebsd-ports-bugs->marino

I'll take it.
Comment 7 dfilter service freebsd_committer freebsd_triage 2013-11-18 09:52:49 UTC
Author: marino
Date: Mon Nov 18 09:52:42 2013
New Revision: 334166
URL: http://svnweb.freebsd.org/changeset/ports/334166

Log:
  cad/feappv: Fix CFLAGS support
  
  This problem could also be fixed by changing the sed pattern, but the
  patch provided to the PR was tested.  The maintainer has not responded
  to the last entries in the PR for over 15 days, so I'm timing it out.
  
  PR:		ports/183513
  Approved by:	maintainer timeout

Added:
  head/cad/feappv/files/
  head/cad/feappv/files/patch-makefile.in   (contents, props changed)

Added: head/cad/feappv/files/patch-makefile.in
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/cad/feappv/files/patch-makefile.in	Mon Nov 18 09:52:42 2013	(r334166)
@@ -0,0 +1,13 @@
+--- makefile.in.orig	2013-07-15 19:15:37.000000000 +0000
++++ makefile.in
+@@ -31,8 +31,8 @@ FF = gfortran
+ CC = gcc
+ 
+ # What optimization level to use
+-  FFOPTFLAG = -O3 -ftree-vectorize -Wall
+-  CCOPTFLAG = -O3 -ftree-vectorize -Wall
++FFOPTFLAG = -O3 -ftree-vectorize -Wall
++CCOPTFLAG = -O3 -ftree-vectorize -Wall
+ 
+ # FFOPTFLAG = -g -O3 -ftree-vectorize -Wall
+ # CCOPTFLAG = -g -O3 -ftree-vectorize -Wall
_______________________________________________
svn-ports-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-ports-all
To unsubscribe, send any mail to "svn-ports-all-unsubscribe@freebsd.org"
Comment 8 John Marino freebsd_committer freebsd_triage 2013-11-18 10:10:48 UTC
State Changed
From-To: feedback->closed

Committed. Thanks!