Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
help: qingy-9999 ebuild PKG_CONFIG problem
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Portage & Programming
View previous topic :: View next topic  
Author Message
fpemud
Guru
Guru


Joined: 15 Feb 2012
Posts: 348

PostPosted: Sun Oct 07, 2012 2:55 am    Post subject: help: qingy-9999 ebuild PKG_CONFIG problem Reply with quote

I'm writing a qingy-9999 ebuild.

The modification:
1. Use latest code from svn
2. add a consolekit use flag
3. call autoreconf

When I emerge this new ebuild, it complains:
Code:
checking for XScreenSaverQueryInfo in -lXss... yes
configure: Support for DirectFB is disabled
checking for CONSOLEKIT... no
configure: error:
         *** ConsoleKit is required when --disable-consolekit is not given.


I debugged and found the reason is PKG_CONFIG env-var is empty when executing PKG_CHECK_MODULES macro in ./configure.

after this the new ebuild got installed and new qingy work well, so it's definitely the PKG_CONFIG reason:
Code:
export PKG_CONFIG=pkg-config
emerge qingy


I have only few knowledge with the spec of autotools and portage, and didn't find anything useful on web.
I want to know who is in charge for setting this env-var and when should it be set?

the qingy-1.0.0 ebuild uses PKG_CHECK_MODULES either, to check if DirectFB presents.
Although i didn't test it but i think there's no problem.
So perhaps my autoreconf is wrong?

Code:
fpemud-workstation qingy # cat qingy-9999.ebuild
# Copyright 1999-2012 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: $

EAPI="2"

inherit elisp-common eutils pam

GENTOO_THEME_VERSION="2.1"

DESCRIPTION="a DirectFB getty replacement"
HOMEPAGE="http://qingy.sourceforge.net/"

if [[ ${PV} == "9999" ]] ; then
   ESVN_REPO_URI="https://${PN}.svn.sourceforge.net/svnroot/qingy/trunk/qingy"
   inherit subversion autotools
   SRC_URI="mirror://gentoo/${PN}-gentoo-theme-${GENTOO_THEME_VERSION}.tar.bz2"
   KEYWORDS="amd64 ppc x86"
else
   SRC_URI="mirror://sourceforge/${PN}/${P}.tar.bz2
      mirror://gentoo/${PN}-gentoo-theme-${GENTOO_THEME_VERSION}.tar.bz2"
   KEYWORDS="~amd64 ~ppc ~x86"
fi

LICENSE="GPL-2"
SLOT="0"
IUSE="consolekit crypt directfb emacs gpm opensslcrypt pam static X"

RDEPEND=">=sys-libs/ncurses-5.4-r6
   opensslcrypt? ( >=dev-libs/openssl-0.9.7e )
   crypt?        ( >=dev-libs/libgcrypt-1.2.1 )
   directfb?     ( >=dev-libs/DirectFB-1.4.2[fbcon,jpeg,png,truetype] )
   emacs?        ( virtual/emacs )
   pam?          ( >=sys-libs/pam-0.75-r11 )
   consolekit?   ( sys-auth/consolekit )
   X?            ( x11-libs/libX11
               x11-libs/libXScrnSaver
               x11-proto/scrnsaverproto )"

DEPEND="${RDEPEND}
   virtual/pkgconfig
   >=sys-apps/sed-4.1.4-r1"
RDEPEND="${RDEPEND}
   pam? ( sys-auth/pambase )"

SITEFILE=50${PN}-gentoo.el

src_unpack()
{
   subversion_src_unpack
   unpack ${A}
}

src_prepare()
{
   eautoreconf
}

src_configure()
{
   local crypto_support="--disable-crypto"
   local emacs_support="--disable-emacs --without-lispdir"

   if use crypt && use opensslcrypt; then
      echo
      ewarn "You can have openssl or libgcrypt as a crypto library, not both."
      ewarn "Using libgcrypt now..."
      echo
   fi

   use emacs        && emacs_support="--enable-emacs --with-lispdir=${SITELISP}/${PN}"
   use opensslcrypt && crypto_support="--enable-crypto=openssl"
   use crypt        && crypto_support="--enable-crypto=libgcrypt"
   econf                                      \
      --sbindir=/sbin                        \
      --disable-optimizations                \
      `use_enable pam`                       \
      `use_enable consolekit`                \
      `use_enable static static-build`       \
      `use_enable gpm gpm-lock`              \
      `use_enable X x-support`               \
      `use_enable directfb DirectFB-support` \
      ${crypto_support}                      \
      ${emacs_support}                  \
      || die "Configuration failed"
}

