2016-09-02 15:00:16 +02:00
|
|
|
{ stdenv, lib, fetchgit, fetchurl, nodejs, phantomjs2, pkgs }:
|
2014-04-20 22:42:55 +02:00
|
|
|
|
|
|
|
with lib;
|
|
|
|
|
|
|
|
let
|
|
|
|
|
|
|
|
# highlight.js is a git submodule of remark
|
|
|
|
highlightjs = fetchgit {
|
2020-04-01 03:11:51 +02:00
|
|
|
url = "https://github.com/isagalaev/highlight.js";
|
2014-04-20 22:42:55 +02:00
|
|
|
rev = "10b9500b67983f0a9c42d8ce8bf8e8c469f7078c";
|
|
|
|
sha256 = "1yy8by15kfklw8lwh17z1swpj067q0skjjih12yawbryraig41m0";
|
|
|
|
};
|
2021-01-19 22:20:11 +01:00
|
|
|
|
2016-09-02 15:00:16 +02:00
|
|
|
nodePackages = import ./nodepkgs.nix {
|
|
|
|
inherit pkgs;
|
2018-08-20 21:11:29 +02:00
|
|
|
inherit (stdenv.hostPlatform) system;
|
2016-09-02 15:00:16 +02:00
|
|
|
};
|
2014-04-20 22:42:55 +02:00
|
|
|
|
|
|
|
in stdenv.mkDerivation rec {
|
2019-08-15 14:41:18 +02:00
|
|
|
pname = "remarkjs";
|
2014-04-20 22:42:55 +02:00
|
|
|
|
2014-10-28 14:44:17 +01:00
|
|
|
version = "0.7.0";
|
2014-04-20 22:42:55 +02:00
|
|
|
|
|
|
|
src = fetchurl {
|
|
|
|
url = "https://github.com/gnab/remark/archive/v${version}.tar.gz";
|
2014-10-28 14:44:17 +01:00
|
|
|
sha256 = "1a2il6aa0g9cnig56ykmq8lr626pbxlsllk6js41h6gcn214rw60";
|
2014-04-20 22:42:55 +02:00
|
|
|
};
|
|
|
|
|
2016-09-02 15:00:16 +02:00
|
|
|
buildInputs = [ nodejs phantomjs2 ] ++ (with nodePackages; [
|
2014-04-20 22:42:55 +02:00
|
|
|
marked
|
|
|
|
browserify
|
|
|
|
uglify-js
|
|
|
|
less
|
|
|
|
mocha
|
2016-09-02 15:00:16 +02:00
|
|
|
#mocha-phantomjs
|
2014-04-20 22:42:55 +02:00
|
|
|
should
|
|
|
|
sinon
|
|
|
|
jshint
|
|
|
|
shelljs
|
2016-09-02 15:00:16 +02:00
|
|
|
]);
|
2014-04-20 22:42:55 +02:00
|
|
|
|
|
|
|
configurePhase = ''
|
|
|
|
mkdir -p node_modules/.bin
|
|
|
|
${concatStrings (map (dep: ''
|
|
|
|
test -d ${dep}/bin && (for b in $(ls ${dep}/bin); do
|
|
|
|
ln -sv -t node_modules/.bin ${dep}/bin/$b
|
|
|
|
done)
|
|
|
|
'') buildInputs)}
|
|
|
|
'';
|
|
|
|
|
|
|
|
buildPhase = ''
|
|
|
|
substituteInPlace make.js --replace "target.test();" ""
|
|
|
|
substituteInPlace make.js --replace vendor/highlight.js ${highlightjs}
|
|
|
|
node make all
|
|
|
|
'';
|
|
|
|
|
|
|
|
installPhase = ''
|
|
|
|
mkdir -p $out/lib
|
|
|
|
cp -v out/* $out/lib/
|
|
|
|
'';
|
|
|
|
|
|
|
|
meta = {
|
2020-04-24 17:03:55 +02:00
|
|
|
homepage = "https://remarkjs.com";
|
2014-11-11 14:20:43 +01:00
|
|
|
description = "A simple, in-browser, markdown-driven slideshow tool";
|
2019-08-20 15:24:01 +02:00
|
|
|
maintainers = [];
|
2021-01-23 18:15:07 +01:00
|
|
|
platforms = lib.platforms.linux;
|
|
|
|
license = lib.licenses.mit;
|
2016-06-11 02:28:50 +02:00
|
|
|
broken = true;
|
2014-04-20 22:42:55 +02:00
|
|
|
};
|
|
|
|
}
|