Forums

Skip to content

Advanced search
  • Quick links
    • Unanswered topics
    • Active topics
    • Search
  • FAQ
  • Login
  • Register
  • Board index Assistance Portage & Programming
  • Search

My first ebuild, keeps looking on the mirrorlist for the src

Problems with emerge or ebuilds? Have a basic programming question about C, PHP, Perl, BASH or something else?
Post Reply
Advanced search
8 posts • Page 1 of 1
Author
Message
kofrad
n00b
n00b
User avatar
Posts: 38
Joined: Tue Oct 26, 2004 2:24 am
Location: South Florida

My first ebuild, keeps looking on the mirrorlist for the src

  • Quote

Post by kofrad » Sun Mar 04, 2012 10:00 pm

I finally succeeded in creating a working ebuild, however there has been one problem trying to get it to work. When portage goes to download the source tarball, it looks for the package on the official gentoo mirrors - not the SRC_URI I provided in the ebuild. I was able to get it to properly build and install on my machine by manually downloading the source to /usr/portage/distfiles/

Can anyone help me figure out why this is happening?
What else might I need to do to get this ebuild ready to submit to the bugtracker for potential inclusion in the full tree?

On another note, I'm considering making a live ebuild to pull the source from git if I can get that figured out

Code: Select all

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

inherit eutils games

DESCRIPTION="Gravit is a free, visually stunning gravity simulator, where you can spend endless time experimenting with various configurations of simulated universes."
HOMEPAGE="http://gravit.slowchop.com/"
SRC_URI="http://gravit.slowchop.com/media/downloads/${P}.tar.gz"

LICENSE="GPL-2"
SLOT="0"
KEYWORDS="~amd64"
IUSE="lua png"

REDEPEND=">=media-libs/libsdl-1.2.6
	media-libs/sdl-image
	media-libs/sdl-ttf
	virtual/opengl
	virtual/glu
	lua? ( >=dev-lang/lua-5.1 )
	png? ( media-libs/libpng )"
DEPEND="${RDEPEND}"

pkg_setup() {
	games_pkg_setup
}

src_compile() {
	egamesconf \
		$(use_enable lua) \
		$(use_enable png)
	emake || die
}

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

	dodoc AUTHORS ChangeLog COPYING NEWS README || die

	prepgamesdirs
}
Top
Chiitoo
Ninja Apprentice
Ninja Apprentice
User avatar
Posts: 3074
Joined: Sun Feb 28, 2010 5:36 pm
Location: Sore wa sore, kore wa kore... nanoda.

  • Quote

Post by Chiitoo » Sun Mar 04, 2012 10:05 pm

Hies.

Really new to ebuilds myself, so I'm really not sure if this is what you're looking for, at all, but:

Code: Select all

RESTRICT="mirror"
It's from my currently best attempt on sort of writing one myself, as seen [post=6959132]here[/post].
Kindest of regardses.
Top
kofrad
n00b
n00b
User avatar
Posts: 38
Joined: Tue Oct 26, 2004 2:24 am
Location: South Florida

  • Quote

Post by kofrad » Sun Mar 04, 2012 10:32 pm

Chiitoo wrote:Hies.

Really new to ebuilds myself, so I'm really not sure if this is what you're looking for, at all, but:

Code: Select all

RESTRICT="mirror"
It's from my currently best attempt on sort of writing one myself, as seen [post=6959132]here[/post].
That was it! Thanks a bunch for the quick reply 8)
Top
Hu
Administrator
Administrator
Posts: 24395
Joined: Tue Mar 06, 2007 5:38 am

Re: My first ebuild, keeps looking on the mirrorlist for the

  • Quote

Post by Hu » Sun Mar 04, 2012 11:34 pm

kofrad wrote:

Code: Select all

# $Header: $
No explicit EAPI?
kofrad wrote:

Code: Select all

REDEPEND=">=media-libs/libsdl-1.2.6
Spelling error. Variable REDEPEND is not standard. You probably meant RDEPEND.
kofrad wrote:

Code: Select all

pkg_setup() {
	games_pkg_setup
}
You can probably omit this, in which case it will default to the corresponding function from an eclass that defined pkg_setup.
kofrad wrote:

Code: Select all

