Bug 218470 - multimedia/handbrake hard codes gcc / ignores CC
Summary: multimedia/handbrake hard codes gcc / ignores CC
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: --- Affects Some People
Assignee: Thomas Zander
URL:
Keywords:
Depends on:
Blocks: 218330
  Show dependency treegraph
 
Reported: 2017-04-07 22:06 UTC by Gerald Pfeifer
Modified: 2017-04-08 22:14 UTC (History)
2 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Gerald Pfeifer freebsd_committer freebsd_triage 2017-04-07 22:06:38 UTC
Testing a patch to align the lang/gcc* ports with other languages
and default to lang/gcc5 (instead of lang/gcc is it currently is)
it turns out that multimedia/handbrake apparently ignore CC and
simply checks for gcc:

http://package18.nyi.freebsd.org/data/110amd64-default-PR218330/2017-04-06_19h28m41s/logs/errors/fusefs-lkl-4.8.493_2.log
Comment 1 Yuichiro NAITO 2017-04-08 10:13:04 UTC
Do you mean the result of following log?

http://package18.nyi.freebsd.org/data/110amd64-default-PR218330/2017-04-06_19h28m41s/logs/errors/handbrake-1.0.3.log

HandBrake uses original configure script written in Python
that uses hard coded 'gcc'.

I made a quick fix for the configure script.
Does this work as you expect?

```
Index: files/patch-make_configure.py
===================================================================
--- files/patch-make_configure.py	(revision 437996)
+++ files/patch-make_configure.py	(working copy)
@@ -36,6 +36,15 @@
      grp.add_option( '--flatpak', default=False, action='store_true', help=h )
      cli.add_option_group( grp )

+@@ -1517,7 +1520,7 @@ try:
+     class Tools:
+         ar    = ToolProbe( 'AR.exe',    'ar' )
+         cp    = ToolProbe( 'CP.exe',    'cp' )
+-        gcc   = ToolProbe( 'GCC.gcc',   'gcc', IfHost( 'gcc-4', '*-*-cygwin*' ))
++        gcc   = ToolProbe( 'GCC.gcc',   'gcc', IfHost( 'gcc-4', '*-*-cygwin*' ), IfHost( os.environ['CC'], '*-*-freebsd*' ))
+
+         if host.match( '*-*-darwin*' ):
+             gmake = ToolProbe( 'GMAKE.exe', 'make', 'gmake' )
 @@ -1924,10 +1927,15 @@ int main()
          doc.add( 'GCC.sysroot', '' )
          doc.add( 'GCC.minver', '' )
```
Comment 2 Thomas Zander freebsd_committer freebsd_triage 2017-04-08 13:42:37 UTC
(In reply to naito.yuichiro from comment #1)

This patch makes it pick up CC. I could also get it to use ccache with it.
I'll commit a variant of it (as it is useful in either case), then Gerald can check whether we need something in addition.
Comment 3 commit-hook freebsd_committer freebsd_triage 2017-04-08 13:50:19 UTC
A commit references this bug:

Author: riggs
Date: Sat Apr  8 13:49:14 UTC 2017
New revision: 438043
URL: https://svnweb.freebsd.org/changeset/ports/438043

Log:
  Honour CC var instead of hardcoded gcc

  PR:		218470
  Submitted by:	naito.yuichiro@gmail.com
  Reported by:	gerald

Changes:
  head/multimedia/handbrake/Makefile
  head/multimedia/handbrake/files/patch-make_configure.py
Comment 4 Thomas Zander freebsd_committer freebsd_triage 2017-04-08 13:52:46 UTC
Thanks again, closing for now.

@gerald, feel free to reopen if we need additional effort here.
Comment 5 Gerald Pfeifer freebsd_committer freebsd_triage 2017-04-08 22:14:53 UTC
Thank you so much, Naito-san, and thanks for your help getting this
in, Thomas!