Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Minecraft (ebuild to build deps from source!)
View unanswered posts
View posts from last 24 hours

Goto page 1, 2, 3 ... 12, 13, 14  Next  
Reply to topic    Gentoo Forums Forum Index Gamers & Players
View previous topic :: View next topic  
Author Message
Chewi
Developer
Developer


Joined: 01 Sep 2003
Posts: 886
Location: Edinburgh, Scotland

PostPosted: Mon Dec 20, 2010 11:50 pm    Post subject: Minecraft (ebuild to build deps from source!) Reply with quote

Hello fellow gamers. I'm sure many of you have at least heard of Minecraft. If you haven't, go check it out! Don't be put off by the graphics. They form an important part of the amazing gameplay. Give it 15 minutes. Watch some videos. You may not "get it" straight away. Several hundred thousand addicts can't be wrong. :lol:

I have a very bad habit of my own, which is that I spend more time writing ebuilds for games than I do actually playing them. That's good news for you though! Minecraft isn't open source (yet!) but all of its dependencies are. Normally it downloads and installs them to ~/.minecraft but as a true Gentoo user, you should not be satisfied with this! :wink: I have therefore created an ebuild that does build the dependencies from source and forces Minecraft to use them.

There are two or three justifications for this. Firstly, the web site does say it may be open sourced one day. We're already half way to supporting that. Second, the bundled copy of OpenAL is built against ALSA but not PulseAudio. If you use PulseAudio (like me), this could create problems for you. Lastly, it may open up support to PPC but I'm not sure whether this would actually work. I know some people have tried on OS X without success. I'd be interested in hearing whether it works for you or not.

You may be concerned that an in-tree ebuild will never keep up with the frequent Minecraft updates. Worry not! The ebuild only downloads the game's launcher, not the game itself. Updates are still handled by the game and are stored in ~/.minecraft as usual. We just don't bother with the dependencies.

If you're interested in a server ebuild, I have created one but that does need to be updated each time so I'm going to wait until tomorrow when the initial fixes for today's problematic Beta 1.0 are released.

If you want to try my ebuild, it is now available from java-overlay so please use layman. Note that the game's ebuild alone is not sufficient as some of the dependencies are also in java-overlay.

If you've not played the game before and you encounter any problems, PLEASE report them here before going upstream. If you want to compare with the official release, make sure you delete ~/.minecraft/bin/version and ~/.minecraft/bin/natives first so that the game can then download and install its own libraries.
Back to top
View user's profile Send private message
Chewi
Developer
Developer


Joined: 01 Sep 2003
Posts: 886
Location: Edinburgh, Scotland

PostPosted: Tue Dec 21, 2010 9:56 pm    Post subject: Reply with quote

The server ebuild is now also up here.
Back to top
View user's profile Send private message
TinheadNed
Guru
Guru


Joined: 05 Apr 2003
Posts: 339
Location: Farnborough, UK

PostPosted: Wed Dec 22, 2010 10:59 am    Post subject: Reply with quote

Installed it here, as I'm a sucker for the "Gentoo way". Appears to work fine in a 30s runaround on ~amd64, thanks!
Back to top
View user's profile Send private message
CatBox360
n00b
n00b


Joined: 15 Jul 2010
Posts: 4

PostPosted: Sat Dec 25, 2010 8:37 am    Post subject: Reply with quote

What a wonderful thing to find on a day like today. Figured I'd give it a try.
So I happily waved bye to windows and rebooted into gentoo only to find out grub got wiped last time i reinstalled windows, so...
Once that was fixed I merrily added java to layman and emerged minecraft. YAY! I said to myself as it finished.
I execute minecraft and java spits out a whole bunch of errors and whatnot. So I scroll up attempting to find whatever the issue was.
I was greeted with "java.io.IOException: Cannot run program "xrandr": java.io.IOException: error=2, "
Being a new gentoo user I simply stared at the screen for a few moments wondering what this could mean. So I pop open google, paste the line, and continue on my way to googleland.
After very little help and a bunch of nongentoo support forums I decide to just search portage for the "missing program"
"Oh" I said to myself, "whatever this is isn't installed... Let's install it!"
So after a few seconds it finishes i type in minecraft again, wringing my hands hoping it works, the login window appears. I do a dance and happily enter my credentials.
I am greeted with the familiar downloading screen and I am brought to the main menu. I scream in glee and enter into the game only to realize it is now 3AM.
I sadly close the game and make my way to the bed. Then I think, "what for? I still have time to play for a bit and sleep!"

