[90722] trunk/dports/cross/avr-gcc/Portfile
g5pw at macports.org
g5pw at macports.org
Tue Mar 13 11:45:34 PDT 2012
Revision: 90722
http://trac.macports.org/changeset/90722
Author: g5pw at macports.org
Date: 2012-03-13 11:45:34 -0700 (Tue, 13 Mar 2012)
Log Message:
-----------
avr-gcc Portfile
- Added modeline
- Updated to use crossgcc portgroup
- Adopted by g5pw
Modified Paths:
--------------
trunk/dports/cross/avr-gcc/Portfile
Modified: trunk/dports/cross/avr-gcc/Portfile
===================================================================
--- trunk/dports/cross/avr-gcc/Portfile 2012-03-13 18:43:59 UTC (rev 90721)
+++ trunk/dports/cross/avr-gcc/Portfile 2012-03-13 18:45:34 UTC (rev 90722)
@@ -1,263 +1,35 @@
+# -*- coding: utf-8; mode: tcl; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- vim:fenc=utf-8:ft=portfile:et:sw=4:ts=4:sts=4
# $Id$
PortSystem 1.0
+PortGroup crossgcc 1.0
name avr-gcc
-version 4.6.2
-platforms darwin
-categories cross devel
-maintainers nomaintainer
+crossgcc.setup avr 4.6.2
+
+maintainers g5pw
license {GPL-3+ Permissive}
-description GNU cross compilers for Atmel AVR
-long_description GNU compilers collection (c and c++) for Atmel AVR 8bit microcontrollers..
-homepage http://gcc.gnu.org/
-master_sites gnu:gcc/gcc-${version}/
+
distfiles gcc-${version}.tar.bz2
-use_bzip2 yes
-worksrcdir gcc-${version}
-checksums md5 028115c4fbfb6cfd75d6369f4a90d87e \
- sha256 60b05463dfe18d40d68fb8a71b25b408a01f86cc6ceaf5e6b22238b6b0f450c2 \
- rmd160 e7041933b39629f9524848dcf81a1a4c02a225c6
-# Parameters for this port.
-set crossgcc-target avr
-set default-languages --enable-languages="c,c++"
+checksums rmd160 e7041933b39629f9524848dcf81a1a4c02a225c6 \
+ sha256 60b05463dfe18d40d68fb8a71b25b408a01f86cc6ceaf5e6b22238b6b0f450c2
-# All cross ports violate the mtree layout.
-destroot.violate_mtree yes
-
# Download everything to gcc/
dist_subdir gcc
-depends_lib bin:${crossgcc-target}-ar:${crossgcc-target}-binutils \
- bin:${crossgcc-target}-as:${crossgcc-target}-binutils \
- bin:${crossgcc-target}-ld:${crossgcc-target}-binutils \
- bin:${crossgcc-target}-nm:${crossgcc-target}-binutils \
- bin:${crossgcc-target}-ranlib:${crossgcc-target}-binutils \
- port:gmp port:mpfr port:libiconv port:libmpc port:ppl
-depends_build bin:msgfmt:gettext
-
-# Since we don't build gcc and binutils at the same time, gcc's Makefile will try to transform
-# program names as gcc's name (add -${version} with ${version} being the version of gcc).
-# But it won't work because binutils binaries don't have the ${version} suffix, and even if they
-# had, they would actually have the binutils' version suffix (and not gcc's version).
-# So let's tell gcc's Makefile not to do that mistake.
-
-set environment [list AR_FOR_TARGET=${crossgcc-target}-ar \
- AS_FOR_TARGET=${crossgcc-target}-as \
- LD_FOR_TARGET=${crossgcc-target}-ld \
- NM_FOR_TARGET=${crossgcc-target}-nm \
- RANLIB_FOR_TARGET=${crossgcc-target}-ranlib]
-
-
-# Build in a different directory, as advised in the README file.
-pre-configure {
- file mkdir "${workpath}/build"
-}
-
patchfiles-append patch-lto-plugin-osx.diff
-configure.dir ${workpath}/build
-configure.cmd ${workpath}/gcc-${version}/configure
-# configure.cc "cc -no-cpp-precomp"
-configure.env ${environment}
-configure.args --infodir='${prefix}/share/info' \
- --mandir='${prefix}/share/man' \
- --target=${crossgcc-target} \
- --program-prefix=${crossgcc-target}- \
- --with-included-gettext \
+configure.args-delete --enable-languages="c,objc,c++,obj-c++"
+
+configure.args-append --with-included-gettext \
--enable-obsolete \
- --disable-nls \
--enable-lto \
- --with-plugin-ld=${crossgcc-target}-ld \
--disable-libquadmath \
- --with-gxx-include-dir=${prefix}/${crossgcc-target}/include/c++/${version}/ \
- ${default-languages}
+ --enable-languages="c,c++"
if {$build_arch != "" && ${os.platform} == "darwin"} {
- configure.cc_archflags
- configure.cxx_archflags
- configure.objc_archflags
configure.args-append --build=${build_arch}-apple-darwin${os.major} \
--host=${build_arch}-apple-darwin${os.major}
-}
-
-build.dir ${workpath}/build
-
-build.args ${environment}
-destroot.args ${environment}
-
-# left as a reference; this was for gcc-4.0.2
-# don't know if this is still needed for gcc-4.6.2
-#platform darwin 9 {
-# patchfiles-append gcc-config-rs6000-host-darwin.c.diff
-#}
-
-post-patch {
- namespace eval crossgcc {}
-
- # Fix the info pages and related stuff.
- #
- # path: path to the doc directory (e.g. gas/doc/)
- # makefile: path to Makefile.in (e.g. gas/doc/Makefile.in)
- # name: name of the info page (e.g. as)
- # suffix: suffix of the souce page (texinfo or texi)
- proc crossgcc::fixinfo { path makefile name suffix } {
- global crossgcc-target worksrcpath
-
- # Fix the source
- reinplace "s|setfilename ${name}.info|setfilename ${crossgcc-target}-${name}.info|g" \
- ${worksrcpath}/${path}/${name}.${suffix}
- reinplace "s|(${name})|(${crossgcc-target}-${name})|g" \
- ${worksrcpath}/${path}/${name}.${suffix}
- reinplace "s|@file{${name}}|@file{${crossgcc-target}-${name}}|g" \
- ${worksrcpath}/${path}/${name}.${suffix}
-
- # Fix the Makefile
- reinplace "s| ${name}.info| ${crossgcc-target}-${name}.info|g" \
- ${worksrcpath}/${makefile}
- reinplace "s|/${name}.info|/${crossgcc-target}-${name}.info|g" \
- ${worksrcpath}/${makefile}
- reinplace "s|^${name}.info|${crossgcc-target}-${name}.info|g" \
- ${worksrcpath}/${makefile}
- reinplace "s| ${name}.pod| ${crossgcc-target}-${name}.pod|g" \
- ${worksrcpath}/${makefile}
- reinplace "s|/${name}.pod|/${crossgcc-target}-${name}.pod|g" \
- ${worksrcpath}/${makefile}
- reinplace "s|^${name}.pod|${crossgcc-target}-${name}.pod|g" \
- ${worksrcpath}/${makefile}
- reinplace "s| ${name}.${suffix}| ${crossgcc-target}-${name}.${suffix}|g" \
- ${worksrcpath}/${makefile}
- reinplace "s|/${name}.${suffix}|/${crossgcc-target}-${name}.${suffix}|g" \
- ${worksrcpath}/${makefile}
- reinplace "s|^${name}.${suffix}|${crossgcc-target}-${name}.${suffix}|g" \
- ${worksrcpath}/${makefile}
-
- # Rename the source
- file rename ${worksrcpath}/${path}/${name}.${suffix} \
- ${worksrcpath}/${path}/${crossgcc-target}-${name}.${suffix}
-
- # Fix install-info's dir.
- # (note: this may be effectless if there was no info dir to be fixed)
- reinplace "s|--info-dir=\$(DESTDIR)\$(infodir)|--dir-file=\$(DESTDIR)\$(infodir)/${crossgcc-target}-gcc-dir|g" \
- "${worksrcpath}/${makefile}"
- }
-
- # Fix the gettext files and related stuff.
- #
- # module: name of the module (e.g. gas)
- proc crossgcc::fixgettext { module } {
- global crossgcc-target worksrcpath
-
- if { [ file exists "${worksrcpath}/${module}/Makefile.in" ] } {
- reinplace "s|@PACKAGE@|${crossgcc-target}- at PACKAGE@|g" \
- "${worksrcpath}/${module}/Makefile.in"
- }
- if { [ file exists "${worksrcpath}/${module}/doc/Makefile.in" ] } {
- reinplace "s|@PACKAGE@|${crossgcc-target}- at PACKAGE@|g" \
- "${worksrcpath}/${module}/doc/Makefile.in"
- }
- if { [ file exists "${worksrcpath}/${module}/po/Make-in" ] } {
- reinplace "s|@PACKAGE@|${crossgcc-target}- at PACKAGE@|g" \
- "${worksrcpath}/${module}/po/Make-in"
- }
- }
-
- # gcc/doc/cpp.texi
- crossgcc::fixinfo gcc/doc/ gcc/Makefile.in cpp texi
-
- # gcc/doc/cppinternals.texi
- crossgcc::fixinfo gcc/doc/ gcc/Makefile.in cppinternals texi
-
- # gcc/doc/gcc.texi
- crossgcc::fixinfo gcc/doc/ gcc/Makefile.in gcc texi
-
- # gcc/doc/gccint.texi
- crossgcc::fixinfo gcc/doc/ gcc/Makefile.in gccint texi
-
- # libquadmath/libquadmath.texi
- crossgcc::fixinfo libquadmath libquadmath/Makefile.in libquadmath texi
-
- # gcc/f/g77.texi
- crossgcc::fixinfo gcc/fortran/ gcc/fortran/Make-lang.in gfortran texi
-
- # gcc/java/gcj.texi
- crossgcc::fixinfo gcc/java/ gcc/java/Make-lang.in gcj texi
-
- # fastjar/fastjar.texi
- #crossgcc::fixinfo fastjar/ fastjar/Makefile.in fastjar texi
-
- # gcc/doc/gccinstall.info
- crossgcc::fixinfo gcc/doc/ gcc/Makefile.in gccinstall info
-
- # gettext stuff.
- crossgcc::fixgettext gcc
- crossgcc::fixgettext fastjar
-}
-
-pre-destroot {
- # gcc needs the cross directory structure to be present
- # in order to fill it during installation.
- file mkdir "${destroot}${prefix}/${crossgcc-target}/bin"
- file mkdir "${destroot}${prefix}/${crossgcc-target}/lib"
-}
-
-post-destroot {
- namespace eval crossgcc {}
-
- # Rename a man page if it exists.
- #
- # section: section of the man page (e.g. 1)
- # manpage: name of the man page (e.g. cpp)
- proc crossgcc::rename_man_page { section manpage } {
- global crossgcc-target destroot prefix
-
- set manpage_path "${destroot}${prefix}/share/man/man${section}/${manpage}.${section}"
- if { [ file exists ${manpage_path} ] } {
- file rename ${manpage_path} \
- "${destroot}${prefix}/share/man/man${section}/${crossgcc-target}-${manpage}.${section}"
- }
- }
-
- # Stuff I don't want (either because they're in the system
- # or because they would conflict with other FSF ports)
- # (it's easier for maintainability purposes to fix things here)
-
- # aliases for locales (should be on the system)
- file delete "${destroot}${prefix}/share/locale/locale.alias"
-
- # FSF propaganda (should already be there or would conflict)
- file delete -force "${destroot}${prefix}/share/man/man7"
-
- # (host) libiberty
- file delete "${destroot}${prefix}/lib/${build_arch}/libiberty.a"
-
- # aliases for charsets (should already be there)
- file delete "${destroot}${prefix}/lib/charset.alias"
-
- # Remove man pages for tools that are not built as part of cross-gcc
- file delete "${destroot}${prefix}/share/man/man1/rmic.1"
- file delete "${destroot}${prefix}/share/man/man1/rmiregistry.1"
- file delete "${destroot}${prefix}/share/man/man1/jv-convert.1"
- file delete "${destroot}${prefix}/share/man/man1/gij.1"
-
- # For some reason, some man pages are not prefixed while they should have been
- # (to avoid conflicting).
- crossgcc::rename_man_page 1 cpp
- crossgcc::rename_man_page 1 gcjh
- crossgcc::rename_man_page 1 gcov
- crossgcc::rename_man_page 1 jcf-dump
- crossgcc::rename_man_page 1 jv-scan
-
- # There is a bug in gcc/Makefile::install-driver
- # For cross compilers, $(GCC_INSTALL_NAME) is equal to
- # $(target_noncanonical)-gcc-$(version)
- # and hence the driver isn't installed.
- xinstall -c "${workpath}/build/gcc/xgcc" \
- "${destroot}${prefix}/bin/${crossgcc-target}-gcc-${version}"
-}
-
-livecheck.type regex
-livecheck.url http://gcc.gnu.org/releases.html
-livecheck.regex {<tr><td><a href="gcc-.*/">GCC (.*)</a></td> <td>.*</td></tr>}
+}
\ No newline at end of file
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macosforge.org/pipermail/macports-changes/attachments/20120313/d1d69110/attachment-0001.html>
More information about the macports-changes
mailing list