Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
ebuild for Micropolis (a.k.a. S*m C*ty)
View unanswered posts
View posts from last 24 hours

Goto page 1, 2  Next  
Reply to topic    Gentoo Forums Forum Index Unsupported Software
View previous topic :: View next topic  
Author Message
mikegpitt
Advocate
Advocate


Joined: 22 May 2004
Posts: 3224

PostPosted: Wed Feb 06, 2008 4:41 am    Post subject: ebuild for Micropolis (a.k.a. S*m C*ty) Reply with quote

Here is an ebuild for the newly open sourced Micropolis... formerly called S*m C*ty. It has been submitted to bugzilla here:
https://bugs.gentoo.org/show_bug.cgi?id=205707

EDIT 5: Updated ebuild posted - 2/11/08

/usr/local/portage/games-simulation/micropolis/micropolis-1.0.ebuild
Code:

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

inherit games eutils

DESCRIPTION="Micropolis (A.K.A. 'S*mC*ty')"
HOMEPAGE="http://www.donhopkins.com/home/micropolis/"
SRC_URI="http://www.donhopkins.com/home/micropolis/micropolis-activity-source.tgz"

RESTRICT="mirror"

LICENSE="GPL | Micropolis"
SLOT="0"
KEYWORDS="~x86 ~ppc ~amd64"
IUSE="alsa"




DEPEND="x11-libs/libX11
        x11-libs/libXpm
        x11-proto/xextproto
        x11-libs/libXext"

RDEPEND="alsa? (media-sound/alsa-utils)"


src_unpack() {
    unpack ${A}
    cd ${WORKDIR}/micropolis-activity

    epatch "${FILESDIR}"/micropolis_git.patch
}


src_compile() {
    cd ${WORKDIR}/micropolis-activity/src

    # both 'make' and 'make install' are part of the normal build process
    make && make install || die "make failed"
}

