koreader-from-src: libk2pdfopt: populate in a more direct manner
This commit is contained in:
@@ -120,6 +120,14 @@ let
|
|||||||
hash = "sha256-SDXKam768xvZZvTbXe3sssvZyeLEEiY97Vrzx8hoc6g=";
|
hash = "sha256-SDXKam768xvZZvTbXe3sssvZyeLEEiY97Vrzx8hoc6g=";
|
||||||
};
|
};
|
||||||
|
|
||||||
|
libk2pdfopt-src-ko = fetchFromGitHub {
|
||||||
|
owner = "koreader";
|
||||||
|
repo = "libk2pdfopt";
|
||||||
|
name = "libk2pdfopt";
|
||||||
|
rev = "09f1e011a618c8ec06b4caa67079682119d2aaa7";
|
||||||
|
hash = "sha256-37sZ46dG6Z1Wk7NrhKAKl5j9r1bN6g01cd5Iyt/2coM=";
|
||||||
|
};
|
||||||
|
|
||||||
nanosvg-headers-ko = symlinkJoin {
|
nanosvg-headers-ko = symlinkJoin {
|
||||||
# koreader's heavily-patched mupdf is dependent on a koreader-specific `stb_image_write` extension to nanosvg.
|
# 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.
|
# nanosvg is used as a header-only library, so just patch that extension straight into the src.
|
||||||
@@ -298,6 +306,7 @@ let
|
|||||||
JPEG_LIB_LINK_FLAG="-L ${lib.getLib libjpeg_turbo}/lib -l:libjpeg.so" \
|
JPEG_LIB_LINK_FLAG="-L ${lib.getLib libjpeg_turbo}/lib -l:libjpeg.so" \
|
||||||
JPEG_DIR="${lib.getDev libjpeg_turbo}" \
|
JPEG_DIR="${lib.getDev libjpeg_turbo}" \
|
||||||
TURBOJPEG_LIB="${lib.getLib libjpeg_turbo}/lib/libturbojpeg.so" \
|
TURBOJPEG_LIB="${lib.getLib libjpeg_turbo}/lib/libturbojpeg.so" \
|
||||||
|
K2PDFOPT_DIR="$NIX_BUILD_TOP/libk2pdfopt" \
|
||||||
KOBO_USBMS_DIR="$NIX_BUILD_TOP/kobo-usbms" \
|
KOBO_USBMS_DIR="$NIX_BUILD_TOP/kobo-usbms" \
|
||||||
LEPTONICA_DIR="$NIX_BUILD_TOP/leptonica" \
|
LEPTONICA_DIR="$NIX_BUILD_TOP/leptonica" \
|
||||||
LIBICONV="${lib.getLib libiconvReal}/lib/libiconv.so" \
|
LIBICONV="${lib.getLib libiconvReal}/lib/libiconv.so" \
|
||||||
@@ -395,6 +404,7 @@ stdenv.mkDerivation rec {
|
|||||||
fbink-src-ko
|
fbink-src-ko
|
||||||
kobo-usbms-src-ko
|
kobo-usbms-src-ko
|
||||||
leptonica-src-ko
|
leptonica-src-ko
|
||||||
|
libk2pdfopt-src-ko
|
||||||
tesseract-src-ko
|
tesseract-src-ko
|
||||||
] ++ (lib.mapAttrsToList
|
] ++ (lib.mapAttrsToList
|
||||||
(name: src: fetchgit (
|
(name: src: fetchgit (
|
||||||
@@ -448,7 +458,7 @@ stdenv.mkDerivation rec {
|
|||||||
--replace-fail ' -rm ' ' # -rm'
|
--replace-fail ' -rm ' ' # -rm'
|
||||||
|
|
||||||
# make some sources writable (only the `sourceRoot` is writable by default)
|
# make some sources writable (only the `sourceRoot` is writable by default)
|
||||||
chmod -R u+w "$NIX_BUILD_TOP"/{fbink,kobo-usbms,leptonica,tesseract}
|
chmod -R u+w "$NIX_BUILD_TOP"/{fbink,kobo-usbms,leptonica,libk2pdfopt,tesseract}
|
||||||
|
|
||||||
# lots of places in Makefile.third (incorrectly) assume lib paths are relative to CURDIR,
|
# 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
|
# so link /nix into CURDIR to allow them to work anyway
|
||||||
@@ -503,7 +513,8 @@ stdenv.mkDerivation rec {
|
|||||||
}
|
}
|
||||||
|
|
||||||
skip_download() {
|
skip_download() {
|
||||||
sed -i 's/DOWNLOAD_COMMAND .*/DOWNLOAD_COMMAND ""/' "base/thirdparty/$1/CMakeLists.txt"
|
# sed -i 's/DOWNLOAD_COMMAND .*/DOWNLOAD_COMMAND ""/' "base/thirdparty/$1/CMakeLists.txt"
|
||||||
|
sed -i "s:DOWNLOAD_COMMAND .*:DOWNLOAD_COMMAND rm -fd $1 \\&\\& ln -s $NIX_BUILD_TOP/$1 .:" "base/thirdparty/$1/CMakeLists.txt"
|
||||||
}
|
}
|
||||||
|
|
||||||
${builtins.concatStringsSep "\n" (
|
${builtins.concatStringsSep "\n" (
|
||||||
@@ -514,6 +525,7 @@ stdenv.mkDerivation rec {
|
|||||||
|
|
||||||
skip_download fbink
|
skip_download fbink
|
||||||
skip_download kobo-usbms
|
skip_download kobo-usbms
|
||||||
|
skip_download libk2pdfopt
|
||||||
|
|
||||||
# outDir should match OUTPUT_DIR in koreader-base
|
# outDir should match OUTPUT_DIR in koreader-base
|
||||||
outDir="$NIX_BUILD_TOP/koreader/base/build/${stdenv.hostPlatform.config}"
|
outDir="$NIX_BUILD_TOP/koreader/base/build/${stdenv.hostPlatform.config}"
|
||||||
|
@@ -144,12 +144,12 @@ in
|
|||||||
# source.hash = "sha256-ofdecix4m0FA9gdyQh7zYn99SYBbH2+a7jfoZlsadoA=";
|
# source.hash = "sha256-ofdecix4m0FA9gdyQh7zYn99SYBbH2+a7jfoZlsadoA=";
|
||||||
# # package = libAndDev libjpeg_turbo;
|
# # package = libAndDev libjpeg_turbo;
|
||||||
# };
|
# };
|
||||||
libk2pdfopt = {
|
# libk2pdfopt = {
|
||||||
source.url = "https://github.com/koreader/libk2pdfopt.git";
|
# source.url = "https://github.com/koreader/libk2pdfopt.git";
|
||||||
source.rev = "09f1e011a618c8ec06b4caa67079682119d2aaa7";
|
# source.rev = "09f1e011a618c8ec06b4caa67079682119d2aaa7";
|
||||||
source.hash = "sha256-37sZ46dG6Z1Wk7NrhKAKl5j9r1bN6g01cd5Iyt/2coM=";
|
# source.hash = "sha256-37sZ46dG6Z1Wk7NrhKAKl5j9r1bN6g01cd5Iyt/2coM=";
|
||||||
# package = k2pdfopt; # nixpkgs k2pdfopt does not compile (broken deps). also, uses old insecure mupdf 1.17 (oh well, koreader is even older)
|
# # package = k2pdfopt; # nixpkgs k2pdfopt does not compile (broken deps). also, uses old insecure mupdf 1.17 (oh well, koreader is even older)
|
||||||
};
|
# };
|
||||||
# libpng = {
|
# libpng = {
|
||||||
# source.url = "https://github.com/glennrp/libpng.git";
|
# source.url = "https://github.com/glennrp/libpng.git";
|
||||||
# source.rev = "v1.6.40";
|
# source.rev = "v1.6.40";
|
||||||
|
Reference in New Issue
Block a user