@@ -0,0 +1,108 @@
1+{ stdenv, lib, fetchurl,
2+ dpkg,
3+ alsaLib,
4+ at-spi2-atk,
5+ atk,
6+ cairo,
7+ cups,
8+ dbus,
9+ expat,
10+ fontconfig,
11+ freetype,
12+ gdk_pixbuf,
13+ glib,
14+ gnome2,
15+ gtk3,
16+ libuuid,
17+ libX11,
18+ libXcomposite,
19+ libXcursor,
20+ libXdamage,
21+ libXext,
22+ libXfixes,
23+ libXi,
24+ libXrandr,
25+ libXrender,
26+ libXScrnSaver,
27+ libXtst,
28+ nspr,
29+ nss,
30+ pango,
31+ udev,
32+ xorg,
33+ zlib
34+}:
35+
36+let rpath = lib.makeLibraryPath [
37+ alsaLib
38+ at-spi2-atk
39+ atk
40+ cairo
41+ cups
42+ dbus
43+ expat
44+ fontconfig
45+ freetype
46+ gdk_pixbuf
47+ glib
48+ gnome2.GConf
49+ gtk3
50+ libuuid
51+ libX11
52+ libXcomposite
53+ libXcursor
54+ libXdamage
55+ libXext
56+ libXfixes
57+ libXi
58+ libXrandr
59+ libXrender
60+ libXScrnSaver
61+ libXtst
62+ nspr
63+ nss
64+ pango
65+ udev
66+ xorg.libxcb
67+ zlib
68+];
69+
70+
71+in stdenv.mkDerivation rec {
72+ name = "brave";
73+ version = "0.25.2";
74+
75+ src = fetchurl {
76+ url = "https://github.com/brave/browser-laptop/releases/download/v${version}dev/brave_${version}_amd64.deb";
77+ sha256 = "1r3rsa6szps7mvvpqyw0mg16zn36x451dxq4nmn2l5ds5cp1f017";
78+ };
79+
80+ phases = [ "unpackPhase" "installPhase" ];
81+
82+ nativeBuildInputs = [ dpkg ];
83+
84+ unpackPhase = "dpkg-deb -x $src .";
85+
86+ installPhase = ''
87+ mkdir -p $out
88+
89+ cp -R usr/* $out
90+
91+ patchelf \
92+ --set-interpreter "$(cat $NIX_CC/nix-support/dynamic-linker)" \
93+ --set-rpath "${rpath}" $out/bin/brave
94+ '';
95+
96+ meta = with stdenv.lib; {
97+ homepage = "https://brave.com/";
98+ description = "Privacy-oriented browser for Desktop and Laptop computers";
99+ longDescription = ''
100+ Brave browser blocks the ads and trackers that slow you down,
101+ chew up your bandwidth, and invade your privacy. Brave lets you
102+ contribute to your favorite creators automatically.
103+ '';
104+ license = licenses.mpl20;
105+ maintainers = [ maintainers.uskudnik ];
106+ platforms = [ "x86_64-linux" ];
107+ };
108+}