Bug 186641 - [patch] devel/llvm33 breaks when python3 is default
Summary: [patch] devel/llvm33 breaks when python3 is default
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: Brooks Davis
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-02-11 01:40 UTC by Gereon Kaiping
Modified: 2014-02-14 21:54 UTC (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Gereon Kaiping 2014-02-11 01:40:00 UTC
devel/llvm33 does not configure when python3 is default, due to
python2 syntax (relative imports) being used in __init__.py, but cmake
accepts the default python version even if that is not a python2.

Fix: Enforce PYTHON_VERSION<3 for llvm33 and pass the PYTHON_CMD make
variable to CMake as PYTHON_EXECUTABLE, e.g.:



.if ${PORT_OPTIONS:MLIT}
 MAN1SRCS+=3D             lit.1
-USE_PYTHON=3D            yes
+USE_PYTHON=3D            -2.9
 LIT_COMMANDS=3D          lit llvm-lit FileCheck
 .else
-USE_PYTHON_BUILD=3D      yes
+USE_PYTHON_BUILD=3D      -2.9
 .endif

 .if ${PORT_OPTIONS:MLTOPLUGIN}
@@ -164,7 +164,7 @@
 .if ${PORT_OPTIONS:MCMAKE}
 post-configure:
        ${MKDIR} ${WRKDIR}/cmake
-       cd ${WRKDIR}/cmake && cmake -G "Unix Makefiles" ${WRKSRC}
+       cd ${WRKDIR}/cmake && cmake -D PYTHON_EXECUTABLE=3D${PYTHON_CMD}
-G "Unix Makefiles" ${WRKSRC}
        ${REINPLACE_CMD} -e 's|${WRKDIR}/cmake|${LLVM_PREFIX}|' \
            -e 's|${WRKSRC}/cmake/modules|${DATADIR}/cmake|' \
            ${WRKDIR}/cmake/share/llvm/cmake/LLVMConfig.cmake--QDlkpJ30JLPYaEBOxzlD8TqHqWnnwOmAbPCNZlxANeZH58Xy
Content-Type: text/plain; name="file.diff"
Content-Transfer-Encoding: 7bit
Content-Disposition: attachment; filename="file.diff"

--- Makefile.orig       2014-02-10 22:57:40.000000000 +0000
+++ Makefile    2014-02-10 23:10:15.000000000 +0000
@@ -112,10 +112,10 @@
How-To-Repeat: 
# cd /usr/ports/lang/llvm33
# make -V PYTHON_VERSION
python3.3
# make configure
[=E2=80=A6snip=E2=80=A6]
-- Constructing LLVMBuild project information
CMake Error at CMakeLists.txt:308 (message):
  Unexpected failure executing llvm-build: Traceback (most recent call last=
):

    File "/usr/ports/devel/llvm33/work/llvm-3.3.src/utils/llvm-build/llvm-b=
uild",
line 3, in <module>
      import llvmbuild
    File "/usr/ports/devel/llvm33/work/llvm-3.3.src/utils/llvm-build/llvmbu=
ild/__init__.py",
line 1, in <module>
      from main import main

  ImportError: No module named 'main'


-- Configuring incomplete, errors occurred!
See also "/usr/ports/devel/llvm33/work/cmake/CMakeFiles/CMakeOutput.log".
See also "/usr/ports/devel/llvm33/work/cmake/CMakeFiles/CMakeError.log".
*** Error code 1

Stop.
make[1]: stopped in /usr/ports/devel/llvm33
*** Error code 1

Stop.
make: stopped in /usr/ports/devel/llvm33
Comment 1 Edwin Groothuis freebsd_committer 2014-02-11 01:40:09 UTC
Responsible Changed
From-To: freebsd-ports-bugs->brooks

Over to maintainer (via the GNATS Auto Assign Tool)
Comment 2 dfilter service freebsd_committer 2014-02-14 21:49:22 UTC
Author: brooks
Date: Fri Feb 14 21:49:15 2014
New Revision: 344317
URL: http://svnweb.freebsd.org/changeset/ports/344317
QAT: https://qat.redports.org/buildarchive/r344317/

Log:
  Fix build when python 3 is the default.
  
  PR:		ports/186641, ports/186642
  Submitted by:	Gereon Kaiping <kta1c10!gereon@linta.de>

Modified:
  head/devel/llvm33/Makefile
  head/lang/clang33/Makefile

Modified: head/devel/llvm33/Makefile
==============================================================================
--- head/devel/llvm33/Makefile	Fri Feb 14 21:03:41 2014	(r344316)
+++ head/devel/llvm33/Makefile	Fri Feb 14 21:49:15 2014	(r344317)
@@ -2,7 +2,7 @@
 
 PORTNAME=	llvm
 PORTVERSION=	3.3
-PORTREVISION=	7
+PORTREVISION=	8
 CATEGORIES=	devel lang
 MASTER_SITES=	http://llvm.org/releases/${PORTVERSION}/
 DISTNAME=	${PORTNAME}-${PORTVERSION}.src
@@ -112,10 +112,10 @@ CONFIGURE_ARGS+=	--disable-docs
 
 .if ${PORT_OPTIONS:MLIT}
 MAN1SRCS+=		lit.1
-USE_PYTHON=		yes
+USE_PYTHON=		-2.9
 LIT_COMMANDS=		lit llvm-lit FileCheck
 .else
-USE_PYTHON_BUILD=	yes
+USE_PYTHON_BUILD=	-2.9
 .endif
 
 .if ${PORT_OPTIONS:MLTOPLUGIN}
@@ -164,7 +164,7 @@ post-patch:
 .if ${PORT_OPTIONS:MCMAKE}
 post-configure:
 	${MKDIR} ${WRKDIR}/cmake
-	cd ${WRKDIR}/cmake && cmake -G "Unix Makefiles" ${WRKSRC}
+	cd ${WRKDIR}/cmake && cmake -DPYTHON_EXECUTABLE=${PYTHON_CMD} -G "Unix Makefiles" ${WRKSRC}
 	${REINPLACE_CMD} -e 's|${WRKDIR}/cmake|${LLVM_PREFIX}|' \
 	    -e 's|${WRKSRC}/cmake/modules|${DATADIR}/cmake|' \
 	    ${WRKDIR}/cmake/share/llvm/cmake/LLVMConfig.cmake

Modified: head/lang/clang33/Makefile
==============================================================================
--- head/lang/clang33/Makefile	Fri Feb 14 21:03:41 2014	(r344316)
+++ head/lang/clang33/Makefile	Fri Feb 14 21:49:15 2014	(r344317)
@@ -2,7 +2,7 @@
 
 PORTNAME=	clang
 DISTVERSION=	3.3
-PORTREVISION=	4
+PORTREVISION=	5
 CATEGORIES=	lang devel
 MASTER_SITES=	http://llvm.org/releases/${PORTVERSION}/
 PKGNAMESUFFIX=	${LLVM_SUFFIX}
@@ -34,7 +34,7 @@ GNU_CONFIGURE=	yes
 GNU_CONFIGURE_PREFIX=	${LLVM_PREFIX}
 USES=		gmake perl5
 USE_LDCONFIG=	yes
-USE_PYTHON_BUILD=	yes
+USE_PYTHON_BUILD=	-2.9
 
 MAKE_ARGS=	CLANG_TBLGEN=${WRKSRC}/${RELTYPE}/bin/clang-tblgen \
 		LLVMIncDir=${LLVM_PREFIX}/include \
_______________________________________________
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 3 Brooks Davis freebsd_committer 2014-02-14 21:54:37 UTC
State Changed
From-To: open->closed

Committed.  Thanks for your submission!