Short story long:
<3 for making this.

Edit: The server ebuild worked flawlessly!
Back to top
View user's profile Send private message
Chiitoo
Administrator
Administrator


Joined: 28 Feb 2010
Posts: 2550
Location: Here and Away Again

PostPosted: Sat Dec 25, 2010 7:04 pm    Post subject: Reply with quote

CatBox360,

that is one nice story you have there hehe. ^^
So nice it made me finally take a look-see and try it out since my friend plays it a lot but I noticed it is now in closed Beta phase (I think it not long ago was free Alpha?) and not free to play anymore...for the time being at least. Or maybe it never was free, can't remember.

Either way, still a good job Chewi!
_________________
Kindest of regardses.
Back to top
View user's profile Send private message
Chewi
Developer
Developer


Joined: 01 Sep 2003
Posts: 886
Location: Edinburgh, Scotland

PostPosted: Sun Dec 26, 2010 12:09 am    Post subject: Reply with quote

You're welcome, guys!

CatBox360, sorry about the xrandr problem. It's a little odd that you didn't have it already as it's pulled in by the xorg-x11 meta package that most people use. Nevertheless, this still points to a missing dependency, probably of LWJGL. I already knew it needed libXrandr but not the xrandr application. I'll check this out and get it fixed.

Chiitoo, Classic was the free version but development stopped on that many months ago. Alpha was the paid version and was very cheap with free updates forever. On Monday, this became the not-so-cheap-but-still-quite-cheap Beta without free updates. When it goes final, the price will go up again.

