mirror of
https://github.com/NixOS/nixpkgs.git
synced 2024-12-02 20:03:16 +00:00
e0464e4788
In preparation for the deprecation of `stdenv.isX`. These shorthands are not conducive to cross-compilation because they hide the platforms. Darwin might get cross-compilation for which the continued usage of `stdenv.isDarwin` will get in the way One example of why this is bad and especially affects compiler packages https://www.github.com/NixOS/nixpkgs/pull/343059 There are too many files to go through manually but a treewide should get users thinking when they see a `hostPlatform.isX` in a place where it doesn't make sense. ``` fd --type f "\.nix" | xargs sd --fixed-strings "stdenv.is" "stdenv.hostPlatform.is" fd --type f "\.nix" | xargs sd --fixed-strings "stdenv'.is" "stdenv'.hostPlatform.is" fd --type f "\.nix" | xargs sd --fixed-strings "clangStdenv.is" "clangStdenv.hostPlatform.is" fd --type f "\.nix" | xargs sd --fixed-strings "gccStdenv.is" "gccStdenv.hostPlatform.is" fd --type f "\.nix" | xargs sd --fixed-strings "stdenvNoCC.is" "stdenvNoCC.hostPlatform.is" fd --type f "\.nix" | xargs sd --fixed-strings "inherit (stdenv) is" "inherit (stdenv.hostPlatform) is" fd --type f "\.nix" | xargs sd --fixed-strings "buildStdenv.is" "buildStdenv.hostPlatform.is" fd --type f "\.nix" | xargs sd --fixed-strings "effectiveStdenv.is" "effectiveStdenv.hostPlatform.is" fd --type f "\.nix" | xargs sd --fixed-strings "originalStdenv.is" "originalStdenv.hostPlatform.is" ```
70 lines
1.8 KiB
Nix
70 lines
1.8 KiB
Nix
{ lib
|
|
, mupdf
|
|
, stdenv
|
|
, fetchFromGitHub
|
|
, substituteAll
|
|
, cmake
|
|
, qt6
|
|
, desktopToDarwinBundle
|
|
}:
|
|
|
|
let
|
|
mupdf-cxx = mupdf.override { enableCxx = true; };
|
|
in
|
|
stdenv.mkDerivation rec {
|
|
pname = "librum";
|
|
version = "0.12.2";
|
|
|
|
src = fetchFromGitHub {
|
|
owner = "Librum-Reader";
|
|
repo = "Librum";
|
|
rev = "v.${version}";
|
|
fetchSubmodules = true;
|
|
hash = "sha256-Iwcbcz8LrznFP8rfW6mg9p7klAtTx4daFxylTeFKrH0=";
|
|
};
|
|
|
|
patches = [
|
|
(substituteAll {
|
|
src = ./use_mupdf_in_nixpkgs.patch;
|
|
nixMupdfLibPath = "${mupdf-cxx.out}/lib";
|
|
nixMupdfIncludePath = "${mupdf-cxx.dev}/include";
|
|
})
|
|
];
|
|
|
|
nativeBuildInputs = [
|
|
cmake
|
|
qt6.qttools
|
|
qt6.wrapQtAppsHook
|
|
] ++ lib.optionals stdenv.hostPlatform.isDarwin [
|
|
desktopToDarwinBundle
|
|
];
|
|
|
|
buildInputs = [
|
|
qt6.qtbase
|
|
qt6.qtsvg
|
|
] ++ lib.optionals stdenv.hostPlatform.isLinux [
|
|
qt6.qtwayland
|
|
];
|
|
|
|
meta = with lib; {
|
|
description = "Application designed to make reading enjoyable and straightforward";
|
|
longDescription = ''
|
|
Librum is an application designed to make reading enjoyable
|
|
and straightforward for everyone. It's not just an e-book
|
|
reader. With Librum, you can manage your own online library
|
|
and access it from any device anytime, anywhere. It has
|
|
features like note-taking, AI tooling, and highlighting,
|
|
while offering customization to make it as personal as you
|
|
want! Librum also provides free access to over 70,000 books
|
|
and personal reading statistics while being free and
|
|
completely open source.
|
|
'';
|
|
homepage = "https://librumreader.com";
|
|
changelog = "https://github.com/Librum-Reader/Librum/releases/tag/${src.rev}";
|
|
license = licenses.gpl3Plus;
|
|
mainProgram = "librum";
|
|
maintainers = with maintainers; [ aleksana oluceps ];
|
|
platforms = platforms.unix;
|
|
};
|
|
}
|