summarylogtreecommitdiffstats
diff options
context:
space:
mode:
authorKevin MacMartin2015-06-10 00:37:49 -0400
committerKevin MacMartin2015-06-10 00:37:49 -0400
commitb594c4ab60cf7a620469aab679979691aabde4c9 (patch)
treedee552e2fce5b9f37bdabc908cf40a822f93bff6
downloadaur-b594c4ab60cf7a620469aab679979691aabde4c9.tar.gz
Initial import into AUR 4
-rw-r--r--.SRCINFO24
-rw-r--r--PKGBUILD47
-rw-r--r--level-change-save.patch14
-rw-r--r--no-encryption.patch50
-rw-r--r--pixel-dungeon.desktop9
-rw-r--r--pixel-dungeon.sh3
-rwxr-xr-xremakepkg12
7 files changed, 159 insertions, 0 deletions
diff --git a/.SRCINFO b/.SRCINFO
new file mode 100644
index 000000000000..17318f964058
--- /dev/null
+++ b/.SRCINFO
@@ -0,0 +1,24 @@
+pkgbase = pixel-dungeon-git
+ pkgdesc = A rogue-like game inspired by Brogue
+ pkgver = 1.7.2a.125
+ pkgrel = 2
+ url = http://pixeldungeon.watabou.ru
+ arch = any
+ license = GPL3
+ makedepends = git
+ makedepends = java-environment
+ depends = java-runtime
+ depends = bash
+ source = pixel-dungeon::git+https://github.com/Arcnor/pixel-dungeon-gdx.git
+ source = pixel-dungeon.sh
+ source = pixel-dungeon.desktop
+ source = no-encryption.patch
+ source = level-change-save.patch
+ sha512sums = SKIP
+ sha512sums = ab43ee17312fbb28daf456f569e9a9ac8c60a22faea500959f8d82794ef3d0a78e21056136742e281f024256bae01e59810c8ced96d9c9fde9abe9ccdb1ed9b6
+ sha512sums = 74c30ef63fec229f199dc9ad1758dab8cdd6484198e143b9defb1a91f52381a8eafd3a2563b3bbc78d97fab306b96fabcfd19ec112616d49c03b5bacc6c3b4a5
+ sha512sums = 93293f1051cdb5860f22c4c952019f04b0ec41e873f9313bd1d0a15a90defce360779ff75d239d0ceb07ce1a2320b2234473ba9cd95f6269e1568bf173b2b0f9
+ sha512sums = 8ad6bf714477e6cc00deb80967ebba332acd4a9ee1a9ba202ef887b07031ec3bd73603a8f7d6584313ac5e4c86da052b94db0e979524c1f8f17f0b49e0a4ea41
+
+pkgname = pixel-dungeon-git
+
diff --git a/PKGBUILD b/PKGBUILD
new file mode 100644
index 000000000000..4bef4eaa21f9
--- /dev/null
+++ b/PKGBUILD
@@ -0,0 +1,47 @@
+# Maintainer: Kevin MacMartin <prurigro at gmail dot com>
+
+_pkgname=pixel-dungeon
+pkgname=${_pkgname}-git
+_pkgver=1.7.2a
+pkgver=1.7.2a.125
+pkgrel=2
+pkgdesc="A rogue-like game inspired by Brogue"
+url="http://pixeldungeon.watabou.ru"
+license=('GPL3')
+depends=('java-runtime' 'bash')
+makedepends=('git' 'java-environment')
+arch=('any')
+source=("$_pkgname::git+https://github.com/Arcnor/pixel-dungeon-gdx.git"
+ "$_pkgname.sh"
+ "$_pkgname.desktop"
+ "no-encryption.patch"
+ "level-change-save.patch")
+sha512sums=('SKIP'
+ 'ab43ee17312fbb28daf456f569e9a9ac8c60a22faea500959f8d82794ef3d0a78e21056136742e281f024256bae01e59810c8ced96d9c9fde9abe9ccdb1ed9b6'
+ '74c30ef63fec229f199dc9ad1758dab8cdd6484198e143b9defb1a91f52381a8eafd3a2563b3bbc78d97fab306b96fabcfd19ec112616d49c03b5bacc6c3b4a5'
+ '93293f1051cdb5860f22c4c952019f04b0ec41e873f9313bd1d0a15a90defce360779ff75d239d0ceb07ce1a2320b2234473ba9cd95f6269e1568bf173b2b0f9'
+ '8ad6bf714477e6cc00deb80967ebba332acd4a9ee1a9ba202ef887b07031ec3bd73603a8f7d6584313ac5e4c86da052b94db0e979524c1f8f17f0b49e0a4ea41')
+
+pkgver() {
+ cd $_pkgname
+ printf '%s' "$_pkgver.$(git rev-list --count HEAD)"
+}
+
+prepare() {
+ cd $_pkgname
+ patch -p1 < ../no-encryption.patch
+ patch -p1 < ../level-change-save.patch
+}
+
+build() {
+ cd $_pkgname
+ unset _JAVA_OPTIONS
+ GRADLE_USER_HOME="$srcdir" ./gradlew desktop:dist
+}
+
+package() {
+ install -Dm755 $_pkgname.sh "$pkgdir/usr/bin/$_pkgname"
+ install -Dm644 $_pkgname.desktop "$pkgdir/usr/share/applications/$_pkgname.desktop"
+ install -Dm644 $_pkgname/android/res/drawable-xxxhdpi/ic_launcher.png "$pkgdir/usr/share/pixmaps/$_pkgname.png"
+ install -Dm644 $_pkgname/desktop/build/libs/desktop-*.jar "$pkgdir/usr/share/$_pkgname/$_pkgname.jar"
+}
diff --git a/level-change-save.patch b/level-change-save.patch
new file mode 100644
index 000000000000..8e03c1e235a0
--- /dev/null
+++ b/level-change-save.patch
@@ -0,0 +1,14 @@
+--- a/core/src/com/watabou/pixeldungeon/Dungeon.java
++++ b/core/src/com/watabou/pixeldungeon/Dungeon.java
+@@ -314,6 +314,11 @@ public class Dungeon {
+ hero.viewDistance = light == null ? level.viewDistance : Math.max( Light.DISTANCE, level.viewDistance );
+
+ observe();
++ try {
++ saveAll();
++ } catch (Exception e) {
++ // Failed to save for some reason
++ }
+ }
+
+ public static boolean posNeeded() {
diff --git a/no-encryption.patch b/no-encryption.patch
new file mode 100644
index 000000000000..a087108c18aa
--- /dev/null
+++ b/no-encryption.patch
@@ -0,0 +1,50 @@
+diff --git a/PD-classes/src/com/watabou/utils/Bundle.java b/PD-classes/src/com/watabou/utils/Bundle.java
+index e266acc..39a47ec 100644
+--- a/PD-classes/src/com/watabou/utils/Bundle.java
++++ b/PD-classes/src/com/watabou/utils/Bundle.java
+@@ -264,27 +264,12 @@ public class Bundle {
+
+ }
+ }
+-
+- private static final char XOR_KEY = 0x1F;
+-
++
+ public static Bundle read( InputStream stream ) {
+
+ try {
+ BufferedReader reader = new BufferedReader( new InputStreamReader( stream ) );
+-
+- StringBuilder builder = new StringBuilder();
+-
+- char[] buffer = new char[0x2000];
+- int count = reader.read( buffer );
+- while (count > 0) {
+- for (int i=0; i < count; i++) {
+- buffer[i] ^= XOR_KEY;
+- }
+- builder.append( buffer, 0, count );
+- count = reader.read( buffer );
+- }
+-
+- JSONObject json = (JSONObject)new JSONTokener( builder.toString() ).nextValue();
++ JSONObject json = (JSONObject)new JSONTokener( reader.readLine() ).nextValue();
+ reader.close();
+
+ return new Bundle( json );
+@@ -295,13 +280,8 @@ public class Bundle {
+
+ public static boolean write( Bundle bundle, OutputStream stream ) {
+ try {
+- BufferedWriter writer = new BufferedWriter( new OutputStreamWriter( stream ) );
+-
+- char[] chars = bundle.data.toString().toCharArray();
+- for (int i=0; i < chars.length; i++) {
+- chars[i] ^= XOR_KEY;
+- }
+- writer.write( chars );
++ BufferedWriter writer = new BufferedWriter( new OutputStreamWriter( stream ) );
++ writer.write( bundle.data.toString() );
+ writer.close();
+
+ return true;
diff --git a/pixel-dungeon.desktop b/pixel-dungeon.desktop
new file mode 100644
index 000000000000..73628c3e0116
--- /dev/null
+++ b/pixel-dungeon.desktop
@@ -0,0 +1,9 @@
+[Desktop Entry]
+Type=Application
+Version=1.0
+Name=Pixel Dungeon
+Comment=Rogue-like game inspired by Brogue
+Exec=pixel-dungeon
+Icon=pixel-dungeon
+Terminal=false
+Categories=Game;
diff --git a/pixel-dungeon.sh b/pixel-dungeon.sh
new file mode 100644
index 000000000000..e4d9feae41a2
--- /dev/null
+++ b/pixel-dungeon.sh
@@ -0,0 +1,3 @@
+#!/usr/bin/env bash
+
+java -jar /usr/share/pixel-dungeon/pixel-dungeon.jar
diff --git a/remakepkg b/remakepkg
new file mode 100755
index 000000000000..4543c107a111
--- /dev/null
+++ b/remakepkg
@@ -0,0 +1,12 @@
+#!/usr/bin/env bash
+
+rm -f *.pkg.*
+rm -f *.src.*
+rm -rf pkg
+rm -rf src
+install -d src
+ln -s "$HOME"/.gradle/daemon src/
+ln -s "$HOME"/.gradle/caches src/
+ln -s "$HOME"/.gradle/native src/
+ln -s "$HOME"/.gradle/wrapper src/
+makepkg