Bug 158722

Summary: [patch] devel/gobject-introspection does not build if CC is not cc
Product: Ports & Packages Reporter: kamikaze
Component: Individual Port(s)Assignee: freebsd-gnome (Nobody) <gnome>
Status: Closed FIXED    
Severity: Affects Only Me    
Priority: Normal    
Version: Latest   
Hardware: Any   
OS: Any   
Attachments:
Description Flags
file.diff none

Description kamikaze 2011-07-08 09:40:01 UTC
The post-patch: section of devel/gobject-introspection makes a supstitution of cc in the file giscanner/sourcescanner.py.

For easy reading I will assume CC="XX XY"

Line 237:
        for filename in filenames:
            if (filename.endswith('.c') or filename.endswith('.cpp') or
                filename.endswith('.cc') or filename.endswith('.cxx')):
                filename = os.path.abspath(filename)
                self._scanner.lex_filename(filename)
            else:
                headers.append(filename)

Turns to:
        for filename in filenames:
            if (filename.endswith('.c') or filename.endswith('.cpp') or
                filename.endswith('.XX YY') or filename.endswith('.cxx')):
                filename = os.path.abspath(filename)
                self._scanner.lex_filename(filename)
            else:
                headers.append(filename)

I think it's clear why that isn't a good idea.

The next affected line is 273:
        cpp_args = ['cc', '-E', '-C', '-I.', '-']

        cpp_args += self._cpp_options
        proc = subprocess.Popen(cpp_args,
                                stdin=subprocess.PIPE,
                                stdout=subprocess.PIPE)

Turns to:
        cpp_args = ['XX YY', '-E', '-C', '-I.', '-']

        cpp_args += self._cpp_options
        proc = subprocess.Popen(cpp_args,
                                stdin=subprocess.PIPE,
                                stdout=subprocess.PIPE)

However the subprocess.Popen constructor requires the following form:
        cpp_args = ['XX', 'YY', '-E', '-C', '-I.', '-']

Fix: The attached patch causes line 239 no longer to be touched and performs the correct substitution for subprocess.Popen in line 273.

Patch attached with submission follows:
How-To-Repeat: Build with no-default CC, to trigger a build fail use CC with spaces.
Comment 1 Edwin Groothuis freebsd_committer freebsd_triage 2011-07-08 09:40:11 UTC
Responsible Changed
From-To: freebsd-ports-bugs->gnome

Over to maintainer (via the GNATS Auto Assign Tool)
Comment 2 Koop Mast freebsd_committer freebsd_triage 2012-02-27 22:46:46 UTC
State Changed
From-To: open->patched

This is patched in our devel tree.
Comment 3 Jeremy Messenger freebsd_committer freebsd_triage 2012-03-14 05:18:28 UTC
State Changed
From-To: patched->closed

Committed, thanks!
Comment 4 dfilter service freebsd_committer freebsd_triage 2012-03-14 05:18:33 UTC
mezz        2012-03-14 05:18:19 UTC

  FreeBSD ports repository

  Modified files:
    devel/gobject-introspection Makefile 
  Log:
  - Fix the build with no-default CC, to trigger a build fail use CC with
    spaces. [1]
  - Remove the cairo dependency. [2]
  
  PR:             ports/158722 [1]
                  ports/161185 [2]
  Submitted by:   Dominic Fandrey <kamikaze@bsdforen.de> [1]
                  Garrett Cooper <gcooper@ixsystems.com> [2]
  Feature safe:   yes
  
  Revision  Changes    Path
  1.19      +3 -5      ports/devel/gobject-introspection/Makefile
_______________________________________________
cvs-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/cvs-all
To unsubscribe, send any mail to "cvs-all-unsubscribe@freebsd.org"