3
0
Fork 0
forked from mirrors/nixpkgs
nixpkgs/pkgs/development/tools/slimerjs/default.nix

40 lines
1.1 KiB
Nix
Raw Normal View History

2021-12-21 11:39:38 +00:00
{ lib, stdenv, fetchFromGitHub, zip, unzip, firefox, bash }:
stdenv.mkDerivation rec {
pname = "slimerjs";
version = "1.0.0";
src = fetchFromGitHub {
2017-03-13 07:23:19 +00:00
owner = "laurentj";
2021-12-21 11:39:38 +00:00
repo = "slimerjs";
sha256 = "sha256-RHd9PqcSkO9FYi5x+09TN7c4fKGf5pCPXjoCUXZ2mvA=";
2019-09-09 00:38:31 +01:00
rev = version;
};
2021-12-21 11:39:38 +00:00
buildInputs = [ zip ];
nativeBuildInputs = [ unzip ];
2021-12-21 11:39:38 +00:00
preConfigure = ''
test -d src && cd src
test -f omni.ja || zip omni.ja -r */
'';
2021-12-21 11:39:38 +00:00
installPhase = ''
mkdir -p "$out"/{bin,share/doc/slimerjs,lib/slimerjs}
cp LICENSE README* "$out/share/doc/slimerjs"
cp -r * "$out/lib/slimerjs"
echo '#!${bash}/bin/bash' >> "$out/bin/slimerjs"
echo 'export SLIMERJSLAUNCHER=${firefox}/bin/firefox' >> "$out/bin/slimerjs"
echo "'$out/lib/slimerjs/slimerjs' \"\$@\"" >> "$out/bin/slimerjs"
chmod a+x "$out/bin/slimerjs"
2016-09-26 14:41:54 +01:00
sed -e 's@MaxVersion=[3456][0-9][.]@MaxVersion=99.@' -i "$out/lib/slimerjs/application.ini"
'';
2021-12-21 11:39:38 +00:00
meta = with lib; {
description = "Gecko-based programmatically-driven browser";
2021-12-21 11:39:38 +00:00
license = licenses.mpl20;
maintainers = with maintainers; [ raskin ];
platforms = platforms.linux;
};
}