summarylogtreecommitdiffstats
diff options
context:
space:
mode:
authorYangtse Su2017-07-14 15:59:40 +0800
committerYangtse Su2017-07-14 15:59:40 +0800
commitb372dd7682a8a96a2922f631c97da64465bde01f (patch)
tree9b4640bf41a189d6e9ec37310a40873665b28afb
downloadaur-b372dd7682a8a96a2922f631c97da64465bde01f.tar.gz
init pkg,tiles version with i18n support
-rw-r--r--.SRCINFO32
-rw-r--r--PKGBUILD54
-rw-r--r--cataclysm-dda.install6
-rw-r--r--fix_locale_and_build_error.patch47
4 files changed, 139 insertions, 0 deletions
diff --git a/.SRCINFO b/.SRCINFO
new file mode 100644
index 000000000000..b7b5aad6369e
--- /dev/null
+++ b/.SRCINFO
@@ -0,0 +1,32 @@
+# Generated by makepkg 5.0.2
+# Fri Jul 14 07:49:14 UTC 2017
+pkgbase = cataclysm-dda-tiles
+ pkgdesc = A post-apocalyptic roguelike,tiles only
+ pkgver = 0.C.2017.07.14
+ pkgrel = 1
+ url = http://en.cataclysmdda.com/
+ install = cataclysm-dda.install
+ arch = x86_64
+ license = CCPL:by-sa
+ makedepends = sdl2_image
+ makedepends = sdl2_ttf
+ makedepends = sdl2_mixer
+ makedepends = freetype2
+ makedepends = git
+ makedepends = gettext
+ depends = ncurses
+ depends = lua
+ optdepends = sdl2_image: for tiles
+ optdepends = sdl2_ttf: for tiles
+ optdepends = freetype2: for tiles
+ optdepends = sdl2_mixer: for tiles
+ conflicts = cataclysm-dda,
+ conflicts = cataclysm-dda-ncurses
+ conflicts = cataclysm-dda-sdl-git
+ source = https://github.com/CleverRaven/Cataclysm-DDA/archive/master.zip
+ source = fix_locale_and_build_error.patch
+ md5sums = SKIP
+ md5sums = b27d839e4a9918eca019e3cd9a4d910b
+
+pkgname = cataclysm-dda-tiles
+
diff --git a/PKGBUILD b/PKGBUILD
new file mode 100644
index 000000000000..7de2bf1a7445
--- /dev/null
+++ b/PKGBUILD
@@ -0,0 +1,54 @@
+# Maintainer: Yangtse Su <yangtsesu@gmail.com>
+# Contributor: Kyle Keen <keenerd@gmail.com>
+# Contributor: Frederic Bezies <fredbezies at gmail dot com>
+# Contributor: Fernando Carmona Varo <ferkiwi @t gmail dot com>
+# Contributor: Klemen Košir <klemen913@gmail.com>
+
+pkgname=cataclysm-dda-tiles
+pkgver=0.C.2017.07.14
+_pkgver=0.C
+pkgrel=1
+pkgdesc="A post-apocalyptic roguelike,tiles only"
+url="http://en.cataclysmdda.com/"
+arch=('x86_64')
+license=("CCPL:by-sa")
+conflicts=('cataclysm-dda')
+depends=('ncurses' 'lua')
+makedepends=('sdl2_image' 'sdl2_ttf' 'sdl2_mixer' 'freetype2' 'git' 'gettext')
+optdepends=('sdl2_image: for tiles'
+ 'sdl2_ttf: for tiles'
+ 'freetype2: for tiles'
+ 'sdl2_mixer: for tiles')
+install=cataclysm-dda.install
+conflicts=('cataclysm-dda', 'cataclysm-dda-ncurses' 'cataclysm-dda-sdl-git')
+source=('https://github.com/CleverRaven/Cataclysm-DDA/archive/master.zip'
+ 'fix_locale_and_build_error.patch')
+md5sums=('SKIP'
+ 'b27d839e4a9918eca019e3cd9a4d910b')
+
+pkgver() {
+ cd "Cataclysm-DDA-master"
+ echo "${_pkgver}.$(date +%Y.%m.%d)"
+}
+
+build() {
+ cd "Cataclysm-DDA-master"
+
+ patch -Np1 -i ../fix_locale_and_build_error.patch
+ make PREFIX=/usr RELEASE=1 LOCALIZE=1 USE_XDG_DIR=1 LUA=1 TILES=1 SOUND=1 LANGUAGES=all
+}
+
+package() {
+ cd "Cataclysm-DDA-master"
+
+ make PREFIX="$pkgdir/usr" RELEASE=1 LOCALIZE=1 USE_XDG_DIR=1 LUA=1 TILES=1 SOUND=1 LANGUAGES=all install
+
+ #The doc goes in /usr/share/doc
+ install -dm755 "$pkgdir/usr/share/doc/cataclysm-dda"
+ unlink doc/JSON_LOADING_ORDER.md
+ cp -T data/json/LOADING_ORDER.md doc/JSON_LOADING_ORDER.md
+ cp -r *.txt doc/* "$pkgdir/usr/share/doc/cataclysm-dda/"
+
+ #License file
+ install -Dm644 LICENSE.txt "$pkgdir/usr/share/licenses/${pkgname}/LICENSE"
+}
diff --git a/cataclysm-dda.install b/cataclysm-dda.install
new file mode 100644
index 000000000000..61f0651b637e
--- /dev/null
+++ b/cataclysm-dda.install
@@ -0,0 +1,6 @@
+
+post_upgrade() {
+ echo "Save formats are almost always incompatible"
+ echo "Please delete all files in ~/.cataclysm-dda/save/"
+}
+
diff --git a/fix_locale_and_build_error.patch b/fix_locale_and_build_error.patch
new file mode 100644
index 000000000000..e2a53c7bb39e
--- /dev/null
+++ b/fix_locale_and_build_error.patch
@@ -0,0 +1,47 @@
+diff -Naur Cataclysm-DDA-master.orig/Makefile Cataclysm-DDA-master/Makefile
+--- Cataclysm-DDA-master.orig/Makefile 2017-07-13 13:39:52.000000000 +0800
++++ Cataclysm-DDA-master/Makefile 2017-07-14 15:23:47.780860342 +0800
+@@ -224,7 +224,7 @@
+ endif
+ DEFINES += -DRELEASE
+ # Check for astyle or JSON regressions on release builds.
+- CHECKS = astyle-check lint-check
++ CHECKS = lint-check
+ endif
+
+ ifdef CLANG
+@@ -389,7 +389,7 @@
+ CXXFLAGS += -DMAPSIZE=$(MAPSIZE)
+ endif
+
+-ifeq ($(shell git rev-parse --is-inside-work-tree),true)
++ifeq ([ -e ".git" ],true)
+ # We have a git repository, use git version
+ DEFINES += -DGIT_VERSION
+ endif
+diff -Naur Cataclysm-DDA-master.orig/src/translations.cpp Cataclysm-DDA-master/src/translations.cpp
+--- Cataclysm-DDA-master.orig/src/translations.cpp 2017-07-13 13:39:52.000000000 +0800
++++ Cataclysm-DDA-master/src/translations.cpp 2017-07-14 15:24:39.930856915 +0800
+@@ -79,10 +79,10 @@
+ #endif
+
+ // Step 2. Bind to gettext domain.
+- const char *locale_dir;
++ std::string locale_dir;
+ #if (defined __linux__ || (defined MACOSX && !defined TILES))
+ if( !FILENAMES["base_path"].empty() ) {
+- locale_dir = std::string( FILENAMES["base_path"] + "share/locale" ).c_str();
++ locale_dir = FILENAMES["base_path"] + "share/locale";
+ } else {
+ locale_dir = "lang/mo";
+ }
+@@ -90,7 +90,8 @@
+ locale_dir = "lang/mo";
+ #endif // __linux__
+
+- bindtextdomain( "cataclysm-dda", locale_dir );
++ const char *locale_dir_char = locale_dir.c_str();
++ bindtextdomain( "cataclysm-dda", locale_dir_char );
+ bind_textdomain_codeset( "cataclysm-dda", "UTF-8" );
+ textdomain( "cataclysm-dda" );
+