111caaad53
This results in a new function called mkChromiumDerivation, which can be used to easily build packages that are based on the Chromium source tree. We pass through this function as mkDerivation in the chromium wrappre, so in the end if you want to create such a package, something like: chromium.mkDerivation (base: { name = "your-shiny-package-based-on-chromium"; ... }) will suffice. Of course, this is only the first step towards this functionality, because right now I'm not even sure the Chromium browser itself will build. Signed-off-by: aszlig <aszlig@redmoonstudios.org>
41 lines
1.3 KiB
Nix
41 lines
1.3 KiB
Nix
{ stdenv, mkChromiumDerivation }:
|
|
|
|
with stdenv.lib;
|
|
|
|
mkChromiumDerivation (base: rec {
|
|
name = "chromium-browser";
|
|
buildTargets = [ "chrome" ];
|
|
|
|
installPhase = ''
|
|
ensureDir "$libExecPath"
|
|
cp -v "$buildPath/"*.pak "$libExecPath/"
|
|
${optionalString (!versionOlder base.version "34.0.0.0") ''
|
|
cp -v "$buildPath/icudtl.dat" "$libExecPath/"
|
|
''}
|
|
cp -vR "$buildPath/locales" "$buildPath/resources" "$libExecPath/"
|
|
cp -v $buildPath/libffmpegsumo.so "$libExecPath/"
|
|
|
|
cp -v "$buildPath/chrome" "$libExecPath/$packageName"
|
|
|
|
mkdir -vp "$out/share/man/man1"
|
|
cp -v "$buildPath/chrome.1" "$out/share/man/man1/$packageName.1"
|
|
|
|
for icon_file in chrome/app/theme/chromium/product_logo_*[0-9].png; do
|
|
num_and_suffix="''${icon_file##*logo_}"
|
|
icon_size="''${num_and_suffix%.*}"
|
|
expr "$icon_size" : "^[0-9][0-9]*$" || continue
|
|
logo_output_prefix="$out/share/icons/hicolor"
|
|
logo_output_path="$logo_output_prefix/''${icon_size}x''${icon_size}/apps"
|
|
mkdir -vp "$logo_output_path"
|
|
cp -v "$icon_file" "$logo_output_path/$packageName.png"
|
|
done
|
|
'';
|
|
|
|
meta = {
|
|
description = "An open source web browser from Google";
|
|
homepage = http://www.chromium.org/;
|
|
maintainers = with maintainers; [ goibhniu chaoflow aszlig wizeman ];
|
|
license = licenses.bsd3;
|
|
platforms = platforms.linux;
|
|
};
|
|
})
|