From 911c7322974d9dd66906937252de6f95e8923f16 Mon Sep 17 00:00:00 2001 From: Adrian Kummerlaender Date: Mon, 24 Sep 2018 10:21:07 +0200 Subject: Unify derivation naming scheme --- default.nix | 12 ++++++---- pkgs/KaTeX/default.nix | 49 --------------------------------------- pkgs/katex-wrapper/default.nix | 49 +++++++++++++++++++++++++++++++++++++++ pkgs/xslt/BuildXSLT/default.nix | 23 ------------------ pkgs/xslt/InputXSLT/default.nix | 20 ---------------- pkgs/xslt/StaticXSLT/default.nix | 23 ------------------ pkgs/xslt/build-xslt/default.nix | 23 ++++++++++++++++++ pkgs/xslt/input-xslt/default.nix | 20 ++++++++++++++++ pkgs/xslt/make-xslt/default.nix | 12 ++++++++++ pkgs/xslt/makeweb/default.nix | 12 ---------- pkgs/xslt/static-xslt/default.nix | 23 ++++++++++++++++++ 11 files changed, 134 insertions(+), 132 deletions(-) delete mode 100644 pkgs/KaTeX/default.nix create mode 100644 pkgs/katex-wrapper/default.nix delete mode 100644 pkgs/xslt/BuildXSLT/default.nix delete mode 100644 pkgs/xslt/InputXSLT/default.nix delete mode 100644 pkgs/xslt/StaticXSLT/default.nix create mode 100644 pkgs/xslt/build-xslt/default.nix create mode 100644 pkgs/xslt/input-xslt/default.nix create mode 100644 pkgs/xslt/make-xslt/default.nix delete mode 100644 pkgs/xslt/makeweb/default.nix create mode 100644 pkgs/xslt/static-xslt/default.nix diff --git a/default.nix b/default.nix index ffc0ddd..dbacace 100644 --- a/default.nix +++ b/default.nix @@ -2,7 +2,9 @@ let pkgs = import { inherit system; }; + callPackage = pkgs.lib.callPackageWith (pkgs // custom); + custom = { custom-vim = callPackage ./pkgs/custom-vim { }; @@ -11,11 +13,11 @@ let oomox-gtk-theme = callPackage ./pkgs/oomox-gtk-theme { }; oomox-archdroid-icon-theme = callPackage ./pkgs/oomox-archdroid-icon-theme { }; - KaTeX = callPackage ./pkgs/KaTeX { }; + katex-wrapper = callPackage ./pkgs/katex-wrapper { }; - InputXSLT = callPackage ./pkgs/xslt/InputXSLT { }; - StaticXSLT = callPackage ./pkgs/xslt/StaticXSLT { }; - BuildXSLT = callPackage ./pkgs/xslt/BuildXSLT { }; - makeweb = callPackage ./pkgs/xslt/makeweb { }; + input-xslt = callPackage ./pkgs/xslt/input-xslt { }; + build-xslt = callPackage ./pkgs/xslt/build-xslt { }; + static-xslt = callPackage ./pkgs/xslt/static-xslt { }; + make-xslt = callPackage ./pkgs/xslt/make-xslt { }; }; in custom diff --git a/pkgs/KaTeX/default.nix b/pkgs/KaTeX/default.nix deleted file mode 100644 index 37fe63a..0000000 --- a/pkgs/KaTeX/default.nix +++ /dev/null @@ -1,49 +0,0 @@ -{ stdenv, pkgs, ... }: - -let - katex-src = stdenv.mkDerivation rec { - name = "katex-src"; - - src = pkgs.fetchzip { - url = "https://github.com/Khan/KaTeX/releases/download/v0.10.0-alpha/katex.zip"; - sha256 = "002dzyf3wcyjxv4m6vv0v99gf82a9k7rxsnlvf93h9fhcda2vj7l"; - }; - - buildInputs = [ pkgs.nodejs ]; - - installPhase = '' - mkdir -p $out/share/katex - cp katex.min.js $out/share/katex/ - ''; - - meta = { - description = "KaTeX"; - homepage = https://github.com/Khan/KaTeX; - license = stdenv.lib.licenses.mit; - platforms = stdenv.lib.platforms.all; - }; - }; -in pkgs.writeTextFile { - name = "katex-wrapper"; - executable = true; - destination = "/bin/katex"; - - text = '' - #!${pkgs.nodejs}/bin/node - - var katex = require("${katex-src}/share/katex/katex.min.js"); - var input = ""; - - var args = process.argv.slice(2); - - process.stdin.on("data", function(chunk) { - input += chunk.toString(); - }); - - process.stdin.on("end", function() { - var options = { displayMode: args.indexOf("--display-mode") !== -1 }; - var output = katex.renderToString(input, options); - console.log(output); - }); - ''; -} diff --git a/pkgs/katex-wrapper/default.nix b/pkgs/katex-wrapper/default.nix new file mode 100644 index 0000000..37fe63a --- /dev/null +++ b/pkgs/katex-wrapper/default.nix @@ -0,0 +1,49 @@ +{ stdenv, pkgs, ... }: + +let + katex-src = stdenv.mkDerivation rec { + name = "katex-src"; + + src = pkgs.fetchzip { + url = "https://github.com/Khan/KaTeX/releases/download/v0.10.0-alpha/katex.zip"; + sha256 = "002dzyf3wcyjxv4m6vv0v99gf82a9k7rxsnlvf93h9fhcda2vj7l"; + }; + + buildInputs = [ pkgs.nodejs ]; + + installPhase = '' + mkdir -p $out/share/katex + cp katex.min.js $out/share/katex/ + ''; + + meta = { + description = "KaTeX"; + homepage = https://github.com/Khan/KaTeX; + license = stdenv.lib.licenses.mit; + platforms = stdenv.lib.platforms.all; + }; + }; +in pkgs.writeTextFile { + name = "katex-wrapper"; + executable = true; + destination = "/bin/katex"; + + text = '' + #!${pkgs.nodejs}/bin/node + + var katex = require("${katex-src}/share/katex/katex.min.js"); + var input = ""; + + var args = process.argv.slice(2); + + process.stdin.on("data", function(chunk) { + input += chunk.toString(); + }); + + process.stdin.on("end", function() { + var options = { displayMode: args.indexOf("--display-mode") !== -1 }; + var output = katex.renderToString(input, options); + console.log(output); + }); + ''; +} diff --git a/pkgs/xslt/BuildXSLT/default.nix b/pkgs/xslt/BuildXSLT/default.nix deleted file mode 100644 index 4e5dcb6..0000000 --- a/pkgs/xslt/BuildXSLT/default.nix +++ /dev/null @@ -1,23 +0,0 @@ -{ stdenv, fetchFromGitHub }: - -stdenv.mkDerivation rec { - name = "BuildXSLT"; - - src = fetchFromGitHub { - owner = "KnairdA"; - repo = "BuildXSLT"; - rev = "master"; - sha256 = "09kxhvhzn0r62l39zgj1kc21rb565fnc1y3sg48p4gi4v15xjmc6"; - }; - - installPhase = '' - mkdir $out - cp -r * $out/ - ''; - - meta = with stdenv.lib; { - description = "BuildXSLT"; - homepage = https://github.com/KnairdA/BuildXSLT/; - license = stdenv.lib.licenses.mit; - }; -} diff --git a/pkgs/xslt/InputXSLT/default.nix b/pkgs/xslt/InputXSLT/default.nix deleted file mode 100644 index a85bc37..0000000 --- a/pkgs/xslt/InputXSLT/default.nix +++ /dev/null @@ -1,20 +0,0 @@ -{ stdenv, fetchFromGitHub, cmake, boost, xalanc, xercesc, discount }: - -stdenv.mkDerivation rec { - name = "InputXSLT"; - - src = fetchFromGitHub { - owner = "KnairdA"; - repo = "InputXSLT"; - rev = "master"; - sha256 = "1j9fld3sh1jyscnsx6ab9jn5x6q67rjh9p3bgsh5na1qrs40dql0"; - }; - - buildInputs = [ cmake boost xalanc xercesc discount ]; - - meta = with stdenv.lib; { - description = "InputXSLT"; - homepage = https://github.com/KnairdA/InputXSLT/; - license = stdenv.lib.licenses.asl20; - }; -} diff --git a/pkgs/xslt/StaticXSLT/default.nix b/pkgs/xslt/StaticXSLT/default.nix deleted file mode 100644 index 3caee06..0000000 --- a/pkgs/xslt/StaticXSLT/default.nix +++ /dev/null @@ -1,23 +0,0 @@ -{ stdenv, fetchFromGitHub }: - -stdenv.mkDerivation rec { - name = "StaticXSLT"; - - src = fetchFromGitHub { - owner = "KnairdA"; - repo = "StaticXSLT"; - rev = "master"; - sha256 = "17gd181cw9yyc4h1fn7fikcgm8g7fdwm7d7fxwib4aynm18kwqad"; - }; - - installPhase = '' - mkdir $out - cp -r * $out/ - ''; - - meta = with stdenv.lib; { - description = "StaticXSLT"; - homepage = https://github.com/KnairdA/StaticXSLT/; - license = stdenv.lib.licenses.mit; - }; -} diff --git a/pkgs/xslt/build-xslt/default.nix b/pkgs/xslt/build-xslt/default.nix new file mode 100644 index 0000000..578786a --- /dev/null +++ b/pkgs/xslt/build-xslt/default.nix @@ -0,0 +1,23 @@ +{ stdenv, fetchFromGitHub }: + +stdenv.mkDerivation rec { + name = "build-xslt"; + + src = fetchFromGitHub { + owner = "KnairdA"; + repo = "BuildXSLT"; + rev = "master"; + sha256 = "09kxhvhzn0r62l39zgj1kc21rb565fnc1y3sg48p4gi4v15xjmc6"; + }; + + installPhase = '' + mkdir $out + cp -r * $out/ + ''; + + meta = with stdenv.lib; { + description = "BuildXSLT"; + homepage = https://github.com/KnairdA/BuildXSLT/; + license = stdenv.lib.licenses.mit; + }; +} diff --git a/pkgs/xslt/input-xslt/default.nix b/pkgs/xslt/input-xslt/default.nix new file mode 100644 index 0000000..cd28a67 --- /dev/null +++ b/pkgs/xslt/input-xslt/default.nix @@ -0,0 +1,20 @@ +{ stdenv, fetchFromGitHub, cmake, boost, xalanc, xercesc, discount }: + +stdenv.mkDerivation rec { + name = "input-xslt"; + + src = fetchFromGitHub { + owner = "KnairdA"; + repo = "InputXSLT"; + rev = "master"; + sha256 = "1j9fld3sh1jyscnsx6ab9jn5x6q67rjh9p3bgsh5na1qrs40dql0"; + }; + + buildInputs = [ cmake boost xalanc xercesc discount ]; + + meta = with stdenv.lib; { + description = "InputXSLT"; + homepage = https://github.com/KnairdA/InputXSLT/; + license = stdenv.lib.licenses.asl20; + }; +} diff --git a/pkgs/xslt/make-xslt/default.nix b/pkgs/xslt/make-xslt/default.nix new file mode 100644 index 0000000..0fb00cc --- /dev/null +++ b/pkgs/xslt/make-xslt/default.nix @@ -0,0 +1,12 @@ +{ pkgs, ... }: + +let + InputXSLT = pkgs.callPackage ../input-xslt { }; + BuildXSLT = pkgs.callPackage ../build-xslt { }; + StaticXSLT = pkgs.callPackage ../static-xslt { }; +in pkgs.writeScriptBin + "make-xslt" + '' + #!/bin/sh + ${InputXSLT}/bin/ixslt --input make.xml --transformation ${BuildXSLT}/build.xsl --include ${StaticXSLT}/ + '' diff --git a/pkgs/xslt/makeweb/default.nix b/pkgs/xslt/makeweb/default.nix deleted file mode 100644 index 0527bbc..0000000 --- a/pkgs/xslt/makeweb/default.nix +++ /dev/null @@ -1,12 +0,0 @@ -{ pkgs, ... }: - -let - InputXSLT = pkgs.callPackage ../InputXSLT { }; - StaticXSLT = pkgs.callPackage ../StaticXSLT { }; - BuildXSLT = pkgs.callPackage ../BuildXSLT { }; -in pkgs.writeScriptBin - "makeweb" - '' - #!/bin/sh - ${InputXSLT}/bin/ixslt --input make.xml --transformation ${BuildXSLT}/build.xsl --include ${StaticXSLT}/ - '' diff --git a/pkgs/xslt/static-xslt/default.nix b/pkgs/xslt/static-xslt/default.nix new file mode 100644 index 0000000..4ef9fba --- /dev/null +++ b/pkgs/xslt/static-xslt/default.nix @@ -0,0 +1,23 @@ +{ stdenv, fetchFromGitHub }: + +stdenv.mkDerivation rec { + name = "static-xslt"; + + src = fetchFromGitHub { + owner = "KnairdA"; + repo = "StaticXSLT"; + rev = "master"; + sha256 = "17gd181cw9yyc4h1fn7fikcgm8g7fdwm7d7fxwib4aynm18kwqad"; + }; + + installPhase = '' + mkdir $out + cp -r * $out/ + ''; + + meta = with stdenv.lib; { + description = "StaticXSLT"; + homepage = https://github.com/KnairdA/StaticXSLT/; + license = stdenv.lib.licenses.mit; + }; +} -- cgit v1.2.3