NetBSD Problem Report #50722

From www@NetBSD.org  Thu Jan 28 23:23:41 2016
Return-Path: <www@NetBSD.org>
Received: from mail.netbsd.org (mail.NetBSD.org [199.233.217.200])
	(using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
	(Client CN "mail.netbsd.org", Issuer "Postmaster NetBSD.org" (verified OK))
	by mollari.NetBSD.org (Postfix) with ESMTPS id 8A80E7ABF0
	for <gnats-bugs@gnats.NetBSD.org>; Thu, 28 Jan 2016 23:23:41 +0000 (UTC)
Message-Id: <20160128232340.1DC147ACBE@mollari.NetBSD.org>
Date: Thu, 28 Jan 2016 23:23:40 +0000 (UTC)
From: okuyama@flex.phys.tohoku.ac.jp
Reply-To: okuyama@flex.phys.tohoku.ac.jp
To: gnats-bugs@NetBSD.org
Subject: do not hardcode lang/gcc48 in gfortran.mk
X-Send-Pr-Version: www-1.0

>Number:         50722
>Category:       pkg
>Synopsis:       do not hardcode lang/gcc48 in gfortran.mk
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    pkg-manager
>State:          closed
>Class:          change-request
>Submitter-Id:   net
>Arrival-Date:   Thu Jan 28 23:25:00 +0000 2016
>Closed-Date:    Mon Sep 12 12:28:41 +0000 2016
>Last-Modified:  Mon Sep 12 12:28:41 +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}

>Release-Note:

>Audit-Trail:
From: "Maya Rashish" <maya@netbsd.org>
To: gnats-bugs@gnats.NetBSD.org
Cc: 
Subject: PR/50722 CVS commit: pkgsrc/mk/compiler
Date: Mon, 12 Sep 2016 12:18:13 +0000

 Module Name:	pkgsrc
 Committed By:	maya
 Date:		Mon Sep 12 12:18:13 UTC 2016

 Modified Files:
 	pkgsrc/mk/compiler: gfortran.mk

 Log Message:
 Introduce GFORTRAN_VERSION, pick which version of gfortran is used.

 modified patch from Rin Okuyama
 PR pkg/50722: do not hardcode lang/gcc48 in gfortran.mk

 "looks ok, needs docs" - wiz
 "it'll do for now, ideally I'd like something more robust and possibly
 integrate into gcc.mk's path selection" - jperkin


 To generate a diff of this commit:
 cvs rdiff -u -r1.8 -r1.9 pkgsrc/mk/compiler/gfortran.mk

 Please note that diffs are not public domain; they are subject to the
 copyright notices on the relevant files.

State-Changed-From-To: open->closed
State-Changed-By: maya@NetBSD.org
State-Changed-When: Mon, 12 Sep 2016 12:28:41 +0000
State-Changed-Why:
committed the change, thanks!


>Unformatted:

NetBSD Home
NetBSD PR Database Search

(Contact us) $NetBSD: query-full-pr,v 1.39 2013/11/01 18:47:49 spz Exp $
$NetBSD: gnats_config.sh,v 1.8 2006/05/07 09:23:38 tsutsui Exp $
Copyright © 1994-2014 The NetBSD Foundation, Inc. ALL RIGHTS RESERVED.