koreader: fix startup

koreader looks for fonts/NotoSans-Regular.ttf at startup but our version
of noto fonts provide different files under different names (eg
NotoSans[wdth,wght].ttf) so koreader crashes.

Let's use the font files provided in the source repo instead. (they are
not in the debian package it seems)
This commit is contained in:
Guillaume Girol 2023-05-09 12:00:00 +00:00
parent 897876e4c4
commit 34ec28a9c0

View File

@ -1,17 +1,15 @@
{ lib, stdenv
, fetchurl
, makeWrapper
, fetchFromGitHub
, dpkg
, glib
, gnutar
, gtk3-x11
, luajit
, sdcv
, SDL2
, noto-fonts
, nerdfonts }:
let font-droid = nerdfonts.override { fonts = [ "DroidSansMono" ]; };
in stdenv.mkDerivation rec {
, SDL2 }:
stdenv.mkDerivation rec {
pname = "koreader";
version = "2022.08";
@ -21,6 +19,14 @@ in stdenv.mkDerivation rec {
sha256 = "sha256-+JBJNJTAnC5gpuo8cehfe/3YwGIW5iFA8bZ8nfz9qsk=";
};
src_repo = fetchFromGitHub {
repo = "koreader";
owner = "koreader";
rev = "v${version}";
fetchSubmodules = true;
sha256 = "sha256-MHQYEzMyZMEQrzR8+Rvci8XjDK2DMUPxjsiWTrrKiAw=";
};
sourceRoot = ".";
nativeBuildInputs = [ makeWrapper dpkg ];
buildInputs = [
@ -42,11 +48,8 @@ in stdenv.mkDerivation rec {
ln -sf ${luajit}/bin/luajit $out/lib/koreader/luajit
ln -sf ${sdcv}/bin/sdcv $out/lib/koreader/sdcv
ln -sf ${gnutar}/bin/tar $out/lib/koreader/tar
find $out -xtype l -delete
for i in ${noto-fonts}/share/fonts/truetype/noto/*; do
ln -s "$i" $out/lib/koreader/fonts/noto/
done
ln -s "${font-droid}/share/fonts/opentype/NerdFonts/Droid Sans Mono Nerd Font Complete Mono.otf" $out/lib/koreader/fonts/droid/DroidSansMono.ttf
find ${src_repo}/resources/fonts -type d -execdir cp -r '{}' $out/lib/koreader/fonts \;
find $out -xtype l -print -delete
wrapProgram $out/bin/koreader --prefix LD_LIBRARY_PATH : ${
lib.makeLibraryPath [ gtk3-x11 SDL2 glib ]
}