add PocketBook port of Koreader

pull/1388/head
chrox 10 years ago
parent b476989d3b
commit 1cba495fe0

@ -18,6 +18,7 @@ INSTALL_DIR=koreader-$(MACHINE)
PLATFORM_DIR=platform PLATFORM_DIR=platform
KINDLE_DIR=$(PLATFORM_DIR)/kindle KINDLE_DIR=$(PLATFORM_DIR)/kindle
KOBO_DIR=$(PLATFORM_DIR)/kobo KOBO_DIR=$(PLATFORM_DIR)/kobo
POCKETBOOK_DIR=$(PLATFORM_DIR)/pocketbook
ANDROID_DIR=$(PLATFORM_DIR)/android ANDROID_DIR=$(PLATFORM_DIR)/android
ANDROID_LAUNCHER_DIR:=$(ANDROID_DIR)/luajit-launcher ANDROID_LAUNCHER_DIR:=$(ANDROID_DIR)/luajit-launcher
WIN32_DIR=$(PLATFORM_DIR)/win32 WIN32_DIR=$(PLATFORM_DIR)/win32
@ -179,6 +180,32 @@ koboupdate: all
tar czafh ../koreader-kobo-$(MACHINE)-$(VERSION).tar.gz \ tar czafh ../koreader-kobo-$(MACHINE)-$(VERSION).tar.gz \
-T koreader/ota/package.index --no-recursion -T koreader/ota/package.index --no-recursion
pbupdate: all
# ensure that the binaries were built for ARM
file $(INSTALL_DIR)/koreader/luajit | grep ARM || exit 1
# remove old package if any
rm -f koreader-pocketbook-$(MACHINE)-$(VERSION).zip
# Pocketbook launching script
mkdir -p $(INSTALL_DIR)/applications
cp $(POCKETBOOK_DIR)/koreader.app $(INSTALL_DIR)/applications
# create new package
cd $(INSTALL_DIR) && \
zip -9 -r \
../koreader-pocketbook-$(MACHINE)-$(VERSION).zip \
koreader applications -x "koreader/resources/fonts/*" \
"koreader/resources/icons/src/*" "koreader/spec/*"
# generate koboupdate package index file
zipinfo -1 koreader-pocketbook-$(MACHINE)-$(VERSION).zip > \
$(INSTALL_DIR)/koreader/ota/package.index
echo "koreader/ota/package.index" >> $(INSTALL_DIR)/koreader/ota/package.index
# update index file in zip package
cd $(INSTALL_DIR) && zip -u ../koreader-pocketbook-$(MACHINE)-$(VERSION).zip \
koreader/ota/package.index
# make gzip pbupdate for zsync OTA update
cd $(INSTALL_DIR) && \
tar czafh ../koreader-pocketbook-$(MACHINE)-$(VERSION).tar.gz \
-T koreader/ota/package.index --no-recursion
androidupdate: all androidupdate: all
mkdir -p $(ANDROID_LAUNCHER_DIR)/assets/module mkdir -p $(ANDROID_LAUNCHER_DIR)/assets/module
-rm $(ANDROID_LAUNCHER_DIR)/assets/module/koreader-* -rm $(ANDROID_LAUNCHER_DIR)/assets/module/koreader-*

@ -1 +1 @@
Subproject commit 941047421763c56ab2d41da73a0e9cf23fea1437 Subproject commit 3ffa5dcb6e70fa1342b07f95ebced4046608990c

@ -8,8 +8,9 @@ local ReaderActivityIndicator = EventListener:new{}
function ReaderActivityIndicator:init() function ReaderActivityIndicator:init()
local dev_mod = Device.model local dev_mod = Device.model
if dev_mod == "KindlePaperWhite" or dev_mod == "KindlePaperWhite2" or dev_mod == "KindleVoyage" or dev_mod == "KindleBasic" or dev_mod == "KindleTouch" then if dev_mod == "KindlePaperWhite" or dev_mod == "KindlePaperWhite2" or dev_mod == "KindleVoyage" or dev_mod == "KindleBasic" or dev_mod == "KindleTouch" then
require "liblipclua" if (pcall(require, "liblipclua")) then
self.lipc_handle = lipc.init("com.github.koreader.activityindicator") self.lipc_handle = lipc.init("com.github.koreader.activityindicator")
end
end end
end end

