1
0
Fork 1
mirror of https://github.com/NixOS/nixpkgs.git synced 2024-11-22 13:41:26 +00:00

codimd: init at 1.2.0

This commit is contained in:
WilliButz 2018-08-19 17:54:46 +02:00 committed by Robin Gloster
parent ffd74d1ee4
commit a31a917eb9
11 changed files with 19780 additions and 0 deletions

View file

@ -0,0 +1,46 @@
{ stdenv, pkgs, buildEnv, fetchFromGitHub, nodejs-6_x, phantomjs2, which }:
let
nodePackages = import ./node.nix {
inherit pkgs;
system = stdenv.system;
};
phantomjs-prebuilt = nodePackages."phantomjs-prebuilt-^2.1.12".override (oldAttrs: {
buildInputs = oldAttrs.buildInputs ++ [ phantomjs2 ];
});
in
stdenv.mkDerivation {
name = "codemirror-hackmdio-05-07-2018";
src = fetchFromGitHub {
owner = "hackmdio";
repo = "CodeMirror";
rev = "df412731ed3923124f9a43f60e84bdf855eb843a";
sha256 = "02v2wccv9sjdda9x45ib8d08i1pc4b8kwg3p6qc314wqq89nhniw";
};
nativeBuildInputs = [ which ];
buildInputs = [ nodejs-6_x phantomjs-prebuilt ] ++ (stdenv.lib.attrVals [
"blint-^1"
"node-static-0.6.0"
"rollup-^0.41.0"
"rollup-plugin-buble-^0.15.0"
"rollup-watch-^3.2.0"
"uglify-js-^2.8.15"
] nodePackages);
buildPhase = ''
patchShebangs .
npm run build
node release
'';
installPhase = ''
mkdir -p $out/lib/node_modules/codemirror
cp -R {codemirror.min.js,addon,bin,keymap,lib,mode,theme} $out/lib/node_modules/codemirror/
ln -s ${nodePackages."url-loader-^0.5.7"}/lib/node_modules/url-loader \
$out/lib/node_modules
'';
}

View file

@ -0,0 +1,8 @@
[ { "blint": "^1" }
, { "node-static": "0.6.0" }
, { "phantomjs-prebuilt": "^2.1.12" }
, { "rollup": "^0.41.0" }
, { "rollup-plugin-buble": "^0.15.0" }
, { "rollup-watch": "^3.2.0" }
, { "uglify-js": "^2.8.15" }
, { "url-loader": "^0.5.7" } ]

View file

@ -0,0 +1,7 @@
#!/usr/bin/env nix-shell
#! nix-shell -i bash -p nodePackages.node2nix
node2nix -6 -i deps.json \
-e ../../../../development/node-packages/node-env.nix \
--no-copy-node-env \
-c node.nix

File diff suppressed because it is too large Load diff

View file

@ -0,0 +1,17 @@
# This file has been generated by node2nix 1.6.0. Do not edit!
{pkgs ? import <nixpkgs> {
inherit system;
}, system ? builtins.currentSystem, nodejs ? pkgs."nodejs-6_x"}:
let
nodeEnv = import ../../../../development/node-packages/node-env.nix {
inherit (pkgs) stdenv python2 utillinux runCommand writeTextFile;
inherit nodejs;
libtool = if pkgs.stdenv.isDarwin then pkgs.darwin.cctools else null;
};
in
import ./node-packages.nix {
inherit (pkgs) fetchurl fetchgit;
inherit nodeEnv;
}

View file

