diff options
author | sbd <sbd@pkgsrc.org> | 2012-09-13 10:04:33 +0000 |
---|---|---|
committer | sbd <sbd@pkgsrc.org> | 2012-09-13 10:04:33 +0000 |
commit | a3087db605647c613912fb8981568ab36e2e0372 (patch) | |
tree | 3a387882ec6e94a6f9415d4bb95a2e4d2738c529 /lang | |
parent | eac258c6f4b327879e203da505639d4ed79f3f64 (diff) | |
download | pkgsrc-a3087db605647c613912fb8981568ab36e2e0372.tar.gz |
Create the gcc47-libs package.
This package contains _just_ the shared libraries from gcc47 that programs
compiled with gcc need at runtime so that the entire gcc47 package does not
have to be install.
Because multiple packages cannot be build from the same PKGDIR and building
components of gcc separately is problematic this package is build using a
a couple of "cheap tricks":
1) gcc47 is built as before (including the libraries) but with a second
RPATH compiled in to all programs.
2) This package has a BUILD_DEPENDS on lang/gcc47 and simply copies the
shared libraries (except the java ones) to the second RPATH location
(so as to not have conflicts with lang/gcc47).
3) When adding a runtime dependence the pattern '{gcc47,gcc47-libs}>=4.7.*'
is used (i.e. the full gcc47 OR the gcc47-libs package can be used).
4) So that when a package that has the above dependence is installed
pkg_add will, if neither gcc47 or gcc47-libs is installed, automatically
install gcc47-libs the PKGREVISION of gcc47-libs should all ways be
bumped so that it is at least 1 more than that of the lang/gcc47
package. (With a note in this packages Makefile and one to be placed
in lang/gcc47's Makefile.)
Diffstat (limited to 'lang')
-rw-r--r-- | lang/gcc47-libs/DESCR | 3 | ||||
-rw-r--r-- | lang/gcc47-libs/Makefile | 74 |
2 files changed, 77 insertions, 0 deletions
diff --git a/lang/gcc47-libs/DESCR b/lang/gcc47-libs/DESCR new file mode 100644 index 00000000000..67396068e82 --- /dev/null +++ b/lang/gcc47-libs/DESCR @@ -0,0 +1,3 @@ +The GNU Compiler Collection (GCC) includes front ends for C, C++, Objective-C, +Fortran, and Go, as well as libraries for these languages (libstdc++, +libgfortran, ...). diff --git a/lang/gcc47-libs/Makefile b/lang/gcc47-libs/Makefile new file mode 100644 index 00000000000..20139bc6ca6 --- /dev/null +++ b/lang/gcc47-libs/Makefile @@ -0,0 +1,74 @@ +# $NetBSD: Makefile,v 1.1 2012/09/13 10:04:33 sbd Exp $ + +GCC_PKGNAME= gcc47 +.include "../../lang/${GCC_PKGNAME}/version.mk" + +DISTNAME= gcc-${GCC_DIST_VERSION} +PKGNAME= ${GCC_PKGNAME}-libs-${GCC_DIST_VERSION} +## The PKGREVISION of this package needs to be at least 1 more than the +## PKGREVISION of the lang/gcc47 package so that with the dependence pattern +## '{gcc47,gcc47-libs}>=4.7.*' pkg_all will choose gcc47-libs over gcc47. +PKGREVISION= 5 +CATEGORIES= lang +MASTER_SITES= # empty +DISTFILES= # empty + +MAINTAINER= sbd@NetBSD.org +HOMEPAGE= http://gcc.gnu.org/ +COMMENT= The GNU Compiler Collection (GCC) support shared libraries. +LICENSE= gnu-gpl-v2 AND gnu-gpl-v3 AND gnu-lgpl-v2 AND gnu-lgpl-v3 + +PKG_DESTDIR_SUPPORT= user-destdir + +USE_TOOLS+= pax + +NO_BUILD= yes + +## Depend on exactly ${GCC_DIST_VERSION}. +BUILD_DEPENDS+= ${GCC_PKGNAME}-${GCC_DIST_VERSION}{,nb[0-9]*}:../../lang/gcc47 + +.include "../../mk/bsd.prefs.mk" + +FIND_PREFIX:= GCC_PKG_PREFIX=${GCC_PKGNAME}-${GCC_DIST_VERSION}* +.include "../../mk/find-prefix.mk" + +GCC_SUBPREFIX= ${GCC_PKGNAME} +GCC_PREFIX= ${GCC_PKG_PREFIX}/${GCC_SUBPREFIX} + +.if defined(_PKGSRC_BARRIER) +TARGET_TRIPLE!= ${GCC_PREFIX}/bin/gcc -dumpmachine +.endif + +.include "../../mk/bsd.prefs.mk" +.if ${_OPSYS_SHLIB_TYPE} == "dylib" +SHLIB_EXT= dylib +.else +SHLIB_EXT= so +.endif + +LIBRARY_FILES= ${WRKDIR}/lib_files + +GENERATE_PLIST+= ${SED} -e 's,^,${GCC_SUBPREFIX}/${TARGET_TRIPLE}/,' \ + ${LIBRARY_FILES}; +GENERATE_PLIST+= ${GREP} 'lib/' ${LIBRARY_FILES} || \ + ${ECHO} '@pkgdir ${GCC_SUBPREFIX}/${TARGET_TRIPLE}/lib' ; + +${LIBRARY_FILES}: + ${PKG_INFO} -qL '${GCC_PKGNAME}-${GCC_DIST_VERSION}*' | \ + ${SED} -n -e's,^${GCC_PREFIX}/,,' -e'/libexec\//d' \ + -e'/libgij/d;/libgcj/d;/libjvm/d' \ + -e'/lib.*\.${SHLIB_EXT}/p' >${LIBRARY_FILES} + +do-install: ${LIBRARY_FILES} +.if defined(TARGET_TRIPLE) && !empty(TARGET_TRIPLE) + ${TEST} -d ${DESTDIR}${GCC_PREFIX}/${TARGET_TRIPLE}/lib || \ + ${MKDIR} ${DESTDIR}${GCC_PREFIX}/${TARGET_TRIPLE}/lib + cd ${GCC_PREFIX} && \ + ${PAX} -rw ${DESTDIR}${GCC_PREFIX}/${TARGET_TRIPLE} <${LIBRARY_FILES} +.else + ${FALSE} +.endif + +.include "../../mk/dlopen.buildlink3.mk" +.include "../../mk/pthread.buildlink3.mk" +.include "../../mk/bsd.pkg.mk" |