Skip to content

Commit

Permalink
portindex: spoof compiler version
Browse files Browse the repository at this point in the history
  • Loading branch information
mohd-akram committed Jan 5, 2025
1 parent b2dcbb9 commit ec29f4b
Showing 1 changed file with 33 additions and 0 deletions.
33 changes: 33 additions & 0 deletions src/port/portindex.tcl
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,39 @@ set worker_init_script {
package require macports
package require Thread

# Spoof the compiler version
rename macports::get_compiler_version macports::__get_compiler_version
proc macports::get_compiler_version {compiler developer_dir} {
global port_options
if {![dict exists $port_options os.major]} {
return [macports::__get_compiler_version $compiler $developer_dir]
}
set os_major [dict get $port_options os.major]
switch -- [file tail ${compiler}] {
clang {
if {${os_major} >= 22} {
return "1500"
} elseif {${os_major} >= 17} {
return "1000.11.45.2"
} elseif {${os_major} >= 14} {
return "602.0.49"
} elseif {${os_major} >= 12} {
return "500.2.75"
} else {
return "1.0"
}
}
llvm-gcc-4.2 -
gcc-4.2 -
gcc-4.0 {
return "1.0"
}
default {
return -code error "don't know how to determine build number of compiler \"${compiler}\""
}
}
}

proc _read_index {idx} {
global qindex oldfd
set offset [dict get $qindex $idx]
Expand Down

0 comments on commit ec29f4b

Please sign in to comment.