koreader: lodepng: provide in a more direct manner

This commit is contained in:
Colin 2024-03-22 18:59:17 +00:00
parent e7a65abd0b
commit ce770dbea9
2 changed files with 18 additions and 7 deletions

View File

@ -128,6 +128,14 @@ let
hash = "sha256-37sZ46dG6Z1Wk7NrhKAKl5j9r1bN6g01cd5Iyt/2coM=";
};
lodepng-src-ko = fetchFromGitHub {
owner = "lvandeve";
repo = "lodepng";
name = "lodepng";
rev = "d398e0f10d152a5d17fa30463474dc9f56523f9c";
hash = "sha256-ApOHUgU6X1rHwyjAHA/0Nt+buDFqY2ttXEnEvdrRl3A=";
};
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.
@ -318,6 +326,7 @@ let
LIBWEBPDEMUX_LIB="${lib.getLib libwebp}/lib/libwebpdemux.so" \
LIBWEBPSHARPYUV_LIB="${lib.getLib libwebp}/lib/libwebpsharpyuv.so" \
LIBWEBP_DIR="${lib.getDev libwebp}" \
LODEPNG_DIR="$NIX_BUILD_TOP/lodepng" \
LPEG_ROCK="${rockspecFor "lpeg"}" \
LUAJIT="${luaEnv}/bin/luajit" \
LUAJIT_JIT="${luaEnv}/share/lua/5.1/jit" \
@ -405,6 +414,7 @@ stdenv.mkDerivation rec {
kobo-usbms-src-ko
leptonica-src-ko
libk2pdfopt-src-ko
lodepng-src-ko
tesseract-src-ko
] ++ (lib.mapAttrsToList
(name: src: fetchgit (
@ -458,7 +468,7 @@ stdenv.mkDerivation rec {
--replace-fail ' -rm ' ' # -rm'
# make some sources writable (only the `sourceRoot` is writable by default)
chmod -R u+w "$NIX_BUILD_TOP"/{fbink,kobo-usbms,leptonica,libk2pdfopt,tesseract}
chmod -R u+w "$NIX_BUILD_TOP"/{fbink,kobo-usbms,leptonica,libk2pdfopt,lodepng,tesseract}
# lots of places in Makefile.third (incorrectly) assume lib paths are relative to CURDIR,
# so link /nix into CURDIR to allow them to work anyway
@ -526,6 +536,7 @@ stdenv.mkDerivation rec {
skip_download fbink
skip_download kobo-usbms
skip_download libk2pdfopt
skip_download lodepng
# outDir should match OUTPUT_DIR in koreader-base
outDir="$NIX_BUILD_TOP/koreader/base/build/${stdenv.hostPlatform.config}"

View File

@ -182,12 +182,12 @@ in
# machineAgnostic = true;
# # package: not in nixpkgs; not even a non-luajit `wpaclient`
# };
lodepng = {
source.url = "https://github.com/lvandeve/lodepng.git";
source.rev = "d398e0f10d152a5d17fa30463474dc9f56523f9c";
source.hash = "sha256-ApOHUgU6X1rHwyjAHA/0Nt+buDFqY2ttXEnEvdrRl3A=";
# package: not in nixpkgs, except in source-only form (mujoco.pin.lodepng)
};
# lodepng = {
# source.url = "https://github.com/lvandeve/lodepng.git";
# source.rev = "d398e0f10d152a5d17fa30463474dc9f56523f9c";
# source.hash = "sha256-ApOHUgU6X1rHwyjAHA/0Nt+buDFqY2ttXEnEvdrRl3A=";
# # package: not in nixpkgs, except in source-only form (mujoco.pin.lodepng)
# };
# lua-htmlparser = {
# source.url = "https://github.com/msva/lua-htmlparser";
# source.rev = "5ce9a775a345cf458c0388d7288e246bb1b82bff";