src_install()
{
   # Copy documentation manually as make install only installs info files
   # INSTALL is left because it contains also configuration informations
   dodoc AUTHORS ChangeLog INSTALL NEWS README THANKS TODO

   # Install the program
   emake DESTDIR="${D}" install || die "Installation failed"

   # Set the settings file umask to 600, in case somebody
   # wants to make use of the autologin feature
   /bin/chmod 600 "${D}/etc/qingy/settings"

   # Install Gentoo theme
   dodir /usr/share/${PN}/themes/gentoo
   cp "${WORKDIR}"/gentoo/* "${D}/usr/share/${PN}/themes/gentoo" \
      || die "Gentoo theme installation failed"

   # Alter config file so that it uses our theme
   sed -i 's/theme = "default"/theme = "gentoo"/' "${D}/etc/${PN}/settings"

   # Install log rotation policy
   insinto /etc/logrotate.d
   newins "${FILESDIR}/${PN}-logrotate" ${PN} || die "Log rotation policy installation failed"

   use emacs && elisp-site-file-install "${FILESDIR}/${SITEFILE}"

   rm "${D}/etc/pam.d/qingy"
   pamd_mimic system-local-login qingy auth account password session
}

pkg_postinst()
{
   einfo "In order to use qingy you must first edit your /etc/inittab"
   einfo "Check the documentation at ${HOMEPAGE}"
   einfo "for instructions on how to do that."
   echo
   einfo "Also, make sure to adjust qingy settings file (/etc/qingy/settings)"
   einfo "to your preferences/machine configuration..."

   if use crypt; then
      echo
      einfo "You will have to create a key pair using 'qingy-keygen'"
      echo
      ewarn "Note that sometimes a generated key-pair may pass the internal tests"
      ewarn "but fail to work properly. You will get a 'regenerate your keys'"
      ewarn "message. If this is your case, please remove /etc/qingy/public_key"
      ewarn "and /etc/qingy/private_key and run qingy-keygen again..."
   fi

   use emacs && echo && elisp-site-regen
}

pkg_postrm() {
   use emacs && elisp-site-regen
}


Last edited by fpemud on Sun Oct 07, 2012 7:21 am; edited 4 times in total
Back to top
View user's profile Send private message
fpemud
Guru
Guru


Joined: 15 Feb 2012
Posts: 348

PostPosted: Sun Oct 07, 2012 3:00 am    Post subject: Reply with quote

Another question, is qingy dead? why don't it release new version anymore?
Back to top
View user's profile Send private message
fpemud
Guru
Guru


Joined: 15 Feb 2012
Posts: 348

PostPosted: Tue Oct 09, 2012 12:10 am    Post subject: Reply with quote

Bump.
Back to top
View user's profile Send private message
fpemud
Guru
Guru


Joined: 15 Feb 2012
Posts: 348

PostPosted: Tue Dec 04, 2012 1:13 pm    Post subject: Reply with quote

Bump again.

I really can't understand why there's no answer? Is it silly? Or is it difficult?
Back to top
View user's profile Send private message
jemi
n00b
n00b


Joined: 06 Oct 2010
Posts: 21

PostPosted: Wed Mar 20, 2013 7:20 pm    Post subject: Reply with quote

Hi fpemud. You need to inherit the autotools eclass, so it can do a lot of the heavy lifting for you. That environment variable should be set by the eclass, and in any case, I don't think this will be able to make it into portage without that eclass. Check out this guide: http://devmanual.gentoo.org/eclass-reference/autotools.eclass/index.html

I hope you're able to figure this out. I really need this ebuild, as it looks like I need properly functioning consolekit in order to get multiuser pulseaudio working, and the non-svn qingy doesn't work properly with it. Please post here whatever you come up with, and I'll help you with it.
Back to top
View user's profile Send private message
jemi
n00b
n00b


Joined: 06 Oct 2010
Posts: 21

PostPosted: Sat Mar 23, 2013 8:25 pm    Post subject: Reply with quote

I forgot to mention, you will also have to inherit the subversion eclass. Here is the page for it from the developer's guide: http://devmanual.gentoo.org/eclass-reference/subversion.eclass/index.html.

[edit: I was just looking at the ebuild and noticed that you had called svn_src_unpack, and I couldn't figure out how that function would be available, until I noticed that you had inherited that eclass in an "if" statement. Based on ebuilds I've worked with in the past, I don't believe this is standard procedure. There is no need to conditionally inherit subversion, because *-9999 ebuilds will not (or at least should not) be used as the basis for making non-VCS ebuilds. Instead, just inherit subversion as part of the main "inherit" line, and it will make it easier for people to maintain this ebuild.]
Back to top
View user's profile Send private message
jemi
n00b
n00b


Joined: 06 Oct 2010
Posts: 21

PostPosted: Sun Mar 24, 2013 6:23 pm    Post subject: Reply with quote

Ok, I got impatient and wrote a new ebuild myself. It's pretty much the same as yours, except it doesn't have any conditional inheritances. I just tried it, and it emerged successfully. Now I suspect that your problem is that you have some sort of misconfiguration in your system that prevents autotools from finding pkg-config. To check this, I recommend you check and see if you are able to compile (not emerge) any program that uses autotools. You have to make sure that the source tree does not contain any autotools generated stuff in it, and for good measure you should make sure there are no object files in there either. If you are able to compile it, I was probably wrong. If you are not, then having a misconfigured setup is most likely. There is also the possibility that you could have a subtle configuration issue that affects some autotools programs and not others (i.e. if qingy's configuration system uses an incorrect method to find pkg-config.). Looking over the old non-9999 qingy ebuild today, that seems quite likely. That older ebuild doesn't inherit autotools, and I see no calls to "auto" anything, so it looks like Michele Noberasco just started using autotools, and may well have made some errors. The notorious difficulty of the autotools build system could also explain why Michele has not come out with a new release in a long time. Everything he has stated online regarding qingy indicates that qingy is not a dead project. Getting enough testing to confirm that the new consolekit compatibility in qingy is implemented correctly could also be a problem holding up a release. In any case, here is the new ebuild. Once I'm able to verify that the binary actually runs, I will submit this to B.G.O. :

Code:
# Copyright 1999-2012 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: /var/cvsroot/gentoo-x86/sys-apps/qingy/qingy-1.0.0.ebuild,v 1.5 2012/05/04 09:17:27 jdhore Exp $

EAPI="2"

inherit autotools elisp-common eutils pam subversion

GENTOO_THEME_VERSION="2.1"

DESCRIPTION="a DirectFB getty replacement"
HOMEPAGE="http://qingy.sourceforge.net/"
ESVN_REPO_URI="https://${PN}.svn.sourceforge.net/svnroot/qingy/trunk/qingy"
SRC_URI="mirror://gentoo/${PN}-gentoo-theme-${GENTOO_THEME_VERSION}.tar.bz2"

LICENSE="GPL-2"
SLOT="0"
KEYWORDS="amd64 ppc x86"
IUSE="consolekit crypt directfb emacs gpm opensslcrypt pam static X"

RDEPEND=">=sys-libs/ncurses-5.4-r6
        opensslcrypt? ( >=dev-libs/openssl-0.9.7e )
        crypt?        ( >=dev-libs/libgcrypt-1.2.1 )
        consolekit?   ( sys-auth/consolekit )
        directfb?     ( >=dev-libs/DirectFB-1.4.2[fbcon,jpeg,png,truetype] )
        emacs?        ( virtual/emacs )
        pam?          ( >=sys-libs/pam-0.75-r11 )
        X?            ( x11-libs/libX11
                                        x11-libs/libXScrnSaver
                                        x11-proto/scrnsaverproto )"
DEPEND="${RDEPEND}
        virtual/pkgconfig
        >=sys-apps/sed-4.1.4-r1"
RDEPEND="${RDEPEND}
        pam? ( sys-auth/pambase )"

SITEFILE=50${PN}-gentoo.el
src_unpack()
{
subversion_src_unpack
   unpack ${A}
}

src_prepare()
{
eautoreconf
}
src_configure()
{
        local crypto_support="--disable-crypto"
        local emacs_support="--disable-emacs --without-lispdir"

        if use crypt && use opensslcrypt; then
                echo
                ewarn "You can have openssl or libgcrypt as a crypto library, not both."
                ewarn "Using libgcrypt now..."
                echo
        fi

        use emacs                && emacs_support="--enable-emacs --with-lispdir=${SITELISP}/${PN}"
        use opensslcrypt && crypto_support="--enable-crypto=openssl"
        use crypt        && crypto_support="--enable-crypto=libgcrypt"
        econf                                      \
                --sbindir=/sbin                        \
                --disable-optimizations                \
                `use_enable pam`                                           \
                `use_enable consolekit`                            \
                `use_enable static static-build`       \
                `use_enable gpm gpm-lock`              \
                `use_enable X x-support`               \
                `use_enable directfb DirectFB-support` \
                ${crypto_support}                      \
                ${emacs_support}                                           \
                || die "Configuration failed"
}

src_install()
{
        # Copy documentation manually as make install only installs info files
        # INSTALL is left because it contains also configuration informations
        dodoc AUTHORS ChangeLog INSTALL NEWS README THANKS TODO

        # Install the program
        emake DESTDIR="${D}" install || die "Installation failed"

        # Set the settings file umask to 600, in case somebody
        # wants to make use of the autologin feature
        /bin/chmod 600 "${D}/etc/qingy/settings"

        # Install Gentoo theme
        dodir /usr/share/${PN}/themes/gentoo
        cp "${WORKDIR}"/gentoo/* "${D}/usr/share/${PN}/themes/gentoo" \
                || die "Gentoo theme installation failed"

        # Alter config file so that it uses our theme
        sed -i 's/theme = "default"/theme = "gentoo"/' "${D}/etc/${PN}/settings"

        # Install log rotation policy
        insinto /etc/logrotate.d
        newins "${FILESDIR}/${PN}-logrotate" ${PN} || die "Log rotation policy installation failed"

        use emacs && elisp-site-file-install "${FILESDIR}/${SITEFILE}"

        rm "${D}/etc/pam.d/qingy"
        pamd_mimic system-local-login qingy auth account password session
}

pkg_postinst()
{
        einfo "In order to use qingy you must first edit your /etc/inittab"
        einfo "Check the documentation at ${HOMEPAGE}"
        einfo "for instructions on how to do that."
        echo
        einfo "Also, make sure to adjust qingy settings file (/etc/qingy/settings)"
        einfo "to your preferences/machine configuration..."

        if use crypt; then
                echo
                einfo "You will have to create a key pair using 'qingy-keygen'"
                echo
                ewarn "Note that sometimes a generated key-pair may pass the internal tests"
                ewarn "but fail to work properly. You will get a 'regenerate your keys'"
                ewarn "message. If this is your case, please remove /etc/qingy/public_key"
                ewarn "and /etc/qingy/private_key and run qingy-keygen again..."
        fi

        use emacs && echo && elisp-site-regen
}

pkg_postrm() {
        use emacs && elisp-site-regen
}


Back to top
View user's profile Send private message
jemi
n00b
n00b


Joined: 06 Oct 2010
Posts: 21

PostPosted: Sun Mar 24, 2013 7:07 pm    Post subject: Reply with quote

Submitted to B.G.O.: https://bugs.gentoo.org/show_bug.cgi?id=463004.
Back to top
View user's profile Send private message
jemi
n00b
n00b


Joined: 06 Oct 2010
Posts: 21

PostPosted: Sun Mar 24, 2013 8:26 pm    Post subject: Reply with quote

If you look here: http://qingy.svn.sourceforge.net/viewvc/qingy/trunk/qingy/ChangeLog?view=log, you can see on the second entry down (revision 434), "still need to work on proper ./configure and stuff". So it definitely looks to me like there is just a little hiccup in the way your pkg-config stuff gets figured out. Probably by any of the proper methods, autotools should be able to find it, but if an improper method is used, as in the case of qingy, it will find something misconfigured, but only on your system or any that have the same issue. I know very little about autotools, in fact I really dislike autotools, but if you really are able to compile other autotools programs then you should be able to get help with another post somewhere on the gentoo forums, or on irc at freenode, #gentoo. Good Luck!
Back to top
View user's profile Send private message
fpemud
Guru
Guru


Joined: 15 Feb 2012
Posts: 348

PostPosted: Mon Mar 25, 2013 1:04 am    Post subject: Reply with quote

jemi you are awesome!
Please accept my sincere thanks for your work and especially the detailed explaination, I will go check my system.

My ebuild is based on another ebuild in the portage tree, so I reserved the inherit-in-if things, I think it's strange too.
Actually I saw your post yestoday but I have no time to do anything then.
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Portage & Programming All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum