Skip to content

Commit

Permalink
port:binutils : make build again and add devport to allow building gcc
Browse files Browse the repository at this point in the history
Committed from host : Bola
  • Loading branch information
RJVB committed Mar 13, 2024
1 parent bdf1653 commit 78d511b
Showing 1 changed file with 50 additions and 31 deletions.
81 changes: 50 additions & 31 deletions devel/binutils/Portfile
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
# -*- coding: utf-8; mode: tcl; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- vim:fenc=utf-8:ft=tcl:et:sw=4:ts=4:sts=4

PortSystem 1.0
PortGroup locale_select 1.0
PortGroup save_configure_cmd 1.0

name binutils
version 2.30 ; revision 1
version 2.30 ; revision 2

checksums rmd160 5b6152ff36d55da3b5da3a21b372897da66d953c \
sha256 efeade848067e9a03f1918b1da0d37aaffa0b0127a06b5e9236229851d9d0c09
Expand Down Expand Up @@ -35,18 +37,30 @@ configure.args --enable-option-checking \
--with-isl=${prefix}

platform linux {
###############################
PortGroup devport 1.0
create_devport port:${name}

if {![is_mainport]} {
# nothing else to be done
return
}
###############################

configure.args-append \
--enable-compressed-debug-sections=all
configure.env-append \
LIBS="-L${prefix}/lib -lintl"
"LIBS=-L${prefix}/lib -lintl"
build.env-append \
LIBS="-L${prefix}/lib -lintl"
"LIBS=-L${prefix}/lib -lintl"
}

configure.save_configure_cmd "install log"

# The Makefile runs configure again in subdirectories.
# It correcty passes along most configure variables (CFLAGS, LDFLAGS, ...),
# but seems to neglect CPPFLAGS.
build.env-append CPPFLAGS='-I${prefix}/include'
build.env-append "CPPFLAGS=-I${prefix}/include"

# Binutils violates the mtree layout by creating ${prefix}/<arch>/
destroot.violate_mtree yes
Expand All @@ -59,7 +73,7 @@ destroot.violate_mtree yes
universal_variant no

post-destroot {
set archdir "${prefix}/${os.arch}-pc-linux-gnu"
set archdir "${prefix}/${build_arch}-pc-linux-gnu"
# the MacPorts install/activation process breaks hard symlinks
file delete ${destroot}${archdir}/bin/ld.bfd
ln -s ld ${destroot}${archdir}/bin/ld.bfd
Expand All @@ -70,34 +84,39 @@ post-destroot {
ln -s ${archdir}/bin/${b} ${destroot}${prefix}/bin/
}
}

register_devport_standard_content
#append_to_devport_standard_content bla
create_devport_content_archive
}


# notes "Having ${name} installed will cause some other ports to\
# fail to build. Consider uninstalling ${name}."

configure.post_args-append "|& tee -a ${workpath}/.macports.${subport}.configure.log'"
pre-configure {
set cmd [join "${configure.cmd} ${configure.pre_args} ${configure.args}"]
configure.pre_args-prepend "-cf '${configure.cmd} "
configure.cmd "/bin/csh"
ui_debug "configure command set to `${configure.cmd} ${configure.pre_args} ${configure.args} ${configure.post_args}`"
system "echo '## ${cmd}' > ${workpath}/.macports.${subport}.configure.log"
}
post-configure {
if {![catch {set fd [open "${workpath}/.macports.${subport}.configure.cmd" "w"]} err]} {
foreach var [array names ::env] {
puts ${fd} "${var}=$::env(${var})"
}
puts ${fd} "[join [lrange [split ${configure.env} " "] 0 end] "\n"]\n"
puts ${fd} "cd ${worksrcpath}"
if {[info exists configure.post_args]} {
puts ${fd} "${configure.cmd} ${configure.pre_args} ${configure.args} ${configure.post_args}"
} else {
puts ${fd} "${configure.cmd} ${configure.pre_args} ${configure.args}"
}
} else {
if {[info exists fd]} {
unset fd
}
}
}
#configure.post_args-append "|& tee -a ${workpath}/.macports.${subport}.configure.log'"
#pre-configure {
# set cmd [join "${configure.cmd} ${configure.pre_args} ${configure.args}"]
# configure.pre_args-prepend "-cf '${configure.cmd} "
# configure.cmd "/bin/csh"
# ui_debug "configure command set to `${configure.cmd} ${configure.pre_args} ${configure.args} ${configure.post_args}`"
# system "echo '## ${cmd}' > ${workpath}/.macports.${subport}.configure.log"
#}
#post-configure {
# if {![catch {set fd [open "${workpath}/.macports.${subport}.configure.cmd" "w"]} err]} {
# foreach var [array names ::env] {
# puts ${fd} "${var}=$::env(${var})"
# }
# puts ${fd} "[join [lrange [split ${configure.env} " "] 0 end] "\n"]\n"
# puts ${fd} "cd ${worksrcpath}"
# if {[info exists configure.post_args]} {
# puts ${fd} "${configure.cmd} ${configure.pre_args} ${configure.args} ${configure.post_args}"
# } else {
# puts ${fd} "${configure.cmd} ${configure.pre_args} ${configure.args}"
# }
# } else {
# if {[info exists fd]} {
# unset fd
# }
# }
#}

0 comments on commit 78d511b

Please sign in to comment.