Unbreak the KUAL extension (#5715)

* Prefer our own FBInk binary
* Get rid of the CRe config tweaks
* Oops, actually ship libkohelper in the KUAL extension.
* Bump extension version
* Flush to disk before printing final status message
reviewable/pr5686/r2
NiLuJe 4 years ago committed by GitHub
parent 8a474e6922
commit 47da0ae1cd
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -181,7 +181,7 @@ kindleupdate: all
ln -sf ../$(KINDLE_DIR)/launchpad $(INSTALL_DIR)/
ln -sf ../../$(KINDLE_DIR)/koreader.sh $(INSTALL_DIR)/koreader
ln -sf ../../$(KINDLE_DIR)/libkohelper.sh $(INSTALL_DIR)/koreader
ln -sf ../../../../$(KINDLE_DIR)/libkohelper.sh $(INSTALL_DIR)/extensions/koreader/bin
ln -sf ../../../../../$(KINDLE_DIR)/libkohelper.sh $(INSTALL_DIR)/extensions/koreader/bin
ln -sf ../../$(COMMON_DIR)/spinning_zsync $(INSTALL_DIR)/koreader
# create new package
cd $(INSTALL_DIR) && pwd && \

@ -22,7 +22,7 @@ logmsg() {
f_log I koreader kual "" "${1}"
fi
# And handle user visual feedback via eips...
# And handle user visual feedback via FBInk/eips...
eips_print_bottom_centered "${1}" 1
}
@ -78,10 +78,14 @@ update_koreader() {
fail=$?
fi
if [ $fail -eq 0 ]; then
logmsg "Update to v${koreader_pkg_ver} successful :)"
# Cleanup behind us...
rm -f "${found_koreader_package}"
# Flush to disk first...
sync
logmsg "Update to v${koreader_pkg_ver} successful :)"
else
# Flush to disk first anyway...
sync
logmsg "Failed to update to v${koreader_pkg_ver} :("
fi
fi
@ -93,55 +97,6 @@ install_koreader() {
update_koreader "clean"
}
# Handle cre's settings...
set_cre_prop() {
# We need at least two args
if [ $# -lt 2 ]; then
logmsg "not enough arg passed to set_cre_prop"
return
fi
cre_prop_key="${1}"
cre_prop_value="${2}"
cre_config="/mnt/us/koreader/data/cr3.ini"
# Check that the config exists...
if [ -f "${cre_config}" ]; then
# dos2unix
# shellcheck disable=SC2039
sed -e "s/$(echo -ne '\r')$//g" -i "${cre_config}"
# And finally set the prop
if sed -re "s/^(${cre_prop_key})(=)(.*?)$/\1\2${cre_prop_value}/" -i "${cre_config}"; then
logmsg "Set ${cre_prop_key} to ${cre_prop_value}"
else
logmsg "Failed to set ${cre_prop_key}"
fi
else
logmsg "No CRe config, launch CRe once first"
fi
}
# Handle CRe's font.hinting.mode
cre_autohint() {
set_cre_prop "font.hinting.mode" "2"
}
cre_bci() {
set_cre_prop "font.hinting.mode" "1"
}
cre_nohinting() {
set_cre_prop "font.hinting.mode" "0"
}
# Handle CRe's font.kerning.enabled
cre_kerning() {
set_cre_prop "font.kerning.enabled" "1"
}
cre_nokerning() {
set_cre_prop "font.kerning.enabled" "0"
}
## Main
case "${1}" in
"update_koreader")
@ -150,21 +105,6 @@ case "${1}" in
"install_koreader")
${1}
;;
"cre_autohint")
${1}
;;
"cre_bci")
${1}
;;
"cre_nohinting")
${1}
;;
"cre_kerning")
${1}
;;
"cre_nokerning")
${1}
;;
*)
logmsg "invalid action (${1})"
;;

@ -2,7 +2,7 @@
<extension>
<information>
<name>KOReader</name>
<version>1.0</version>
<version>1.1</version>
<author>KOReader Dev Team</author>
<id>KOReader</id>
</information>

@ -79,66 +79,6 @@
"refresh": false,
"status": false,
"internal": "status Try to install KOreader from scratch . . ."
},
{
"name": "CRe font hinting: Autohint",
"if": "\"/mnt/us/koreader/data/cr3.ini\" -f \"/mnt/us/koreader/data/cr3.ini\" \"font.hinting.mode=2\" -g! &&",
"priority": 3,
"action": "./bin/koreader-ext.sh",
"params": "cre_autohint",
"exitmenu": false,
"checked": true,
"refresh": true,
"status": false,
"internal": "status Setup CRe to use autohinting"
},
{
"name": "CRe font hinting: BCI",
"if": "\"/mnt/us/koreader/data/cr3.ini\" -f \"/mnt/us/koreader/data/cr3.ini\" \"font.hinting.mode=1\" -g! &&",
"priority": 4,
"action": "./bin/koreader-ext.sh",
"params": "cre_bci",
"exitmenu": false,
"checked": true,
"refresh": true,
"status": false,
"internal": "status Setup CRe to use bytecode hinting"
},
{
"name": "CRe font hinting: None",
"if": "\"/mnt/us/koreader/data/cr3.ini\" -f \"/mnt/us/koreader/data/cr3.ini\" \"font.hinting.mode=0\" -g! &&",
"priority": 5,
"action": "./bin/koreader-ext.sh",
"params": "cre_nohinting",
"exitmenu": false,
"checked": true,
"refresh": true,
"status": false,
"internal": "status Setup CRe to forgo font hinting"
},
{
"name": "Enable CRe font kerning",
"if": "\"/mnt/us/koreader/data/cr3.ini\" -f \"/mnt/us/koreader/data/cr3.ini\" \"font.kerning.enabled=1\" -g! &&",
"priority": 6,
"action": "./bin/koreader-ext.sh",
"params": "cre_kerning",
"exitmenu": false,
"checked": true,
"refresh": true,
"status": false,
"internal": "status Setup CRe to enable kerning"
},
{
"name": "Disable CRe font kerning",
"if": "\"/mnt/us/koreader/data/cr3.ini\" -f \"/mnt/us/koreader/data/cr3.ini\" \"font.kerning.enabled=0\" -g! &&",
"priority": 7,
"action": "./bin/koreader-ext.sh",
"params": "cre_nokerning",
"exitmenu": false,
"checked": true,
"refresh": true,
"status": false,
"internal": "status Setup CRe to disable kerning"
}
]
}

@ -18,7 +18,7 @@ fi
## Check if we have an FBInk binary available somewhere...
# Default to something that won't horribly blow up...
FBINK_BIN="true"
for my_dir in libkh/bin koreader linkss/bin linkfonts/bin usbnet/bin; do
for my_dir in koreader libkh/bin linkss/bin linkfonts/bin usbnet/bin; do
my_fbink="/mnt/us/${my_dir}/fbink"
if [ -x "${my_fbink}" ]; then
FBINK_BIN="${my_fbink}"
@ -38,7 +38,7 @@ has_fbink() {
return 1
}
# NOTE: Yeah, the name becomes a bit of a lie now that we're exclusively using FBInk ;p.
# NOTE: Yeah, the name becomes a bit of a lie now that we're (hopefully) exclusively using FBInk ;p.
eips_print_bottom_centered() {
# We need at least two args
if [ $# -lt 2 ]; then

Loading…
Cancel
Save