src_install() {

    dodoc ${WORKDIR}/micropolis-activity/manual/*

    dodir /usr/games/share/micropolis

    cp ${WORKDIR}/micropolis-activity/Micropolis            ${D}/usr/games/share/micropolis/.
    cp ${WORKDIR}/micropolis-activity/__init__.py           ${D}/usr/games/share/micropolis/.
    cp ${WORKDIR}/micropolis-activity/micropolisactivity.py ${D}/usr/games/share/micropolis/.
    cp -Rp ${WORKDIR}/micropolis-activity/activity          ${D}/usr/games/share/micropolis/.
    cp -Rp ${WORKDIR}/micropolis-activity/cities            ${D}/usr/games/share/micropolis/.
    cp -Rp ${WORKDIR}/micropolis-activity/images            ${D}/usr/games/share/micropolis/.
    cp -Rp ${WORKDIR}/micropolis-activity/res               ${D}/usr/games/share/micropolis/.


    # create launcher script

    echo "#!/bin/bash" > ${WORKDIR}/micropolis
    echo "# Launcher for Micropolis" >> ${WORKDIR}/micropolis
    echo "" >> ${WORKDIR}/micropolis
    echo "cd /usr/games/share/micropolis/" >> ${WORKDIR}/micropolis
    echo "./Micropolis" >> ${WORKDIR}/micropolis

    dodir /usr/games/bin

    cp ${WORKDIR}/micropolis ${D}/usr/games/bin/micropolis
    gamesowners ${D}/usr/games/bin/micropolis
    gamesperms ${D}/usr/games/bin/micropolis

    # fix sound
    chmod 750 ${D}/usr/games/share/micropolis/res/sounds/player


    # finish up
    doicon "${WORKDIR}"/micropolis-activity/Micropolis.png
    make_desktop_entry micropolis 'Micropolis City Simulation Game' micropolis.png Application


    prepgamesdirs
}


This ebuild also requires the micropolis_git.patch found here:
http://rmdir.de/~michael/micropolis_git.patch

You can place the patch in the files dir for the ebuild.

As I noted on bugzilla, the build process and runtime environment of Micropolis is a bit wierd, so I'm not 100% sure if the ebuild conforms to Gentoo's standards.

Enjoy!


Last edited by mikegpitt on Mon Feb 11, 2008 6:01 am; edited 8 times in total
Back to top
View user's profile Send private message
duckz
Apprentice
Apprentice


Joined: 26 Jun 2007
Posts: 158

PostPosted: Wed Feb 06, 2008 1:38 pm    Post subject: Reply with quote

I need to add :

Code:
RESTRICT="nomirror"


in the ebuild
_________________
emerge -va techygadget.com <- install my blog in gentoo
./configure anime wallpaper
make install premium drupal theme
Back to top
View user's profile Send private message
mikegpitt
Advocate
Advocate


Joined: 22 May 2004
Posts: 3224

PostPosted: Wed Feb 06, 2008 5:55 pm    Post subject: Reply with quote

duckz wrote:
I need to add :

Code:
RESTRICT="nomirror"


in the ebuild
Good point... I noticed that it probed the mirrors 1st... there are a few other small tweaks I want to add. I'll post them later. Thanks!
Back to top
View user's profile Send private message
Dirk.R.Gently
Guru
Guru


Joined: 29 Jan 2007
Posts: 546
Location: Titan

PostPosted: Wed Feb 06, 2008 6:14 pm    Post subject: Reply with quote

Nice job. Ebuild worked just fine.

A couple things to point out. The .desktop file exec= command is incorrect. Isn't the ebuild meant to use the /usr/share/games directory?

Also I tested on ~ppc, no problems.
_________________
Helpful Linux Tidbits
Back to top
View user's profile Send private message
mikegpitt
Advocate
Advocate


Joined: 22 May 2004
Posts: 3224

PostPosted: Wed Feb 06, 2008 6:28 pm    Post subject: Reply with quote

Dirk.R.Gently wrote:
Nice job. Ebuild worked just fine.

A couple things to point out. The .desktop file exec= command is incorrect. Isn't the ebuild meant to use the /usr/share/games directory?

Also I tested on ~ppc, no problems.
I didn't catch the .desktop thing... I'll add a patch for it later when I get the chance.

BTW - Does anyone know if there is a specific place to put the .desktop files in Gentoo?
Back to top
View user's profile Send private message
mikegpitt
Advocate
Advocate


Joined: 22 May 2004
Posts: 3224

PostPosted: Thu Feb 07, 2008 2:03 am    Post subject: Reply with quote

I edited the ebuild based on the above comments, and also changed around the dependancys. I didn't need to patch the .desktop file, since it looks like it was in the correct format as compared to others on my system. I did however edit the launcher executable to be compatible iwth the .deskt file (now it's 'micropolis' instead of 'Micropolis').

I did notice that no sounds play for me, and I get these errors:
Code:
couldn't find "/usr/games/share/micropolis/res//sounds/player" to execute


Not sure what to make of that... the file itself seems ok, and I have aplay installed.
Back to top
View user's profile Send private message
desultory
Administrator
Administrator


Joined: 04 Nov 2005
Posts: 9398

PostPosted: Thu Feb 07, 2008 3:15 am    Post subject: Reply with quote

mikegpitt wrote:
BTW - Does anyone know if there is a specific place to put the .desktop files in Gentoo?
They go in /usr/share/applications/, but instead of making and placing them manually use make_desktop_entry() from eutils.eclass.
Back to top
View user's profile Send private message
mikegpitt
Advocate
Advocate


Joined: 22 May 2004
Posts: 3224

PostPosted: Thu Feb 07, 2008 4:52 am    Post subject: Reply with quote

desultory wrote:
mikegpitt wrote:
BTW - Does anyone know if there is a specific place to put the .desktop files in Gentoo?
They go in /usr/share/applications/, but instead of making and placing them manually use make_desktop_entry() from eutils.eclass.
Thanks for the tip... it's added to the ebuild.
Back to top
View user's profile Send private message
s.hase
Apprentice
Apprentice


Joined: 19 Nov 2004
Posts: 293

PostPosted: Thu Feb 07, 2008 11:10 am    Post subject: Reply with quote

I tested it on amd64, no problems noticed. Thanks for the ebuild!
Back to top
View user's profile Send private message
El_Presidente_Pufferfish
Veteran
Veteran


Joined: 11 Jul 2002
Posts: 1179
Location: Seattle

PostPosted: Thu Feb 07, 2008 5:28 pm    Post subject: Reply with quote

Can you change the resolution?
Back to top
View user's profile Send private message
mikegpitt
Advocate
Advocate


Joined: 22 May 2004
Posts: 3224

PostPosted: Thu Feb 07, 2008 7:10 pm    Post subject: Reply with quote

s.hase wrote:
I tested it on amd64, no problems noticed. Thanks for the ebuild!
~amd64 added... thanks!

El_Presidente_Pufferfish wrote:
Can you change the resolution?
It looks like the patch changes the resolution to 1200x900. I didn't realise since I'm running on 1280x1024, but this could be a problem for other users. I'll try editing the patch later to lower the resolution to wither 1024x768 or 800x600.

BTW - The first screen is not resizable, but the actual gameplay window is resizable.
Back to top
View user's profile Send private message
psdasilva
Apprentice
Apprentice


Joined: 03 Sep 2005
Posts: 239

PostPosted: Fri Feb 08, 2008 2:38 am    Post subject: Reply with quote

mikegpitt wrote:

I did notice that no sounds play for me, and I get these errors:
Code:
couldn't find "/usr/games/share/micropolis/res//sounds/player" to execute


Not sure what to make of that... the file itself seems ok, and I have aplay installed.


The EXECUTION bit must be turned on on that file:
Code:

chmod 750 /usr/games/share/micropolis/res//sounds/player
Back to top
View user's profile Send private message
nutbar21
Apprentice
Apprentice


Joined: 05 Dec 2004
Posts: 205
Location: USA

PostPosted: Fri Feb 08, 2008 3:00 am    Post subject: Reply with quote

I also did a
Code:
chmod 750 /usr/games/share/micropolis/res/sounds/player
to get sound to work. The errors don't show up and sound works properly after this operation.

I do notice that this game is significantly different from the SNES version I spent so many hours playing... you can't "extend" land by placing a parks around the edges of lakes, for instance.

Thanks to mikegpitt for the ebuild by the way!
_________________
"Your voice is like the sound of sirens to a house on fire..." -The Alkaline Trio
Back to top
View user's profile Send private message
mikegpitt
Advocate
Advocate


Joined: 22 May 2004
Posts: 3224

PostPosted: Fri Feb 08, 2008 6:02 am    Post subject: Reply with quote

I feel stupid for not checking the file permissions for the sound problem :lol: It's fixed in the ebuild now... I still need to look into the resolution issue.
Back to top
View user's profile Send private message
desultory
Administrator
Administrator


Joined: 04 Nov 2005
Posts: 9398

PostPosted: Fri Feb 08, 2008 9:58 am    Post subject: Reply with quote

mikegpitt wrote:
Code:
RESTRICT="nomirror"
Using nomirror in this context is deprecated in favor of using mirror, though they presently cause identical behavior.
mikegpitt wrote:
Code:
    # copy over licence
    dodir /usr/portage/licenses/
Instead of doing this add the license to the licenses subdirectory of the overlay, otherwise license filtering will not work.
mikegpitt wrote:
Code:
    # fix sound
    chmod 755 ${WORKDIR}/micropolis-activity/res/sounds/player
This could be done with gamesowners() and gamesperms().
mikegpitt wrote:
Code:
    chmod 755 ${D}/usr/games/bin/micropolis
This, too.
Back to top
View user's profile Send private message
psdasilva
Apprentice
Apprentice


Joined: 03 Sep 2005
Posts: 239

PostPosted: Fri Feb 08, 2008 10:12 pm    Post subject: Reply with quote

mikegpitt wrote:

Code:
    # fix sound
    chmod 755 ${WORKDIR}/micropolis-activity/res/sounds/player



Must be 750 and not 755. The permissions are for users and group (games in the case), not for others.
Back to top
View user's profile Send private message
mikegpitt
Advocate
Advocate


Joined: 22 May 2004
Posts: 3224

PostPosted: Mon Feb 11, 2008 6:03 am    Post subject: Reply with quote

Edited ebuild posted based on the above comments...

gamesowners() and gamesperms() worked well for the launcher script, but wouldn't change the permissions for the sound script. I kept the chmod 750 fix in for that.

Thanks!
Back to top
View user's profile Send private message
GoldenMouse
Tux's lil' helper
Tux's lil' helper


Joined: 29 Sep 2005
Posts: 112

PostPosted: Wed Feb 20, 2008 10:52 pm    Post subject: Reply with quote

Build fails with "Failed Patch: micropolis_git.patch!"

I'm getting such things as "can't find file to patch at input line 178" and "Perhaps you used the wrong -p or --strip option?"

I'm not sure if this is a bug or an artifact of my own stupidity.
Back to top
View user's profile Send private message
mikegpitt
Advocate
Advocate


Joined: 22 May 2004
Posts: 3224

PostPosted: Thu Feb 21, 2008 12:47 am    Post subject: Reply with quote

GoldenMouse wrote:
Build fails with "Failed Patch: micropolis_git.patch!"

I'm getting such things as "can't find file to patch at input line 178" and "Perhaps you used the wrong -p or --strip option?"

I'm not sure if this is a bug or an artifact of my own stupidity.
I'm using epatch, so no problems with picking the correct options. I just checked and it looks like the patch itself has changed. I'm not sure what the new modifications are all about, but I'll take a look into it.

For now, use the original patch that I posted to bugzilla. It is here: https://bugs.gentoo.org/attachment.cgi?id=142768
Back to top
View user's profile Send private message
hitachi
Guru
Guru


Joined: 20 Feb 2006
Posts: 472
Location: Freiburg / Deutschland

PostPosted: Thu Mar 27, 2008 12:27 pm    Post subject: Reply with quote

Hi,
what needs to be done to have micropolis in the tree? Even mask would be great.
Back to top
View user's profile Send private message
mikegpitt
Advocate
Advocate


Joined: 22 May 2004
Posts: 3224

PostPosted: Thu Mar 27, 2008 3:06 pm    Post subject: Reply with quote

hitachi wrote:
Hi,
what needs to be done to have micropolis in the tree? Even mask would be great.
Not sure... I guess that's up the the devs. It is in bugzilla so that parts is done, so it's a waiting game.

Can anyone shed light on how new ebuilds go from bugzilla to portage?
Back to top
View user's profile Send private message
hitachi
Guru
Guru


Joined: 20 Feb 2006
Posts: 472
Location: Freiburg / Deutschland

PostPosted: Thu Mar 27, 2008 3:15 pm    Post subject: Reply with quote

mikegpitt wrote:
Not sure... I guess that's up the the devs. It is in bugzilla so that parts is done, so it's a waiting game.

Can anyone shed light on how new ebuilds go from bugzilla to portage?

That would be interesting to know. Also found something else I would like to have up to date in the tree.

OT Part (how to get this up to date?):
http://gentoo-portage.com/app-misc/gramps
http://www.gramps-project.org/wiki/index.php?title=Main_Page
Back to top
View user's profile Send private message
Necoro
Veteran
Veteran


Joined: 18 Dec 2005
Posts: 1912
Location: München (Germany)

PostPosted: Thu Mar 27, 2008 4:13 pm    Post subject: Reply with quote

Did you think of adding it to the sunrise overlay?
_________________
Inter Deum Et Diabolum Semper Musica Est.
Back to top
View user's profile Send private message
hitachi
Guru
Guru


Joined: 20 Feb 2006
Posts: 472
Location: Freiburg / Deutschland

PostPosted: Thu Mar 27, 2008 9:49 pm    Post subject: Reply with quote

I don't want this to become OT so just one question: Isn't the overlay taking development power away from the team?
Back to top
View user's profile Send private message
desultory
Administrator
Administrator


Joined: 04 Nov 2005
Posts: 9398

PostPosted: Fri Mar 28, 2008 12:09 am    Post subject: Reply with quote

Rather the contrary, it can be a valuable recruiting tool helping to expand the pool of developers maintaining a given set of packages.
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Unsupported Software All times are GMT
Goto page 1, 2  Next
Page 1 of 2

 
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