2023-07-15 17:15:38 +00:00
|
|
|
{ lib
|
|
|
|
, bash
|
|
|
|
, fetchFromGitHub
|
|
|
|
, firefox
|
|
|
|
, strip-nondeterminism
|
|
|
|
, stdenv
|
|
|
|
, unzip
|
|
|
|
, zip
|
|
|
|
}:
|
2021-12-24 04:21:11 +00:00
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
|
|
|
pname = "slimerjs";
|
|
|
|
version = "1.0.0";
|
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
2020-04-24 23:36:52 +00:00
|
|
|
owner = "laurentj";
|
2021-12-24 04:21:11 +00:00
|
|
|
repo = "slimerjs";
|
|
|
|
sha256 = "sha256-RHd9PqcSkO9FYi5x+09TN7c4fKGf5pCPXjoCUXZ2mvA=";
|
2020-04-24 23:36:52 +00:00
|
|
|
rev = version;
|
|
|
|
};
|
2021-12-24 04:21:11 +00:00
|
|
|
|
2021-03-19 17:17:44 +00:00
|
|
|
buildInputs = [ zip ];
|
2023-07-15 17:15:38 +00:00
|
|
|
nativeBuildInputs = [
|
|
|
|
strip-nondeterminism
|
|
|
|
unzip
|
|
|
|
];
|
2021-12-24 04:21:11 +00:00
|
|
|
|
2020-04-24 23:36:52 +00:00
|
|
|
preConfigure = ''
|
|
|
|
test -d src && cd src
|
|
|
|
test -f omni.ja || zip omni.ja -r */
|
|
|
|
'';
|
2021-12-24 04:21:11 +00:00
|
|
|
|
2020-04-24 23:36:52 +00:00
|
|
|
installPhase = ''
|
2023-07-15 17:15:38 +00:00
|
|
|
strip-nondeterminism --type zip omni.ja
|
2020-04-24 23:36:52 +00:00
|
|
|
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"
|
|
|
|
sed -e 's@MaxVersion=[3456][0-9][.]@MaxVersion=99.@' -i "$out/lib/slimerjs/application.ini"
|
|
|
|
'';
|
2021-12-24 04:21:11 +00:00
|
|
|
|
|
|
|
meta = with lib; {
|
2021-02-05 17:12:51 +00:00
|
|
|
description = "Gecko-based programmatically-driven browser";
|
2024-04-21 15:54:59 +00:00
|
|
|
mainProgram = "slimerjs";
|
2021-12-24 04:21:11 +00:00
|
|
|
license = licenses.mpl20;
|
|
|
|
maintainers = with maintainers; [ raskin ];
|
|
|
|
platforms = platforms.linux;
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
}
|