nixpkgs mirror (for testing)
github.com/NixOS/nixpkgs
nix
1{
2 cargo,
3 desktop-file-utils,
4 fetchFromGitLab,
5 gettext,
6 glib,
7 gtk4,
8 gtksourceview5,
9 lib,
10 libadwaita,
11 meson,
12 ninja,
13 pkg-config,
14 poppler,
15 rustPlatform,
16 rustc,
17 stdenv,
18 testers,
19 wrapGAppsHook4,
20 clippy,
21 nix-update-script,
22}:
23
24stdenv.mkDerivation (finalAttrs: {
25 pname = "citations";
26 version = "0.9.0";
27
28 src = fetchFromGitLab {
29 domain = "gitlab.gnome.org";
30 owner = "World";
31 repo = "citations";
32 rev = finalAttrs.version;
33 hash = "sha256-oWRBJvf7EimxIwdsr11vsN5605nZ4p4LQ1tzx/ZiCrg=";
34 };
35
36 cargoDeps = rustPlatform.fetchCargoVendor {
37 src = finalAttrs.src;
38 hash = "sha256-FCrrZ9efzTsYleOzaBVjLpC+shgwLnvHfpJmWXF80DI=";
39 };
40
41 nativeBuildInputs = [
42 desktop-file-utils
43 gettext
44 glib
45 meson
46 ninja
47 pkg-config
48 rustPlatform.cargoSetupHook
49 cargo
50 rustc
51 wrapGAppsHook4
52 ];
53
54 buildInputs = [
55 glib
56 gtk4
57 gtksourceview5
58 libadwaita
59 poppler
60 ];
61
62 env.NIX_CFLAGS_COMPILE = lib.optionalString stdenv.cc.isClang (
63 lib.concatStringsSep " " [
64 "-Wno-typedef-redefinition"
65 "-Wno-unused-parameter"
66 "-Wno-missing-field-initializers"
67 "-Wno-incompatible-function-pointer-types"
68 ]
69 );
70
71 doCheck = true;
72
73 nativeCheckInputs = [ clippy ];
74
75 preCheck = ''
76 sed -i -e '/PATH=/d' ../src/meson.build
77 '';
78
79 passthru = {
80 tests.version = testers.testVersion {
81 package = finalAttrs.finalPackage;
82 command = "citations --help";
83 };
84
85 updateScript = nix-update-script { };
86 };
87
88 meta = {
89 description = "Manage your bibliographies using the BibTeX format";
90 homepage = "https://apps.gnome.org/app/org.gnome.World.Citations";
91 license = lib.licenses.gpl3Plus;
92 maintainers = with lib.maintainers; [ benediktbroich ];
93 teams = [ lib.teams.gnome-circle ];
94 platforms = lib.platforms.unix;
95 mainProgram = "citations";
96 };
97})