82 lines
2.0 KiB
Bash
82 lines
2.0 KiB
Bash
|
# Copyright 1999-2009 Gentoo Foundation
|
||
|
# Distributed under the terms of the GNU General Public License v2
|
||
|
# $Header: $
|
||
|
|
||
|
ARTS_REQUIRED="never"
|
||
|
EAPI="1"
|
||
|
inherit kde
|
||
|
|
||
|
DESCRIPTION="Allows *some* Gtk, Qt3, and Qt4 applications to use KDE's file dialogs when run under KDE"
|
||
|
HOMEPAGE="http://www.kde-apps.org/content/show.php?content=36077"
|
||
|
SRC_URI="http://home.freeuk.com/cpdrummond/KGtk-${PV}.tar.bz2"
|
||
|
S=$WORKDIR/KGtk-$PV
|
||
|
|
||
|
LICENSE="GPL-2"
|
||
|
SLOT="0"
|
||
|
KEYWORDS="~amd64 ~ppc ~x86"
|
||
|
IUSE="qt4 kde4"
|
||
|
|
||
|
RDEPEND=">=x11-libs/gtk+-2.6
|
||
|
qt4? ( || ( x11-libs/qt-gui:4 x11-libs/qt:4 ) )"
|
||
|
|
||
|
DEPEND="${RDEPEND}
|
||
|
>=dev-util/cmake-2.4.8"
|
||
|
if use !kde4; then
|
||
|
need-kde 3.5
|
||
|
fi
|
||
|
|
||
|
src_unpack() {
|
||
|
unpack ${A}
|
||
|
cd "${S}"
|
||
|
epatch "${FILESDIR}/"${P}"-gcc433.patch"
|
||
|
epatch "${FILESDIR}/"${P}"-kde4.patch"
|
||
|
}
|
||
|
|
||
|
src_compile() {
|
||
|
mkdir -p "${S}/build" && cd "${S}/build"
|
||
|
cmake \
|
||
|
-DCMAKE_INSTALL_PREFIX:PATH=/usr \
|
||
|
.. || die "cmake (configure) failed"
|
||
|
emake || die "emake failed"
|
||
|
|
||
|
if use qt4; then
|
||
|
K4GTK_FLAGS="-DKGTK_QT4=true DKGTK_GTK2=false"
|
||
|
if use kde4; then
|
||
|
K4GTK_FLAGS="-DKGTK_KDE4=true ${K4GTK_FLAGS}"
|
||
|
fi
|
||
|
|
||
|
mkdir -p "${S}/build4" && cd "${S}/build4"
|
||
|
cmake \
|
||
|
-DCMAKE_INSTALL_PREFIX:PATH=/usr ${K4GTK_FLAGS} \
|
||
|
.. || die "cmake (configure) failed"
|
||
|
emake || die "emake failed"
|
||
|
|
||
|
fi
|
||
|
}
|
||
|
|
||
|
src_install() {
|
||
|
cd "${S}/build"
|
||
|
emake install DESTDIR="${D}" || die "make install failed"
|
||
|
|
||
|
if use qt4; then
|
||
|
cd "${S}/build4"
|
||
|
emake install DESTDIR="${D}" || die "make install failed"
|
||
|
fi
|
||
|
if use kde4; then
|
||
|
cd "${S}/build4/kdialogd4"
|
||
|
emake install DESTDIR="${D}" || die "make install failed"
|
||
|
fi
|
||
|
|
||
|
find "${D}" -name kdialogd-wrapper -exec sed -i 's@kdialogd4@which kdialogd4 \&>/dev/null \&\& kdialogd4 || kdialogd3@' {} \;
|
||
|
dodoc ../{AUTHORS,ChangeLog,TODO,README}
|
||
|
}
|
||
|
|
||
|
pkg_postinst() {
|
||
|
elog "To see the kde-file-selector in a gtk-application, just do:"
|
||
|
elog "cd /usr/local/bin"
|
||
|
elog "ln -s /usr/bin/kgtk-wrapper application(eg. firefox)"
|
||
|
elog "Make sure that /usr/local/bin is before /usr/bin in your \$PATH"
|
||
|
elog
|
||
|
elog "You need to restart kde and be sure to change your symlinks to non-.sh"
|
||
|
}
|