diff options
-rw-r--r-- | .SRCINFO | 32 | ||||
-rwxr-xr-x | MCEdit | 6 | ||||
-rwxr-xr-x | MCEdit.desktop | 12 | ||||
-rwxr-xr-x | PKGBUILD | 74 | ||||
-rwxr-xr-x | directories.patch | 81 | ||||
-rw-r--r-- | setup_leveldb.patch | 22 |
6 files changed, 227 insertions, 0 deletions
diff --git a/.SRCINFO b/.SRCINFO new file mode 100644 index 000000000000..98ebd69d2b73 --- /dev/null +++ b/.SRCINFO @@ -0,0 +1,32 @@ +pkgbase = mcedit-git + pkgdesc = Minecraft world editor + pkgver = 20180211 + pkgrel = 1 + url = https://www.mcedit-unified.net/ + arch = any + license = BSD + makedepends = cython2 + depends = python2 + depends = python2-opengl + depends = python2-numpy + depends = python2-pygame + depends = python2-yaml + depends = python2-pillow + depends = python2-ftputil + depends = python2-xlib + depends = xclip + conflicts = mcedit + conflicts = pymclevel + source = MCEdit + source = MCEdit.desktop + source = directories.patch + source = setup_leveldb.patch + source = git+https://github.com/Podshot/MCEdit-Unified.git + md5sums = b08f609c8923067b13a9bd462999a6f4 + md5sums = 53fe3c41d58fd1f6429f90ba0b1831ac + md5sums = 91f520357b56b83e96073c385aa4e19e + md5sums = 7eee6c02f60a7ff1c7d245624b75bace + md5sums = SKIP + +pkgname = mcedit-git + diff --git a/MCEdit b/MCEdit new file mode 100755 index 000000000000..c471f6985305 --- /dev/null +++ b/MCEdit @@ -0,0 +1,6 @@ +#!/bin/sh +LIB=/usr/lib/mcedit +DATA=$SHARE/MCEditData + +cd /usr/share/mcedit +PYTHONPATH="$LIB:$PYTHONPATH" python2 -O $LIB/mcedit.py diff --git a/MCEdit.desktop b/MCEdit.desktop new file mode 100755 index 000000000000..2ac8bef287cd --- /dev/null +++ b/MCEdit.desktop @@ -0,0 +1,12 @@ +[Desktop Entry] +Categories=Game;ArcadeGame; +Comment=Minecraft World Editor +Encoding=UTF-8 +Exec=/usr/bin/MCEdit +Icon=/usr/share/pixmaps/MCEdit.png +Name=MCEdit +Path=/usr/share/mcedit/ +StartupNotify=false +Terminal=false +Type=Application +Version=stable21 diff --git a/PKGBUILD b/PKGBUILD new file mode 100755 index 000000000000..7946b41f7eea --- /dev/null +++ b/PKGBUILD @@ -0,0 +1,74 @@ +# Maintainer: Kozec <kozec at kozec dot com> + +pkgname='mcedit-git' +reponame='MCEdit-Unified' +pkgver='20180211' +pkgrel=1 +pkgdesc='Minecraft world editor' +arch=('any') +url='https://www.mcedit-unified.net/' +license=('BSD') + +makedepends=('cython2') +depends=('python2' 'python2-opengl' 'python2-numpy' 'python2-pygame' + 'python2-yaml' 'python2-pillow' 'python2-ftputil' 'python2-xlib' 'xclip') +conflicts=('mcedit' 'pymclevel') + +source=(MCEdit MCEdit.desktop + directories.patch + setup_leveldb.patch + git+https://github.com/Podshot/$reponame.git + ) + +prepare() { + cd ${srcdir}/${reponame} + grep -rlZ DejaVuSans\-Regular\.ttf * | while IFS= read -r -d '' filename; do sed -i 's/DejaVuSans\-Regular\.ttf/DejaVuSans\.ttf/g' "$filename"; done + msg setup_leveldb.patch + patch -Np0 -i ../setup_leveldb.patch || return 1 + msg directories.patch + patch -Np0 -i ../directories.patch || return 1 +} + + +build() { + cd ${srcdir}/${reponame} + python2 setup.py all + cd pymclevel + python2 setup_leveldb.py +} + + +package() { + cd ${srcdir}/${reponame} + mkdir -p "${pkgdir}/usr/bin" + mkdir -p "${pkgdir}/usr/lib/mcedit" + mkdir -p "${pkgdir}/usr/share/mcedit" + mkdir -p "${pkgdir}/usr/share/applications" + mkdir -p "${pkgdir}/usr/share/pixmaps" + # Pys + cp *.py "${pkgdir}/usr/lib/mcedit" + cp *.pyc "${pkgdir}/usr/lib/mcedit" + cp cpngfilters* "${pkgdir}/usr/lib/mcedit" + for i in albow editortools pymclevel utilities panels viewports leveldb_mcpe; do + cp -R $i "${pkgdir}/usr/lib/mcedit/$i" + done + + # Images and stuff + cp *.png "${pkgdir}/usr/share/mcedit" + for i in stock-schematics toolicons stock-filters stock-brushes lang\ + item-textures Items splashes bo3.def RELEASE-VERSION.json\ + LR5_mzu.fot mcver; do + cp -R $i "${pkgdir}/usr/share/mcedit/$i" + done + ln -s "/usr/share/mcedit/favicon.png" "${pkgdir}/usr/share/pixmaps/MCEdit.png" + + # Launcher + install -D -m755 "${srcdir}/MCEdit" "${pkgdir}/usr/bin/" + install -D "${srcdir}/MCEdit.desktop" "${pkgdir}/usr/share/applications" +} + +md5sums=('b08f609c8923067b13a9bd462999a6f4' + '53fe3c41d58fd1f6429f90ba0b1831ac' + '91f520357b56b83e96073c385aa4e19e' + '7eee6c02f60a7ff1c7d245624b75bace' + 'SKIP') diff --git a/directories.patch b/directories.patch new file mode 100755 index 000000000000..fedb972aa789 --- /dev/null +++ b/directories.patch @@ -0,0 +1,81 @@ +# Just hardcoded path for everyday Arch use + +--- directories.py.orig 2018-02-14 14:21:29.914005138 -0700 ++++ directories.py 2018-02-14 14:24:53.049999361 -0700 +@@ -91,7 +91,7 @@ + # Linux bundle uses 'sys.frozen' + return os.path.join(os.path.dirname(os.path.dirname(os.path.abspath(__file__))), *args) + elif not getattr(sys, 'frozen', False): +- return os.path.join(os.path.dirname(os.path.abspath(__file__)), *args) ++ return os.path.join(getDataDir(), *args) + + if executable_lookup: + return os.path.join(os.path.dirname(sys.executable), *args) +@@ -127,7 +127,10 @@ + # dataDir = os.path.dirname(__file__) + # """ # + # else: +- dataDir = os.getcwdu() ++ if sys.platform.startswith("linux"): ++ dataDir = "/usr/share/mcedit" ++ else: ++ dataDir = os.getcwdu() + if len(path) > 0: + return os.path.join(dataDir, path) + return dataDir + +--- splash.py.orig 2018-02-14 14:43:30.832967572 -0700 ++++ splash.py 2018-02-14 14:44:54.798965185 -0700 +@@ -16,7 +16,7 @@ + no_splash = False + #cur_dir = directories.getDataDir() + #splash_name = os.path.join(cur_dir, 'splash') +-splash_name = directories.getDataFile('splash') ++splash_name = os.path.join(directories.getDocumentsFolder(), 'splash') + splash = None + splash_img_fp = None + fp = None + +--- albow/resource.py.orig 2018-02-14 14:26:35.612996444 -0700 ++++ albow/resource.py 2018-02-14 14:30:55.736989047 -0700 +@@ -1,6 +1,7 @@ + # -*- coding: utf-8 -*- + #-# Modified by D.C.-G. for translation purpose + import os ++import sys + + import logging + log = logging.getLogger(__name__) +@@ -155,6 +156,8 @@ + names.append(fontNm) + # print names + path = _resource_path("fonts", names, **kwds) ++ if sys.platform.startswith("linux"): ++ path = os.path.join("/usr/share/fonts/TTF", *names) + key = (path, size) + font = font_cache.get(key) + if not font: + +--- mcedit.py.orig 2015-08-12 07:12:26.000000000 -0600 ++++ mcedit.py 2015-12-24 16:06:54.623474504 -0700 +@@ -38,6 +38,8 @@ + # + if sys.platform == "darwin": + logfile = os.path.expanduser("~/Library/Logs/mcedit.log") ++elif sys.platform.startswith("linux"): ++ logfile = os.path.expanduser('~/.mcedit/mcedit.log') + else: + logfile = os.path.join(os.getcwdu(), logfile) + fh = logging.FileHandler(logfile, mode="w") + +--- pymclevel/materials.py.orig 2018-02-14 13:58:46.074043924 -0700 ++++ pymclevel/materials.py 2018-02-14 14:01:49.687038702 -0700 +@@ -93,7 +93,7 @@ + self.blockstates = json.load(def_file) + else: + # In all other cases, retrieve the file directly from the file system. +- with open(os.path.join("pymclevel", definition_file)) as def_file: ++ with open(os.path.join("/usr/lib/mcedit/pymclevel", definition_file)) as def_file: + self.blockstates = json.load(def_file) + + self.material_map[self._mats] = self diff --git a/setup_leveldb.patch b/setup_leveldb.patch new file mode 100644 index 000000000000..f461bfb9bdcc --- /dev/null +++ b/setup_leveldb.patch @@ -0,0 +1,22 @@ +--- pymclevel/setup_leveldb.py.orig 2018-02-14 05:21:27.948494140 -0700 ++++ pymclevel/setup_leveldb.py 2018-02-14 05:22:42.476492806 -0700 +@@ -255,12 +255,19 @@ + fd.seek(0) + fd.write(f_data.replace(hook, c_data)) + ++ with open("db/snappy_compressor.cc", "r+") as f: ++ data = f.read().replace("#include <snappy/snappy.h>", "#include <snappy.h>") ++ f.seek(0) ++ f.write(data) ++ f.truncate() ++ + if zlib: + with open("Makefile", "r+") as f: + # If '-lz' is specified, we *may* need to specify the full library path. Just force it to be sure. + data = f.read().replace("LIBS += $(PLATFORM_LIBS) -lz", "LIBS += $(PLATFORM_LIBS) %s" % zlib) + # All the same if a path is specified, we need the one we found here. (SuSE don't have a /lib/x64_86-linux-gnu directory.) + data = data.replace("LIBS += $(PLATFORM_LIBS) /lib/x86_64-linux-gnu/libz.so.1.2.8", "LIBS += $(PLATFORM_LIBS) %s" % zlib) ++ data = data.replace(" db/autocompact_test \\", "# db/autocompact_test \\") + f.seek(0) + f.write(data) + cpath = os.environ.get("CPATH") |