3
0
Fork 0
forked from mirrors/nixpkgs
nixpkgs/pkgs/applications/networking/browsers/webbrowser/default.nix
Jonathan Ringer 9bb3fccb5b treewide: pkgs.pkgconfig -> pkgs.pkg-config, move pkgconfig to alias.nix
continuation of #109595

pkgconfig was aliased in 2018, however, it remained in
all-packages.nix due to its wide usage. This cleans
up the remaining references to pkgs.pkgsconfig and
moves the entry to aliases.nix.

python3Packages.pkgconfig remained unchanged because
it's the canonical name of the upstream package
on pypi.
2021-01-19 01:16:25 -08:00

110 lines
3.1 KiB
Nix

{ stdenv, lib, fetchgit, makeDesktopItem, pkg-config, makeWrapper
# Build
, python2, autoconf213, yasm, perl
, unzip, gnome2, gnum4
# Runtime
, xorg, zip, freetype, fontconfig, glibc, libffi
, dbus, dbus-glib, gtk2, alsaLib, jack2, ffmpeg
}:
let
libPath = lib.makeLibraryPath [ ffmpeg ];
in stdenv.mkDerivation rec {
pname = "webbrowser";
version = "29.0.0rc1";
src = fetchgit {
url = "https://git.nuegia.net/webbrowser.git";
rev = version;
sha256 = "1d82943mla6q3257081d946kgms91dg0n93va3zlzm9hbbqilzm6";
fetchSubmodules = true;
};
desktopItem = makeDesktopItem {
name = "webbrowser";
exec = "webbrowser %U";
icon = "webbrowser";
desktopName = "Web Browser";
genericName = "Web Browser";
categories = "Network;WebBrowser;";
mimeType = lib.concatStringsSep ";" [
"text/html"
"text/xml"
"application/xhtml+xml"
"application/vnd.mozilla.xul+xml"
"x-scheme-handler/http"
"x-scheme-handler/https"
];
};
nativeBuildInputs = [
gnum4 makeWrapper perl pkg-config python2
];
buildInputs = [
alsaLib dbus dbus-glib ffmpeg fontconfig freetype yasm zip jack2 gtk2
unzip gnome2.GConf xorg.libXt
];
enableParallelBuilding = true;
configurePhase = ''
export MOZCONFIG=$PWD/.mozconfig
export MOZ_NOSPAM=1
cp $src/doc/mozconfig.example $MOZCONFIG
# Need to modify it
chmod 644 $MOZCONFIG
substituteInPlace $MOZCONFIG \
--replace "mk_add_options PYTHON=/usr/bin/python2" "mk_add_options PYTHON=${python2}/bin/python2" \
--replace "mk_add_options AUTOCONF=/usr/bin/autoconf-2.13" "mk_add_options AUTOCONF=${autoconf213}/bin/autoconf" \
--replace 'mk_add_options MOZ_OBJDIR=$HOME/build/wbobjects/' "" \
--replace "ac_add_options --x-libraries=/usr/lib64" "ac_add_options --x-libraries=${lib.makeLibraryPath [ xorg.libX11 ]}" \
--replace "_BUILD_64=1" "_BUILD_64=${lib.optionalString stdenv.hostPlatform.is64bit "1"}" \
--replace "--enable-ccache" "--disable-ccache"
echo >> $MOZCONFIG '
#
# NixOS-specific adjustments
#
ac_add_options --prefix=$out
mk_add_options MOZ_MAKE_FLAGS="-j$NIX_BUILD_CORES"
'
'';
buildPhase = "$src/mach build";
installPhase = ''
$src/mach install
mkdir -p $out/share/applications
cp ${desktopItem}/share/applications/* $out/share/applications
for n in 16 32 48; do
size=$n"x"$n
mkdir -p $out/share/icons/hicolor/$size/apps
cp $src/webbrowser/branding/unofficial/default$n.png \
$out/share/icons/hicolor/$size/apps/webbrowser.png
done
# Needed to make videos work
wrapProgram $out/lib/webbrowser-${version}/webbrowser \
--prefix LD_LIBRARY_PATH : "${libPath}"
'';
meta = with lib; {
description = "Generic web browser without trackers compatible with XUL plugins using UXP rendering engine";
homepage = "https://git.nuegia.net/webbrowser.git/";
license = [ licenses.mpl20 licenses.gpl3 ];
maintainers = with maintainers; [ TheBrainScrambler ];
platforms = [ "i686-linux" "x86_64-linux" ];
broken = true; # 2021-01-07
};
}