| 1 |
# Copyright 1999-2004 Gentoo Foundation |
| 2 |
# Distributed under the terms of the GNU General Public License v2 |
| 3 |
# $Header$ |
| 4 |
# |
| 5 |
# Otavio R. Piske "AngusYoung" <angusyoung@gentoo.org> |
| 6 |
# Diego Pettenò <flameeyes@gentoo.org> |
| 7 |
|
| 8 |
inherit eutils |
| 9 |
|
| 10 |
ECLASS=bsdmk |
| 11 |
INHERITED="$INHERITED $ECLASS" |
| 12 |
EXPORT_FUNCTIONS src_compile src_install src_unpack |
| 13 |
|
| 14 |
# this should actually be BDEPEND, but this works. |
| 15 |
DEPEND="sys-devel/pmake" |
| 16 |
|
| 17 |
IUSE="profile" |
| 18 |
|
| 19 |
#unalias -a |
| 20 |
alias install-info='/usr/bin/bsdinstall-info' |
| 21 |
|
| 22 |
#### mkmake <options> |
| 23 |
# calls pmake command with the given options, passing ${mymakeopts} to |
| 24 |
# enable ports to useflags bridge. |
| 25 |
# |
| 26 |
########################################################################### |
| 27 |
mkmake() { |
| 28 |
use profile || mymakeopts="${mymakeopts} NOPROFILE= " |
| 29 |
|
| 30 |
pmake ${MAKEOPTS} ${EXTRA_EMAKE} ${mymakeopts} NO_WERROR= "$@" |
| 31 |
} |
| 32 |
|
| 33 |
mkinstall() { |
| 34 |
use profile || mymakeopts="${mymakeopts} NOPROFILE= " |
| 35 |
|
| 36 |
pmake ${mymakeopts} NO_WERROR= DESTDIR="${D}" "$@" install |
| 37 |
} |
| 38 |
|
| 39 |
#### dummy_mk <dirnames> |
| 40 |
# removes the specified subdirectories and creates a dummy makefile in them |
| 41 |
# useful to remove the need for "minimal" patches |
| 42 |
# |
| 43 |
############################################################################ |
| 44 |
dummy_mk() { |
| 45 |
for dir in $@; do |
| 46 |
echo ".include <bsd.lib.mk>" > ${dir}/Makefile |
| 47 |
done |
| 48 |
} |
| 49 |
|
| 50 |
bsdmk_src_unpack() { |
| 51 |
unpack ${A} |
| 52 |
cd ${S} |
| 53 |
|
| 54 |
for patch in ${PATCHES}; do |
| 55 |
epatch ${patch} |
| 56 |
done |
| 57 |
|
| 58 |
dummy_mk ${REMOVE_SUBDIRS} |
| 59 |
|
| 60 |
ebegin "Renaming libraries" |
| 61 |
# We don't use libtermcap, we use libncurses |
| 62 |
find ${S} -name Makefile -print0 | xargs -0 \ |
| 63 |
sed -i -e 's:-ltermcap:-lncurses:g; s:{LIBTERMCAP}:{LIBNCURSES}:g' |
| 64 |
# flex provides libfl, not libl |
| 65 |
find ${S} -name Makefile -print0 | xargs -0 \ |
| 66 |
sed -i -e 's:-ll:-lfl:g; s:{LIBL}:{LIBFL}:g' |
| 67 |
|
| 68 |
eend $? |
| 69 |
} |
| 70 |
|
| 71 |
bsdmk_src_compile() { |
| 72 |
use profile && filter-flags "-fomit-frame-pointer" |
| 73 |
|
| 74 |
mkmake || die "make failed" |
| 75 |
} |
| 76 |
|
| 77 |
bsdmk_src_install() { |
| 78 |
mkinstall || die "install failed" |
| 79 |
} |