wiki:FreeBSDPocketMine

Introduction

PocketMine is an open source server for playing MineCraft Pocket Edition (MCPE) is available on iOS and android.

Important: This guide is for developers if you simply like to run PocketMine on Windows or Linux look at their website.

This guide is intended to get PocketMine to work from Git for use with iOS client MineCraft PE v0.14.0. The server software being using is FreeBSD. I am running it inside a FreeBSDJail

rzplay# svn co http://svn.freebsd.org/ports/head /usr/ports

Update few outdated ports

rvdzwet@rzplay:/home/rvdzwet % svn diff /usr/ports/textproc/pecl-yaml
Index: /usr/ports/textproc/pecl-yaml/Makefile
===================================================================
--- /usr/ports/textproc/pecl-yaml/Makefile	(revision 409208)
+++ /usr/ports/textproc/pecl-yaml/Makefile	(working copy)
@@ -2,7 +2,7 @@
 # $FreeBSD$
 
 PORTNAME=	yaml
-PORTVERSION=	1.2.0
+PORTVERSION=	2.0.0RC7
 CATEGORIES=	textproc pear
 MASTER_SITES=	http://pecl.php.net/get/
 PKGNAMEPREFIX=	pecl-
@@ -20,6 +20,5 @@
 USE_PHP=	yes
 USE_PHP_BUILD=	yes
 USE_PHPEXT=	yes
-IGNORE_WITH_PHP=	70
 
 .include <bsd.port.mk>
Index: /usr/ports/textproc/pecl-yaml/distinfo
===================================================================
--- /usr/ports/textproc/pecl-yaml/distinfo	(revision 409208)
+++ /usr/ports/textproc/pecl-yaml/distinfo	(working copy)
@@ -1,2 +1,2 @@
-SHA256 (PECL/yaml-1.2.0.tgz) = fdf0eec6bf16b0c45e58076a2048f96140a778463724fb82ab49ab5fb4c7e19a
-SIZE (PECL/yaml-1.2.0.tgz) = 38606
+SHA256 (PECL/yaml-2.0.0RC7.tgz) = d49acf2b7843258957a16df0d7ced56c0e1fc3eaa54f54289e4012edc002814c
+SIZE (PECL/yaml-2.0.0RC7.tgz) = 38233
rvdzwet@rzplay:/home/rvdzwet % svn diff /usr/ports/devel/pecl-pthreads
Index: /usr/ports/devel/pecl-pthreads/Makefile
===================================================================
--- /usr/ports/devel/pecl-pthreads/Makefile	(revision 409208)
+++ /usr/ports/devel/pecl-pthreads/Makefile	(working copy)
@@ -2,7 +2,7 @@
 # $FreeBSD$
 
 PORTNAME=	pthreads
-PORTVERSION=	2.0.10
+PORTVERSION=	3.1.6
 CATEGORIES=	devel
 MASTER_SITES=	http://pecl.php.net/get/
 PKGNAMEPREFIX=	pecl-
Index: /usr/ports/devel/pecl-pthreads/distinfo
===================================================================
--- /usr/ports/devel/pecl-pthreads/distinfo	(revision 409208)
+++ /usr/ports/devel/pecl-pthreads/distinfo	(working copy)
@@ -1,2 +1,2 @@
-SHA256 (PECL/pthreads-2.0.10.tgz) = 8bdf8d8918680421ca0ced1e62292eeb626f800a808d0a3b6812841756588cf6
-SIZE (PECL/pthreads-2.0.10.tgz) = 85247
+SHA256 (PECL/pthreads-3.1.6.tgz) = bb13da909a7a7ae1f9e499166103a2d24628993238ce03a8aae3eaa492c0b736
+SIZE (PECL/pthreads-3.1.6.tgz) = 80932

Compile PHP from ports as ZTS feature is needed for pthreads

rzplay# pkg delete 'php7*' rzplay# make -C /usr/ports/lang/php70 WITH=ZTS deinstall reinstall rzplay# make -C /usr/ports/devel/pecl-pthreads deinstall reinstall rzplay# make -C /usr/ports/archivers/php70-phar deinstall reinstall rzplay# make -C /usr/ports/archivers/php70-zlib deinstall reinstall rzplay# make -C /usr/ports/databases/php70-sqlite3 deinstall reinstall rzplay# make -C /usr/ports/textproc/pecl-yaml deinstall reinstall rzplay# make -C /usr/ports/ftp/php70-curl deinstall reinstall rzplay# make -C /usr/ports/lang/php70-extensions config rzplay# make -C /usr/ports/net/php70-sockets deinstall reinstall rzplay# make -C /usr/ports/math/php70-bcmath deinstall reinstall rzplay# make -C /usr/ports/devel/php70-json deinstall reinstall

Add some more standard packages

rzplay# pkg install git bash subversion

Checkout Source Code and dependencies

rzplay% git clone https://github.com/PocketMine/PocketMine-MP rzplay% ( cd PocketMine-MP/src/spl ; git submodule init; git submodule update )

All done, let's start the server

rzplay% bash ./PocketMine-MP/start.sh -p /usr/local/bin/php

(Optional) automatic starting of application

Since it is interactive I like to start it in a screen session on boot by including it into crontab

rzplay% crontab -e

@reboot $HOME/start-pocketmine.sh
rzplay% cat <<EOF > $HOME/start-pocketmine.sh
/usr/local/bin/screen -S PocketMine -d -m /usr/local/bin/bash $HOME/PocketMine-MP/start.sh -p /usr/local/bin/php
EOF

rzplay% chmod 755 $HOME/start-pocketmine.sh

All done, server running at rzplay.vanderzwet.net at (standard) port 19132

Folks

PocketMine has quite some forks ClearSky and Genisys for example. I like to stick to the 'original one'.

Questions and/or Comments? Please send them to me

Last modified 9 years ago Last modified on Feb 26, 2016, 2:32:12 PM
Note: See TracWiki for help on using the wiki.