nixpkgs mirror (for testing)
github.com/NixOS/nixpkgs
nix
1{
2 lib,
3 rustPlatform,
4 fetchFromGitHub,
5 pkg-config,
6 wrapGAppsHook3,
7 atk,
8 cairo,
9 gdk-pixbuf,
10 glib,
11 gtk3,
12 pango,
13}:
14
15rustPlatform.buildRustPackage rec {
16 pname = "browsers";
17 version = "0.7.0";
18
19 src = fetchFromGitHub {
20 owner = "Browsers-software";
21 repo = "browsers";
22 tag = version;
23 hash = "sha256-s03BEscaYdSitLtlqbX/tgGSLRHuXc9Ht+3RMCUIdY8=";
24 };
25
26 cargoHash = "sha256-tz4ju0NwgG5yb1VndYqyf+g631izPl904KYDUvawO28=";
27
28 nativeBuildInputs = [
29 pkg-config
30 wrapGAppsHook3
31 ];
32
33 buildInputs = [
34 atk
35 cairo
36 gdk-pixbuf
37 glib
38 gtk3
39 pango
40 ];
41
42 postInstall = ''
43 install -m 444 \
44 -D extra/linux/dist/software.Browsers.template.desktop \
45 -t $out/share/applications
46 mv $out/share/applications/software.Browsers.template.desktop $out/share/applications/software.Browsers.desktop
47 substituteInPlace \
48 $out/share/applications/software.Browsers.desktop \
49 --replace-fail 'Exec=€ExecCommand€' 'Exec=${pname} %u'
50 cp -r resources $out
51 for size in 16 32 128 256 512; do
52 install -m 444 \
53 -D resources/icons/"$size"x"$size"/software.Browsers.png \
54 -t $out/share/icons/hicolor/"$size"x"$size"/apps
55 done
56 '';
57
58 meta = {
59 description = "Open the right browser at the right time";
60 homepage = "https://browsers.software";
61 changelog = "https://github.com/Browsers-software/browsers/blob/${src.rev}/CHANGELOG.md";
62 license = lib.licenses.mit;
63 maintainers = with lib.maintainers; [ ravenz46 ];
64 mainProgram = "browsers";
65 };
66}