pkgsrc-Bugs archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

pkg/50722: do not hardcode lang/gcc48 in gfortran.mk



>Number:         50722
>Category:       pkg
>Synopsis:       do not hardcode lang/gcc48 in gfortran.mk
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    pkg-manager
>State:          open
>Class:          change-request
>Submitter-Id:   net
>Arrival-Date:   Thu Jan 28 23:25:00 +0000 2016
>Originator:     Rin Okuyama
>Release:        pkgsrc-current (20160128)
>Organization:
Department of Physics, Tohoku University
>Environment:
NetBSD XXX 7.99.25 NetBSD 7.99.25 (GENERIC) #0: Fri Jan  8 09:56:49 JST 2016  rin@XXX:XXX amd64
>Description:
Today, lang/gcc48 is hardcoded in gfortran.mk. As a result, for example,
even if lang/gcc5 is installed, lang/gcc48 is additionally required by
packages depending on gfortran.

With the attached patch, the user can choose the version of gcc via the
variable GFORTRAN_VERSION. I've checked that math/coinmp can be built
with gfortran in lang/gcc5, by setting PKGSRC_FORTRAN=gfortran and
GFORTRAN_VERSION=5.

In this version, GFORTRAN_VERSION is set to 48 by default; even if the
user has gcc5, gcc48 is still required unless he or she explicitly sets
the variable to 5.
>How-To-Repeat:
n/a
>Fix:
--- pkgsrc/mk/compiler/gfortran.mk.orig	2016-01-29 06:46:33.000000000 +0900
+++ pkgsrc/mk/compiler/gfortran.mk	2016-01-29 08:08:17.000000000 +0900
@@ -40,8 +40,15 @@
 
 .include "../../mk/bsd.prefs.mk"
 
-.if !empty(PKGPATH:Mlang/gcc48) || !empty(PKGPATH:Mdevel/patch) || \
-    !empty(PKGPATH:Mdevel/libtool-base)
+_ver_=	44 45 46 47 48 49 5
+.if defined(GFORTRAN_VERSION) && empty(_ver_:M${GFORTRAN_VERSION})
+.error GFORTRAN_VERSION=${GFORTRAN_VERSION} is not supported. Choose one of the\
+following: ${_ver_}.
+.endif
+GFORTRAN_VERSION?=	48
+
+.if !empty(PKGPATH:Mlang/gcc${GFORTRAN_VERSION}) || \
+    !empty(PKGPATH:Mdevel/patch) || !empty(PKGPATH:Mdevel/libtool-base)
 IGNORE_GFORTRAN=	yes
 MAKEFLAGS+=		IGNORE_GFORTRAN=yes
 .endif
@@ -68,7 +75,7 @@
 .endif
 
 .if !empty(_USE_GFORTRAN:M[yY][eE][sS])
-_GFORTRANBASE=	${LOCALBASE}/gcc48
+_GFORTRANBASE=	${LOCALBASE}/gcc${GFORTRAN_VERSION}
 FC=		gfortran
 
 _GFORTRAN_DIR=	${WRKDIR}/.gfortran
@@ -89,8 +96,8 @@
 .  endif
 
 # Add the dependency on gfortran.
-BUILDLINK_DEPMETHOD.gcc48=	full
-.  include "../../lang/gcc48/buildlink3.mk"
+BUILDLINK_DEPMETHOD.gcc${GFORTRAN_VERSION}=	full
+.  include "../../lang/gcc${GFORTRAN_VERSION}/buildlink3.mk"
 
 .  if defined(GFORTRAN_DIR) && !empty(GFORTRAN_DIR)
 PKGSRC_MAKE_ENV+=	GFORTRAN_DIR=${GFORTRAN_DIR:Q}



Home | Main Index | Thread Index | Old Index