@ -0,0 +1,156 @@
{ stdenv, pkgs, buildEnv, fetchFromGitHub, makeWrapper
, fetchpatch, nodejs-6_x, phantomjs2 }:
let
nodePackages = import ./node.nix {
inherit pkgs;
system = stdenv.system;
};
addPhantomjs = (pkgs:
map (pkg: pkg.override ( oldAttrs: {
buildInputs = oldAttrs.buildInputs or [] ++ [ phantomjs2 ];
})) pkgs);
drvName = drv: (builtins.parseDrvName drv).name;
linkNodeDeps = ({ pkg, deps, name ? "" }:
nodePackages.${pkg}.override (oldAttrs: {
postInstall = stdenv.lib.concatStringsSep "\n" (map (dep: ''
ln -s ${nodePackages.${dep}}/lib/node_modules/${drvName dep} \
$out/lib/node_modules/${if name != "" then name else drvName pkg}/node_modules
'') deps
);
})
);
filterNodePackagesToList = (filterPkgs: allPkgs:
stdenv.lib.mapAttrsToList (_: v: v) (
stdenv.lib.filterAttrs (n: _:
! builtins.elem (drvName n) filterPkgs
) allPkgs)
);
# add phantomjs to buildInputs
pkgsWithPhantomjs = (addPhantomjs (map (
p: nodePackages.${p}
) [
"js-url-^2.3.0"
"markdown-pdf-^8.0.0"
]));
# link extra dependencies to lib/node_modules
pkgsWithExtraDeps = map (args:
linkNodeDeps args ) [
{ pkg = "select2-^3.5.2-browserify";
deps = [ "url-loader-^0.5.7" ]; }
{ pkg = "js-sequence-diagrams-^1000000.0.6";
deps = [ "lodash-^4.17.4" ]; }
{ pkg = "ionicons-~2.0.1";
deps = [ "url-loader-^0.5.7" "file-loader-^0.9.0" ]; }
{ pkg = "font-awesome-^4.7.0";
deps = [ "url-loader-^0.5.7" "file-loader-^0.9.0" ]; }
{ pkg = "bootstrap-^3.3.7";
deps = [ "url-loader-^0.5.7" "file-loader-^0.9.0" ]; }
{ pkg = "markdown-it-^8.2.2";
deps = [ "json-loader-^0.5.4" ]; }
{ pkg = "markdown-it-emoji-^1.3.0";
deps = [ "json-loader-^0.5.4" ]; }
{ pkg = "raphael-git+https://github.com/dmitrybaranovskiy/raphael";
deps = [ "eve-^0.5.4" ];
name = "raphael"; }
];
codemirror = pkgs.callPackage ./CodeMirror { };
nodeEnv = buildEnv {
name = "codimd-env";
paths = pkgsWithPhantomjs ++ pkgsWithExtraDeps ++ [
codemirror
] ++ filterNodePackagesToList [
"bootstrap"
"codemirror-git+https://github.com/hackmdio/CodeMirror.git"
"font-awesome"
"ionicons"
"js-sequence-diagrams"
"js-url"
"markdown-it"
"markdown-pdf"
"node-uuid"
"raphael-git+https://github.com/dmitrybaranovskiy/raphael"
"select2-browserify"
] nodePackages;
};
name = "codimd-${version}";
version = "1.2.0";
src = stdenv.mkDerivation {
name = "${name}-src";
inherit version;
src = fetchFromGitHub {
owner = "hackmdio";
repo = "codimd";
rev = version;
sha256 = "003v90g5sxxjv5smxvz6y6bq2ny0xpxhsx2cdgkvj7jla243v48s";
};
dontBuild = true;
installPhase = ''
mkdir $out
cp -R . $out
'';
};
in
stdenv.mkDerivation rec {
inherit name version src;
nativeBuildInputs = [ makeWrapper ];
buildInputs = [ nodejs-6_x ];
NODE_PATH = "${nodeEnv}/lib/node_modules";
patches = [
(fetchpatch { # fixes for configurable paths
url = "https://patch-diff.githubusercontent.com/raw/hackmdio/codimd/pull/940.patch";
sha256 = "0n9lfaxirngywx8m5f0nqzykqdjzc8f3cl10ir1g7s5kq4zc7hhn";
})
];
buildPhase = ''
ln -s ${nodeEnv}/lib/node_modules node_modules
npm run build
'';
installPhase = ''
mkdir -p $out/bin
cat > $out/bin/codimd <<EOF
#!${stdenv.shell}/bin/sh
${nodejs-6_x}/bin/node $out/app.js
EOF
cp -R {app.js,bin,lib,locales,package.json,public} $out/
'';
postFixup = ''
chmod +x $out/bin/codimd
wrapProgram $out/bin/codimd \
--set NODE_PATH "${nodeEnv}/lib/node_modules"
'';
passthru = {
sequelize = pkgs.writeScript "codimd-sequelize" ''
#!${pkgs.bash}/bin/bash -e
export NODE_PATH="${nodeEnv}/lib/node_modules"
exec -a "$0" "${nodeEnv}/lib/node_modules/sequelize-cli/bin/sequelize" "$@"
'';
};
meta = with stdenv.lib; {
description = "Realtime collaborative markdown notes on all platforms";
license = licenses.agpl3;
homepage = https://github.com/hackmdio/codimd;
maintainers = with maintainers; [ willibutz ];
platforms = platforms.linux;
};
}

