tech-pkg archive

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

Re: gcc runtime dependency



>>On Sat, May 21, 2022 at 07:55:39AM +0000, Nia Alarie wrote:
[...]
>> Modified files:
>> 
>> Index: pkgsrc/audio/strawberry/Makefile
>> diff -u pkgsrc/audio/strawberry/Makefile:1.34 pkgsrc/audio/strawberry/Makefile:1.35
>> --- pkgsrc/audio/strawberry/Makefile:1.34	Mon Apr 18 19:10:26 2022
>> +++ pkgsrc/audio/strawberry/Makefile	Sat May 21 07:55:39 2022
>> @@ -1,4 +1,4 @@
>> -# $NetBSD: Makefile,v 1.34 2022/04/18 19:10:26 adam Exp $
>> +# $NetBSD: Makefile,v 1.35 2022/05/21 07:55:39 nia Exp $
>>  
>>  DISTNAME=	strawberry-1.0.4
>>  PKGREVISION=	1
>> @@ -17,6 +17,7 @@ TOOL_DEPENDS+=	qt5-qttools-[0-9]*:../../
>>  USE_CMAKE=	yes
>>  USE_LANGUAGES=	c c++
>>  USE_TOOLS+=	pkg-config
>> +GCC_REQD+=	7 # std::optional
>>  
>>  DEPENDS+=	gst-plugins1-flac-[0-9]*:../../audio/gst-plugins1-flac
>>  DEPENDS+=	gst-plugins1-mpg123-[0-9]*:../../audio/gst-plugins1-mpg123
>> @@ -39,6 +40,14 @@ DEPENDS+=	gst-plugins1-oss-[0-9]*:../../
>>  
>>  .if ${OPSYS} == "NetBSD"
>>  PREFER.sqlite3=	pkgsrc # fts5
>> +# This package will link against libstdc++.so from the pkgsrc GCC when the
>> +# base OS GCC doesn't meet the minimum requirement. Thus we do this so the
>> +# appropriate gcc-libs package will be captured as a dependency, otherwise
>> +# binary packages will be broken.
>> +.  if ${OPSYS_VERSION} < 090000
>> +USE_PKGSRC_GCC=		yes
>> +USE_PKGSRC_GCC_RUNTIME=	yes
>> +.  endif
>
>Can we somehow put that bit in the infrastructure? We have it in quite
>a number of packages now.
> Thomas

Hello,

As mentioned by John Klos in another thread ("gcc 7.5.0 as dependency
for tcsh in NetBSD-8?"), these changes have had unintended (I assume)
consequences. r. 1.240 of mk/compiler/gcc.mk is misbehaving on NetBSD
8.x such that GCC 7 will universally be required from pkgsrc.

We have this:

_GCC7_PATTERNS= 5 6 [0-6].* 7 7.*

being processed by this:

# Determine which GCC version is required by examining _GCC_REQD.
_NEED_GCC7?=	no
.for _pattern_ in ${_GCC7_PATTERNS}
.  if !empty(_GCC_REQD:M${_pattern_})
.    if ${OPSYS} == "NetBSD" && ${OPSYS_VERSION} < 089937
USE_PKGSRC_GCC=		yes
USE_PKGSRC_GCC_RUNTIME=	yes
.    endif
_NEED_GCC7=	yes
.  endif
.endfor

where _GCC_REQD starts out with a value that will always match what's
in _GCC7_PATTERNS.

If you're running amd64 (for example), you'll end up with a dependency
pattern of gcc7 >= 3.0 (assuming the package hasn't explicitly set
GCC_REQD to something else), but the pkgsrc origin of GCC is explicitly
enforced in that block, so it becomes a universal requirement.

At minimum, I think these USE_PKGSRC_* overrides need to be placed a
lot further on in the code. The way this code generally handles GCC
versioning is a bit baroque, so I'm not sure if the previous version --
which also applied "[0-6].*", for GCC 6 instead -- worked the way it
did deliberately or by accident.

Regards,

Dave



Home | Main Index | Thread Index | Old Index