1
0
Fork 1
mirror of https://github.com/NixOS/nixpkgs.git synced 2024-12-03 02:51:18 +00:00

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}:
let
s = # Generated upstream information
rec {
baseName="slimerjs";
version="1.0.0";
name="${baseName}-${version}";
{ lib, stdenv, fetchFromGitHub, zip, unzip, firefox, bash }:
stdenv.mkDerivation rec {
pname = "slimerjs";
version = "1.0.0";
src = fetchFromGitHub {
owner = "laurentj";
repo = baseName;
sha256="1w4sfrv520isbs7r1rlzl5y3idrpad7znw9fc92yz40jlwz7sxs4";
repo = "slimerjs";
sha256 = "sha256-RHd9PqcSkO9FYi5x+09TN7c4fKGf5pCPXjoCUXZ2mvA=";
rev = version;
};
in
stdenv.mkDerivation {
inherit (s) name version;
buildInputs = [ zip ];
nativeBuildInputs = [ unzip ];
#src = fetchurl {
# inherit (s) url sha256;
#};
#src = fetchgit {
# inherit (s) url sha256 rev;
#};
src = fetchFromGitHub {
inherit (s) owner repo rev sha256;
};
preConfigure = ''
test -d src && cd src
test -f omni.ja || zip omni.ja -r */
'';
installPhase = ''
mkdir -p "$out"/{bin,share/doc/slimerjs,lib/slimerjs}
cp LICENSE README* "$out/share/doc/slimerjs"
@ -38,11 +29,11 @@ stdenv.mkDerivation {
chmod a+x "$out/bin/slimerjs"
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";
license = lib.licenses.mpl20 ;
maintainers = [lib.maintainers.raskin];
platforms = lib.platforms.linux;
license = licenses.mpl20;
maintainers = with maintainers; [ raskin ];
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