summaryrefslogtreecommitdiff
path: root/default.nix
blob: 840513b4dc384f247d40eea4f3bb3448bd1e5785 (plain)
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
with import <nixpkgs> {};

stdenv.mkDerivation {
  name = "noscript.xpi";

  src = ./.;

  nativeBuildInputs = [
    bash
    (perl.withPackages (p: with p; [
      LWP RegexpCommon RegexpAssemble
      ListMoreUtils
    ]))
    which
    git
    nodePackages.web-ext

    # pretend we have curl, but rely on vendored PSL instead
    (writeShellScriptBin "curl" "")
  ];

  patchPhase = ''
    chmod +x build.sh TLD/generate.sh TLD/generate.pl html5_events/html5_events.pl
    patchShebangs .
  '';

  buildPhase = ''
    export HOME=$PWD
    git config --global user.email "you@example.com"
    git config --global user.name "Your Name"

    ./build.sh
  '';

  installPhase = ''
    cp xpi/*.xpi $out
  '';
}