24 , gobject-introspection
26 , gsettings-desktop-schemas
30 , withLibsecret ? true
31 , supportNautilus ? (!stdenv.hostPlatform.isDarwin)
38 stdenv.mkDerivation (finalAttrs: {
42 outputs = [ "out" "dev" "devdoc" ];
44 src = fetchFromGitLab {
45 domain = "gitlab.gnome.org";
46 owner = "GNOME/Incubator";
48 rev = finalAttrs.version;
49 hash = "sha256-T67d7xHK23CvmT8omEqNZrV5KloK4QXU973dtP9lTDE=";
52 cargoRoot = "shell-rs";
54 cargoDeps = rustPlatform.importCargoLock {
55 lockFile = ./Cargo.lock;
58 "cairo-rs-0.20.0" = "sha256-us8Q1cqHbs0wSfMcRgZx7wTqSagYkLv/aNI8Fle2nNk=";
59 "gdk4-0.9.0" = "sha256-a+fkiCilKbq7sBHZ9Uvq9a/qqbsVomxG6K07B5f4eYM=";
60 "libadwaita-0.7.0" = "sha256-gfkaj/BIqvWj1UNVAGNNXww4aoJPlqvBwIRGmDiv48E=";
76 rustPlatform.cargoSetupHook
80 dbus # only needed to find the service directory
86 gsettings-desktop-schemas
94 ] ++ lib.optionals withLibsecret [
96 ] ++ lib.optionals supportNautilus [
98 ] ++ lib.optionals stdenv.hostPlatform.isDarwin [
99 darwin.apple_sdk.frameworks.Foundation
104 ] ++ lib.optionals (!withLibsecret) [
106 ] ++ lib.optionals (!supportNautilus) [
110 env.NIX_CFLAGS_COMPILE = lib.optionalString (
111 stdenv.cc.isClang && lib.versionAtLeast stdenv.cc.version "16"
112 ) "-Wno-error=incompatible-function-pointer-types";
115 substituteInPlace $out/share/thumbnailers/papers.thumbnailer \
116 --replace-fail '=papers-thumbnailer' "=$out/bin/papers-thumbnailer"
121 --prefix XDG_DATA_DIRS : "${shared-mime-info}/share"
122 # Required to open multiple files.
123 # https://gitlab.gnome.org/GNOME/Incubator/papers/-/issues/176
124 --prefix PATH : "$out/bin"
126 '' + lib.optionalString stdenv.hostPlatform.isDarwin ''
127 install_name_tool -add_rpath "$out/lib" "$out/bin/papers"
131 # Cannot be in postInstall, otherwise _multioutDocs hook in preFixup will move right back.
132 moveToOutput "share/doc" "$devdoc"
136 homepage = "https://wiki.gnome.org/Apps/papers";
137 changelog = "https://gitlab.gnome.org/GNOME/Incubator/papers/-/blob/${finalAttrs.version}/NEWS?ref_type=tags";
138 description = "GNOME's document viewer";
141 papers is a document viewer for multiple document formats. It
142 currently supports PDF, PostScript, DjVu, and TIFF (not DVI anymore).
143 The goal of papers is to replace the evince document viewer that exist
144 on the GNOME Desktop with a more modern interface.
147 license = licenses.gpl2Plus;
148 platforms = platforms.unix;
149 mainProgram = "papers";
150 maintainers = teams.gnome.members;