2
0
mirror of https://github.com/koreader/koreader synced 2024-10-31 21:20:20 +00:00
koreader/setupkoenv.lua
NiLuJe b72a2000b1
A few minor fixes after #4847 (#4850)
* Add a toggle to disable the C blitter in the Dev menu (depends on https://github.com/koreader/koreader-base/pull/882) (never shown if the JIT is disabled, grayed out if the C blitter is not installed)
* Fix a few sizeUtf8Text call sites that were doing a nil check in order to account for the new return type.
* Tweak statusbar handling to avoid spurious sizeUtf8Text warnings when it's hidden, and unify its behavior between being hidden via toggle, and hidden on book open (at least when all-at-once is not enabled).
* c.f., https://github.com/koreader/koreader-base/pull/882 (Android, PB, RGB32 & Legacy Kindle regression fixes).
2019-03-29 20:12:09 +01:00

33 lines
992 B
Lua

-- set search path for 'require()'
package.path =
"common/?.lua;rocks/share/lua/5.1/?.lua;frontend/?.lua;" ..
package.path
package.cpath =
"common/?.so;common/?.dll;/usr/lib/lua/?.so;rocks/lib/lua/5.1/?.so;" ..
package.cpath
-- set search path for 'ffi.load()'
local ffi = require("ffi")
local dummy = require("ffi/posix_h")
local C = ffi.C
if ffi.os == "Windows" then
C._putenv("PATH=libs;common;")
end
local ffi_load = ffi.load
-- patch ffi.load for thirdparty luajit libraries
ffi.load = function(lib)
io.write("ffi.load: ", lib, "\n")
local loaded, re = pcall(ffi_load, lib)
if loaded then return re end
local lib_path = package.searchpath(lib, "./lib?.so;./libs/lib?.so;./libs/lib?.so.1")
if not lib_path then
io.write("ffi.load (warning): ", re, "\n")
error('Not able to load dynamic library: ' .. lib)
else
io.write("ffi.load (assisted searchpath): ", lib_path, "\n")
return ffi_load(lib_path)
end
end