koreader-from-src: get a few more dependencies to succeed
This commit is contained in:
parent
98ef5d77c3
commit
e5d311188e
|
@ -1,6 +1,7 @@
|
||||||
{ lib, stdenv
|
{ lib, stdenv
|
||||||
, autoconf
|
, autoconf
|
||||||
, automake
|
, automake
|
||||||
|
, buildPackages
|
||||||
, cmake
|
, cmake
|
||||||
, fetchurl
|
, fetchurl
|
||||||
, git
|
, git
|
||||||
|
@ -13,6 +14,7 @@
|
||||||
, gnutar
|
, gnutar
|
||||||
, gtk3-x11
|
, gtk3-x11
|
||||||
, luajit
|
, luajit
|
||||||
|
, perl
|
||||||
, pkg-config
|
, pkg-config
|
||||||
, ragel
|
, ragel
|
||||||
, sdcv
|
, sdcv
|
||||||
|
@ -53,8 +55,8 @@ stdenv.mkDerivation rec {
|
||||||
|
|
||||||
patches = [
|
patches = [
|
||||||
./debug.patch
|
./debug.patch
|
||||||
./mupdf_dir.patch #< TODO: needed?
|
# ./mupdf_dir.patch #< TODO: needed?
|
||||||
./mupdf_no_rm_build_dir.patch
|
./no_rm_build_dirs.patch
|
||||||
(substituteAll (
|
(substituteAll (
|
||||||
{
|
{
|
||||||
src = ./vendor-external-projects.patch;
|
src = ./vendor-external-projects.patch;
|
||||||
|
@ -75,6 +77,7 @@ stdenv.mkDerivation rec {
|
||||||
git
|
git
|
||||||
libtool
|
libtool
|
||||||
makeWrapper
|
makeWrapper
|
||||||
|
perl # TODO: openssl might try to take a runtime dep on this; see nixpkg
|
||||||
pkg-config
|
pkg-config
|
||||||
ragel
|
ragel
|
||||||
which
|
which
|
||||||
|
@ -89,6 +92,10 @@ stdenv.mkDerivation rec {
|
||||||
SDL2
|
SDL2
|
||||||
];
|
];
|
||||||
|
|
||||||
|
postPatch = ''
|
||||||
|
substituteInPlace ../openssl/config --replace '/usr/bin/env' '${buildPackages.coreutils}/bin/env'
|
||||||
|
'';
|
||||||
|
|
||||||
dontConfigure = true;
|
dontConfigure = true;
|
||||||
buildPhase = ''
|
buildPhase = ''
|
||||||
install_lib() {
|
install_lib() {
|
||||||
|
@ -97,6 +104,7 @@ stdenv.mkDerivation rec {
|
||||||
platform="$3"
|
platform="$3"
|
||||||
|
|
||||||
lib_src="../$lib"
|
lib_src="../$lib"
|
||||||
|
build_dir="base/thirdparty/$lib/build/$platform"
|
||||||
|
|
||||||
# link the nix clone into the directory koreader would use for checkout
|
# link the nix clone into the directory koreader would use for checkout
|
||||||
# ref="base/thirdparty/$l/build/git_checkout"
|
# ref="base/thirdparty/$l/build/git_checkout"
|
||||||
|
@ -114,7 +122,7 @@ stdenv.mkDerivation rec {
|
||||||
# instead, we replicate that effect here, and by creating these "stamp" files
|
# instead, we replicate that effect here, and by creating these "stamp" files
|
||||||
# koreader will know to skip the `git clone` and `git checkout` calls.
|
# koreader will know to skip the `git clone` and `git checkout` calls.
|
||||||
# the logic we're spoofing lives in koreader/base/thirdparty/cmake_modules/koreader_thirdparty_git.cmake
|
# the logic we're spoofing lives in koreader/base/thirdparty/cmake_modules/koreader_thirdparty_git.cmake
|
||||||
stamp_dir="base/thirdparty/$lib/build/$platform/git_checkout/stamp"
|
stamp_dir="$build_dir/git_checkout/stamp"
|
||||||
stamp_info="$stamp_dir/$lib-gitinfo-$rev.txt"
|
stamp_info="$stamp_dir/$lib-gitinfo-$rev.txt"
|
||||||
stamp_clone="$stamp_dir/$lib-gitclone-lastrun.txt"
|
stamp_clone="$stamp_dir/$lib-gitclone-lastrun.txt"
|
||||||
echo "creating stamps for $lib: $stamp_clone > $stamp_info"
|
echo "creating stamps for $lib: $stamp_clone > $stamp_info"
|
||||||
|
@ -128,7 +136,7 @@ stdenv.mkDerivation rec {
|
||||||
# koreader would copy the checkout into this build/working directory,
|
# koreader would copy the checkout into this build/working directory,
|
||||||
# but because we spoof the stamps to work around other git errors,
|
# but because we spoof the stamps to work around other git errors,
|
||||||
# copy it there on koreader's behalf
|
# copy it there on koreader's behalf
|
||||||
prefix="base/thirdparty/$lib/build/$platform/$lib-prefix"
|
prefix="$build_dir/$lib-prefix"
|
||||||
mkdir -p "$prefix/src"
|
mkdir -p "$prefix/src"
|
||||||
cp -R "$lib_src" "$prefix/src/$lib"
|
cp -R "$lib_src" "$prefix/src/$lib"
|
||||||
# src dir needs to be writable for koreader to apply its own patches
|
# src dir needs to be writable for koreader to apply its own patches
|
||||||
|
@ -136,15 +144,23 @@ stdenv.mkDerivation rec {
|
||||||
}
|
}
|
||||||
|
|
||||||
'' + builtins.concatStringsSep "\n" (lib.mapAttrsToList
|
'' + builtins.concatStringsSep "\n" (lib.mapAttrsToList
|
||||||
(name: src: ''install_lib "${name}" "${src.source.rev}" "${if src.buildInSource or false then "" else "x86_64-unknown-linux-gnu"}"'')
|
(name: src:
|
||||||
|
let
|
||||||
|
# for machine-agnostic libraries (e.g. pure lua), koreader doesn't build them in a flavored directory
|
||||||
|
machine = if src.machineAgnostic or false then "" else "x86_64-unknown-linux-gnu";
|
||||||
|
in
|
||||||
|
''install_lib "${name}" "${src.source.rev}" "${machine}"''
|
||||||
|
)
|
||||||
sources.thirdparty
|
sources.thirdparty
|
||||||
) + ''
|
) + ''
|
||||||
|
|
||||||
make TARGET=debian DEBIAN=1 INSTALL_DIR="$out" SHELL=sh VERBOSE=1
|
make TARGET=debian DEBIAN=1 SHELL=sh VERBOSE=1
|
||||||
'';
|
'';
|
||||||
|
# XXX: ^ don't specify INSTALL_DIR="$out" as make arg because that conflicts with vars used by third-party libs
|
||||||
|
# might be safe to specify that as an env var, though?
|
||||||
|
|
||||||
installPhase = ''
|
installPhase = ''
|
||||||
make TARGET=debian DEBIAN=1 INSTALL_DIR="$out" update
|
make TARGET=debian DEBIAN=1 update
|
||||||
'';
|
'';
|
||||||
|
|
||||||
meta = with lib; {
|
meta = with lib; {
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
diff --git a/base/Makefile.third b/base/Makefile.third
|
diff --git a/base/Makefile.third b/base/Makefile.third
|
||||||
index f6a80523..061d2340 100644
|
index f6a80523..1080ab98 100644
|
||||||
--- a/base/Makefile.third
|
--- a/base/Makefile.third
|
||||||
+++ b/base/Makefile.third
|
+++ b/base/Makefile.third
|
||||||
@@ -137,7 +137,6 @@ $(MUPDF_LIB) $(MUPDF_DIR)/include: $(JPEG_LIB) \
|
@@ -137,7 +137,6 @@ $(MUPDF_LIB) $(MUPDF_DIR)/include: $(JPEG_LIB) \
|
||||||
|
@ -10,3 +10,11 @@ index f6a80523..061d2340 100644
|
||||||
install -d $(MUPDF_BUILD_DIR)
|
install -d $(MUPDF_BUILD_DIR)
|
||||||
cd $(MUPDF_BUILD_DIR) && \
|
cd $(MUPDF_BUILD_DIR) && \
|
||||||
$(CMAKE) $(CMAKE_FLAGS) \
|
$(CMAKE) $(CMAKE_FLAGS) \
|
||||||
|
@@ -665,7 +664,6 @@ $(OUTPUT_DIR)/data/KoboUSBMS.tar.gz: $(THIRDPARTY_DIR)/kobo-usbms/*.*
|
||||||
|
# ===========================================================================
|
||||||
|
# common lua library for networking
|
||||||
|
$(LUASOCKET): $(THIRDPARTY_DIR)/luasocket/*.*
|
||||||
|
- -rm -rf $(LUASOCKET) $(LUASOCKET_BUILD_DIR)
|
||||||
|
install -d $(LUASOCKET_BUILD_DIR)
|
||||||
|
cd $(LUASOCKET_BUILD_DIR) && \
|
||||||
|
$(CMAKE) $(CMAKE_FLAGS) \
|
|
@ -34,6 +34,7 @@
|
||||||
source.hash = "sha256-L4m/F9rs8fiv9rSf8oy7P6cthhupc6R/lCv30PLiQ4M=";
|
source.hash = "sha256-L4m/F9rs8fiv9rSf8oy7P6cthhupc6R/lCv30PLiQ4M=";
|
||||||
};
|
};
|
||||||
giflib = {
|
giflib = {
|
||||||
|
# Completed
|
||||||
source.url = "https://gitlab.com/koreader/giflib.git";
|
source.url = "https://gitlab.com/koreader/giflib.git";
|
||||||
source.rev = "5.1.4";
|
source.rev = "5.1.4";
|
||||||
source.hash = "sha256-znbY4tliXHXVLBd8sTKrbglOdCUb7xhcCQsDDWcQfhw=";
|
source.hash = "sha256-znbY4tliXHXVLBd8sTKrbglOdCUb7xhcCQsDDWcQfhw=";
|
||||||
|
@ -98,13 +99,17 @@
|
||||||
source.url = "https://github.com/koreader/lj-wpaclient.git";
|
source.url = "https://github.com/koreader/lj-wpaclient.git";
|
||||||
source.rev = "2f93beb3071e6ebb57c783bd5b92f83aa5ebb757";
|
source.rev = "2f93beb3071e6ebb57c783bd5b92f83aa5ebb757";
|
||||||
source.hash = "sha256-ilJviGZTvL2i1TN5lHQ4eA9pFiM7NlXD+v9ofv520b8=";
|
source.hash = "sha256-ilJviGZTvL2i1TN5lHQ4eA9pFiM7NlXD+v9ofv520b8=";
|
||||||
|
machineAgnostic = true;
|
||||||
};
|
};
|
||||||
lodepng = {
|
lodepng = {
|
||||||
|
# Completed
|
||||||
source.url = "https://github.com/lvandeve/lodepng.git";
|
source.url = "https://github.com/lvandeve/lodepng.git";
|
||||||
source.rev = "c18b949b71f45e78b1f9a28c5d458bce0da505d6";
|
source.rev = "c18b949b71f45e78b1f9a28c5d458bce0da505d6";
|
||||||
source.hash = "sha256-AAw6I+MxDaxmGpjC5efxuBNw7Lx8FXwg2TEfl6LfPfQ=";
|
source.hash = "sha256-AAw6I+MxDaxmGpjC5efxuBNw7Lx8FXwg2TEfl6LfPfQ=";
|
||||||
};
|
};
|
||||||
lua-htmlparser = {
|
lua-htmlparser = {
|
||||||
|
# TODO: fails build
|
||||||
|
# - `sh: line 1: luarocks: command not found`
|
||||||
source.url = "https://github.com/msva/lua-htmlparser";
|
source.url = "https://github.com/msva/lua-htmlparser";
|
||||||
source.rev = "5ce9a775a345cf458c0388d7288e246bb1b82bff";
|
source.rev = "5ce9a775a345cf458c0388d7288e246bb1b82bff";
|
||||||
source.hash = "sha256-aSTLSfqz/MIDFVRwtBlDNBUhPb7KqOl32/Y62Hdec1s=";
|
source.hash = "sha256-aSTLSfqz/MIDFVRwtBlDNBUhPb7KqOl32/Y62Hdec1s=";
|
||||||
|
@ -121,11 +126,13 @@
|
||||||
source.hash = "sha256-y/czEVPtCt4uN1n49Qi7BrgZmkG+SDXlM5D2GvvO2qg=";
|
source.hash = "sha256-y/czEVPtCt4uN1n49Qi7BrgZmkG+SDXlM5D2GvvO2qg=";
|
||||||
};
|
};
|
||||||
luasec = {
|
luasec = {
|
||||||
|
# Completed
|
||||||
source.url = "https://github.com/brunoos/luasec";
|
source.url = "https://github.com/brunoos/luasec";
|
||||||
source.rev = "tags/v1.3.1";
|
source.rev = "tags/v1.3.1";
|
||||||
source.hash = "sha256-3iYRNQoVk5HFjDSqRRmg1taSqeT2cHFil36vxjrEofo=";
|
source.hash = "sha256-3iYRNQoVk5HFjDSqRRmg1taSqeT2cHFil36vxjrEofo=";
|
||||||
};
|
};
|
||||||
luasocket = {
|
luasocket = {
|
||||||
|
# Completed
|
||||||
source.url = "https://github.com/lunarmodules/luasocket";
|
source.url = "https://github.com/lunarmodules/luasocket";
|
||||||
source.rev = "8c2ff7217e2a205eb107a6f48b04ff1b2b3090a1";
|
source.rev = "8c2ff7217e2a205eb107a6f48b04ff1b2b3090a1";
|
||||||
source.hash = "sha256-Y35QYNLznQmErr6rIjxLzw0/6Y7y8TbzD4yaEdgEljA=";
|
source.hash = "sha256-Y35QYNLznQmErr6rIjxLzw0/6Y7y8TbzD4yaEdgEljA=";
|
||||||
|
@ -152,17 +159,13 @@
|
||||||
source.url = "https://github.com/ArtifexSoftware/mupdf.git";
|
source.url = "https://github.com/ArtifexSoftware/mupdf.git";
|
||||||
source.rev = "tags/1.13.0";
|
source.rev = "tags/1.13.0";
|
||||||
source.hash = "sha256-pQejRon9fO9A1mhz3oLjBr1j4HveDLcQIWjR1/Rpy5Q=";
|
source.hash = "sha256-pQejRon9fO9A1mhz3oLjBr1j4HveDLcQIWjR1/Rpy5Q=";
|
||||||
# buildInSource = true;
|
|
||||||
};
|
};
|
||||||
nanosvg = {
|
nanosvg = {
|
||||||
# Completed
|
# Completed
|
||||||
# XXX koreader expects stamp file to not have x86_64-... prefix?
|
|
||||||
# maybe because it specifies an empty BUILD_COMMAND instead of `KO_MAKE_RECURSIVE`?
|
|
||||||
# or because `BUILD_IN_SOURCE`?
|
|
||||||
source.url = "https://github.com/memononen/nanosvg.git";
|
source.url = "https://github.com/memononen/nanosvg.git";
|
||||||
source.rev = "9da543e8329fdd81b64eb48742d8ccb09377aed1";
|
source.rev = "9da543e8329fdd81b64eb48742d8ccb09377aed1";
|
||||||
source.hash = "sha256-VOiN6583DtzGYPRkl19VG2QvSzl4T9HaynBuNcvZf94=";
|
source.hash = "sha256-VOiN6583DtzGYPRkl19VG2QvSzl4T9HaynBuNcvZf94=";
|
||||||
buildInSource = true;
|
machineAgnostic = true;
|
||||||
};
|
};
|
||||||
openssh = {
|
openssh = {
|
||||||
source.url = "https://github.com/openssh/openssh-portable.git";
|
source.url = "https://github.com/openssh/openssh-portable.git";
|
||||||
|
@ -170,6 +173,7 @@
|
||||||
source.hash = "sha256-yjIpSbe5pt9sEV2MZYGztxejg/aBFfKO8ieRvoLN2KA=";
|
source.hash = "sha256-yjIpSbe5pt9sEV2MZYGztxejg/aBFfKO8ieRvoLN2KA=";
|
||||||
};
|
};
|
||||||
openssl = {
|
openssl = {
|
||||||
|
# Completed
|
||||||
source.url = "https://github.com/openssl/openssl.git";
|
source.url = "https://github.com/openssl/openssl.git";
|
||||||
source.rev = "OpenSSL_1_1_1u";
|
source.rev = "OpenSSL_1_1_1u";
|
||||||
source.hash = "sha256-JOcUj4ovA6621+1k2HUsvhGX1B9BjvaMbCaSx680nSs=";
|
source.hash = "sha256-JOcUj4ovA6621+1k2HUsvhGX1B9BjvaMbCaSx680nSs=";
|
||||||
|
@ -190,6 +194,7 @@
|
||||||
source.hash = "sha256-FQvlrJ+Uy7+wtUxBuS5NdoToUwNRhYw2ju8Ya8MLyQw=";
|
source.hash = "sha256-FQvlrJ+Uy7+wtUxBuS5NdoToUwNRhYw2ju8Ya8MLyQw=";
|
||||||
};
|
};
|
||||||
turbo = {
|
turbo = {
|
||||||
|
# Completed
|
||||||
source.url = "https://github.com/kernelsauce/turbo";
|
source.url = "https://github.com/kernelsauce/turbo";
|
||||||
source.rev = "tags/v2.1.3";
|
source.rev = "tags/v2.1.3";
|
||||||
source.hash = "sha256-vBRkFdc5a0FIt15HBz3TnqMZ+GGsqjEefnfJEpuVTBs=";
|
source.hash = "sha256-vBRkFdc5a0FIt15HBz3TnqMZ+GGsqjEefnfJEpuVTBs=";
|
||||||
|
|
Loading…
Reference in New Issue
Block a user