diff options
author | Richard Yao <ryao@gentoo.org> | 2012-11-09 20:58:01 +0000 |
---|---|---|
committer | Richard Yao <ryao@gentoo.org> | 2012-11-09 20:58:01 +0000 |
commit | 4326c81d045b4489b5f0c37e3f2613e228a04be6 (patch) | |
tree | 1c7ad921dc1d63cd808c40f45474b4e73f87bcbb /sys-freebsd | |
parent | Mask new u-boot-tools (diff) | |
download | historical-4326c81d045b4489b5f0c37e3f2613e228a04be6.tar.gz historical-4326c81d045b4489b5f0c37e3f2613e228a04be6.tar.bz2 historical-4326c81d045b4489b5f0c37e3f2613e228a04be6.zip |
Install libusb-1.0.pc to make sys-apps/usbutils happy
Package-Manager: portage-2.1.11.31/cvs/Linux x86_64
Diffstat (limited to 'sys-freebsd')
-rw-r--r-- | sys-freebsd/freebsd-lib/ChangeLog | 10 | ||||
-rw-r--r-- | sys-freebsd/freebsd-lib/Manifest | 14 | ||||
-rw-r--r-- | sys-freebsd/freebsd-lib/files/libusb-1.0.pc.in | 11 | ||||
-rw-r--r-- | sys-freebsd/freebsd-lib/freebsd-lib-9.1_rc3-r1.ebuild | 527 |
4 files changed, 549 insertions, 13 deletions
diff --git a/sys-freebsd/freebsd-lib/ChangeLog b/sys-freebsd/freebsd-lib/ChangeLog index d7521b0dabe9..d9e55cd42bd3 100644 --- a/sys-freebsd/freebsd-lib/ChangeLog +++ b/sys-freebsd/freebsd-lib/ChangeLog @@ -1,6 +1,13 @@ # ChangeLog for sys-freebsd/freebsd-lib # Copyright 1999-2012 Gentoo Foundation; Distributed under the GPL v2 -# $Header: /var/cvsroot/gentoo-x86/sys-freebsd/freebsd-lib/ChangeLog,v 1.162 2012/11/06 12:54:50 aballier Exp $ +# $Header: /var/cvsroot/gentoo-x86/sys-freebsd/freebsd-lib/ChangeLog,v 1.163 2012/11/09 20:58:00 ryao Exp $ + +*freebsd-lib-9.1_rc3-r1 (09 Nov 2012) + + 09 Nov 2012; Richard Yao <ryao@gentoo.org> +files/libusb-1.0.pc.in, + +freebsd-lib-9.1_rc3-r1.ebuild, freebsd-lib-9.0-r3.ebuild, + freebsd-lib-9.1_rc1.ebuild: + Install libusb-1.0.pc to make sys-apps/usbutils happy *freebsd-lib-9.1_rc3 (06 Nov 2012) @@ -860,4 +867,3 @@ 19 Oct 2004; Otavio R. Piske <angusyoung@gentoo.org> freebsd-lib-5.2.1.ebuild: Initial release - diff --git a/sys-freebsd/freebsd-lib/Manifest b/sys-freebsd/freebsd-lib/Manifest index 92eff0bcc1f0..d22bb2882edb 100644 --- a/sys-freebsd/freebsd-lib/Manifest +++ b/sys-freebsd/freebsd-lib/Manifest @@ -1,6 +1,3 @@ ------BEGIN PGP SIGNED MESSAGE----- -Hash: SHA256 - AUX freebsd-lib-6.0-flex-2.5.31.patch 421 SHA256 1d46cf13e1059ae3731ba5555764e020fcf4de7db5abf039fac83423e05d53c4 SHA512 c16a99b85e7908e77915796245741cbfcfb30ab1f4f0a8d565c28256b25d1532209ed27328d8b1571f61677251830f1fb6bbec17a8104686f56afd87f3226dec WHIRLPOOL 177f7ee5764f79fcdab768b13016e809f677cfd57a06ebb5e1bbafc6520f309b328908716ee02a8155f35566faefa95b67b064dafa8de9a7d2a19bde92b386b0 AUX freebsd-lib-6.0-gccfloat.patch 542 SHA256 d549125f174c86c2d5e7e1f1c99cf1303b84e91ce8ee51db8c962be48b7a7951 SHA512 810745085c601757397b6d0338dba1631e4f623c3bae8a588e9f0b5c7cd9a9416d832093f97925fcef27ffcf20929bef8a5bcbeecf7a583c0a7eb6ce71f39495 WHIRLPOOL dee1bcf99935ae9ead0d5f498049a46ee89416f06eb7361901c69f40d0151ae1d3647a7dbb1c58b1aca7f541169b20d622019bc20b12953ba0c06fba56fd375e AUX freebsd-lib-6.0-pmc.patch 338 SHA256 36ca464f0aa1ed8784c8f1edc4a3580704c9a7813963684305250d806000075f SHA512 33187ec853ddf0c39680af60b669e60d3e213eba20a2e1ba995c991f04c053c5adcc5169b92c5d1d4cfbc7e03b72af2df4a5349361b41c56ca4a9b91e81bb327 WHIRLPOOL 1744ed829c1775c01b5d1b827b5677b6b5d731cff376da4d8e7ab8facbb0c465131a34157d77186bfcf1a1097f515e3909d1e753aa2b8e72efaf7feae319361f @@ -23,6 +20,7 @@ AUX freebsd-lib-includes.patch 316 SHA256 be4dd4c905715c2d165be282cf377f799b32cc AUX freebsd-lib-new_as.patch 1494 SHA256 6021f34246dcf768a94ffe7273ea2f5590adf6d82ce7fb555234f8012bdbd982 SHA512 f53aa3833179c701a8c0fc6c48c3ab9d1a2694a1c30287ae08e9ea94ddf8c547f7bfe632908b9c3a3ffc4541ed2bf41277a309ffbb7d3eea58d389198d884adb WHIRLPOOL 738b312f04f8a51ab7182c4fde21bfa18d90c9a85486cd071724a61c2ecdb58cb3cdf4c52c50219baab91f15ccebf7de7700267952da65ec52e7c71eab3f954b AUX freebsd-sources-9.0-sysctluint.patch 403 SHA256 884fbc5d6d3766ea3d4609946f56072f36f95368dc13ee316c330a46d42f0c9e SHA512 f3a87cb187858bc6fd1bafda3c3bd7bbda52b07239a50a7c1aa201df2c52a58d4809e196b8799b1949c8ca1a556519d454ad1789358540e3a96cd480fc0a504c WHIRLPOOL 1fd9852d59378b3fa8682886085f4f63ccd2a57806161b9a3ccb0cbe0c465be2e5620ed57942a8687656859e1a9df17c7d298ea66ec037514bbe7707783aa9f8 AUX libmap.conf 201 SHA256 36a1bd56965f171cbb058f6e1762801e3b92c083fe36f6fe046bd669beed9742 SHA512 abc358dff495fe96b9ed549bacb5278577ca4da46b89b87e9211a2f6acdd455111df02ba11b797287f839af6cc22f8810e8ac1dc52154acc8b22364e667b3c49 WHIRLPOOL 0827a0ea9b8a2faed019d13356a793b2b572e54d6f8ebf32a9f12214759153433e21f7d8fdedf43e038ac1925432c1f4843441db47d29895eda51781f1fedb5e +AUX libusb-1.0.pc.in 207 SHA256 edf35e887cbfed2df288825434c467e0a946eeb21e0d631f55940bb177c2ba15 SHA512 93289cecfc298a31fd4fd0848bf25a63048a7549bd81792d7bd158731246221c24ec9f469a918430da56873a0936fb2b372cedaaa32a38ccd5323de0f9a89b93 WHIRLPOOL 7c81b0df4548a9391b4e1420186f1e970aa9e2e73a89e817adbff9de52b8797cbd8a4d8b3ca01f782f86e4b1e48fad72a08b5bff49d5ee6ffaa5135c015ca5ae AUX libusb.pc.in 208 SHA256 9bfe398a335f8b9b1c3dd167ab0c9206fe3bdd4e1da318ece977e20f3c2d7c56 SHA512 e9c6d5f04057cf8c13f69a3d8e07bdd517fdb01d572a69a1beb397766311b3c53894b108caaaea740bfc27b227a9620621dac5846bff1a367fbf9954f38bb40c WHIRLPOOL e80e76a8a564655d924a7148a841c7c7cf0be0ea3bdbd76e95e5004124543826e5d925dfe791f4b040e042a10923865bb517499d9f5be39611fedbcceebe32d8 DIST freebsd-cddl-9.0.tar.bz2 878299 SHA256 80d2efbe5a0dcba98050e420ecc16c6fb8ad4c410c05424a5bf6800de58ced4b SHA512 7ae24468e0e95164e99dcb677472a1bbe6a0cb5e09bff7cc460fea7315ec071247e3a426c182fcf19b3ebbb7b9a1caa0d031d73d7d9dd3be9e2db50839227b4a WHIRLPOOL 8020f629133a469af75045e31dfd6a020a41ee5393d4f941db796add37cc7e6e53e82ab8c3056926b28a7b40734bf772060181ba5f526cf7d5be6fde818519c7 DIST freebsd-cddl-9.1_rc1.tar.bz2 899168 SHA256 966eb6b9dccb0f00381e68cf6fe4b56e485ac4e44914b655e3e4f7106053fb22 SHA512 933f7755ca0b396b427b8c8218fb44033885b66e5215fedd20298e84c93495bad15a3a6ad1384c74757ae3d2de0ebdc50fadc2133179c98488d60bc0fcd95556 WHIRLPOOL fd1bee5fadd44999a26826a2e0f9afee0212f7963fc4129ab6f3c1dff91458a16d8101bd086f5aae6b823599678cbe3bf15e2181bf3c75c2591c2e9701125b85 @@ -96,13 +94,7 @@ EBUILD freebsd-lib-8.2-r1.ebuild 15816 SHA256 0d7ffdafe52db8b8c0c13741d15cf5ef32 EBUILD freebsd-lib-9.0-r3.ebuild 16939 SHA256 ecc43945584cb6a1705b10a22932e7c0a3e69d42abdec19de2a236f989a13681 SHA512 b56cf43b0641e10dad34a833cc1fa90371c320483040610583c8c498cc8e9abef11b47a515255a10531e2e615b15c30a1e15ca47151b4e3afa22405c0ca3dde0 WHIRLPOOL 95ee506b9efe14f7d4801508dabb210f979c1ca44ec89afe86e9138fef5c4aec72d66efde74997e91f4d960c437da57e5e0548ae80d701110dc6ffca683e6c4e EBUILD freebsd-lib-9.1_rc1.ebuild 16864 SHA256 2f363fc9bd9d256d60a6e50fb3c8d400edd701a7fec58fc230eae1e1cd1beecf SHA512 b67d084a151f524410f57bb3bdc7d785c60f152818cc96d138cb2d396cbf33c598adaae27a1964b7f08b4a1df546358434e5b959d2f50430e7cbe19d5faf2831 WHIRLPOOL 1b8e10dbb5c5794bc1be724652481698377bc2e6d21956c1bb9739314fae5cfb9c096fc8a348ee4b751d0cb8ee0a65403b7d10048e9b5b26c843e5559d4cb343 EBUILD freebsd-lib-9.1_rc2.ebuild 16864 SHA256 e8d7d8ffa9e6287e84b047c6be9ca6ea77f348717edf026baecc73ccd62819c2 SHA512 4f345b71c12e50a1823bf6414ab6c7fe1ad7b13d903243ebe1b8404a019b0200c1ff0b38ca4b5d1fb7cd49d46ae2ef52f1067d29a96a025e3132eb6ce5e0c985 WHIRLPOOL e01a431e704edeb476c66b27b0d4b18a2f713f4261abcdb9e213f43be603df95313ae7e9769e0c5b51239590d4f7a79169f38d162fbca7476337655dfc405a01 +EBUILD freebsd-lib-9.1_rc3-r1.ebuild 16993 SHA256 ab207a42b8802a9b3540dbd4ba5c4d029df5494411c5732ec3fdfab9f7a96d55 SHA512 89451686f16254fce14afdb2d98931ccd18c924a4b6cf63a905c3e5fb8000b2bf580d575e9e6047cb8aa4d469f170edbeb589bfe46d86f4011dd8474bfeb199b WHIRLPOOL 8befdb9ef8e0dc16a87ed4c8e98c5c4fc3b782c65ea08182e0706c0879901ae889dd1d9f599dcf50260461ee83bceb14c48347d2f3d203783fe74bce4a129914 EBUILD freebsd-lib-9.1_rc3.ebuild 16864 SHA256 602f5220e8a725ebfd0331d8ff04e6f569a82fae4b52d7b9dcb817d629c85c57 SHA512 5f1c3921f475684db2612df22465a1304d6dedc67c6ed14d7f2c4b16af0ddb974033e7d670a4657ad8532428f04ea790924add726026a285cb6e3349cf1cd001 WHIRLPOOL 3414cc8894a6601c49502d511d0f17b34e2750dfa18624a4adfb3dd758450688b4dd4a1853337a31d0eff2fa1cbcd8b8f61c85add8fdac86835bf8e45c580090 -MISC ChangeLog 33522 SHA256 638d6a136c93265bd7cd806941f20daa506691c4670cac9866a81899a18a5ef8 SHA512 5bd27880485f63d19808919d01d20994f0cdab88410237d9799839a62f77dfc8584d0009ef6c44e1a5f5e3b1649ac7c5ad70b1aa3a39526bf2260f740c22e5c2 WHIRLPOOL e21b8abdd138b3f1bfcd7e5484f301972b1d3fb265260c338a00a6369b475db263eed3ba489fcea6b4c6df5ea59ae68419aff68df78c4230e1ba94420cc7f6b7 +MISC ChangeLog 33774 SHA256 78c78a25b0ea54b8c491b5d4938b28edc222f85448b44919679fbd38cc586712 SHA512 2523b2bf3296cd14f4c168f289b9fb0cab4832a401a15046027b6694906ed02ee8210f4a72de84dcbffe0051df20509b12fcb540ee6468e588767c7bfb469e1b WHIRLPOOL 3fe2f19e5c0abc00fa8aab50e12f44d1137535013672d815c3fcd70f136fab6983a2dd474d10f9e0b87a9d2275156143c76a7115d379544cbff1eaf04383189d MISC metadata.xml 410 SHA256 0ea0a391db3018afdf230e293ffedbc313b4a20db703c8c83fdf144a28c6c246 SHA512 de2a427cd8fcc2c0d7c0a1821f4cc916a280d9c0e21d83fdb7c35d110b48e96854baffc7d469e3461c2a6ee81eaec14d105c45cafbd3aaa37100a525bc60b7af WHIRLPOOL 3b2f587e647dafdb68bdb147bb0d5fecea0e728b52eabb61deb2623641117be6ac0871405666d7616ae1d60eaacf0b621cba8175dca463e9344ad83a4daf5865 ------BEGIN PGP SIGNATURE----- -Version: GnuPG v2.0.19 (GNU/Linux) - -iEYEAREIAAYFAlCZCJwACgkQvFcC4BYPU0oxjwCfaPKxipYulsDbW4lURspM1GC+ -/pEAn0m+A2pAE2Di+SUs6jWCMzn8cKCl -=uNS+ ------END PGP SIGNATURE----- diff --git a/sys-freebsd/freebsd-lib/files/libusb-1.0.pc.in b/sys-freebsd/freebsd-lib/files/libusb-1.0.pc.in new file mode 100644 index 000000000000..058ecb4384a3 --- /dev/null +++ b/sys-freebsd/freebsd-lib/files/libusb-1.0.pc.in @@ -0,0 +1,11 @@ +prefix=/usr +exec_prefix=${prefix} +libdir=@LIBDIR@ +includedir=${prefix}/include + +Name: libusb +Description: USB access library (FreeBSD version) +Version: 1.0.1 +Libs: -L${libdir} -lusb +Cflags: -I${includedir} + diff --git a/sys-freebsd/freebsd-lib/freebsd-lib-9.1_rc3-r1.ebuild b/sys-freebsd/freebsd-lib/freebsd-lib-9.1_rc3-r1.ebuild new file mode 100644 index 000000000000..a76097c0bfee --- /dev/null +++ b/sys-freebsd/freebsd-lib/freebsd-lib-9.1_rc3-r1.ebuild @@ -0,0 +1,527 @@ +# Copyright 1999-2012 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Header: /var/cvsroot/gentoo-x86/sys-freebsd/freebsd-lib/freebsd-lib-9.1_rc3-r1.ebuild,v 1.1 2012/11/09 20:58:00 ryao Exp $ + +EAPI=2 + +inherit bsdmk freebsd flag-o-matic multilib toolchain-funcs eutils + +DESCRIPTION="FreeBSD's base system libraries" +SLOT="0" +KEYWORDS="~amd64-fbsd ~sparc-fbsd ~x86-fbsd" + +# Crypto is needed to have an internal OpenSSL header +# sys is needed for libalias, probably we can just extract that instead of +# extracting the whole tarball +SRC_URI="mirror://gentoo/${LIB}.tar.bz2 + mirror://gentoo/${CONTRIB}.tar.bz2 + mirror://gentoo/${CRYPTO}.tar.bz2 + mirror://gentoo/${LIBEXEC}.tar.bz2 + mirror://gentoo/${ETC}.tar.bz2 + mirror://gentoo/${INCLUDE}.tar.bz2 + mirror://gentoo/${USBIN}.tar.bz2 + mirror://gentoo/${GNU}.tar.bz2 + build? ( + mirror://gentoo/${SYS}.tar.bz2 ) + zfs? ( + mirror://gentoo/${CDDL}.tar.bz2 )" + +if [ "${CATEGORY#*cross-}" = "${CATEGORY}" ]; then + RDEPEND="ssl? ( dev-libs/openssl ) + hesiod? ( net-dns/hesiod ) + kerberos? ( virtual/krb5 ) + usb? ( !dev-libs/libusb !dev-libs/libusbx ) + userland_GNU? ( sys-apps/mtree ) + zfs? ( =sys-freebsd/freebsd-cddl-${RV}* ) + >=dev-libs/expat-2.0.1 + !sys-libs/libutempter + !sys-freebsd/freebsd-headers" + DEPEND="${RDEPEND} + >=sys-devel/flex-2.5.31-r2 + =sys-freebsd/freebsd-sources-${RV}* + !bootstrap? ( app-arch/bzip2 )" +else + SRC_URI="${SRC_URI} + mirror://gentoo/${SYS}.tar.bz2" +fi + +DEPEND="${DEPEND} + =sys-freebsd/freebsd-mk-defs-${RV}*" + +S="${WORKDIR}/lib" + +export CTARGET=${CTARGET:-${CHOST}} +if [ "${CTARGET}" = "${CHOST}" -a "${CATEGORY#*cross-}" != "${CATEGORY}" ]; then + export CTARGET=${CATEGORY/cross-} +fi + +IUSE="atm bluetooth ssl hesiod ipv6 kerberos usb netware + build bootstrap crosscompile_opts_headers-only zfs + userland_GNU userland_BSD multilib" + +pkg_setup() { + [ -c /dev/zero ] || \ + die "You forgot to mount /dev; the compiled libc would break." + + if ! use ssl && use kerberos; then + eerror "If you want kerberos support you need to enable ssl support, too." + fi + + use atm || mymakeopts="${mymakeopts} WITHOUT_ATM= " + use bluetooth || mymakeopts="${mymakeopts} WITHOUT_BLUETOOTH= " + use hesiod || mymakeopts="${mymakeopts} WITHOUT_HESIOD= " + use ipv6 || mymakeopts="${mymakeopts} WITHOUT_INET6_SUPPORT= " + use kerberos || mymakeopts="${mymakeopts} WITHOUT_KERBEROS_SUPPORT= " + use netware || mymakeopts="${mymakeopts} WITHOUT_IPX= WITHOUT_IPX_SUPPORT= WITHOUT_NCP= " + use ssl || mymakeopts="${mymakeopts} WITHOUT_OPENSSL= " + use usb || mymakeopts="${mymakeopts} WITHOUT_USB= " + use zfs || mymakeopts="${mymakeopts} WITHOUT_CDDL= " + + mymakeopts="${mymakeopts} WITHOUT_BIND= WITHOUT_BIND_LIBS= WITHOUT_SENDMAIL= WITHOUT_CLANG= " + + if [ "${CTARGET}" != "${CHOST}" ]; then + mymakeopts="${mymakeopts} MACHINE=$(tc-arch-kernel ${CTARGET})" + mymakeopts="${mymakeopts} MACHINE_ARCH=$(tc-arch-kernel ${CTARGET})" + fi +} + +PATCHES=( + "${FILESDIR}/${PN}-6.0-pmc.patch" + "${FILESDIR}/${PN}-6.0-gccfloat.patch" + "${FILESDIR}/${PN}-6.0-flex-2.5.31.patch" + "${FILESDIR}/${PN}-6.1-csu.patch" + "${FILESDIR}/${PN}-8.0-rpcsec_gss.patch" + "${FILESDIR}/${PN}-9.0-liblink.patch" + "${FILESDIR}/${PN}-bsdxml2expat.patch" ) + +# Here we disable and remove source which we don't need or want +# In order: +# - ncurses stuff +# - libexpat creates a bsdxml library which is the same as expat +# - archiving libraries (have their own ebuild) +# - sendmail libraries (they are installed by sendmail) +# - SNMP library and dependency (have their own ebuilds) +# - Clang (compiler_rt and blocksruntime) +# +# The rest are libraries we already have somewhere else because +# they are contribution. +# Note: libtelnet is an internal lib used by telnet and telnetd programs +# as it's not used in freebsd-lib package itself, it's pointless building +# it here. +REMOVE_SUBDIRS="ncurses \ + libexpat \ + libz libbz2 libarchive liblzma \ + libsm libsmdb libsmutil \ + libbegemot libbsnmp \ + libcompiler_rt libblocksruntime \ + libpam libpcap bind libwrap libmagic \ + libcom_err libtelnet + libelf libedit" + +# Are we building a cross-compiler? +is_crosscompile() { + [ "${CATEGORY#*cross-}" != "${CATEGORY}" ] +} + +src_prepare() { + sed -i.bak -e 's:-o/dev/stdout:-t:' "${S}/libc/net/Makefile.inc" + + # Upstream Display Managers default to using VT7 + # We should make FreeBSD allow this by default + local x= + for x in "${WORKDIR}"/etc/etc.*/ttys ; do + sed -i.bak \ + -e '/ttyv5[[:space:]]/ a\ +# Display Managers default to VT7.\ +# If you use the xdm init script, keep ttyv6 commented out\ +# unless you force a different VT for the DM being used.' \ + -e '/^ttyv[678][[:space:]]/ s/^/# /' "${x}" \ + || die "Failed to sed ${x}" + rm "${x}".bak + done + + # This one is here because it also + # patches "${WORKDIR}/include" + cd "${WORKDIR}" + epatch "${FILESDIR}/${PN}-includes.patch" + epatch "${FILESDIR}/${PN}-8.0-gcc45.patch" + epatch "${FILESDIR}/${PN}-9.0-opieincludes.patch" + + # Don't install the hesiod man page or header + rm "${WORKDIR}"/include/hesiod.h || die + sed -i.bak -e 's:hesiod.h::' "${WORKDIR}"/include/Makefile || die + sed -i.bak -e 's:hesiod.c::' -e 's:hesiod.3::' \ + "${WORKDIR}"/lib/libc/net/Makefile.inc || die + + # Fix the Makefiles of these few libraries that will overwrite our LDADD. + cd "${S}" + for dir in libradius libtacplus libcam libdevstat libfetch libgeom libmemstat libopie \ + libsmb; do sed -i.bak -e 's:LDADD=:LDADD+=:g' "${dir}/Makefile" || \ + die "Problem fixing \"${dir}/Makefile" + done + # Call LD with LDFLAGS, rename them to RAW_LDFLAGS + sed -e 's/LDFLAGS/RAW_LDFLAGS/g' \ + -i "${S}/csu/i386-elf/Makefile" \ + -i "${S}/csu/ia64/Makefile" || die + if use build; then + cd "${WORKDIR}" + # This patch has to be applied on ${WORKDIR}/sys, so we do it here since it + # shouldn't be a symlink to /usr/src/sys (which should be already patched) + epatch "${FILESDIR}"/${PN}-7.1-types.h-fix.patch + epatch "${FILESDIR}"/freebsd-sources-9.0-sysctluint.patch + return 0 + fi + + if ! is_crosscompile ; then + ln -s "/usr/src/sys-${RV}" "${WORKDIR}/sys" || die "Couldn't make sys symlink!" + else + sed -i.bak -e "s:/usr/include:/usr/${CTARGET}/usr/include:g" \ + "${S}/libc/rpc/Makefile.inc" \ + "${S}/libc/yp/Makefile.inc" + fi + + if install --version 2> /dev/null | grep -q GNU; then + sed -i.bak -e 's:${INSTALL} -C:${INSTALL}:' "${WORKDIR}/include/Makefile" + fi + + # Let arch-specific includes to be found + local machine + machine=$(tc-arch-kernel ${CTARGET}) + ln -s "${WORKDIR}/sys/${machine}/include" "${WORKDIR}/include/machine" || \ + die "Couldn't make ${machine}/include symlink." + + cd "${S}" + use bootstrap && dummy_mk libstand + # Try to fix sed calls for GNU sed. Do it only with GNU userland and force + # BSD's sed on BSD. + if use userland_GNU; then + find . -name Makefile -exec sed -ibak 's/sed -i /sed -i/' {} \; + fi +} + +get_csudir() { + if [ -d "${WORKDIR}/lib/csu/$1-elf" ]; then + echo "lib/csu/$1-elf" + else + echo "lib/csu/$1" + fi +} + +bootstrap_csu() { + local csudir="$(get_csudir $(tc-arch-kernel ${CTARGET}))" + export RAW_LDFLAGS=$(raw-ldflags) + cd "${WORKDIR}/${csudir}" || die "Missing ${csudir}." + freebsd_src_compile + + CFLAGS="${CFLAGS} -B ${MAKEOBJDIRPREFIX}/${WORKDIR}/${csudir}" + append-ldflags "-B ${MAKEOBJDIRPREFIX}/${WORKDIR}/${csudir}" +} + +# Compile libssp_nonshared.a and add it's path to LDFLAGS. +bootstrap_libssp_nonshared() { + cd "${WORKDIR}/gnu/lib/libssp/libssp_nonshared/" || die "missing libssp." + freebsd_src_compile + append-ldflags "-L${MAKEOBJDIRPREFIX}/${WORKDIR}/gnu/lib/libssp/libssp_nonshared/" + export LDADD="-lssp_nonshared" +} + +# What to build for a non-native build: cross-compiler, non-native abi in +# multilib. We also need the csu but this has to be handled separately. +NON_NATIVE_SUBDIRS="lib/libc lib/msun gnu/lib/libssp/libssp_nonshared lib/libthr lib/libutil" + +# Subdirs for a native build: +NATIVE_SUBDIRS="lib gnu/lib/libssp/libssp_nonshared gnu/lib/libregex" + +# Is my $ABI native ? +is_native_abi() { + is_crosscompile && return 1 + use multilib || return 0 + [ "${ABI}" = "${DEFAULT_ABI}" ] +} + +# Do we need to bootstrap the csu and libssp_nonshared? +need_bootstrap() { + is_crosscompile || use build || ! is_native_abi || has_version "<${CATEGORY}/${P}" +} + +# Get the subdirs we are building. +get_subdirs() { + local ret="" + if is_native_abi ; then + # If we are building for the native ABI, build everything + ret="${NATIVE_SUBDIRS}" + elif is_crosscompile ; then + # With a cross-compiler we only build the very core parts. + ret="${NON_NATIVE_SUBDIRS}" + if [ "${EBUILD_PHASE}" = "install" ]; then + # Add the csu dir first when installing. We treat it separately for + # compiling. + ret="$(get_csudir $(tc-arch-kernel ${CTARGET})) ${ret}" + fi + elif use build ; then + # For the non-native ABIs we only build the csu parts and very core + # libraries for now. + ret="gnu/lib/libssp/libssp_nonshared" + if [ "${EBUILD_PHASE}" = "install" ]; then + ret="$(get_csudir $(tc-arch-kernel ${CHOST})) ${ret}" + fi + else + # Only build the csu parts and core libraries for now. + ret="gnu/lib/libssp/libssp_nonshared" + if [ "${EBUILD_PHASE}" = "install" ]; then + ret="$(get_csudir $(tc-arch-kernel ${CHOST})) ${ret}" + fi + # Finally, with a non-native ABI without USE=build, we build everything + # too. + #ret="${NATIVE_SUBDIRS}" + fi + echo "${ret}" +} + +# Bootstrap the core libraries and setup the flags so that the other parts can +# build against it. +do_bootstrap() { + einfo "Bootstrapping on ${CHOST} for ${CTARGET}" + if ! is_crosscompile ; then + # Pre-install headers, but not when building a cross-compiler since we + # assume they have been installed in the previous pass. + einfo "Pre-installing includes in include_proper_${ABI}" + mkdir "${WORKDIR}/include_proper_${ABI}" || die + CTARGET="${CHOST}" install_includes "/include_proper_${ABI}" + CFLAGS="${CFLAGS} -isystem ${WORKDIR}/include_proper_${ABI}" + fi + bootstrap_csu + bootstrap_libssp_nonshared +} + +# Compile it. Assume we have the toolchain setup correctly. +do_compile() { + export MAKEOBJDIRPREFIX="${WORKDIR}/${CHOST}" + mkdir "${MAKEOBJDIRPREFIX}" || die "Could not create ${MAKEOBJDIRPREFIX}." + need_bootstrap && do_bootstrap + + export RAW_LDFLAGS=$(raw-ldflags) + + # Everything is now setup, build it! + for i in $(get_subdirs) ; do + einfo "Building in ${i}... with CC=${CC} and CFLAGS=${CFLAGS}" + cd "${WORKDIR}/${i}/" || die "missing ${i}." + freebsd_src_compile || die "make ${i} failed" + done +} + +src_compile() { + # Does not work with GNU sed + # Force BSD's sed on BSD. + if use userland_BSD ; then + export ESED=/usr/bin/sed + unalias sed + fi + + cd "${WORKDIR}/include" + $(freebsd_get_bmake) CC="$(tc-getCC)" || die "make include failed" + + use crosscompile_opts_headers-only && return 0 + + # Bug #270098 + append-flags $(test-flags -fno-strict-aliasing) + + # Bug #324445 + append-flags $(test-flags -fno-strict-overflow) + + # strip flags and do not do it later, we only add safe, and in fact + # needed flags after all + strip-flags + export NOFLAGSTRIP=yes + if is_crosscompile ; then + export YACC='yacc -by' + CHOST=${CTARGET} tc-export CC LD CXX RANLIB + mymakeopts="${mymakeopts} NLS=" + append-flags "-I/usr/${CTARGET}/usr/include" + append-ldflags "-L${WORKDIR}/${CHOST}/${WORKDIR}/lib/libc" + fi + + if is_crosscompile ; then + do_compile + else + for ABI in $(get_all_abis) ; do + # First, save the variables: CFLAGS, CXXFLAGS, LDFLAGS and mymakeopts. + for i in CFLAGS CXXFLAGS LDFLAGS mymakeopts ; do + export ${i}_SAVE="${!i}" + done + + multilib_toolchain_setup ${ABI} + + local target="$(tc-arch-kernel ${CHOST})" + mymakeopts="${mymakeopts} TARGET=${target} MACHINE=${target} MACHINE_ARCH=${target}" + CFLAGADD="" + if ! is_native_abi ; then + mymakeopts="${mymakeopts} COMPAT_32BIT=" + fi + + einfo "Building for ABI ${ABI} and TARGET=$(tc-arch-kernel ${CHOST})" + + CTARGET="${CHOST}" do_compile + + # Restore the variables now. + for i in CFLAGS CXXFLAGS LDFLAGS mymakeopts ; do + ii="${i}_SAVE" + export ${i}="${!ii}" + done + done + fi +} + +gen_libc_ldscript() { + # Parameters: + # $1 = target libdir + # $2 = source libc dir + # $3 = source libssp_nonshared dir + + # Clear the symlink. + rm -f "${D}/$2/libc.so" || die + + # Move the library if needed + if [ "$1" != "$2" ] ; then + mv "${D}/$2/libc.so.7" "${D}/$1/" || die + fi + + # Generate libc.so ldscript for inclusion of libssp_nonshared.a when linking + # this is done to avoid having to touch gcc spec file as it is currently + # done on FreeBSD upstream, mostly because their binutils aren't able to + # cope with linker scripts yet. + # Taken from toolchain-funcs.eclass: + local output_format + output_format=$($(tc-getCC) ${CFLAGS} ${LDFLAGS} -Wl,--verbose 2>&1 | sed -n 's/^OUTPUT_FORMAT("\([^"]*\)",.*/\1/p') + [[ -n ${output_format} ]] && output_format="OUTPUT_FORMAT ( ${output_format} )" + + cat > "${D}/$2/libc.so" <<-END_LDSCRIPT +/* GNU ld script + SSP (-fstack-protector) requires __stack_chk_fail_local to be local. + GCC invokes this symbol in a non-PIC way, which results in TEXTRELs if + this symbol was provided by a shared libc. So we link in + libssp_nonshared.a from here. + */ +${output_format} +GROUP ( /$1/libc.so.7 /$3/libssp_nonshared.a ) +END_LDSCRIPT +} + +do_install() { + export MAKEOBJDIRPREFIX="${WORKDIR}/${CHOST}" + for i in $(get_subdirs) ; do + einfo "Installing in ${i}..." + cd "${WORKDIR}/${i}/" || die "missing ${i}." + freebsd_src_install || die "Install ${i} failed" + done +} + +src_install() { + [ "${CTARGET}" = "${CHOST}" ] \ + && INCLUDEDIR="/usr/include" \ + || INCLUDEDIR="/usr/${CTARGET}/usr/include" + dodir ${INCLUDEDIR} + einfo "Installing for ${CTARGET} in ${CHOST}.." + install_includes ${INCLUDEDIR} + + use crosscompile_opts_headers-only && return 0 + local mylibdir=$(get_libdir) + + if is_crosscompile ; then + mymakeopts="${mymakeopts} NO_MAN= \ + INCLUDEDIR=/usr/${CTARGET}/usr/include \ + SHLIBDIR=/usr/${CTARGET}/usr/lib \ + LIBDIR=/usr/${CTARGET}/usr/lib" + + dosym "usr/include" "/usr/${CTARGET}/sys-include" + do_install + else + if ! use multilib ; then + # Set SHLIBDIR and LIBDIR for multilib + mymakeopts="${mymakeopts} SHLIBDIR=/usr/${mylibdir} LIBDIR=/usr/${mylibdir}" + do_install + else + for ABI in $(get_all_abis) ; do + mymakeopts_SAVE="${mymakeopts}" + multilib_toolchain_setup ${ABI} + mymakeopts="${mymakeopts} SHLIBDIR=/usr/$(get_libdir) LIBDIR=/usr/$(get_libdir)" + do_install + mymakeopts="${mymakeopts_SAVE}" + done + fi + fi + + # Don't install the rest of the configuration files if crosscompiling + if is_crosscompile ; then + # This is to get it stripped with the correct tools, otherwise it gets + # stripped with the host strip. + # And also get the correct OUTPUT_FORMAT in the libc ldscript. + export CHOST=${CTARGET} + gen_libc_ldscript "usr/${CTARGET}/usr/lib" "usr/${CTARGET}/usr/lib" "usr/${CTARGET}/usr/lib" + return 0 + fi + + cd "${WORKDIR}/etc/" + insinto /etc + doins auth.conf nls.alias mac.conf netconfig + + # Install ttys file + local MACHINE="$(tc-arch-kernel)" + doins "etc.${MACHINE}"/* + + # Generate ldscripts for core libraries that will go in / + gen_usr_ldscript -a alias cam geom ipsec jail kiconv \ + kvm m md procstat sbuf thr ufs util + + gen_libc_ldscript "${mylibdir}" "usr/${mylibdir}" "usr/${mylibdir}" + + # Install a libusb.pc for better compat with Linux's libusb + if use usb ; then + dodir /usr/$(get_libdir)/pkgconfig + sed -e "s:@LIBDIR@:/usr/$(get_libdir):" "${FILESDIR}/libusb.pc.in" > "${D}/usr/$(get_libdir)/pkgconfig/libusb.pc" || die + sed -e "s:@LIBDIR@:/usr/$(get_libdir):" "${FILESDIR}/libusb-1.0.pc.in" > "${D}/usr/$(get_libdir)/pkgconfig/libusb1.0.pc" || die + fi +} + +install_includes() +{ + local INCLUDEDIR="$1" + + # The idea is to be called from either install or unpack. + # During unpack it's required to install them as portage's user. + if [[ "${EBUILD_PHASE}" == "install" ]]; then + local DESTDIR="${D}" + BINOWN="root" + BINGRP="wheel" + else + local DESTDIR="${WORKDIR}" + [[ -z "${USER}" ]] && USER="portage" + BINOWN="${USER}" + [[ -z "${GROUPS}" ]] && GROUPS="portage" + BINGRP="${GROUPS}" + fi + + # Must exist before we use it. + [[ -d "${DESTDIR}${INCLUDEDIR}" ]] || die "dodir or mkdir ${INCLUDEDIR} before using install_includes." + cd "${WORKDIR}/include" + + local MACHINE="$(tc-arch-kernel)" + + einfo "Installing includes into ${INCLUDEDIR} as ${BINOWN}:${BINGRP}..." + $(freebsd_get_bmake) installincludes \ + MACHINE=${MACHINE} MACHINE_ARCH=${MACHINE} \ + DESTDIR="${DESTDIR}" \ + INCLUDEDIR="${INCLUDEDIR}" BINOWN="${BINOWN}" \ + BINGRP="${BINGRP}" || die "install_includes() failed" + einfo "includes installed ok." + EXTRA_INCLUDES="lib/librtld_db lib/libutil lib/msun gnu/lib/libregex" + for i in $EXTRA_INCLUDES; do + einfo "Installing $i includes into ${INCLUDEDIR} as ${BINOWN}:${BINGRP}..." + cd "${WORKDIR}/$i" || die + $(freebsd_get_bmake) installincludes DESTDIR="${DESTDIR}" \ + MACHINE=${MACHINE} MACHINE_ARCH=${MACHINE} \ + INCLUDEDIR="${INCLUDEDIR}" BINOWN="${BINOWN}" \ + BINGRP="${BINGRP}" || die "problem installing $i includes." + einfo "$i includes installed ok." + done +} |