@ -143,8 +143,8 @@ wrapper for FFI input open
Note that we adhere to the "." syntax here for compatibility. Note that we adhere to the "." syntax here for compatibility.
TODO: clean up separation FFI/this TODO: clean up separation FFI/this
--]] --]]
function Input.open(device) function Input.open(device, kobo_events)
input.open(device) input.open(device, kobo_events and 1 or 0)
end end
--[[ --[[
@ -341,6 +341,7 @@ function Input:handleTouchEv(ev)
local touch_ges = self.gesture_detector:feedEvent(self.MTSlots) local touch_ges = self.gesture_detector:feedEvent(self.MTSlots)
self.MTSlots = {} self.MTSlots = {}
if touch_ges then if touch_ges then
--DEBUG("ges", touch_ges)
return Event:new("Gesture", return Event:new("Gesture",
self.gesture_detector:adjustGesCoordinate(touch_ges) self.gesture_detector:adjustGesCoordinate(touch_ges)
) )

@ -6,29 +6,30 @@ local function yes() return true end
local PocketBook = Generic:new{ local PocketBook = Generic:new{
-- both the following are just for testing similar behaviour -- both the following are just for testing similar behaviour
-- see ffi/framebuffer_mxcfb.lua -- see ffi/framebuffer_mxcfb.lua
model = "KindlePaperWhite", model = "PocketBook",
isKindle = yes, isPocketBook = yes,
isTouchDevice = yes, isTouchDevice = yes,
display_dpi = 212, display_dpi = 212,
touch_dev = "/dev/input/event0", touch_dev = "/dev/input/event1", -- probably useless
emu_events_dev = "/var/dev/shm/emu_events",
} }
function PocketBook:init() function PocketBook:init()
-- this example uses the mxcfb framebuffer driver: -- this example uses the mxcfb framebuffer driver:
self.screen = require("ffi/framebuffer_mxcfb"):new{device = self, debug = DEBUG} self.screen = require("ffi/framebuffer_mxcfb"):new{device = self, debug = DEBUG}
self.input = require("device/input"):new{device = self} self.input = require("device/input"):new{device = self, debug = DEBUG}
-- we inject an input hook for debugging purposes. You probably don't want -- we inject an input hook for debugging purposes. You probably don't want
-- it after everything is implemented. -- it after everything is implemented.
self.input:registerEventAdjustHook(function(event) self.input:registerEventAdjustHook(function(event)
DEBUG("got event:", event)
end) end)
-- no backlight management yet -- no backlight management yet
self.input.open("/dev/input/event0") os.remove(self.emu_events_dev)
self.input.open("/dev/input/event1") os.execute("mkfifo " .. self.emu_events_dev)
self.input.open(self.emu_events_dev, 1)
Generic.init(self) Generic.init(self)
end end

@ -0,0 +1,29 @@
#!/bin/sh
export LC_ALL="en_US.UTF-8"
# working directory of koreader
KOREADER_DIR=/mnt/ext1/koreader
# update to new version from OTA directory
NEWUPDATE="${KOREADER_DIR}/ota/koreader.updated.tar"
INSTALLED="${KOREADER_DIR}/ota/koreader.installed.tar"
if [ -f $NEWUPDATE ]; then
# TODO: any graphic indication for the updating progress?
cd /mnt/ext1/ && tar xf $NEWUPDATE && mv $NEWUPDATE $INSTALLED
fi
# we're always starting from our working directory
cd $KOREADER_DIR
# export trained OCR data directory
export TESSDATA_PREFIX="data"
# export dict directory
export STARDICT_DATA_DIR="data/dict"
./reader.lua /mnt/ext1 2> crash.log
if pidof reader.lua > /dev/null 2>&1 ; then
killall -TERM reader.lua
fi
Loading…
Cancel
Save