2023-07-15 17:15:38 +00:00
|
|
|
{ lib
|
|
|
|
, stdenv
|
|
|
|
, fetchFromGitHub
|
|
|
|
, cmake
|
|
|
|
, qtbase
|
|
|
|
, qtx11extras ? null # qt5 only
|
|
|
|
, wrapQtAppsHook
|
|
|
|
|
|
|
|
# before that => zeal
|
|
|
|
, sqlite
|
|
|
|
, json_c
|
|
|
|
, mecab
|
|
|
|
, libzip
|
|
|
|
, mpv
|
|
|
|
, yt-dlp
|
|
|
|
# optional
|
|
|
|
, makeWrapper}:
|
|
|
|
|
|
|
|
let
|
|
|
|
isQt5 = lib.versions.major qtbase.version == "5";
|
|
|
|
|
|
|
|
in
|
|
|
|
stdenv.mkDerivation (finalAttrs: {
|
|
|
|
pname = "memento";
|
2024-02-07 01:22:34 +00:00
|
|
|
version = "1.2.2";
|
2023-07-15 17:15:38 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "ripose-jp";
|
|
|
|
repo = "Memento";
|
2023-08-22 20:05:09 +00:00
|
|
|
rev = "v${finalAttrs.version}";
|
2024-02-07 01:22:34 +00:00
|
|
|
hash = "sha256-55VvT7pHN0/HqxM4vMDQDgUwkVmO/8aOEOye8jcFzgI=";
|
2023-07-15 17:15:38 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
nativeBuildInputs = [
|
|
|
|
cmake
|
|
|
|
makeWrapper
|
|
|
|
wrapQtAppsHook
|
|
|
|
];
|
|
|
|
|
|
|
|
buildInputs = [
|
|
|
|
qtbase
|
|
|
|
sqlite
|
|
|
|
json_c
|
|
|
|
libzip
|
|
|
|
mecab
|
|
|
|
] ++ lib.optionals isQt5 [ qtx11extras ];
|
|
|
|
|
|
|
|
propagatedBuildInputs = [ mpv ];
|
|
|
|
|
|
|
|
preFixup = ''
|
|
|
|
wrapProgram "$out/bin/memento" \
|
|
|
|
--prefix PATH : "${yt-dlp}/bin" \
|
|
|
|
'';
|
|
|
|
|
|
|
|
meta = with lib; {
|
|
|
|
description = "An mpv-based video player for studying Japanese";
|
|
|
|
homepage = "https://ripose-jp.github.io/Memento/";
|
|
|
|
license = licenses.gpl2;
|
|
|
|
maintainers = with maintainers; [ teto ];
|
|
|
|
platforms = platforms.linux;
|
2024-01-02 11:29:13 +00:00
|
|
|
mainProgram = "memento";
|
2023-07-15 17:15:38 +00:00
|
|
|
};
|
|
|
|
})
|
|
|
|
|