koreader-from-src: use nixpkgs nanosvg (or, most of it)
This commit is contained in:
@@ -65,6 +65,7 @@
|
|||||||
, libpng
|
, libpng
|
||||||
, libunibreak
|
, libunibreak
|
||||||
, libwebp
|
, libwebp
|
||||||
|
, nanosvg
|
||||||
, openssl
|
, openssl
|
||||||
, openssh
|
, openssh
|
||||||
, sdcv
|
, sdcv
|
||||||
@@ -87,6 +88,15 @@ let
|
|||||||
rev = "v${version}";
|
rev = "v${version}";
|
||||||
hash = "sha256-/51pOGSAoaS0gOKlqNKruwaKY5qylzCpeNUrWyzYTpA=";
|
hash = "sha256-/51pOGSAoaS0gOKlqNKruwaKY5qylzCpeNUrWyzYTpA=";
|
||||||
};
|
};
|
||||||
|
nanosvg-headers-ko = symlinkJoin {
|
||||||
|
# koreader's heavily-patched mupdf is dependent on a koreader-specific `stb_image_write` extension to nanosvg.
|
||||||
|
# nanosvg is used as a header-only library, so just patch that extension straight into the src.
|
||||||
|
name = "nanosvg-headers-ko";
|
||||||
|
paths = [
|
||||||
|
"${nanosvg.src}/src"
|
||||||
|
"${src}/base/thirdparty/nanosvg"
|
||||||
|
];
|
||||||
|
};
|
||||||
# XXX: for some inscrutable reason, `enable52Compat` is *partially* broken, only when cross compiling.
|
# XXX: for some inscrutable reason, `enable52Compat` is *partially* broken, only when cross compiling.
|
||||||
# `table.unpack` is non-nil, but `table.pack` is nil.
|
# `table.unpack` is non-nil, but `table.pack` is nil.
|
||||||
# the normal path is for `enable52Compat` to set `env.NIX_CFLAGS_COMPILE = "-DLUAJIT_ENABLE_LUA52COMPAT";`
|
# the normal path is for `enable52Compat` to set `env.NIX_CFLAGS_COMPILE = "-DLUAJIT_ENABLE_LUA52COMPAT";`
|
||||||
@@ -279,6 +289,8 @@ let
|
|||||||
LUA_LIBDIR="${lib.getLib luaEnv}/lib/libluajit-5.1.so" \
|
LUA_LIBDIR="${lib.getLib luaEnv}/lib/libluajit-5.1.so" \
|
||||||
LUA_RAPIDJSON_ROCK="${rockspecFor "rapidjson"}" \
|
LUA_RAPIDJSON_ROCK="${rockspecFor "rapidjson"}" \
|
||||||
LUA_SPORE_ROCK="${rockspecFor "lua-spore"}" \
|
LUA_SPORE_ROCK="${rockspecFor "lua-spore"}" \
|
||||||
|
NANOSVG_HEADERS="${nanosvg-headers-ko}" \
|
||||||
|
NANOSVG_INCLUDE_DIR="${nanosvg-headers-ko}" \
|
||||||
OPENSSL_LIB="${lib.getLib openssl}/lib/libssl.so" \
|
OPENSSL_LIB="${lib.getLib openssl}/lib/libssl.so" \
|
||||||
OPENSSL_DIR="${opensslAll}" \
|
OPENSSL_DIR="${opensslAll}" \
|
||||||
SSL_LIB="${lib.getLib openssl}/lib/libssl.so.3" \
|
SSL_LIB="${lib.getLib openssl}/lib/libssl.so.3" \
|
||||||
@@ -515,7 +527,7 @@ stdenv.mkDerivation rec {
|
|||||||
|
|
||||||
passthru = {
|
passthru = {
|
||||||
# exposed for debugging
|
# exposed for debugging
|
||||||
inherit luajit52 luaEnv rockspecFor;
|
inherit luajit52 luaEnv nanosvg-headers-ko rockspecFor;
|
||||||
inherit (overlayedLuaPkgs luaEnv.pkgs)
|
inherit (overlayedLuaPkgs luaEnv.pkgs)
|
||||||
luajson
|
luajson
|
||||||
htmlparser
|
htmlparser
|
||||||
|
@@ -241,13 +241,13 @@ in
|
|||||||
# package = libAndDev mupdf; # nixpkgs' mupdf is incompatible with koreader's `libwrap-mupdf`
|
# package = libAndDev mupdf; # nixpkgs' mupdf is incompatible with koreader's `libwrap-mupdf`
|
||||||
# package = libAndDev mupdf_1_17; # does not compile
|
# package = libAndDev mupdf_1_17; # does not compile
|
||||||
};
|
};
|
||||||
nanosvg = {
|
# nanosvg = {
|
||||||
source.url = "https://github.com/memononen/nanosvg.git";
|
# source.url = "https://github.com/memononen/nanosvg.git";
|
||||||
source.rev = "93ce879dc4c04a3ef1758428ec80083c38610b1f";
|
# source.rev = "93ce879dc4c04a3ef1758428ec80083c38610b1f";
|
||||||
source.hash = "sha256-ZtenaXJqMZr2+BxYENG1zUoQ+Qoxlxy0m/1YfJBKAFk=";
|
# source.hash = "sha256-ZtenaXJqMZr2+BxYENG1zUoQ+Qoxlxy0m/1YfJBKAFk=";
|
||||||
machineAgnostic = true;
|
# machineAgnostic = true;
|
||||||
package = nanosvg.src; # KOReader only wants the .h files, but decides to do that without even building it.
|
# package = nanosvg.src; # KOReader only wants the .h files, but decides to do that without even building it.
|
||||||
};
|
# };
|
||||||
# openssh = {
|
# openssh = {
|
||||||
# source.url = "https://github.com/openssh/openssh-portable.git";
|
# source.url = "https://github.com/openssh/openssh-portable.git";
|
||||||
# source.rev = "V_8_6_P1";
|
# source.rev = "V_8_6_P1";
|
||||||
|
Reference in New Issue
Block a user