-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathdefault.nix
181 lines (169 loc) · 3.38 KB
/
default.nix
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
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
{
lib,
libGL,
libGLU,
libevent,
libffi,
libjpeg,
libpng,
libstartup_notification,
libvpx,
libwebp,
fetchzip,
stdenv,
fontconfig,
libxkbcommon,
zlib,
freetype,
gtk3,
libxml2,
dbus,
xcb-util-cursor,
alsa-lib,
libpulseaudio,
pango,
atk,
cairo,
gdk-pixbuf,
glib,
udev,
libva,
mesa,
libnotify,
cups,
pciutils,
ffmpeg,
libglvnd,
pipewire,
speechd,
libxcb,
libX11,
libXcursor,
libXrandr,
libXi,
libXext,
libXcomposite,
libXdamage,
libXfixes,
libXScrnSaver,
makeWrapper,
copyDesktopItems,
wrapGAppsHook,
}:
stdenv.mkDerivation (finalAttrs: {
pname = "zen-browser";
version = "1.7.2b";
src = let
repo = "https://github.com/zen-browser/desktop";
archive = {
name = "zen";
extension = "tar.bz2";
fullname = "${archive.name}.linux-x86_64.${archive.extension}";
};
url = lib.strings.concatStringsSep "/" [
repo
"releases/download"
finalAttrs.version
archive.fullname
];
in
fetchzip {
inherit url;
inherit (archive) extension;
hash = "sha256-grjl6hzmq/WH4z3MygBEh5A+uFNHK8PSGPwC73llJcg=";
};
runtimeLibs = [
libGL
libGLU
libevent
libffi
libjpeg
libpng
libstartup_notification
libvpx
libwebp
stdenv.cc.cc
fontconfig
libxkbcommon
zlib
freetype
gtk3
libxml2
dbus
xcb-util-cursor
alsa-lib
libpulseaudio
pango
atk
cairo
gdk-pixbuf
glib
udev
libva
mesa
libnotify
cups
pciutils
ffmpeg
libglvnd
pipewire
speechd
libxcb
libX11
libXcursor
libXrandr
libXi
libXext
libXcomposite
libXdamage
libXfixes
libXScrnSaver
];
desktopSrc = ./.;
nativeBuildInputs = [
makeWrapper
copyDesktopItems
wrapGAppsHook
];
installPhase = ''
mkdir -p $out/{bin,opt/zen} && cp -r $src/* $out/opt/zen
ln -s $out/opt/zen/zen $out/bin/zen
install -D $desktopSrc/zen.desktop $out/share/applications/zen.desktop
for i in 16 32 48 64 128; do
install -Dm 644 $src/browser/chrome/icons/default/default$i.png \
$out/share/icons/hicolor/$ix$i/apps/zen.png
done
'';
fixupPhase = let
ld-lib-path = lib.makeLibraryPath finalAttrs.runtimeLibs;
in ''
chmod 755 $out/bin/zen $out/opt/zen/*
interpreter=$(cat $NIX_CC/nix-support/dynamic-linker)
for bin in zen zen-bin; do
patchelf --set-interpreter "$interpreter" $out/opt/zen/$bin
wrapProgram $out/opt/zen/$bin \
--set LD_LIBRARY_PATH "${ld-lib-path}" \
--set MOZ_LEGACY_PROFILES 1 \
--set MOZ_ALLOW_DOWNGRADE 1 \
--set MOZ_APP_LAUNCHER zen \
--prefix XDG_DATA_DIRS : "$GSETTINGS_SCHEMAS_PATH"
done;
for bin in glxtest updater vaapitest; do
patchelf --set-interpreter "$interpreter" $out/opt/zen/$bin
wrapProgram $out/opt/zen/$bin \
--set LD_LIBRARY_PATH "${ld-lib-path}"
done;
'';
meta = {
changelog = "https://zen-browser.app/release-notes/#${finalAttrs.version}";
homepage = "https://zen-browser.app/";
description = "Experience tranquillity while browsing the web without people tracking you";
license = lib.licenses.mit;
platforms = ["x86_64-linux"];
maintainers = with lib.maintainers; [
gurjaka
sigmanificient
];
mainProgram = "zen";
};
})