2023-06-10 03:51:44 +00:00
|
|
|
{ lib
|
|
|
|
, bash
|
|
|
|
, fetchFromGitHub
|
|
|
|
, firefox
|
2023-06-10 04:17:58 +00:00
|
|
|
, strip-nondeterminism
|
2023-06-10 03:51:44 +00:00
|
|
|
, stdenv
|
|
|
|
, unzip
|
|
|
|
, zip
|
|
|
|
}:
|
2021-12-21 11:39:38 +00:00
|
|
|
|
|
|
|
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-08 23:38:31 +00:00
|
|
|
rev = version;
|
2013-10-20 20:30:11 +00:00
|
|
|
};
|
2021-12-21 11:39:38 +00:00
|
|
|
|
2021-02-20 21:01:53 +00:00
|
|
|
buildInputs = [ zip ];
|
2023-06-10 04:17:58 +00:00
|
|
|
nativeBuildInputs = [
|
|
|
|
strip-nondeterminism
|
|
|
|
unzip
|
|
|
|
];
|
2021-12-21 11:39:38 +00:00
|
|
|
|
2013-10-30 22:59:45 +00:00
|
|
|
preConfigure = ''
|
|
|
|
test -d src && cd src
|
|
|
|
test -f omni.ja || zip omni.ja -r */
|
|
|
|
'';
|
2021-12-21 11:39:38 +00:00
|
|
|
|
2013-10-20 20:30:11 +00:00
|
|
|
installPhase = ''
|
2023-06-10 04:17:58 +00:00
|
|
|
strip-nondeterminism --type zip omni.ja
|
2013-10-20 20:30:11 +00:00
|
|
|
mkdir -p "$out"/{bin,share/doc/slimerjs,lib/slimerjs}
|
|
|
|
cp LICENSE README* "$out/share/doc/slimerjs"
|
2013-10-30 22:59:45 +00:00
|
|
|
cp -r * "$out/lib/slimerjs"
|
2013-10-20 20:30:11 +00:00
|
|
|
echo '#!${bash}/bin/bash' >> "$out/bin/slimerjs"
|
2014-11-03 11:11:25 +00:00
|
|
|
echo 'export SLIMERJSLAUNCHER=${firefox}/bin/firefox' >> "$out/bin/slimerjs"
|
2013-10-20 20:30:11 +00:00
|
|
|
echo "'$out/lib/slimerjs/slimerjs' \"\$@\"" >> "$out/bin/slimerjs"
|
|
|
|
chmod a+x "$out/bin/slimerjs"
|
2016-09-26 13:41:54 +00:00
|
|
|
sed -e 's@MaxVersion=[3456][0-9][.]@MaxVersion=99.@' -i "$out/lib/slimerjs/application.ini"
|
2013-10-20 20:30:11 +00:00
|
|
|
'';
|
2021-12-21 11:39:38 +00:00
|
|
|
|
|
|
|
meta = with lib; {
|
2021-01-24 09:19:10 +00:00
|
|
|
description = "Gecko-based programmatically-driven browser";
|
2021-12-21 11:39:38 +00:00
|
|
|
license = licenses.mpl20;
|
|
|
|
maintainers = with maintainers; [ raskin ];
|
|
|
|
platforms = platforms.linux;
|
2013-10-20 20:30:11 +00:00
|
|
|
};
|
|
|
|
}
|