Merge pull request #151551 from Stunkymonkey/slimerjs-refactor

slimerjs: refactor
This commit is contained in:
7c6f434c 2021-12-21 12:24:16 +00:00 committed by GitHub
commit 2b5a71e1ee
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 17 additions and 31 deletions

View File

@ -1,33 +1,24 @@
{lib, stdenv, fetchFromGitHub, zip, unzip, firefox, bash}: { lib, stdenv, fetchFromGitHub, zip, unzip, firefox, bash }:
let
s = # Generated upstream information stdenv.mkDerivation rec {
rec { pname = "slimerjs";
baseName="slimerjs"; version = "1.0.0";
version="1.0.0";
name="${baseName}-${version}"; src = fetchFromGitHub {
owner = "laurentj"; owner = "laurentj";
repo = baseName; repo = "slimerjs";
sha256="1w4sfrv520isbs7r1rlzl5y3idrpad7znw9fc92yz40jlwz7sxs4"; sha256 = "sha256-RHd9PqcSkO9FYi5x+09TN7c4fKGf5pCPXjoCUXZ2mvA=";
rev = version; rev = version;
}; };
in
stdenv.mkDerivation {
inherit (s) name version;
buildInputs = [ zip ]; buildInputs = [ zip ];
nativeBuildInputs = [ unzip ]; nativeBuildInputs = [ unzip ];
#src = fetchurl {
# inherit (s) url sha256;
#};
#src = fetchgit {
# inherit (s) url sha256 rev;
#};
src = fetchFromGitHub {
inherit (s) owner repo rev sha256;
};
preConfigure = '' preConfigure = ''
test -d src && cd src test -d src && cd src
test -f omni.ja || zip omni.ja -r */ test -f omni.ja || zip omni.ja -r */
''; '';
installPhase = '' installPhase = ''
mkdir -p "$out"/{bin,share/doc/slimerjs,lib/slimerjs} mkdir -p "$out"/{bin,share/doc/slimerjs,lib/slimerjs}
cp LICENSE README* "$out/share/doc/slimerjs" cp LICENSE README* "$out/share/doc/slimerjs"
@ -38,11 +29,11 @@ stdenv.mkDerivation {
chmod a+x "$out/bin/slimerjs" chmod a+x "$out/bin/slimerjs"
sed -e 's@MaxVersion=[3456][0-9][.]@MaxVersion=99.@' -i "$out/lib/slimerjs/application.ini" sed -e 's@MaxVersion=[3456][0-9][.]@MaxVersion=99.@' -i "$out/lib/slimerjs/application.ini"
''; '';
meta = {
inherit (s) version; meta = with lib; {
description = "Gecko-based programmatically-driven browser"; description = "Gecko-based programmatically-driven browser";
license = lib.licenses.mpl20 ; license = licenses.mpl20;
maintainers = [lib.maintainers.raskin]; maintainers = with maintainers; [ raskin ];
platforms = lib.platforms.linux; platforms = platforms.linux;
}; };
} }

View File

@ -1,2 +0,0 @@
url http://slimerjs.org/download.html
version_link '/slimerjs-[0-9.]+[.]zip$'

View File

@ -1,3 +0,0 @@
url https://github.com/laurentj/slimerjs
target default.nix
GH_latest