diff options
author | Nicolas B. Pierron <nicolas.b.pierron@nbp.name> | 2018-08-21 11:58:56 +0200 |
---|---|---|
committer | Nicolas B. Pierron <nicolas.b.pierron@gmail.com> | 2018-08-28 18:15:19 +0200 |
commit | 9c40b54e39de43273f0e70b043b317e42495d7d2 (patch) | |
tree | bcb36ae2e6c0a39df33c12ceedb7edbeb4a4282e | |
parent | 65ef92a7f9f1d5bff6be1d4dc86f1cd25c09a004 (diff) | |
download | nixlib-9c40b54e39de43273f0e70b043b317e42495d7d2.tar nixlib-9c40b54e39de43273f0e70b043b317e42495d7d2.tar.gz nixlib-9c40b54e39de43273f0e70b043b317e42495d7d2.tar.bz2 nixlib-9c40b54e39de43273f0e70b043b317e42495d7d2.tar.lz nixlib-9c40b54e39de43273f0e70b043b317e42495d7d2.tar.xz nixlib-9c40b54e39de43273f0e70b043b317e42495d7d2.tar.zst nixlib-9c40b54e39de43273f0e70b043b317e42495d7d2.zip |
Add nodejs and cbindgen dependency for building Firefox.
-rw-r--r-- | firefox-overlay.nix | 7 | ||||
-rw-r--r-- | pkgs/cbindgen/default.nix | 25 | ||||
-rw-r--r-- | pkgs/gecko/default.nix | 8 |
3 files changed, 40 insertions, 0 deletions
diff --git a/firefox-overlay.nix b/firefox-overlay.nix index bdabbb68918d..1c0612a0f213 100644 --- a/firefox-overlay.nix +++ b/firefox-overlay.nix @@ -153,6 +153,9 @@ in gecko = super.callPackage ./pkgs/gecko { inherit (self.python35Packages) setuptools; pythonFull = self.python35Full; + nodejs = + if builtins.compareVersions self.nodejs.name "nodejs-8.11.3" < 0 + then self.nodejs-8_x else self.nodejs; # Due to std::ascii::AsciiExt changes in 1.23, Gecko does not compile, so # use the latest Rust version before 1.23. @@ -163,4 +166,8 @@ in # Set of packages which are frozen at this given revision of nixpkgs-mozilla. firefox-nightly-bin = super.callPackage ./pkgs/firefox-nightly-bin/default.nix { }; + + # Use rust-cbindgen imported from Nixpkgs (August 2018) unless the current + # version of Nixpkgs already packages a version of rust-cbindgen. + rust-cbindgen = super.rust-cbindgen or super.callPackage ./pkgs/cbindgen { }; } diff --git a/pkgs/cbindgen/default.nix b/pkgs/cbindgen/default.nix new file mode 100644 index 000000000000..63a32de67399 --- /dev/null +++ b/pkgs/cbindgen/default.nix @@ -0,0 +1,25 @@ +### NOTE: This file is imported from Nixpkgs repository (August 2018) +### It is used as a fallback when rust-cbindgen is not provided by the +### current version of Nixpkgs. +{ stdenv, fetchFromGitHub, rustPlatform }: + +rustPlatform.buildRustPackage rec { + name = "rust-cbindgen-${version}"; + version = "0.6.1"; + + src = fetchFromGitHub { + owner = "eqrion"; + repo = "cbindgen"; + rev = "v${version}"; + sha256 = "03qzqy3indqghqy7rnli1zrrlnyfkygxjpb2s7041cik54kf2krw"; + }; + + cargoSha256 = "0c3xpzff8jldqbn5a25yy6c2hlz5xy636ml6sj5d24wzcgwg5a2i"; + + meta = with stdenv.lib; { + description = "A project for generating C bindings from Rust code"; + homepage = https://github.com/eqrion/cbindgen; + license = licenses.mpl20; + maintainers = with maintainers; [ jtojnar ]; + }; +} diff --git a/pkgs/gecko/default.nix b/pkgs/gecko/default.nix index d0ba4206fff7..6db9e1f1fe14 100644 --- a/pkgs/gecko/default.nix +++ b/pkgs/gecko/default.nix @@ -13,6 +13,8 @@ , ccache , zlib, xorg +, rust-cbindgen +, nodejs }: let @@ -82,6 +84,12 @@ let # Useful for getting notification at the end of the build. libnotify + # cbindgen is used to generate C bindings for WebRender. + rust-cbindgen + + # NodeJS is used for tooling around JS development. + nodejs + ] ++ optionals inNixShell [ valgrind gdb rr ccache ]; |