koreader-from-src: fbink: provide the sources more directly
This commit is contained in:
parent
98073f5e19
commit
f889543aa5
|
@ -89,6 +89,14 @@ let
|
|||
hash = "sha256-/51pOGSAoaS0gOKlqNKruwaKY5qylzCpeNUrWyzYTpA=";
|
||||
};
|
||||
|
||||
fbink-src-ko = fetchFromGitHub {
|
||||
owner = "NiLuJe";
|
||||
repo = "FBInk";
|
||||
name = "fbink"; # where to unpack this in `srcs`
|
||||
rev = "1a989b30a195ca240a3cf37f9de61b4b3c7e891c";
|
||||
hash = "sha256-lXjAX0BoHW3L1E54d5J+wiAlAZXVmj9Y1Un8yaCwO8w=";
|
||||
};
|
||||
|
||||
leptonica-src-ko = fetchFromGitHub {
|
||||
# k2pdf needs leptonica src, because it actually patches it and builds it itself:
|
||||
# - `cp -f $(LEPTONICA_MOD)/dewarp2.c $(LEPTONICA_DIR)/src/dewarp2.c`
|
||||
|
@ -262,6 +270,7 @@ let
|
|||
DJVULIBRE_LIB="${lib.getLib djvulibre}/lib/libdjvulibre.so" \
|
||||
DJVULIBRE_LIB_LINK_FLAG="-L ${lib.getLib djvulibre}/lib -l:libdjvulibre.so" \
|
||||
DJVULIBRE_DIR="${djvulibreAll}" \
|
||||
FBINK_DIR="$NIX_BUILD_TOP/fbink" \
|
||||
FREETYPE_LIB="${lib.getLib freetype}/lib/libfreetype.so" \
|
||||
FREETYPE_LIB_LINK_FLAG="-L ${lib.getLib freetype}/lib -l:libfreetype.so" \
|
||||
FREETYPE_DIR="${lib.getDev freetype}" \
|
||||
|
@ -374,6 +383,7 @@ stdenv.mkDerivation rec {
|
|||
inherit version;
|
||||
srcs = [
|
||||
src
|
||||
fbink-src-ko
|
||||
leptonica-src-ko
|
||||
tesseract-src-ko
|
||||
] ++ (lib.mapAttrsToList
|
||||
|
@ -428,7 +438,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"/{leptonica,tesseract}
|
||||
chmod -R u+w "$NIX_BUILD_TOP"/{fbink,leptonica,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
|
||||
|
@ -482,12 +492,18 @@ stdenv.mkDerivation rec {
|
|||
chmod u+w -R "$prefix/src/$lib"
|
||||
}
|
||||
|
||||
skip_download() {
|
||||
sed -i 's/DOWNLOAD_COMMAND .*/DOWNLOAD_COMMAND ""/' "base/thirdparty/$1/CMakeLists.txt"
|
||||
}
|
||||
|
||||
${builtins.concatStringsSep "\n" (
|
||||
lib.mapAttrsToList
|
||||
(name: src: lib.escapeShellArgs [ "link_lib_into_build_dir" name src.source.rev ])
|
||||
sources.thirdparty
|
||||
)}
|
||||
|
||||
skip_download fbink
|
||||
|
||||
# outDir should match OUTPUT_DIR in koreader-base
|
||||
outDir="$NIX_BUILD_TOP/koreader/base/build/${stdenv.hostPlatform.config}"
|
||||
mkdir -p "$outDir"
|
||||
|
|
|
@ -82,12 +82,12 @@ in
|
|||
# source.hash = "sha256-OWSbxdr93FH3ed0D+NSFWIah7VDTcL3LIGOciY+f4dk=";
|
||||
# # package = djvulibre; # "cp -fL /build/koreader/base/thirdparty/djvulibre/build/aarch64-unknown-linux-gnu/djvulibre-prefix/src/djvulibre/libdjvu/.libs/libdjvulibre.so.21 ..."
|
||||
# };
|
||||
fbink = {
|
||||
source.url = "https://github.com/NiLuJe/FBInk.git";
|
||||
source.rev = "1a989b30a195ca240a3cf37f9de61b4b3c7e891c";
|
||||
source.hash = "sha256-O3bZzvuj/BRVV+UoutaaZZgGZws2J/i5ArfBHbz6omI=";
|
||||
# package: not packaged for nix
|
||||
};
|
||||
# fbink = {
|
||||
# source.url = "https://github.com/NiLuJe/FBInk.git";
|
||||
# source.rev = "1a989b30a195ca240a3cf37f9de61b4b3c7e891c";
|
||||
# source.hash = "sha256-O3bZzvuj/BRVV+UoutaaZZgGZws2J/i5ArfBHbz6omI=";
|
||||
# # package: not packaged for nix
|
||||
# };
|
||||
# freetype2 = {
|
||||
# source.url = "https://gitlab.com/koreader/freetype2.git";
|
||||
# source.rev = "VER-2-13-2";
|
||||
|
|
Loading…
Reference in New Issue
Block a user