--- plan9port/plan9port-20140306.ebuild +++ plan9port.new/plan9port-20140306.ebuild @@ -21,19 +21,33 @@ RDEPEND="${DEPEND}" S="${WORKDIR}/${PN}" PLAN9=/usr/lib/plan9 +EPLAN9="${EPREFIX}"${PLAN9} QA_MULTILIB_PATHS="${PLAN9}/.*/.*" src_prepare() { epatch "${FILESDIR}/${PN}-"{noexecstack,cflags,builderr}".patch" + # don't hardcode /bin and /usr/bin in PATH + sed -i '/PATH/s,/bin:/usr/bin:,,' INSTALL || die "sed on INSTALL failed" + + # don't hardcode /usr/{,local/}include and prefix /usr/include/* + for f in src/cmd/fontsrv/freetyperules.sh INSTALL \ + $(find -name makefile); do + sed -r -i -e 's,-I/usr(|/local)/include ,,g' \ + -e "s,-I/usr(|/local)/include,-I${EPREFIX}/usr\1/include,g" ${f} \ + || die "sed on ${f} failed" + done + # Fix paths, done in place of ./INSTALL -c einfo "Fixing hard-coded /usr/local/plan9 paths" grep --null -l -r '/usr/local/plan9' | - xargs --null sed -i "s!/usr/local/plan9!${PLAN9}!g" + xargs --null sed -i "s!/usr/local/plan9!${EPLAN9}!g" } src_configure() { - if ! use X; then + if use X; then + echo "X11=${EPREFIX}/usr" >> LOCAL.config + else echo "WSYSTYPE=nowsys" >> LOCAL.config fi } @@ -54,14 +68,14 @@ src_install() { docompress -x $PLAN9/man # do* plays with the executable bit, and we should not modify them - cp -a * "${D}/${PLAN9}" + cp -a * "${ED}/${PLAN9}" # build the environment variables and install them in env.d cat > "${T}/30plan9" <<-EOF - PLAN9="${PLAN9}" - PATH="${PLAN9}/bin" - ROOTPATH="${PLAN9}/bin" - MANPATH="${PLAN9}/man" + PLAN9="${EPLAN9}" + PATH="${EPLAN9}/bin" + ROOTPATH="${EPLAN9}/bin" + MANPATH="${EPLAN9}/man" EOF doenvd "${T}/30plan9" }