Change:
Project description Librum is an e-book reader that can download books from a personal online library. Metadata homepage URL: source URL: license: gpl3 platforms: gnu/linux, macos, windows
I'm interested in this package, so here's my two cents comment.
Very interested as well.
I'm taking a stab at this. Nothing to show for it yet, but I will share my draft later. Need to learn some cmake stuff to figure out how to make it use a nixpkgs-provided mupdf build instead of doing an in-tree vendored build of it.
I got a basic flake working in my fork of the librum client . Hopefully this can help get the ball rolling. Not sure how much time I can commit to this, so anyone feel free to take over if you are more motivated. To my untrained eye, it doesn't seem too complicated IMO. Its just a few patches here and there mainly to remove the in-tree deps. Disclaimer: This is basically a script kiddies-approach. I'm not very proficient with nix and even less so with cmake. There could be several issues. ! As a side-note, I'd like to request the packaging of the along with the client. I'm not sure if that should be rolled into its own issue, but I'm more-or-less just saying it here to announce that it is something I might look into myself. (It's just a config file... nevermind)
Is there any update on the Librum-Server package?

Discussion:
<ins> { lib , mupdf , stdenv , fetchFromGitHub , substituteAll , cmake , qt6 , desktopToDarwinBundle }: let mupdf-cxx = mupdf.override { enableCxx = true; }; in stdenv.mkDerivation rec { pname = "librum"; version = "0.12.1"; src = fetchFromGitHub { owner = "Librum-Reader"; repo = "Librum"; rev = "v.${version}"; fetchSubmodules = true; hash = "sha256-/QxTWlTMoXykPe3z+mmn6eaGRJDu2IX8BJPcXi1gUqQ="; }; 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.isDarwin [ desktopToDarwinBundle ]; buildInputs = [ qt6.qtbase qt6.qtsvg ] ++ lib.optionals stdenv.isLinux [ qt6.qtwayland ]; meta = with lib; { description = "An 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"; license = licenses.gpl3Plus; mainProgram = "librum"; maintainers = with maintainers; [ aleksana oluceps ]; platforms = platforms.unix; }; } </ins>

<ins> diff --git a/CMakeLists.txt b/CMakeLists.txt index 191ff732..de46f35b 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -71,7 +71,7 @@ endif() # Dependencies add_subdirectory(libs/rapidfuzz-cpp) - +include_directories(@nixMupdfIncludePath@) # Build add_subdirectory(src/) diff --git a/src/application/CMakeLists.txt b/src/application/CMakeLists.txt index bf122a66..64415be3 100644 --- a/src/application/CMakeLists.txt +++ b/src/application/CMakeLists.txt @@ -102,10 +102,9 @@ if(ANDROID) endif() if(UNIX) -    set(MUPDF_OUTPUT_DIR "${PROJECT_SOURCE_DIR}/libs/mupdf/build/$<IF:$<CONFIG:Debug>,shared-debug,shared-release>") +    set(MUPDF_OUTPUT_DIR "@nixMupdfLibPath@") set(MUPDF_OUTPUT "${MUPDF_OUTPUT_DIR}/libmupdfcpp.so") set(MUPDF_OUTPUT "${MUPDF_OUTPUT_DIR}/libmupdfcpp.so" PARENT_SCOPE) -    set(MUPDF_BUILD_COMMAND ./scripts/mupdfwrap.py ${VENV_OPTION} -d build/$<IF:$<CONFIG:Debug>,shared-debug,shared-release> -b --m-target libs ${EXTRA_MAKE_AGRS} -j 0 m01) elseif(WIN32) set(MUPDF_OUTPUT_DIR "${PROJECT_SOURCE_DIR}/libs/mupdf/platform/win32/x64/$<IF:$<CONFIG:Debug>,Debug,Release>") set(MUPDF_OUTPUT "${MUPDF_OUTPUT_DIR}/mupdfcpp64.lib" PARENT_SCOPE) @@ -113,8 +112,6 @@ elseif(WIN32) set(MUPDF_BUILD_COMMAND python scripts/mupdfwrap.py ${VENV_OPTION} -d build/$<IF:$<CONFIG:Debug>,shared-debug,shared-release> -b -j 0 m01) endif() -message("MuPdf build command: " ${MUPDF_BUILD_COMMAND}) - set(CC_COMMAND "${CMAKE_C_COMPILER}") set(CXX_COMMAND "${CMAKE_CXX_COMPILER}") @@ -135,18 +132,6 @@ else() endif() -add_custom_target(mupdf -   COMMAND ${CMAKE_COMMAND} -E env -        ${ANDROID_COMPILERS} -        "USE_SYSTEM_LIBJPEG=${USE_SYSTEM_LIBJPEG_VALUE}" -        "USE_SONAME=no" -        ${MUPDF_BUILD_COMMAND} -   BYPRODUCTS ${MUPDF_OUTPUT} -   WORKING_DIRECTORY ${PROJECT_SOURCE_DIR}/libs/mupdf -   COMMENT "Building mupdf (This takes a while) ..." -) - - #Copy the mupdf dlls to the build directory for windows if(WIN32) add_custom_command( @@ -168,8 +153,6 @@ add_library(application interfaces/utility/i_book_getter.hpp ) -add_dependencies(application mupdf) # Ensure the mupdf target is built before the application target - target_compile_definitions(application PRIVATE APPLICATION_LIBRARY) target_include_directories(application @@ -188,12 +171,6 @@ target_include_directories(application ${CMAKE_CURRENT_SOURCE_DIR}/core/utils ) -# Make sure to ignore warnings from mupdf by adding it as a system include directory -target_include_directories(application SYSTEM PUBLIC -                    ${PROJECT_SOURCE_DIR}/libs/mupdf/platform/c++/include -                    ${PROJECT_SOURCE_DIR}/libs/mupdf/include -) - target_compile_definitions(application PRIVATE $<$<OR:$<CONFIG:Debug>,$<CONFIG:RelWithDebInfo>>:QT_QML_DEBUG> @@ -236,29 +213,10 @@ if(LINUX) install(TARGETS application DESTINATION lib ) - -    # Install mupdf's shared libraries -    install(FILES ${MUPDF_OUTPUT_DIR}/libmupdfcpp.so -                  ${MUPDF_OUTPUT_DIR}/libmupdf.so -            DESTINATION lib) - -    # Install links with correct permissions -    if(EXISTS "${MUPDF_OUTPUT_DIR}/libmupdfcpp.so.24.0") -        install(FILES ${MUPDF_OUTPUT_DIR}/libmupdfcpp.so.24.0 -                      ${MUPDF_OUTPUT_DIR}/libmupdf.so.24.0 -                PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE -                            GROUP_READ GROUP_EXECUTE -                            WORLD_READ WORLD_EXECUTE -                DESTINATION lib) -    endif() elseif(APPLE) install(TARGETS application DESTINATION lib ) -    # Install mupdf's shared libraries -    install(FILES ${MUPDF_OUTPUT_DIR}/libmupdfcpp.so -                  ${MUPDF_OUTPUT_DIR}/libmupdf.dylib -            DESTINATION lib) endif() </ins>