Skip to content

Commit 42f06bb

Browse files
committed
gcc14: Make default runtime provider
1 parent 7206de1 commit 42f06bb

File tree

4 files changed

+26
-89
lines changed

4 files changed

+26
-89
lines changed

lang/gcc12/Portfile

+1-1
Original file line numberDiff line numberDiff line change
@@ -376,7 +376,7 @@ if {${subport} eq ${libgccname}} {
376376
# No need to build as nothing that isn't provided by libgcc13
377377
platforms any
378378

379-
depends_run path:share/doc/libgcc/README:libgcc
379+
depends_run port:libgcc13
380380
depends_lib
381381

382382
fetch.type none

lang/gcc13/Portfile

+14-84
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ PortGroup compiler_blacklist_versions 1.0
66
PortGroup active_variants 1.1
77
PortGroup conflicts_build 1.0
88

9-
epoch 0
9+
epoch 1
1010
name gcc13
1111

1212
homepage https://gcc.gnu.org/
@@ -62,7 +62,7 @@ depends_lib-append port:cctools \
6262
port:zlib \
6363
port:zstd
6464
depends_run-append port:gcc_select \
65-
path:share/doc/libgcc/README:libgcc
65+
port:libgcc13
6666

6767
depends_skip_archcheck-append gcc_select ld64 cctools
6868
license_noconflict gmp mpfr ppl libmpc zlib
@@ -340,9 +340,6 @@ proc dylib_list {location} {
340340

341341
if {${subport} eq ${libgccname}} {
342342

343-
# Always provides primary runtime so always in conflict
344-
conflicts libgcc-devel
345-
346343
# Activate hack for new libgcc
347344
# https://trac.macports.org/wiki/PortfileRecipes#deactivatehack
348345
pre-activate {
@@ -388,88 +385,21 @@ if {${subport} eq ${libgccname}} {
388385
}
389386
}
390387

391-
# http://trac.macports.org/ticket/35770
392-
# http://trac.macports.org/ticket/38814
393-
# While there can be multiple versions of these runtimes in a single
394-
# process, it is not possible to pass objects between different versions,
395-
# so we simplify this by having the libgcc port provide the newest version
396-
# of these runtimes for all versions of gcc to use.
397-
#
398-
# If there is a binary incompatible change to the runtime in a future
399-
# version of gcc, then the latest version of gcc to provide a given ABI
400-
# version should continue to provide a subport for that and older gcc
401-
# versions.
402-
403-
depends_run
404-
depends_lib-delete port:zlib port:libiconv
405-
depends_build-append {*}${depends_lib}
406-
depends_lib port:zlib port:libiconv
407-
408-
configure.args-replace \
409-
--libdir=${prefix}/lib/${name} \
410-
--libdir=${prefix}/lib/libgcc
411-
412-
configure.args-replace \
413-
--with-gxx-include-dir=${prefix}/include/${name}/c++/ \
414-
--with-gxx-include-dir=${prefix}/include/gcc/c++/
415-
416-
post-destroot {
417-
418-
# Temporary working dir for dylibs
419-
file mkdir ${destroot}${prefix}/lib/libgcc.merged
420-
421-
# loop over libs to install
422-
set dylibs [dylib_list ${destroot}${prefix}/lib/libgcc]
423-
foreach dylib ${dylibs} {
424-
425-
# Different OS versions (e.g. Leopard) or architectures (e.g. PPC) don't produce all the dylibs
426-
# https://trac.macports.org/ticket/40098
427-
# https://trac.macports.org/ticket/40100
428-
if { ![file exists ${destroot}${prefix}/lib/libgcc/${dylib}] } {
429-
continue
430-
}
431-
432-
# Move dylib to temp area
433-
move ${destroot}${prefix}/lib/libgcc/${dylib} ${destroot}${prefix}/lib/libgcc.merged
388+
# No need to build as nothing that isn't provided by libgcc14
389+
platforms any
434390

435-
# If needed create versionless sym link to dylib
436-
set dylib_split [split ${dylib} "."]
437-
set dylib_nover ${destroot}${prefix}/lib/libgcc.merged/[lindex ${dylib_split} 0].[lindex ${dylib_split} end]
438-
if { ![file exists ${dylib_nover}] } {
439-
ln -s ${dylib} ${dylib_nover}
440-
}
441-
442-
# Universal support
443-
if {[variant_exists universal] && [variant_isset universal]} {
444-
foreach archdir [glob ${destroot}${prefix}/lib/libgcc/*/] {
445-
set archdir_nodestroot [string map "${destroot}/ /" ${archdir}]
446-
if {[file exists ${archdir}/${dylib}]} {
447-
system "install_name_tool -id ${prefix}/lib/libgcc/${dylib} ${archdir}/${dylib}"
448-
foreach link [glob -tails -directory ${archdir} *.dylib] {
449-
system "install_name_tool -change ${archdir_nodestroot}${link} ${prefix}/lib/libgcc/${link} ${archdir}/${dylib}"
450-
}
451-
system "lipo -create -output ${destroot}${prefix}/lib/libgcc.merged/${dylib}~ ${destroot}${prefix}/lib/libgcc.merged/${dylib} ${archdir}/${dylib} && mv ${destroot}${prefix}/lib/libgcc.merged/${dylib}~ ${destroot}${prefix}/lib/libgcc.merged/${dylib}"
452-
}
453-
}
454-
}
455-
456-
# strip debug symbols to supress debugger warnings:
457-
# http://trac.macports.org/attachment/ticket/34831
458-
if {! [string match *libgcc_ext* ${dylib}]} {
459-
system "strip -x ${destroot}${prefix}/lib/libgcc.merged/${dylib}"
460-
}
461-
}
462-
463-
file delete -force ${destroot}${prefix}/bin
464-
file delete -force ${destroot}${prefix}/share
465-
file delete -force ${destroot}${prefix}/lib/libgcc
466-
file delete -force ${destroot}${prefix}/libexec
467-
468-
move ${destroot}${prefix}/lib/libgcc.merged ${destroot}${prefix}/lib/libgcc
391+
depends_run path:share/doc/libgcc/README:libgcc
392+
depends_lib
469393

470-
# For binary compatibility with binaries that linked against the old libstdcxx port
471-
ln -s libgcc/libstdc++.6.dylib ${destroot}${prefix}/lib/libstdc++.6.dylib
394+
fetch.type none
395+
build { }
396+
use_configure no
397+
patchfiles
472398

399+
destroot {
400+
set doc_dir ${destroot}${prefix}/share/doc/${subport}
401+
xinstall -m 755 -d ${doc_dir}
402+
system "echo ${subport} provides no runtime > ${doc_dir}/README"
473403
}
474404

475405
}

lang/gcc14/Portfile

+9-2
Original file line numberDiff line numberDiff line change
@@ -342,8 +342,7 @@ proc dylib_list {location} {
342342
if {${subport} eq ${libgccname}} {
343343

344344
# Always provides primary runtime so always in conflict
345-
# Until promoted to default runtime, conflict with libgcc13
346-
conflicts libgcc-devel libgcc13
345+
conflicts libgcc-devel
347346

348347
# Activate hack for new libgcc
349348
# https://trac.macports.org/wiki/PortfileRecipes#deactivatehack
@@ -380,6 +379,14 @@ if {${subport} eq ${libgccname}} {
380379
registry_deactivate_composite libgcc12 "" [list ports_nodepcheck 1]
381380
}
382381
}
382+
if {![catch {set installed [lindex [registry_active libgcc13] 0]}]} {
383+
# Extract the epoch of the installed libgcc13
384+
set _epoch [lindex $installed 5]
385+
# If < 1 need to deactivate
386+
if {[vercmp $_epoch < 1]} {
387+
registry_deactivate_composite libgcc13 "" [list ports_nodepcheck 1]
388+
}
389+
}
383390
if {![catch {set installed [lindex [registry_active libgcc-devel] 0]}]} {
384391
# Extract the epoch of the installed libgcc-devel
385392
set _epoch [lindex $installed 5]

lang/libgcc/Portfile

+2-2
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ PortGroup select 1.0
55

66
epoch 3
77
name libgcc
8-
version 7.0
8+
version 8.0
99
revision 0
1010

1111
conflicts libgcc-devel
@@ -34,7 +34,7 @@ variant universal { }
3434
if { ${os.major} < 10 } {
3535
set gcc_version 7
3636
} else {
37-
set gcc_version 13
37+
set gcc_version 14
3838
}
3939
depends_lib port:libgcc${gcc_version}
4040

0 commit comments

Comments
 (0)