about summary refs log tree commit diff
path: root/nixpkgs/pkgs/applications/networking/browsers/nyxt/default.nix
blob: 6a990201c75d9a59a8ecc24094efd3fb88cd6952 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
{ stdenv, lib, sbclPackages
, makeWrapper, wrapGAppsHook, gst_all_1
, glib, gdk-pixbuf, cairo
, mailcap, pango, gtk3
, glib-networking, gsettings-desktop-schemas
, xclip, wl-clipboard, notify-osd, enchant
}:

stdenv.mkDerivation rec {
  pname = "nyxt";
  inherit (sbclPackages.nyxt) version;

  src = sbclPackages.nyxt;

  nativeBuildInputs = [ makeWrapper wrapGAppsHook ];
  gstBuildInputs = with gst_all_1; [
    gstreamer gst-libav
    gst-plugins-base
    gst-plugins-good
    gst-plugins-bad
    gst-plugins-ugly
  ];
  buildInputs = [
    glib gdk-pixbuf cairo
    mailcap pango gtk3
    glib-networking gsettings-desktop-schemas
    notify-osd enchant
  ] ++ gstBuildInputs;

  GST_PLUGIN_SYSTEM_PATH_1_0 = lib.makeSearchPathOutput "lib" "lib/gstreamer-1.0" gstBuildInputs;

  # The executable is already built in sbclPackages.nyxt, buildPhase tries to build using the makefile which we ignore
  dontBuild = true;

  dontWrapGApps = true;
  installPhase = ''
    mkdir -p $out/share/applications/
    sed "s/VERSION/$version/" $src/assets/nyxt.desktop > $out/share/applications/nyxt.desktop
    for i in 16 32 128 256 512; do
      mkdir -p "$out/share/icons/hicolor/''${i}x''${i}/apps/"
      cp -f $src/assets/nyxt_''${i}x''${i}.png "$out/share/icons/hicolor/''${i}x''${i}/apps/nyxt.png"
    done

    mkdir -p $out/bin && makeWrapper $src/bin/nyxt $out/bin/nyxt \
      --prefix PATH : ${lib.makeBinPath [ xclip wl-clipboard ]} \
      --prefix GST_PLUGIN_SYSTEM_PATH_1_0 : "${GST_PLUGIN_SYSTEM_PATH_1_0}" \
      --argv0 nyxt "''${gappsWrapperArgs[@]}"
  '';

  checkPhase = ''
    $out/bin/nyxt -h
  '';

  meta = with lib; {
    description = "Infinitely extensible web-browser (with Lisp development files using WebKitGTK platform port)";
    mainProgram = "nyxt";
    homepage = "https://nyxt.atlas.engineer";
    license = licenses.bsd3;
    maintainers = with maintainers; [ lewo dariof4 ];
    platforms = platforms.all;
  };
}