src_compile() {
	egamesconf \
		$(use_enable lua) \
		$(use_enable png)
Configuration is better done in src_configure, though you need to use a higher EAPI to have that function.
Top
kofrad
n00b
n00b
User avatar
Posts: 38
Joined: Tue Oct 26, 2004 2:24 am
Location: South Florida

Re: My first ebuild, keeps looking on the mirrorlist for the

  • Quote

Post by kofrad » Mon Mar 05, 2012 12:10 am

Hu wrote:
kofrad wrote:

Code: Select all

# $Header: $
No explicit EAPI?
kofrad wrote:

Code: Select all

REDEPEND=">=media-libs/libsdl-1.2.6
Spelling error. Variable REDEPEND is not standard. You probably meant RDEPEND.
kofrad wrote:

Code: Select all

src_compile() {
	egamesconf \
		$(use_enable lua) \
		$(use_enable png)
Configuration is better done in src_configure, though you need to use a higher EAPI to have that function.

Thanks for pointing those things out. I'm reading through some more documentation of ebuilds and am double checking everything once again. Looks like I'll be fine with EAPI="2" for right now to use src_configure().

Hu wrote:
kofrad wrote:

Code: Select all

pkg_setup() {
	games_pkg_setup
}
You can probably omit this, in which case it will default to the corresponding function from an eclass that defined pkg_setup.
From the documentation I read regarding the games eclass, I thought that would be the necessary for making sure the proper directories and permissions are created for running games.

After taking a second look, it seems like the eclass will override the default behavior and call whatever is needed by the games eclass, correct?
Top
kofrad
n00b
n00b
User avatar
Posts: 38
Joined: Tue Oct 26, 2004 2:24 am
Location: South Florida

  • Quote

Post by kofrad » Mon Mar 05, 2012 3:47 am

Here is my revised ebuild, if anyone can look this over for any potential problems, it would be greatly appreciated. If all is well I will work on getting things like the ChangeLog together to submit onto the bug tracker for possible inclusion into the portage tree. Thanks everyone for all your help! :D

Code: Select all

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

EAPI="2"

inherit eutils games

RESTRICT="mirror"
DESCRIPTION="Gravit is a free, visually stunning gravity simulator, where you can spend endless time experimenting with various configurations of simulated universes."
HOMEPAGE="http://gravit.slowchop.com/"
SRC_URI="http://gravit.slowchop.com/media/downloads/${P}.tar.gz"

LICENSE="GPL-2"
SLOT="0"
KEYWORDS="~amd64"
IUSE="lua png"

RDEPEND=">=media-libs/libsdl-1.2.6
	media-libs/sdl-image
	media-libs/sdl-ttf
	virtual/opengl
	virtual/glu
	lua? ( >=dev-lang/lua-5.1 )
	png? ( media-libs/libpng )"
DEPEND="${RDEPEND}"

pkg_setup() {
	games_pkg_setup
}

src_configure() {
	if [[ -x ${ECONF_SOURCE:-.}/configure ]]; then
		egamesconf \
			$(use_enable lua) \
			$(use_enable png)
	fi
}

src_compile() {
	if [ -f Makefile ]; then
		emake || die "emake failed"
	fi
}

src_install() {
	emake DESTDIR="${D}" install || die "Install failed"

	dodoc AUTHORS ChangeLog NEWS README || die
	doicon data/gravit.png

	make_desktop_entry ${PN} Gravit /usr/share/pixmaps/${PN}.png

	prepgamesdirs
}
Top
Hu
Administrator
Administrator
Posts: 24395
Joined: Tue Mar 06, 2007 5:38 am

  • Quote

Post by Hu » Mon Mar 05, 2012 4:34 am

Testing for the presence of configure and Makefile is useful in the generic functions that ebuilds inherit, so that the ebuild does not need to override the function if the file is missing. However, for an ebuild where you control the function and know the upstream tarball, you know whether configure and Makefile exist. Therefore, there is no point in testing for them. If they exist now, assume they will continue to exist and remove the test. If they do not exist now, then the test is guaranteed to be false, so remove it and the code it guards.
Top
kofrad
n00b
n00b
User avatar
Posts: 38
Joined: Tue Oct 26, 2004 2:24 am
Location: South Florida

  • Quote

Post by kofrad » Fri Mar 09, 2012 4:18 am

Thanks for the response, I had included it kind of as a sanity-check. After thinking about it though, I'm sure the standard ebuild functions include any that might be needed. Thanks for clarifying that for me.
Top
Post Reply

8 posts • Page 1 of 1

Return to “Portage & Programming”

Jump to
  • Assistance
  • ↳   News & Announcements
  • ↳   Frequently Asked Questions
  • ↳   Installing Gentoo
  • ↳   Multimedia
  • ↳   Desktop Environments
  • ↳   Networking & Security
  • ↳   Kernel & Hardware
  • ↳   Portage & Programming
  • ↳   Gamers & Players
  • ↳   Other Things Gentoo
  • ↳   Unsupported Software
  • Discussion & Documentation
  • ↳   Documentation, Tips & Tricks
  • ↳   Gentoo Chat
  • ↳   Gentoo Forums Feedback
  • ↳   Duplicate Threads
  • International Gentoo Users
  • ↳   中文 (Chinese)
  • ↳   Dutch
  • ↳   Finnish
  • ↳   French
  • ↳   Deutsches Forum (German)
  • ↳   Diskussionsforum
  • ↳   Deutsche Dokumentation
  • ↳   Greek
  • ↳   Forum italiano (Italian)
  • ↳   Forum di discussione italiano
  • ↳   Risorse italiane (documentazione e tools)
  • ↳   Polskie forum (Polish)
  • ↳   Instalacja i sprzęt
  • ↳   Polish OTW
  • ↳   Portuguese
  • ↳   Documentação, Ferramentas e Dicas
  • ↳   Russian
  • ↳   Scandinavian
  • ↳   Spanish
  • ↳   Other Languages
  • Architectures & Platforms
  • ↳   Gentoo on ARM
  • ↳   Gentoo on PPC
  • ↳   Gentoo on Sparc
  • ↳   Gentoo on Alternative Architectures
  • ↳   Gentoo on AMD64
  • ↳   Gentoo for Mac OS X (Portage for Mac OS X)
  • Board index
  • All times are UTC
  • Delete cookies

© 2001–2026 Gentoo Foundation, Inc.

Powered by phpBB® Forum Software © phpBB Limited

Privacy Policy

 

 

magic