I have been using my own server more than I thought I would (it's fun, even with just my wife!) so I've made further improvements to the server ebuild that I will put up soon. It now supports running multiple servers on the same machine. It also has an init script for running a server system-wide. When doing this, the console is easily accessed via tmux, a GNU Screen-a-like. Finally, I am adding optional hMod support through yet another ebuild. hMod was updated to support Beta today.

P.S. I became a Dad 5 hours ago! What a Christmas this has been! :D
Back to top
View user's profile Send private message
CatBox360
n00b
n00b


Joined: 15 Jul 2010
Posts: 4

PostPosted: Mon Dec 27, 2010 4:05 pm    Post subject: Reply with quote

Yea like I said, I'm still pretty craptastic with things, so I most likely messed something up along the way with xrandr or whatever, but no big deal.

As far as the init script and hmod support, that is an excellent idea. I just found hmod a couple of days ago and love it. Would it be possible to somehow add use flags for different plugins? Dunno if it is possible at all, but it would be a really nifty thing to do.

Congrats on the kid as well.
Back to top
View user's profile Send private message
Ant P.
Watchman
Watchman


Joined: 18 Apr 2009
Posts: 6920

PostPosted: Wed Dec 29, 2010 9:03 pm    Post subject: Reply with quote

The /usr/games/bin/minecraft script needs -Djava.net.preferIPv4Stack=true added, I can't connect at all without that.
Back to top
View user's profile Send private message
Chewi
Developer
Developer


Joined: 01 Sep 2003
Posts: 886
Location: Edinburgh, Scotland

PostPosted: Wed Dec 29, 2010 9:40 pm    Post subject: Reply with quote

Ant_P, thanks for that information. I'll add that to the client and server. I've not tried IPv6 before. Normally I'd say this should be up to the user but I guess it makes sense in this case if Minecraft's authentication server doesn't support IPv6. You can set up servers to accept clients without authentication but I doubt many people do that.

CatBox360, I considered doing either that or having ebuilds for each plugin but it just wouldn't be feasible. There are too many plugins and they are updated too frequently for it to be maintainable. I might package Updatr, which would help, but I haven't decided on that yet.
Back to top
View user's profile Send private message
Chiitoo
Administrator
Administrator


Joined: 28 Feb 2010
Posts: 2550
Location: Here and Away Again

PostPosted: Thu Dec 30, 2010 5:19 pm    Post subject: Reply with quote

Chewi wrote:
Chiitoo, Classic was the free version but development stopped on that many months ago. Alpha was the paid version and was very cheap with free updates forever. On Monday, this became the not-so-cheap-but-still-quite-cheap Beta without free updates. When it goes final, the price will go up again.

Heh, yeah I remember now/refreshed my memory at the site.
Thanks.

Chewi wrote:
P.S. I became a Dad 5 hours ago! What a Christmas this has been! :D

Hey, congratulations and good luck for the future!
_________________
Kindest of regardses.
Back to top
View user's profile Send private message
Dorsai!
Apprentice
Apprentice


Joined: 27 Jul 2008
Posts: 285
Location: Bavaria

PostPosted: Sat Jan 01, 2011 4:38 pm    Post subject: Reply with quote

Hi, thanks for your work on this ebuild.

Anyway, since I began using it, I cannot change my controls ingame. I always set TAB to Inventory but this is not saved properly and the next time I start Minecraft I have to set it again.

Can anyone verify such a behavior or is something wrong with my config files?
Back to top
View user's profile Send private message
Chewi
Developer
Developer


Joined: 01 Sep 2003
Posts: 886
Location: Edinburgh, Scotland

PostPosted: Sat Jan 01, 2011 4:52 pm    Post subject: Reply with quote

It works for me and I did try that specific case. The ebuild doesn't change how settings are saved but we do use our own copy of jinput so maybe that has something to do with it. See if and how ~/.minecraft/options.txt changes when you set the option.
Back to top
View user's profile Send private message
Chewi
Developer
Developer


Joined: 01 Sep 2003
Posts: 886
Location: Edinburgh, Scotland

PostPosted: Mon Jan 03, 2011 2:30 pm    Post subject: Reply with quote

I've updated the client and server ebuilds. The xrandr and IPv6 issues are fixed. The server improvements I mentioned have been applied but I only added hMod and Updatr to the java-experimental overlay, available from https://overlays.gentoo.org/svn/proj/java/java-experimental. This is because Bukkit was announced yesterday and this obsoletes hMod. I only found this out after spending ages on one of Updatr's dependencies. :( Still, it sounds like a big improvement so I'll look into it when it's available. It doesn't appear to be usable just yet.

If you used my previous server ebuild (probably just CatBox360) then you'll need to move ~/.minecraft/server to ~/.minecraft/servers/main or /var/lib/minecraft/main. The latter needs to be owned by the games user.
Back to top
View user's profile Send private message
vekin
n00b
n00b


Joined: 06 Jan 2011
Posts: 4

PostPosted: Thu Jan 06, 2011 9:25 am    Post subject: Reply with quote

It's not working for me.

Edit: I fixed it by emerging another game that created the group games.

Code:

 * CPV:  games-server/minecraft-server-20101222-r1
 * REPO: java-overlay
 * USE:  amd64 elibc_glibc kernel_linux multilib userland_GNU
 * Using: icedtea6-bin
>>> Unpacking source...
>>> Source unpacked in /var/tmp/portage/games-server/minecraft-server-20101222-r1/work
>>> Preparing source in /var/tmp/portage/games-server/minecraft-server-20101222-r1/work ...
>>> Source prepared.
>>> Configuring source in /var/tmp/portage/games-server/minecraft-server-20101222-r1/work ...
>>> Source configured.
>>> Compiling source in /var/tmp/portage/games-server/minecraft-server-20101222-r1/work ...
java-pkg-2_src_compile: build.xml not found so nothing to do.
>>> Source compiled.
>>> Test phase [not enabled]: games-server/minecraft-server-20101222-r1

>>> Install minecraft-server-20101222-r1 into /var/tmp/portage/games-server/minecraft-server-20101222-r1/image/ category games-server
install: invalid user `games'
touch: cannot touch `/var/tmp/portage/games-server/minecraft-server-20101222-r1/image//var/lib/minecraft/.keep_games-server_minecraft-server-0': No such file or directory
 * ERROR: games-server/minecraft-server-20101222-r1 failed:
 *   Failed to create .keep in /var/tmp/portage/games-server/minecraft-server-20101222-r1/image//var/lib/minecraft
 *
 * Call stack:
 *     ebuild.sh, line   47:  Called src_install
 *   environment, line 4458:  Called keepdir '/var/lib/minecraft' '/var/run/minecraft'
 *     ebuild.sh, line  323:  Called die
 * The specific snippet of code:
 *            touch "${D}${x}/.keep_${CATEGORY}_${PN}-${SLOT}" || \
 *               die "Failed to create .keep in ${D}${x}"
 *
 * If you need support, post the output of 'emerge --info =games-server/minecraft-server-20101222-r1',
 * the complete build log and the output of 'emerge -pqv =games-server/minecraft-server-20101222-r1'.
 * This ebuild is from an overlay named 'java-overlay': '/var/lib/layman/java-overlay/'
!!! When you file a bug report, please include the following information:
GENTOO_VM=icedtea6-bin  CLASSPATH="" JAVA_HOME="/opt/icedtea6-bin-1.9.2"
JAVACFLAGS="-source 1.6 -target 1.6" COMPILER=""
and of course, the output of emerge --info
 * The complete build log is located at '/var/tmp/portage/games-server/minecraft-server-20101222-r1/temp/build.log'.
 * The ebuild environment file is located at '/var/tmp/portage/games-server/minecraft-server-20101222-r1/temp/environment'.
 * S: '/var/tmp/portage/games-server/minecraft-server-20101222-r1/work'
Back to top
View user's profile Send private message
Chewi
Developer
Developer


Joined: 01 Sep 2003
Posts: 886
Location: Edinburgh, Scotland

PostPosted: Thu Jan 06, 2011 11:25 am    Post subject: Reply with quote

vekin, thanks for reporting this. The java pkg_setup was overriding the games pkg_setup. I need to explicitly call both. This is now fixed.
Back to top
View user's profile Send private message
d_logan
n00b
n00b


Joined: 09 May 2006
Posts: 73

PostPosted: Sat Jan 15, 2011 12:56 am    Post subject: Reply with quote

Thanks for the ebuilds, awesome game! I built the game from the portage overlay a few days ago. Just now, I tried building the minecraft-server package, but I keep getting checksum errors:
Code:
>>> Downloading 'http://www.minecraft.net/download/minecraft_server.jar'
--2011-01-14 18:53:57--  http://www.minecraft.net/download/minecraft_server.jar
Resolving www.minecraft.net... 194.28.157.42
Connecting to www.minecraft.net|194.28.157.42|:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: 382946 (374K) [application/java-archive]
Saving to: `/usr/portage/distfiles/minecraft-server-20101222.jar'

100%[=================================================================================================>] 382,946      154K/s   in 2.4s   

2011-01-14 18:54:00 (154 KB/s) - `/usr/portage/distfiles/minecraft-server-20101222.jar' saved [382946/382946]

('Filesize does not match recorded size', 382946, 351879)
!!! Fetched file: minecraft-server-20101222.jar VERIFY FAILED!
!!! Reason: Filesize does not match recorded size
!!! Got:      382946
!!! Expected: 351879
Refetching... File renamed to '/usr/portage/distfiles/minecraft-server-20101222.jar._checksum_failure_.PsnuRu'

!!! Couldn't download 'minecraft-server-20101222.jar'. Aborting.


Any ideas?
Back to top
View user's profile Send private message
Chewi
Developer
Developer


Joined: 01 Sep 2003
Posts: 886
Location: Edinburgh, Scotland

PostPosted: Sat Jan 15, 2011 1:11 am    Post subject: Reply with quote

An upstream update was released today. I already knew but didn't get round to it. I'll update the ebuild in the morning. It'll probably still work if you just redigest.
Back to top
View user's profile Send private message
Chewi
Developer
Developer


Joined: 01 Sep 2003
Posts: 886
Location: Edinburgh, Scotland

PostPosted: Sat Jan 15, 2011 11:33 am    Post subject: Reply with quote

Done the update. Note that if you've installed hMod, you'll need to remove it or the server won't start. The latest hMod isn't compatible with this update but unfortunately Bukkit isn't ready yet either. The Bukkit developers said they *may* update hMod but Bukkit will take priority.

UPDATE : They've decided not to update hMod because it was proving to be more effort than it was worth.
Back to top
View user's profile Send private message
d_logan
n00b
n00b


Joined: 09 May 2006
Posts: 73

PostPosted: Sat Jan 15, 2011 8:52 pm    Post subject: Reply with quote

Thanks, the build works. Does anyone know if I can play 2 people on a LAN without registering a 2nd account?

Nevermind, figured that out, but for some reason monsters don't die in daylight.
Back to top
View user's profile Send private message
Ant P.
Watchman
Watchman


Joined: 18 Apr 2009
Posts: 6920

PostPosted: Thu Feb 03, 2011 9:54 pm    Post subject: Reply with quote

Hey, could you change the ebuild to use lwjgl 2.6 instead? Apparently it fixes a bug which has been plaguing me for a long time now.
Back to top
View user's profile Send private message
Chewi
Developer
Developer


Joined: 01 Sep 2003
Posts: 886
Location: Edinburgh, Scotland

PostPosted: Thu Feb 03, 2011 10:08 pm    Post subject: Reply with quote

Since I already did an ebuild for 2.6, this is simply a one line change but how confident are you that 2.6 is entirely compatible? Have you tried it yet?
Back to top
View user's profile Send private message
XQYZ
Apprentice
Apprentice


Joined: 19 Jul 2009
Posts: 231
Location: Europe

PostPosted: Thu Feb 03, 2011 11:33 pm    Post subject: Reply with quote

Ant_P wrote:
Hey, could you change the ebuild to use lwjgl 2.6 instead? Apparently it fixes a bug which has been plaguing me for a long time now.


Same. I actually noticed this quite a lot recently, but I haven't gotten around to looking at it. Workaround is just pupping up the menu (ESC), so it's bareable.
Back to top
View user's profile Send private message
Chewi
Developer
Developer


Joined: 01 Sep 2003
Posts: 886
Location: Edinburgh, Scotland

PostPosted: Thu Feb 03, 2011 11:51 pm    Post subject: Reply with quote

Okay, I'll take your word for it and have committed that change. Please let me know immediately if it doesn't fix the problem or if anything else breaks.
Back to top
View user's profile Send private message
Ant P.
Watchman
Watchman


Joined: 18 Apr 2009
Posts: 6920

PostPosted: Fri Feb 04, 2011 12:24 am    Post subject: Reply with quote

Seems much better! And it also seems to have fixed the bug where the pause menu randomly pops up when I try to do an unrelated action...
Back to top
View user's profile Send private message
WastingBody
Tux's lil' helper
Tux's lil' helper


Joined: 09 May 2008
Posts: 105

PostPosted: Tue Feb 08, 2011 12:00 am    Post subject: Reply with quote

Would it be possible to switch -Xms512M with -Xincgc in the java launcher? It tends to use less RAM, and it's nice to have that extra RAM for other things that may be running at the same time on the server. Source.
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Gamers & Players All times are GMT
Goto page 1, 2, 3 ... 12, 13, 14  Next
Page 1 of 14

 
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