summarylogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--PKGBUILD43
-rw-r--r--PathOfBuilding-force-disable-devmode.patch13
-rw-r--r--lzip-linux.patch70
-rw-r--r--pobfrontend-writable-user-dir.patch25
4 files changed, 147 insertions, 4 deletions
diff --git a/PKGBUILD b/PKGBUILD
index 6a669612f31..0d51aac2ab8 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -6,7 +6,7 @@ pkgdesc='An offline build planner for Path of Exile using PoBFrontent'
arch=('x86_64')
url='https://github.com/Openarl/PathOfBuilding'
license=('MIT')
-pkgver=1.4.152.r895.37
+pkgver=1.4.156.r996.37.479
depends=('zlib' 'qt5-base' 'luajit' 'libgl' 'curl')
makedepends=('meson' 'ninja' 'unzip' 'rsync')
@@ -15,17 +15,39 @@ source=(
'git+https://github.com/Openarl/PathOfBuilding'
'git+https://github.com/philroberts/pobfrontend'
'git+https://github.com/Lua-cURL/Lua-cURLv3'
+ 'https://github.com/Openarl/PathOfBuilding/files/1167199/PathOfBuilding-runtime-src.zip'
'PathOfBuilding.sh'
+ 'PathOfBuilding-force-disable-devmode.patch'
+ 'pobfrontend-writable-user-dir.patch'
+ 'lzip-linux.patch'
)
sha256sums=(
'SKIP'
'SKIP'
'SKIP'
+ '6d21872a2b2bdbfaebb20de5cac28ac402316e5314c97a89049320ff13c2f622'
'02b44b44872bae4725bc6de600f4592ce33b26e90fa0f392922004ee15898446'
+ '38a09a82f06c2d8738f674c5d2818e5f9580bb25611212507814c97ac25adbd1'
+ '58a47220d0d1b0209734fc42c0f7dc603c231985eb52f393a7c28598200503e1'
+ '9dbc8802b74ceed78f1a6ba1d5b90251f5ae7f9a8cf5497426e4a35001112fcd'
+)
+noextract=(
+ 'PathOfBuilding-runtime-src.zip'
)
-#prepare() {
-#}
+prepare() {
+ # extract the runtime sources including sources for lzip and lcurl
+ (mkdir -p "${srcdir}/PathOfBuilding-runtime-src" \
+ && cd "${srcdir}/PathOfBuilding-runtime-src" \
+ && unzip -o "${srcdir}/PathOfBuilding-runtime-src.zip" \
+ )
+ # patch lzip
+ (cd "${srcdir}/PathOfBuilding-runtime-src/LZip" && patch -p1 <"${srcdir}/lzip-linux.patch")
+ # disable devmode
+ (cd "${srcdir}/PathOfBuilding" && patch -p1 <"${srcdir}/PathOfBuilding-force-disable-devmode.patch")
+ # fix pobfrontend to have a writable user dir
+ (cd "${srcdir}/pobfrontend" && patch -p1 <"${srcdir}/pobfrontend-writable-user-dir.patch")
+}
pkgver() {
cd "${srcdir}/PathOfBuilding"
@@ -33,10 +55,22 @@ pkgver() {
pob_r=$(git rev-list --count HEAD)
cd "${srcdir}/pobfrontend"
pf_r=$(git rev-list --count HEAD)
- printf '%s.r%s.%s' "$pob_v" "$pob_r" "$pf_r"
+ cd "${srcdir}/Lua-cURLv3"
+ lc_r=$(git rev-list --count HEAD)
+ printf '%s.r%s.%s.%s' "$pob_v" "$pob_r" "$pf_r" "$lc_r"
}
build() {
+ # build lzip.so
+ (cd "${srcdir}/PathOfBuilding-runtime-src/LZip" \
+ && g++ ${CXXFLAGS} -W -Wall -fPIC -shared -o lzip.so \
+ -I"$(pkgconf luajit --variable=includedir)" \
+ lzip.cpp \
+ ${LDFLAGS} \
+ -L"$(pkgconf luajit --variable=libdir)" \
+ -l"$(pkgconf luajit --variable=libname)" \
+ -lz
+ )
# build lcurl.so
(cd "${srcdir}/Lua-cURLv3" && make LUA_IMPL=luajit)
# build pobfrontend
@@ -61,6 +95,7 @@ package() {
# tidy-up permissions
chmod og-w -R "${dst_dir}"
# install binaries
+ install -s -m755 "${srcdir}/PathOfBuilding-runtime-src/LZip/lzip.so" -t "${dst_dir}"
install -s -m755 "${srcdir}/Lua-cURLv3/lcurl.so" -t "${dst_dir}"
install -s -m755 "${srcdir}/pobfrontend/build/pobfrontend" -t "${dst_dir}"
# install shell script
diff --git a/PathOfBuilding-force-disable-devmode.patch b/PathOfBuilding-force-disable-devmode.patch
new file mode 100644
index 00000000000..b4c24f88b35
--- /dev/null
+++ b/PathOfBuilding-force-disable-devmode.patch
@@ -0,0 +1,13 @@
+diff --git a/Launch.lua b/Launch.lua
+index 0673314..3126c1e 100644
+--- a/Launch.lua
++++ b/Launch.lua
+@@ -51,7 +51,7 @@ function launch:OnInit()
+ if localManXML and not self.versionBranch and not self.versionPlatform then
+ -- Looks like a remote manifest, so we're probably running from a repository
+ -- Enable dev mode to disable updates and set user path to be the script path
+- self.devMode = true
++ self.devMode = false
+ end
+ RenderInit()
+ ConPrintf("Loading main script...")
diff --git a/lzip-linux.patch b/lzip-linux.patch
new file mode 100644
index 00000000000..e92febfc4a5
--- /dev/null
+++ b/lzip-linux.patch
@@ -0,0 +1,70 @@
+--- a/lzip.cpp 2016-05-17 22:53:16.000000000 +0200
++++ b/lzip.cpp 2019-12-16 17:58:11.855288565 +0100
+@@ -1,17 +1,18 @@
+ #include <stdio.h>
+ #include <stdlib.h>
+ #include <string.h>
+-#include <io.h>
+
+-#include "_lib/zlib.h"
++#include "zlib.h"
+
+ extern "C" {
+-#include "_lib\lua.h"
+-#include "_lib\lauxlib.h"
+-#include "_lib\lualib.h"
+-#include "_lib\luajit.h"
++#include "lua.h"
++#include "lauxlib.h"
++#include "lualib.h"
++#include "luajit.h"
+ }
+
++#if defined(WIN32)
++#define DLLEXPORT __declspec(dllexport)
+ #if defined(_WIN64)
+ #pragma comment(lib, "_lib\\lua51_64")
+ #else
+@@ -26,6 +27,9 @@
+ #else
+ #pragma comment(lib, "_lib\\zlib32MT")
+ #endif
++#else
++#define DLLEXPORT __attribute__((visibility("default")))
++#endif
+
+ typedef unsigned char byte;
+ typedef unsigned int dword;
+@@ -656,7 +660,7 @@
+ if (n < 1) {
+ luaL_error(L, "Usage: zipFile:Read(count) or zipFile:read(\"*a\")");
+ }
+- int count;
++ int count = 0;
+ if (lua_isnumber(L, 1)) {
+ count = lua_tointeger(L, 1);
+ } else {
+@@ -673,6 +677,7 @@
+ byte* buf = new byte[count];
+ lzf->file->Read(buf, count);
+ lua_pushlstring(L, (char*)buf, count);
++ delete[] buf;
+ return 1;
+ }
+
+@@ -683,7 +688,7 @@
+ return 1;
+ }
+
+-extern "C" __declspec(dllexport) int luaopen_lzip(lua_State* L)
++extern "C" DLLEXPORT int luaopen_lzip(lua_State* L)
+ {
+ lua_settop(L, 0);
+ lua_newtable(L); // Library table
+@@ -742,4 +747,4 @@
+ lua_pop(L, 2);
+
+ return 1;
+-}
+\ No newline at end of file
++}
diff --git a/pobfrontend-writable-user-dir.patch b/pobfrontend-writable-user-dir.patch
new file mode 100644
index 00000000000..544df2670b2
--- /dev/null
+++ b/pobfrontend-writable-user-dir.patch
@@ -0,0 +1,25 @@
+diff --git a/pobwindow.hpp b/pobwindow.hpp
+index cd88f54..7edec7f 100644
+--- a/pobwindow.hpp
++++ b/pobwindow.hpp
+@@ -2,6 +2,7 @@
+ #include <QDir>
+ #include <QOpenGLWindow>
+ #include <QPainter>
++#include <QStandardPaths>
+ #include <memory>
+
+ #include "main.h"
+@@ -30,10 +31,11 @@ public:
+ // theformat.setAlphaBufferSize(8);
+ // std::cout << theformat.hasAlpha() << std::endl;
+ // setFormat(theformat);
++ QString AppDataLocation = QStandardPaths::writableLocation(QStandardPaths::AppDataLocation);
+ scriptPath = QDir::currentPath();
+ scriptWorkDir = QDir::currentPath();
+ basePath = QDir::currentPath();
+- userPath = QDir::currentPath();
++ userPath = AppDataLocation;
+
+ fontFudge = 0;
+ }