nixpkgs mirror (for testing)
github.com/NixOS/nixpkgs
nix
1{
2 lib,
3 stdenv,
4 fetchFromGitHub,
5 pkg-config,
6 desktop-file-utils,
7 appstream-glib,
8 gjs,
9 glib,
10 gobject-introspection,
11 gtk4,
12 libadwaita,
13 libportal,
14 meson,
15 ninja,
16 wrapGAppsHook4,
17 nix-update-script,
18}:
19
20stdenv.mkDerivation (finalAttrs: {
21 pname = "bella";
22 version = "0.1.7";
23
24 src = fetchFromGitHub {
25 owner = "josephmawa";
26 repo = "Bella";
27 tag = "v${finalAttrs.version}";
28 hash = "sha256-ePzDnaoGPa5Hku7Rpced989QB6uOXN/jfXgTwtlE7rQ=";
29 };
30
31 strictDeps = true;
32
33 nativeBuildInputs = [
34 pkg-config
35 desktop-file-utils # `desktop-file-validate`, `update-desktop-database`
36 appstream-glib # `appstream-util`
37 gjs
38 glib # `glib-compile-schemas`
39 gobject-introspection
40 gtk4 # `gtk4-update-icon-cache`
41 meson
42 ninja
43 wrapGAppsHook4
44 ];
45
46 buildInputs = [
47 libadwaita
48 libportal
49 ];
50
51 # GJS uses argv[0] to find gresource files, and wrappers will cause that mechanism to fail.
52 # Manually overriding the entrypoint name should do the job.
53 #
54 # - https://gitlab.gnome.org/GNOME/gjs/-/blob/6aca7b50785fa1638f144b17060870d721e3f65a/modules/script/package.js#L159
55 # - https://gitlab.gnome.org/GNOME/gjs/-/blob/6aca7b50785fa1638f144b17060870d721e3f65a/modules/script/package.js#L37
56 preFixup = ''
57 sed -i "1 a imports.package._findEffectiveEntryPointName = () => 'io.github.josephmawa.Bella';" $out/bin/io.github.josephmawa.Bella
58 '';
59
60 passthru.updateScript = nix-update-script { };
61
62 meta = {
63 description = "Simple eye dropper and color picker";
64 homepage = "https://github.com/josephmawa/Bella";
65 license = lib.licenses.gpl3Only;
66 maintainers = with lib.maintainers; [ pluiedev ];
67 mainProgram = "io.github.josephmawa.Bella";
68 platforms = lib.lists.intersectLists lib.platforms.linux gjs.meta.platforms;
69 };
70})