View file

@ -0,0 +1,150 @@
[ { "eve": "^0.5.4" }
, { "babel-cli": "^6.18.0" }
, { "babel-core": "^6.21.0" }
, { "babel-loader": "^6.2.10" }
, { "babel-plugin-transform-runtime": "^6.15.0" }
, { "babel-polyfill": "^6.22.0" }
, { "babel-preset-es2015": "^6.18.0" }
, { "babel-runtime": "^6.20.0" }
, { "copy-webpack-plugin": "^4.0.1" }
, { "css-loader": "^0.26.1" }
, { "doctoc": "^1.3.0" }
, { "ejs-loader": "^0.3.0" }
, { "exports-loader": "^0.6.3" }
, { "expose": "^0.1.4" }
, { "expose-loader": "^0.7.1" }
, { "extract-text-webpack-plugin": "^1.0.1" }
, { "file-loader": "^0.9.0" }
, { "html-webpack-plugin": "^2.25.0" }
, { "imports-loader": "^0.7.0" }
, { "json-loader": "^0.5.4" }
, { "jsonlint": "^1.6.2" }
, { "less": "^2.7.1" }
, { "less-loader": "^2.2.3" }
, { "optimize-css-assets-webpack-plugin": "^1.3.0" }
, { "script-loader": "^0.7.0" }
, { "standard": "^9.0.1" }
, { "string-loader": "^0.0.1" }
, { "style-loader": "^0.13.1" }
, { "url-loader": "^0.5.7" }
, { "webpack": "^1.14.0" }
, { "webpack-parallel-uglify-plugin": "^0.2.0" }
, { "Idle.Js": "git+https://github.com/shawnmclean/Idle.js" }
, { "archiver": "^2.1.1" }
, { "async": "^2.1.4" }
, { "aws-sdk": "^2.7.20" }
, { "base64url": "^3.0.0" }
, { "azure-storage": "^2.7.0" }
, { "blueimp-md5": "^2.6.0" }
, { "body-parser": "^1.15.2" }
, { "bootstrap": "^3.3.7" }
, { "bootstrap-validator": "^0.11.8" }
, { "chance": "^1.0.4" }
, { "cheerio": "^0.22.0" }
, { "codemirror": "git+https://github.com/hackmdio/CodeMirror.git" }
, { "compression": "^1.6.2" }
, { "connect-flash": "^0.1.1" }
, { "connect-session-sequelize": "^4.1.0" }
, { "cookie": "0.3.1" }
, { "cookie-parser": "1.4.3" }
, { "deep-freeze": "^0.0.1" }
, { "diff-match-patch": "git+https://github.com/hackmdio/diff-match-patch.git" }
, { "ejs": "^2.5.5" }
, { "emojify.js": "~1.1.0" }
, { "express": ">=4.14" }
, { "express-session": "^1.14.2" }
, { "file-saver": "^1.3.3" }
, { "flowchart.js": "^1.6.4" }
, { "font-awesome": "^4.7.0" }
, { "formidable": "^1.0.17" }
, { "gist-embed": "~2.6.0" }
, { "graceful-fs": "^4.1.11" }
, { "handlebars": "^4.0.6" }
, { "helmet": "^3.3.0" }
, { "highlight.js": "~9.12.0" }
, { "i18n": "^0.8.3" }
, { "imgur": "git+https://github.com/hackmdio/node-imgur.git" }
, { "ionicons": "~2.0.1" }
, { "jquery": "^3.1.1" }
, { "jquery-mousewheel": "^3.1.13" }
, { "jquery-ui": "^1.12.1" }
, { "js-cookie": "^2.1.3" }
, { "js-sequence-diagrams": "^1000000.0.6" }
, { "js-url": "^2.3.0" }
, { "js-yaml": "^3.7.0" }
, { "jsdom-nogyp": "^0.8.3" }
, { "keymaster": "^1.6.2" }
, { "list.js": "^1.5.0" }
, { "lodash": "^4.17.4" }
, { "lz-string": "1.4.4" }
, { "markdown-it": "^8.2.2" }
, { "markdown-it-abbr": "^1.0.4" }
, { "markdown-it-container": "^2.0.0" }
, { "markdown-it-deflist": "^2.0.1" }
, { "markdown-it-emoji": "^1.3.0" }
, { "markdown-it-footnote": "^3.0.1" }
, { "markdown-it-imsize": "^2.0.1" }
, { "markdown-it-ins": "^2.0.0" }
, { "markdown-it-mark": "^2.0.0" }
, { "markdown-it-mathjax": "^2.0.0" }
, { "markdown-it-regexp": "^0.4.0" }
, { "markdown-it-sub": "^1.0.0" }
, { "markdown-it-sup": "^1.0.0" }
, { "markdown-pdf": "^8.0.0" }
, { "mathjax": "~2.7.0" }
, { "mermaid": "~7.1.0" }
, { "mattermost": "^3.4.0" }
, { "meta-marked": "^0.4.2" }
, { "method-override": "^2.3.7" }
, { "minimist": "^1.2.0" }
, { "minio": "^6.0.0" }
, { "moment": "^2.17.1" }
, { "morgan": "^1.7.0" }
, { "mysql": "^2.12.0" }
, { "node-uuid": "^1.4.7" }
, { "octicons": "~4.4.0" }
, { "passport": "^0.4.0" }
, { "passport-dropbox-oauth2": "^1.1.0" }
, { "passport-facebook": "^2.1.1" }
, { "passport-github": "^1.1.0" }
, { "passport-gitlab2": "^4.0.0" }
, { "passport-google-oauth20": "^1.0.0" }
, { "passport-ldapauth": "^2.0.0" }
, { "passport-local": "^1.0.0" }
, { "passport-oauth2": "^1.4.0" }
, { "passport-twitter": "^1.0.4" }
, { "passport-saml": "^0.31.0" }
, { "passport.socketio": "^3.7.0" }
, { "pdfobject": "^2.0.201604172" }
, { "pg": "^6.1.2" }
, { "pg-hstore": "^2.3.2" }
, { "prismjs": "^1.6.0" }
, { "randomcolor": "^0.5.3" }
, { "raphael": "git+https://github.com/dmitrybaranovskiy/raphael" }
, { "readline-sync": "^1.4.7" }
, { "request": "^2.79.0" }
, { "reveal.js": "~3.6.0" }
, { "scrypt": "^6.0.3" }
, { "select2": "^3.5.2-browserify" }
, { "sequelize": "^3.28.0" }
, { "sequelize-cli": "^2.5.1" }
, { "shortid": "2.2.8" }
, { "socket.io": "~2.0.4" }
, { "socket.io-client": "~2.0.4" }
, { "spin.js": "^2.3.2" }
, { "sqlite3": "^4.0.1" }
, { "store": "^2.0.12" }
, { "string": "^3.3.3" }
, { "tedious": "^1.14.0" }
, { "to-markdown": "^3.0.3" }
, { "toobusy-js": "^0.5.1" }
, { "uuid": "^3.1.0" }
, { "uws": "~0.14.1" }
, { "validator": "^10.4.0" }
, { "velocity-animate": "^1.4.0" }
, { "visibilityjs": "^1.2.4" }
, { "viz.js": "^1.7.0" }
, { "winston": "^2.3.0" }
, { "xss": "^1.0.3" } ]

