Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
migrating ebuild from autogen to cmake [solved]
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
Frautoincnam
Guru
Guru


Joined: 19 May 2017
Posts: 306

PostPosted: Sat Aug 24, 2024 4:22 pm    Post subject: migrating ebuild from autogen to cmake [solved] Reply with quote

Hi,

I'm not a dev.
I use a software that is not in portage anymore (net-nntp/pan).
I had an ebuild for my personnal use for the version 155 (created from previous one in portage).
Pan has now a version 160 on its web site.
And it doesn't use autotools anymore but cmake instead (https://gitlab.gnome.org/GNOME/pan/-/blob/master/README.org?ref_type=heads).

Can someone help me transform it so I can use the latest version, if it's not too complicated, please?

Code:
# cat pan-0.155.ebuild
# Copyright 1999-2019 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2

EAPI=8

inherit xdg-utils

DESCRIPTION="A newsreader for GNOME"
HOMEPAGE="http://pan.rebelbase.com/"
SRC_URI="https://gitlab.gnome.org/GNOME/pan/-/archive/v${PVR}/${PN}-v${PVR}.tar.bz2"

LICENSE="GPL-2"
SLOT="0"
KEYWORDS="~alpha amd64 hppa ~ppc ~ppc64 ~sparc x86"
IUSE="dbus gnome-keyring libnotify spell ssl"

RDEPEND="
        >=dev-libs/glib-2.26:2
        dev-libs/gmime:3.0
        >=sys-libs/zlib-1.2.0
        >=x11-libs/gtk+-2.16:2
        gnome-keyring? ( >=gnome-base/libgnome-keyring-3.2 )
        libnotify? ( >=x11-libs/libnotify-0.4.1:0= )
        spell? (
                >=app-text/enchant-1.6:0/0
                >=app-text/gtkspell-3.0.10:3 )
        ssl? ( >=net-libs/gnutls-3:0= )
"
DEPEND="${RDEPEND}
        app-text/yelp-tools
        >=sys-devel/gettext-0.19.7
        virtual/pkgconfig
"

S="${WORKDIR}/pan-v${PVR}"

src_configure() {
        ./autogen.sh \
                --prefix=/usr \
                --with-yelp-tools \
                --with-gmime-crypto \
                $(use_with dbus) \
                $(use_enable gnome-keyring gkr) \
                $(use_with spell gtkspell) \
                $(use_enable libnotify) \
                $(use_with ssl gnutls)
}

pkg_postinst() {
        xdg_desktop_database_update
        xdg_icon_cache_update
        xdg_mimeinfo_database_update
}

pkg_postrm() {
        xdg_desktop_database_update
        xdg_icon_cache_update
        xdg_mimeinfo_database_update
}


Last edited by Frautoincnam on Sat Aug 24, 2024 7:33 pm; edited 1 time in total
Back to top
View user's profile Send private message
fedeliallalinea
Administrator
Administrator


Joined: 08 Mar 2003
Posts: 31175
Location: here

PostPosted: Sat Aug 24, 2024 4:43 pm    Post subject: Reply with quote

You should inherit cmake eclass and change the src_configure function like this
Code:
src_configure() {
        local mycmakeargs=(
                -DWANT_DBUS=$(usex dbus)
                -DWANT_NOTIFY=$(usex libnotify)
                ...
        )
        cmake_src_configure
}

_________________
Questions are guaranteed in life; Answers aren't.
Back to top
View user's profile Send private message
Frautoincnam
Guru
Guru


Joined: 19 May 2017
Posts: 306

PostPosted: Sat Aug 24, 2024 5:05 pm    Post subject: Reply with quote

fedeliallalinea wrote:
You should inherit cmake eclass and change the src_configure function like this
Code:
src_configure() {
        local mycmakeargs=(
                -DWANT_DBUS=$(usex dbus)
                -DWANT_NOTIFY=$(usex libnotify)
                ...
        )
        cmake_src_configure
}


Many thanks.
I already had inherit cmake and local mycmakeargs=() tips, but forgot cmake_src_configure and hadn't "usex" syntax.

One question: $(usex ...) generates a yes/no value. But defaults is ON/OFF. Isn't it a problem?

Code:
    local mycmakeargs=(
        -DWANT_DBUS=$(usex dbus)
        -DWANT_GKR=$(usex gnome-keyring)
        -DWANT_GTKSPELL=$(usex spell)
        -DWANT_NOTIFY=$(usex libnotify)
        -DWANT_GNUTLS=$(usex ssl)
    )

gives:
Code:
WANT_DBUS:BOOL=yes
WANT_GKR:BOOL=no
WANT_GMIME_CRYPTO:BOOL=OFF
WANT_GNUTLS:BOOL=yes
WANT_GTKSPELL:BOOL=yes
WANT_NOTIFY:BOOL=yes
WANT_WEBKIT:BOOL=OFF


EDIT:
Works fine with yes/no instead of ON/OFF.

Thanks again.


Last edited by Frautoincnam on Sat Aug 24, 2024 5:25 pm; edited 1 time in total
Back to top
View user's profile Send private message
fedeliallalinea
Administrator
Administrator


Joined: 08 Mar 2003
Posts: 31175
Location: here

PostPosted: Sat Aug 24, 2024 5:25 pm    Post subject: Reply with quote

Frautoincnam wrote:
One question: $(usex ...) generates a yes/no value. But defaults is ON/OFF. Isn't it a problem?

I missed this part, you can use the usex function in this way $(usex dbus ON OFF) (see documentation)
_________________
Questions are guaranteed in life; Answers aren't.
Back to top
View user's profile Send private message
Frautoincnam
Guru
Guru


Joined: 19 May 2017
Posts: 306

PostPosted: Sat Aug 24, 2024 5:26 pm    Post subject: Reply with quote

fedeliallalinea wrote:
Frautoincnam wrote:
One question: $(usex ...) generates a yes/no value. But defaults is ON/OFF. Isn't it a problem?

I missed this part, you can use the usex function in this way $(usex dbus ON OFF) (see documentation)


Ok, Thanks, but (I just edited my post) it seems to work fine with yes/no.
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