Merge pull request #63040 from worldofpeace/brave

brave: 0.61.50 -> 0.65.118
This commit is contained in:
worldofpeace 2019-06-15 21:10:20 -04:00 committed by GitHub
commit 72291fb668
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -14,6 +14,7 @@
, glib , glib
, gnome2 , gnome2
, gnome3 , gnome3
, gsettings-desktop-schemas
, gtk3 , gtk3
, libuuid , libuuid
, libX11 , libX11
@ -37,114 +38,118 @@
, wrapGAppsHook , wrapGAppsHook
}: }:
let rpath = lib.makeLibraryPath [ let
alsaLib
at-spi2-atk rpath = lib.makeLibraryPath [
at-spi2-core alsaLib
atk at-spi2-atk
cairo at-spi2-core
cups atk
dbus cairo
expat cups
fontconfig dbus
freetype expat
gdk_pixbuf fontconfig
glib freetype
gnome2.GConf gdk_pixbuf
gtk3 glib
libX11 gnome2.GConf
libXScrnSaver gtk3
libXcomposite libX11
libXcursor libXScrnSaver
libXdamage libXcomposite
libXext libXcursor
libXfixes libXdamage
libXi libXext
libXrandr libXfixes
libXrender libXi
libXtst libXrandr
libuuid libXrender
nspr libXtst
nss libuuid
pango nspr
udev nss
xdg_utils pango
xorg.libxcb udev
zlib xdg_utils
xorg.libxcb
zlib
]; ];
in
in stdenv.mkDerivation rec { stdenv.mkDerivation rec {
pname = "brave"; pname = "brave";
version = "0.61.50"; version = "0.65.118";
src = fetchurl { src = fetchurl {
url = "https://github.com/brave/brave-browser/releases/download/v${version}/brave-browser_${version}_amd64.deb"; url = "https://github.com/brave/brave-browser/releases/download/v${version}/brave-browser_${version}_amd64.deb";
sha256 = "1lbajxnxqkd422rckfjm65pwwzl66v7anq4jrzxi29d5x7abl3c1"; sha256 = "13bihzf4yfgn01nrw780swhmcdh8gq71jqilhbi04jn1h1pbm3wg";
}; };
dontConfigure = true; dontConfigure = true;
dontBuild = true; dontBuild = true;
dontPatchELF = true; dontPatchELF = true;
nativeBuildInputs = [ dpkg wrapGAppsHook ]; nativeBuildInputs = [ dpkg wrapGAppsHook ];
buildInputs = [ glib gnome3.gsettings_desktop_schemas gnome3.adwaita-icon-theme ]; buildInputs = [ glib gsettings-desktop-schemas gnome3.adwaita-icon-theme ];
unpackPhase = "dpkg-deb --fsys-tarfile $src | tar -x --no-same-permissions --no-same-owner"; unpackPhase = "dpkg-deb --fsys-tarfile $src | tar -x --no-same-permissions --no-same-owner";
installPhase = '' installPhase = ''
mkdir -p $out $out/bin mkdir -p $out $out/bin
cp -R usr/share $out cp -R usr/share $out
cp -R opt/ $out/opt cp -R opt/ $out/opt
export BINARYWRAPPER=$out/opt/brave.com/brave/brave-browser export BINARYWRAPPER=$out/opt/brave.com/brave/brave-browser
# Fix path to bash in $BINARYWRAPPER # Fix path to bash in $BINARYWRAPPER
substituteInPlace $BINARYWRAPPER \ substituteInPlace $BINARYWRAPPER \
--replace /bin/bash ${stdenv.shell} --replace /bin/bash ${stdenv.shell}
ln -sf $BINARYWRAPPER $out/bin/brave ln -sf $BINARYWRAPPER $out/bin/brave
patchelf \ patchelf \
--set-interpreter "$(cat $NIX_CC/nix-support/dynamic-linker)" \ --set-interpreter "$(cat $NIX_CC/nix-support/dynamic-linker)" \
--set-rpath "${rpath}" $out/opt/brave.com/brave/brave --set-rpath "${rpath}" $out/opt/brave.com/brave/brave
# Fix paths # Fix paths
substituteInPlace $out/share/applications/brave-browser.desktop \ substituteInPlace $out/share/applications/brave-browser.desktop \
--replace /usr/bin/brave-browser $out/bin/brave --replace /usr/bin/brave-browser $out/bin/brave
substituteInPlace $out/share/gnome-control-center/default-apps/brave-browser.xml \ substituteInPlace $out/share/gnome-control-center/default-apps/brave-browser.xml \
--replace /opt/brave.com $out/opt/brave.com --replace /opt/brave.com $out/opt/brave.com
substituteInPlace $out/share/menu/brave-browser.menu \ substituteInPlace $out/share/menu/brave-browser.menu \
--replace /opt/brave.com $out/opt/brave.com --replace /opt/brave.com $out/opt/brave.com
substituteInPlace $out/opt/brave.com/brave/default-app-block \ substituteInPlace $out/opt/brave.com/brave/default-app-block \
--replace /opt/brave.com $out/opt/brave.com --replace /opt/brave.com $out/opt/brave.com
# Correct icons location # Correct icons location
icon_sizes=("16" "22" "24" "32" "48" "64" "128" "256") icon_sizes=("16" "22" "24" "32" "48" "64" "128" "256")
for icon in ''${icon_sizes[*]} for icon in ''${icon_sizes[*]}
do do
mkdir -p $out/share/icons/hicolor/$icon\x$icon/apps mkdir -p $out/share/icons/hicolor/$icon\x$icon/apps
ln -s $out/opt/brave.com/brave/product_logo_$icon.png $out/share/icons/hicolor/$icon\x$icon/apps/brave-browser.png ln -s $out/opt/brave.com/brave/product_logo_$icon.png $out/share/icons/hicolor/$icon\x$icon/apps/brave-browser.png
done done
# Replace xdg-settings and xdg-mime # Replace xdg-settings and xdg-mime
ln -sf ${xdg_utils}/bin/xdg-settings $out/opt/brave.com/brave/xdg-settings ln -sf ${xdg_utils}/bin/xdg-settings $out/opt/brave.com/brave/xdg-settings
ln -sf ${xdg_utils}/bin/xdg-mime $out/opt/brave.com/brave/xdg-mime ln -sf ${xdg_utils}/bin/xdg-mime $out/opt/brave.com/brave/xdg-mime
'';
meta = with stdenv.lib; {
homepage = "https://brave.com/";
description = "Privacy-oriented browser for Desktop and Laptop computers";
changelog = "https://github.com/brave/brave-browser/blob/v${version}/CHANGELOG.md";
longDescription = ''
Brave browser blocks the ads and trackers that slow you down,
chew up your bandwidth, and invade your privacy. Brave lets you
contribute to your favorite creators automatically.
''; '';
license = licenses.mpl20;
meta = with stdenv.lib; { maintainers = [ maintainers.uskudnik ];
homepage = "https://brave.com/"; platforms = [ "x86_64-linux" ];
description = "Privacy-oriented browser for Desktop and Laptop computers"; };
longDescription = ''
Brave browser blocks the ads and trackers that slow you down,
chew up your bandwidth, and invade your privacy. Brave lets you
contribute to your favorite creators automatically.
'';
license = licenses.mpl20;
maintainers = [ maintainers.uskudnik ];
platforms = [ "x86_64-linux" ];
};
} }