Add truecraft

This commit is contained in:
Travis Burtrum 2018-03-08 21:04:02 -05:00
parent c0a3606968
commit cd11ecc792
7 changed files with 265 additions and 0 deletions

View File

@ -0,0 +1,72 @@
# Maintainer: wenLiangcan <boxeed at gmail dot com>
_pkgname=truecraft
pkgname=truecraft-git
pkgver=r816.90160bd
pkgrel=1
epoch=1
pkgdesc="A completely clean-room implementation of Minecraft beta 1.7.3 (circa September 2011)."
arch=('i686' 'x86_64')
url="https://github.com/SirCmpwn/TrueCraft"
license=('MIT')
depends=('mono>=4.0' 'desktop-file-utils' 'gtk2' 'webkitgtk2' 'gtk-sharp-2' 'sdl_mixer')
makedepends=('git' 'nuget')
source=("${_pkgname}"::"git://github.com/SirCmpwn/TrueCraft.git"
"${_pkgname}.svg"::'https://truecraft.io/static/truecraft_earth.svg')
provides=('truecraft')
conflicts=('truecraft')
md5sums=('SKIP'
'2e23dc787e60fa1184bca7025589660d')
pkgver() {
cd "${_pkgname}"
printf "r%s.%s" "$(git rev-list --count HEAD)" "$(git rev-parse --short HEAD)"
}
prepare() {
cat > "${_pkgname}.sh" << EOF
#!/usr/bin/env sh
mkdir -p \$HOME/.config/truecraft
cd \$HOME/.config/truecraft
ln -sf /usr/share/${_pkgname}/* ./
mono /usr/share/${_pkgname}/TrueCraft.Launcher.exe
EOF
cat > "${_pkgname}.desktop" << EOF
[Desktop Entry]
Name=TrueCraft
GenericName=TrueCraft
Comment=A completely clean-room implementation of Minecraft beta 1.7.3
Exec=${_pkgname}
Icon=${_pkgname}.svg
Terminal=false
Type=Application
Categories=Game;
EOF
}
build() {
cd "${_pkgname}"
git reset --hard
git submodule update --init --recursive || return 1
nuget restore
xbuild /p:Configuration=Release
cd 'TrueCraft.Launcher/bin/Release/'
# rm -f truecraft MonoGame.Framework.MacOS.dll MonoGame.Framework.Windows.dll
}
package() {
install -Dm755 "${_pkgname}.sh" "${pkgdir}/usr/bin/${_pkgname}"
install -Dm644 "${_pkgname}.svg" "${pkgdir}/usr/share/pixmaps/${_pkgname}.svg"
install -Dm644 "${_pkgname}.desktop" "${pkgdir}/usr/share/applications/${_pkgname}.desktop"
cd "${_pkgname}"
install -Dm644 LICENSE "${pkgdir}/usr/share/licenses/${_pkgname}/LICENSE"
cd 'TrueCraft.Launcher/bin/Release/'
find . -type f -exec install -Dm644 {} \
"${pkgdir}/usr/share/${_pkgname}/{}" \;
}

96
src/webkitgtk/PKGBUILD Normal file
View File

@ -0,0 +1,96 @@
# $Id: PKGBUILD 294869 2017-04-27 03:06:45Z foutrelis $
# Contributor: Andreas Radke <andyrtr@archlinux.org>
pkgbase=webkitgtk
pkgname=(webkitgtk webkitgtk2)
pkgver=2.4.11
pkgrel=11
pkgdesc="Legacy Web content engine"
arch=(i686 x86_64)
url="https://webkitgtk.org/"
license=(custom)
depends=(libxt libxslt sqlite libsoup 'enchant>=2.2' libgl geoclue2 gst-plugins-base-libs
libsecret libwebp harfbuzz-icu)
makedepends=(gtk3 gtk2 gperf gobject-introspection python2 mesa ruby)
optdepends=('gst-plugins-base: free media decoding'
'gst-plugins-good: media decoding'
'gst-libav: nonfree media decoding')
options=(!emptydirs)
install=webkitgtk.install
source=(https://webkitgtk.org/releases/$pkgbase-${pkgver}.tar.xz
webkitgtk-2.4.9-abs.patch
icu59.patch
enchant-2.x.patch
pkgconfig-enchant-2.patch)
sha256sums=('588aea051bfbacced27fdfe0335a957dca839ebe36aa548df39c7bbafdb65bf7'
'ec294bbb5588a1802a68e3615c6718486b22f922645c5fef686d3d103014bf70'
'a1118b3c9317806438c1e2f46f17e15556aae34665f739ca72b94b10b16ae422'
'8db282f3b7f0e21ff51121c2579466c3194475a20d35c4fbd0e53f35b5639919'
'df8284004f25d189184aab1009df696c915212e0e439a555dbd0dbec06111e2e')
prepare() {
mkdir build-gtk{,2} path
ln -s /usr/bin/python2 path/python
cd $pkgbase-$pkgver
patch -Np1 -i ../webkitgtk-2.4.9-abs.patch
patch -Np1 -i ../icu59.patch
patch -Np1 -i ../enchant-2.x.patch
# https://www.archlinux.org/todo/enchant-221-rebuild/
patch -Np1 -i ../pkgconfig-enchant-2.patch
}
_build() (
_ver="$1"; shift
cd build-${_ver}
PATH="$srcdir/path:$PATH"
CXXFLAGS+=" -fno-delete-null-pointer-checks"
CFLAGS+=" -fno-delete-null-pointer-checks"
CFLAGS+=" -Wno-expansion-to-defined"
CXXFLAGS+=" -Wno-expansion-to-defined"
../$pkgbase-$pkgver/configure --prefix=/usr \
--libexecdir=/usr/lib/webkit${_ver} \
--enable-introspection \
--disable-webkit2 \
--disable-gtk-doc \
"$@"
# https://bugzilla.gnome.org/show_bug.cgi?id=655517
sed -i 's/ -shared / -Wl,-O1,--as-needed\0/g' libtool
make all stamp-po
)
build() {
_build gtk
_build gtk2 --with-gtk=2.0
}
package_webkitgtk() {
pkgdesc+=" for GTK+ 3"
depends+=(gtk3)
optdepends+=('gtk2: Netscape plugin support')
provides=("webkitgtk3=${pkgver}" "libwebkit3=${pkgver}")
conflicts=(webkitgtk3 libwebkit3)
replaces=(webkitgtk3 libwebkit3)
make -C build-gtk -j1 DESTDIR="$pkgdir" install
install -Dm644 $pkgbase-$pkgver/Source/WebKit/LICENSE \
"$pkgdir/usr/share/licenses/webkitgtk/LICENSE"
}
package_webkitgtk2() {
pkgdesc+=" for GTK+ 2"
depends+=(gtk2)
provides=("libwebkit=${pkgver}")
conflicts=(libwebkit)
replaces=(libwebkit)
make -C build-gtk2 -j1 DESTDIR="$pkgdir" install
install -Dm644 $pkgbase-$pkgver/Source/WebKit/LICENSE \
"$pkgdir/usr/share/licenses/webkitgtk2/LICENSE"
}

View File

@ -0,0 +1,11 @@
--- webkitgtk-2.4.9/Source/WebCore/platform/text/enchant/TextCheckerEnchant.cpp.orig 2017-12-06 14:59:40.768262788 -0500
+++ webkitgtk-2.4.9/Source/WebCore/platform/text/enchant/TextCheckerEnchant.cpp 2017-12-06 15:03:10.000000000 -0500
@@ -128,7 +128,7 @@
for (i = 0; i < numberOfSuggestions; i++)
guesses.append(String::fromUTF8(suggestions[i]));
- enchant_dict_free_suggestions(*iter, suggestions);
+ enchant_dict_free_string_list(*iter, suggestions);
}
return guesses;

35
src/webkitgtk/icu59.patch Normal file
View File

@ -0,0 +1,35 @@
--- webkitgtk-2.16.1/Source/JavaScriptCore/API/JSStringRef.h.orig 2017-02-20 17:20:08.000000000 +0100
+++ webkitgtk-2.16.1/Source/JavaScriptCore/API/JSStringRef.h 2017-04-22 14:35:00.926530142 +0200
@@ -32,6 +32,7 @@
#include <stdbool.h>
#endif
#include <stddef.h> /* for size_t */
+#include <uchar.h>
#ifdef __cplusplus
extern "C" {
@@ -46,4 +47,4 @@
- typedef unsigned short JSChar;
+ typedef char16_t JSChar;
#else
typedef wchar_t JSChar;
#endif
--- webkitgtk-2.16.1/Source/WebKit2/Shared/API/c/WKString.h.orig 2017-02-20 17:20:17.000000000 +0100
+++ webkitgtk-2.16.1/Source/WebKit2/Shared/API/c/WKString.h 2017-04-22 14:35:56.853196170 +0200
@@ -28,6 +28,7 @@
#include <WebKit2/WKBase.h>
#include <stddef.h>
+#include <uchar.h>
#ifndef __cplusplus
#include <stdbool.h>
@@ -39,7 +40,7 @@
#if !defined(WIN32) && !defined(_WIN32) \
&& !((defined(__CC_ARM) || defined(__ARMCC__)) && !defined(__linux__)) /* RVCT */
- typedef unsigned short WKChar;
+ typedef char16_t WKChar;
#else
typedef wchar_t WKChar;
#endif

View File

@ -0,0 +1,11 @@
--- webkitgtk-2.4.11/Source/autotools/FindDependencies.m4.orig 2018-01-19 23:47:23.866875328 +0800
+++ webkitgtk-2.4.11/Source/autotools/FindDependencies.m4 2018-01-19 23:47:34.543576202 +0800
@@ -154,7 +154,7 @@
AC_SUBST(PANGO_LIBS)
if test "$enable_spellcheck" = "yes"; then
- PKG_CHECK_MODULES(ENCHANT, enchant >= enchant_required_version, [], [enable_spellcheck="no"])
+ PKG_CHECK_MODULES(ENCHANT, enchant-2 >= enchant_required_version, [], [enable_spellcheck="no"])
AC_SUBST(ENCHANT_CFLAGS)
AC_SUBST(ENCHANT_LIBS)
fi

View File

@ -0,0 +1,26 @@
diff -Nur webkitgtk-2.4.9.orig/Source/WebCore/platform/gtk/GtkClickCounter.cpp webkitgtk-2.4.9/Source/WebCore/platform/gtk/GtkClickCounter.cpp
--- webkitgtk-2.4.9.orig/Source/WebCore/platform/gtk/GtkClickCounter.cpp 2015-05-20 03:03:24.000000000 -0600
+++ webkitgtk-2.4.9/Source/WebCore/platform/gtk/GtkClickCounter.cpp 2016-02-07 11:30:42.392686308 -0700
@@ -85,8 +85,8 @@
guint32 eventTime = getEventTime(event);
if ((event->type == GDK_2BUTTON_PRESS || event->type == GDK_3BUTTON_PRESS)
- || ((abs(buttonEvent->x - m_previousClickPoint.x()) < doubleClickDistance)
- && (abs(buttonEvent->y - m_previousClickPoint.y()) < doubleClickDistance)
+ || ((fabs(buttonEvent->x - m_previousClickPoint.x()) < doubleClickDistance)
+ && (fabs(buttonEvent->y - m_previousClickPoint.y()) < doubleClickDistance)
&& (eventTime - m_previousClickTime < static_cast<guint>(doubleClickTime))
&& (buttonEvent->button == m_previousClickButton)))
m_currentClickCount++;
diff -Nur webkitgtk-2.4.9.orig/Source/WebCore/platform/gtk/LocalizedStringsGtk.cpp webkitgtk-2.4.9/Source/WebCore/platform/gtk/LocalizedStringsGtk.cpp
--- webkitgtk-2.4.9.orig/Source/WebCore/platform/gtk/LocalizedStringsGtk.cpp 2015-05-20 03:03:24.000000000 -0600
+++ webkitgtk-2.4.9/Source/WebCore/platform/gtk/LocalizedStringsGtk.cpp 2016-02-07 11:49:36.384691005 -0700
@@ -659,7 +659,7 @@
if (!std::isfinite(time))
return String::fromUTF8(_("indefinite time"));
- int seconds = static_cast<int>(abs(time));
+ int seconds = static_cast<int>(fabs(time));
int days = seconds / (60 * 60 * 24);
int hours = seconds / (60 * 60);
int minutes = (seconds / 60) % 60;

View File

@ -0,0 +1,14 @@
post_install() {
post_upgrade $1 0
}
post_upgrade() {
if (( $(vercmp $2 2.4.11-4) < 0)); then
cat <<END
> WARNING: WebKitGTK+ 2.4 is known to have many security vulnerabilities that
will NOT be fixed. Avoid browsing with it.
END
fi
}