• Stars
    star
    116
  • Rank 303,894 (Top 6 %)
  • Language
    Shell
  • Created about 8 years ago
  • Updated 7 months ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Compile scripts used to build PHP for PocketMine-MP on multiple platforms

Custom PHP build scripts for PocketMine-MP

Build status

Looking for prebuilt binaries? Head over to releases

compile.sh

Bash script used to compile PHP on MacOS and Linux platforms. Make sure you have make autoconf automake libtool m4 wget getconf gzip bzip2 bison g++ git cmake pkg-config re2c ca-certificates.

Recommendations

  • If you're going to use the compiled binary only on the machine you're build it on, remove the -t option for best performance - this will allow the script to optimize for the current machine rather than a generic one.
  • ext-gd2 is NOT included unless the -g flag is provided, as PocketMine-MP doesn't need it. However, if your plugins need it, don't forget to enable it using -g.
  • The -c and -l options can be used to specify cache folders to speed up recompiling if you're recompiling many times (e.g. to improve the script).

Common pitfalls

  • Avoid using the script in directory trees containing spaces. Some libraries don't like trying to be built in directory trees containing spaces, e.g. /home/user/my folder/pocketmine-mp/ might experience problems.

Additional notes

Mac OSX (native compile)

  • Most dependencies can be installed using Homebrew
  • You will additionally need glibtool (GNU libtool, xcode libtool won't work)

Android 64-bit (cross-compile)

  • Only aarch64 targets are supported for Android cross-compile.
  • The aarch64-linux-musl toolchain is required. You can compile and install it using https://github.com/pmmp/musl-cross-make (PMMP fork includes musl-libc patches for DNS resolver config path and increasing stack size limit for LevelDB)
Script flags Description
-c Uses the folder specified for caching downloaded tarballs, zipballs etc.
-d Compiles with debugging symbols and disables optimizations (slow, but useful for debugging segfaults)
-D Compiles with separated debugging symbols, but leaves optimizations enabled (used for distributed binaries)
-g Will compile GD2
-j Set make threads to #
-l Uses the folder specified for caching compilation artifacts (useful for rapid rebuild and testing)
-n Don't remove sources after completing compilation
-s Will compile everything statically
-t Set target
-v Enable Valgrind support in PHP
-x Specifies we are doing cross-compile
-P Compiles extensions for the major PocketMine-MP version specified (can be 4 or 5)

Example:

Target Arguments
linux64 -t linux64 -j4 -P5
linux64, PM4 -t linux64 -j4 -P4
mac64 -t mac-x86-64 -j4 -P5
android-aarch64 -t android-aarch64 -x -j4 -P5

windows-compile-vs.bat

Batch script utilizing Visual Studio on Windows to compile PHP binaries from sources. Ensure you have Visual Studio 2019, git, 7z and wget installed in your PATH.

This script doesn't accept parameters, but the following environment variables are influential:

Variable Description
PHP_DEBUG_BUILD Disables optimisations and builds PHP with detailed debugging information (useful for debugging segfaults)
SOURCES_PATH Where to put the downloaded sources for compilation
VS_EDITION Edition of Visual Studio installed, set to Community by default
PM_VERSION_MAJOR Major version of PocketMine-MP to build extensions for (defaults to 4, can be 4 or 5)

More Repositories

1

PocketMine-MP

A server software for Minecraft: Bedrock Edition in PHP
PHP
3,247
star
2

BedrockProtocol

An implementation of the Minecraft: Bedrock Edition protocol in PHP
PHP
130
star
3

DevTools

Development tools plugin for PocketMine-MP
PHP
104
star
4

BedrockData

Blobs of data generated from Minecraft: Bedrock Edition used by PocketMine-MP
PHP
94
star
5

RakLib

RakNet server implementation written in PHP
PHP
84
star
6

ext-pmmpthread

Fork of https://github.com/krakjoe/pthreads with a revamped API and PHP 8.1+ support
C
82
star
7

Math

PHP library containing math related code used in PocketMine-MP
PHP
41
star
8

NBT

PHP library for working with the NBT (Named Binary Tag) data storage format, as designed by Mojang.
PHP
40
star
9

DeveloperDocs

Documentation for PocketMine-MP plugin developers
HTML
37
star
10

ext-chunkutils2

PHP extension in C++ implementing performance-sensitive parts of the PocketMine-MP chunk system
C++
31
star
11

bds-modding-devkit

Auxiliary scripts used for modding BDS for generating protocol data
Shell
31
star
12

RegisterBlocksDemoPM5

Demo plugin showing how to add missing vanilla (not custom) blocks to PM5
PHP
30
star
13

BinaryUtils

PHP library containing classes and methods for conveniently handling binary strings
PHP
24
star
14

PocketMine-Docker

Hosts the files used to build pmmp/pocketmine-mp Docker image
PHP
24
star
15

Language

Language files for PocketMine-MP
22
star
16

ext-encoding

High-performance `ByteBuffer` implementation for PHP, planned for use in a future version of PocketMine-MP
C++
21
star
17

PocketMine-C-ChunkUtils

PHP C extension implementing some chunk conversion methods for PocketMine-MP
PHP
21
star
18

RconServer

Control your PocketMine-MP server remotely using RCON tools
PHP
19
star
19

SessionsDemo

Demo plugin showing how to manage plugin player data at runtime (without custom Player classes)
PHP
19
star
20

AntiInstaBreak

PocketMine-MP plugin implementing instabreak anti-cheat which was originally built-in.
PHP
19
star
21

Snooze

Event loop for handling notifications from multiple threads at once
PHP
16
star
22

BedrockBlockPaletteArchive

Archive of previous Minecraft Bedrock block palettes of interest, useful for world format upgrading
15
star
23

BedrockBlockUpgradeSchema

(Mostly) auto-generated schemas for upgrading blockstates found in older Minecraft: Bedrock worlds
15
star
24

extension-stub-generator

Generates stubs for extension classes, constants, functions and more. Useful for autocomplete in IDEs.
PHP
13
star
25

SPL

[deprecated] Miscellaneous PHP library files required by PocketMine-MP and related projects
PHP
13
star
26

doc.pmmp.io

Documentation for PocketMine-MP
Python
13
star
27

CrashArchive

Web-based searchable archive for PocketMine-MP crash reports
Go
12
star
28

BedrockProtocolDumper

Generate basic information about new protocol versions from BDS using Python and GNU objdump
Python
12
star
29

bds-mod-saveallchunks

Mod for BDS to force it to save all chunks, useful for exporting vanilla maps for custom server use
CMake
12
star
30

ext-libdeflate

PHP bindings for libdeflate, a zlib replacement with significantly better performance.
C
11
star
31

ext-morton

PHP bindings for libmorton C++ library
C++
9
star
32

PreProcessor

[deprecated] Scripts used to optimise PocketMine-MP before building phars
C++
8
star
33

setup-php-action

GitHub Action to setup PHP binaries with extensions needed by PocketMine-MP
TypeScript
8
star
34

pmmp.io

The Website.
JavaScript
7
star
35

BedrockItemUpgradeSchema

JSON schemas for upgrading items saved on older Minecraft: Bedrock world saves
7
star
36

ext-xxhash

High-performance PHP binding for xxhash https://github.com/Cyan4973/xxHash
C
6
star
37

pocketmine-helm

Helm chart to deploy PocketMine-MP with plugins on Kubernetes
Go
6
star
38

ext-arraydebug

Debug functions for PHP arrays to calculate things like hash distribution and other internal information
C
6
star
39

UUID

Stepping-stone of PM 4.0 development. Abandoned, retained for historic purposes only.
PHP
6
star
40

get.pmmp.io

Source code for https://get.pmmp.io
Shell
5
star
41

setup-action

GitHub action for setting up the environment for PocketMine
TypeScript
5
star
42

ErrorHandler

Basic utilities to make nasty PHP E_* errors more usable
PHP
4
star
43

DataModels

JSON schema models and generated code to validate and handle various data in PocketMine-MP
PHP
4
star
44

BasicSpawnProtection

Basic vanilla-like spawn protection for PocketMine-MP
PHP
4
star
45

RakLibIpc

Channel-based inter-thread/inter-process communication protocol library for RakLib
PHP
3
star
46

ext-recursionguard

Lightweight PHP extension to hard-cap function call depth.
C
3
star
47

PcntlSignalHandler

[deprecated] PocketMine-MP plugin to allow stopping the server gracefully using CTRL+C
PHP
3
star
48

Log

Logging components used by PocketMine-MP and related projects
PHP
3
star
49

registry.pmmp.io

Plugin registry API server
TypeScript
2
star
50

DependencyMirror

Mirrors of packages needed by PHP-Binaries build
2
star
51

CodeStyle

Pocketmine's style rules, including custom rules.
PHP
2
star
52

Color

Color handling library used by PocketMine-MP and related projects
PHP
2
star
53

update.pmmp.io

Artifacts used by https://get.pmmp.io and https://update.pmmp.io/api
PHP
1
star
54

CompatibilityDataPM4

Backwards-compatibility resource files needed by PocketMine-MP 4.x
1
star
55

LogPthreads

[deprecated] pthreads-specific logging components used by PocketMine-MP and related projects
PHP
1
star