View file

@ -0,0 +1,7 @@
#!/usr/bin/env nix-shell
#! nix-shell -i bash -p nodePackages.node2nix
node2nix -6 -i deps.json \
-e ../../../development/node-packages/node-env.nix \
--no-copy-node-env \
-c node.nix

File diff suppressed because it is too large Load diff

View file

@ -0,0 +1,17 @@
# This file has been generated by node2nix 1.6.0. Do not edit!
{pkgs ? import <nixpkgs> {
inherit system;
}, system ? builtins.currentSystem, nodejs ? pkgs."nodejs-6_x"}:
let
nodeEnv = import ../../../development/node-packages/node-env.nix {
inherit (pkgs) stdenv python2 utillinux runCommand writeTextFile;
inherit nodejs;
libtool = if pkgs.stdenv.isDarwin then pkgs.darwin.cctools else null;
};
in
import ./node-packages.nix {
inherit (pkgs) fetchurl fetchgit;
inherit nodeEnv;
}

View file

@ -1797,6 +1797,8 @@ with pkgs;
cmst = libsForQt5.callPackage ../tools/networking/cmst { };
codimd = callPackage ../servers/web-apps/codimd { };
colord = callPackage ../tools/misc/colord { };
colord-gtk = callPackage ../tools/misc/colord-gtk { };