about summary refs log tree commit diff
path: root/pkgs/development/beam-modules
diff options
context:
space:
mode:
authorBarry Moore <chiroptical@gmail.com>2024-04-02 13:29:40 -0400
committerBarry Moore <chiroptical@gmail.com>2024-04-02 13:48:05 -0400
commit41e52bde8b47d2c097d9f6bf82ece6b7b9405aef (patch)
tree6c2a60acdfdea2d8cfce632bd00211ae086a4c2d /pkgs/development/beam-modules
parenta62fab270ea6c170e8926326a3c5f4de7b4d5356 (diff)
ex_doc: init at 0.31.2
Diffstat (limited to 'pkgs/development/beam-modules')
-rw-r--r--pkgs/development/beam-modules/default.nix2
-rw-r--r--pkgs/development/beam-modules/ex_doc/default.nix55
2 files changed, 57 insertions, 0 deletions
diff --git a/pkgs/development/beam-modules/default.nix b/pkgs/development/beam-modules/default.nix
index 9e30ec4ef7b1b..d94bdf2b2d8ea 100644
--- a/pkgs/development/beam-modules/default.nix
+++ b/pkgs/development/beam-modules/default.nix
@@ -83,6 +83,8 @@ let
       # Remove old versions of elixir, when the supports fades out:
       # https://hexdocs.pm/elixir/compatibility-and-deprecations.html
 
+      ex_doc = callPackage ./ex_doc { inherit elixir fetchMixDeps mixRelease; };
+
       elixir-ls = callPackage ./elixir-ls { inherit elixir fetchMixDeps mixRelease; };
 
       lfe = lfe_2_1;
diff --git a/pkgs/development/beam-modules/ex_doc/default.nix b/pkgs/development/beam-modules/ex_doc/default.nix
new file mode 100644
index 0000000000000..2eb92f1ac4c08
--- /dev/null
+++ b/pkgs/development/beam-modules/ex_doc/default.nix
@@ -0,0 +1,55 @@
+{ lib, elixir, fetchFromGitHub, fetchMixDeps, mixRelease, nix-update-script }:
+# Based on ../elixir-ls/default.nix
+
+let
+  pname = "ex_doc";
+  version = "0.31.2";
+  src = fetchFromGitHub {
+    owner = "elixir-lang";
+    repo = "${pname}";
+    rev = "v${version}";
+    hash = "sha256-qUiXZ1KHD9sS1xG7QNYyrZVzPqerwCRdkN8URrlQ45g=";
+  };
+in
+mixRelease {
+  inherit pname version src elixir;
+
+  stripDebug = true;
+
+  mixFodDeps = fetchMixDeps {
+    pname = "mix-deps-${pname}";
+    inherit src version elixir;
+    hash = "sha256-ZNHhWCZ3n2Y/XCsXVjbu4wbx/J95JdFP/2raACciAUU=";
+  };
+
+  configurePhase = ''
+    runHook preConfigure
+    mix deps.compile --no-deps-check
+    runHook postConfigure
+  '';
+
+  buildPhase = ''
+    runHook preBuild
+    mix do escript.build
+    runHook postBuild
+  '';
+
+  installPhase = ''
+    runHook preInstall
+    mkdir -p $out/bin
+    cp -v ex_doc $out/bin
+    runHook postInstall
+  '';
+
+  meta = with lib; {
+    homepage = "https://github.com/elixir-lang/ex_doc";
+    description = ''
+      ExDoc produces HTML and EPUB documentation for Elixir projects
+    '';
+    license = licenses.asl20;
+    platforms = platforms.unix;
+    mainProgram = "ex_doc";
+    maintainers = with maintainers; [chiroptical];
+  };
+  passthru.updateScript = nix-update-script { };
+}