Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Writing an ebuild for Simon-0.4
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
keba
Guru
Guru


Joined: 02 Jun 2006
Posts: 328
Location: Switzerland

PostPosted: Sat Mar 09, 2013 5:18 am    Post subject: Writing an ebuild for Simon-0.4 Reply with quote

Hi,

I'm trying to write an ebuild for Simon, voice recognition software. So far, I have written an ebuild of one of its dependencies, pockesphinx:
Code:
# Copyright 1999-2010 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: /var/cvsroot/gentoo-x86/app-accessibility/pocketsphinx/pocketsphinx-0.8.ebuild,v 1.1 2013/03/09 02:03:03 beandog Exp $

EAPI="2"
inherit cmake-utils

DESCRIPTION="Speech recognizer library written in C"
HOMEPAGE="http://cmusphinx.sourceforge.net/"
SRC_URI="mirror://sourceforge/cmusphinx/${P}.tar.gz"
#SRC_URI="http://aarnet.dl.sourceforge.net/project/cmusphinx/pocketsphinx/0.8/pocketsphinx-0.8.tar.gz"

LICENSE="GPL-2"
SLOT="0"
KEYWORDS="~amd64 ~ppc ~x86"
IUSE="debug"

RDEPEND=">=app-accessibility/sphinxbase-0.8"
DEPEND="${RDEPEND}"

DOCS="ChangeLog README"

src_configure() {
   econf
}

src_compile() {
   emake
}

src_install() {
   emake DESTDIR="${D}" install
}


My problem is that Simon itself is a lot more complicated. The build script that is provided wants to do stuff that I have no clue how to translate into ebuild language:
Code:

mkdir build 2> /dev/null
cd build
cmake -DCMAKE_INSTALL_PREFIX=`kde4-config --prefix` ..
make
su -c 'make install && ldconfig'
kbuildsycoca4


I have tried several things, like an ebuild that doesn't specify any build instructions (does not compile), or one that uses the kde4-base scripts (fails), and other stuff. The only way it works is a manual compilation, i.e. not as an ebuild. Can you help? Thanks

This version of Simon is available at http://simon-listens.blogspot.com.
_________________
Prayer can change the world!
Back to top
View user's profile Send private message
Hu
Moderator
Moderator


Joined: 06 Mar 2007
Posts: 21586

PostPosted: Sat Mar 09, 2013 5:43 pm    Post subject: Reply with quote

Why did you set pocketsphinx to inherit cmake-utils? Based on the ebuild you provided, pocketsphinx appears to use autotools, not cmake.

For Simon, could you post exactly what you tried? Based on the functionality provided by cmake-utils, it looks like most or maybe all of the steps you describe should have been executed for you as default phases.
Back to top
View user's profile Send private message
bec
Apprentice
Apprentice


Joined: 30 Sep 2004
Posts: 220
Location: Cali - Colombia

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

Hello Keba and Hu,

Based on your conversation, I tested successfully the following pocketsphinx-0.8.ebuild:

Code:

# Copyright 1999-2013 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: $

EAPI=5

DESCRIPTION="Speech recognizer library written in C"
HOMEPAGE="http://cmusphinx.sourceforge.net/"
SRC_URI="mirror://sourceforge/cmusphinx/${P}.tar.gz"

LICENSE="GPL-2"
SLOT="0"
KEYWORDS="~amd64 ~X86"
IUSE="debug"

RDEPEND=">=app-accessibility/sphinxbase-0.8"
DEPEND="${RDEPEND}"
DOCS="ChangeLog README"

_________________
abe
Back to top
View user's profile Send private message
leo.the_zoo
Apprentice
Apprentice


Joined: 04 Jul 2005
Posts: 160
Location: Poland

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

Well, there you have a rudimentary but working version:
Code:

# Copyright 1999-2013 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: $

EAPI=5

inherit kde4-base

SRC_URI="http://download.kde.org/stable/simon/${PV}/src/${P}.tar.bz2"
DESCRIPTION="Open-Source Speech Recognition"
HOMEPAGE="http://simon-listens.blogspot.com/"
LICENSE="GPL-2"

KEYWORDS="~amd64 ~x86"
SLOT="0"
DEPEND="x11-libs/qwt"



You will have to add some use flags and other dependencies that will be pulled by them. You will have to add a custom src_configure() function where you define a mycmakeargs array. Please check some KDE4 ebuilds like, say, kde-base/okular, to see how to get things done. By the way, you just see how cool is Gentoo build system and eclasses - so many things you don't have to care since someone else already did. :)

Good luck!

EDIT: The program for which you created an ebuild seems to be an optional package.
EDIT2: Added license info to the ebuild.
Back to top
View user's profile Send private message
bec
Apprentice
Apprentice


Joined: 30 Sep 2004
Posts: 220
Location: Cali - Colombia

PostPosted: Thu Mar 21, 2013 4:18 pm    Post subject: Reply with quote

Thanks leo.the_zoo!

Adding some more stuff to simon-0.4.0.ebuild:

Code:

# Copyright 1999-2013 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: $

EAPI=5

KDE_HANDBOOK="optional"
inherit kde4-base


DESCRIPTION="Open-source speech recognition program for KDE"
HOMEPAGE="http://www.simon-listens.org/"
SRC_URI="mirror://kde/stable/${PN}/${PV}/src/${P}.tar.bz2"

LICENSE="GPL-2"
SLOT="4"
KEYWORDS="~amd64 ~x86"
IUSE="kdepim libsamplerate opencv"

RDEPEND="media-libs/alsa-lib
        x11-libs/qwt
        app-accessibility/pocketsphinx
        kdepim?         ( kde-base/kdepimlibs )
        libsamplerate? ( media-libs/libsamplerate )
        opencv?        ( media-libs/opencv )
       "

DEPEND="${RDEPEND}
        sys-devel/bison
        dev-util/desktop-file-utils
        sys-devel/gettext"

src_configure() {
    mycmakeargs=(
        $(cmake-utils_use_with libsamplerate)
        $(cmake-utils_use_with opencv)
        $(cmake-utils_use_with kdepim)
    )

    kde4-base_src_configure
}



- But I can't find qaccessibility-client in gentoo, It seems to be an optional dependency.
- I think pocketsphinx is mandatory, as this is the speech recognition engine

EDIT: reordered DEPEND/RDEPEND
_________________
abe
Back to top
View user's profile Send private message
leo.the_zoo
Apprentice
Apprentice


Joined: 04 Jul 2005
Posts: 160
Location: Poland

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

I also noted lack of qaccessibility-client but did not care too much since if that was critical, I'd expect ebuild to exit with a proper error message.
I have no knowledge on speech-recognition, I only wanted to help you to start up with writing a proper ebuild and I'm happy it worked.
Usually a detailed list of dependencies can be found somewhere in documentation attached or project's website.
I wish you good luck with writing and once you have it finished, you may think of making it find the way to Portage tree.
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