beam-packages: add nodocs target for building ex_doc on 27+

This commit is contained in:
Adam Stephens 2024-09-06 09:57:17 -04:00
parent 5a24308c38
commit 836658e721
No known key found for this signature in database
3 changed files with 17 additions and 10 deletions

View File

@ -19,11 +19,11 @@
, libGLU ? null
, wxGTK ? null
, xorg ? null
, exdoc ? null
, ex_doc ? null
, parallelBuild ? false
, systemd
, wxSupport ? true
, exdocSupport ? false
, ex_docSupport ? false
, systemdSupport ? lib.meta.availableOn stdenv.hostPlatform systemd # systemd support in epmd
# updateScript deps
, writeScript
@ -64,7 +64,7 @@
, installPhase ? ""
, preInstall ? ""
, postInstall ? ""
, installTargets ? [ "install" "install-docs" ]
, installTargets ? if ((lib.versionOlder version "27.0") || ex_docSupport) then [ "install" "install-docs" ] else [ "install" ]
, checkPhase ? ""
, preCheck ? ""
, postCheck ? ""
@ -80,7 +80,7 @@ else libGL != null && libGLU != null && wxGTK != null && xorg != null);
assert odbcSupport -> unixODBC != null;
assert javacSupport -> openjdk11 != null;
assert exdocSupport -> exdoc != null;
assert ex_docSupport -> ex_doc != null;
let
inherit (lib) optional optionals optionalAttrs optionalString;
@ -122,15 +122,15 @@ stdenv.mkDerivation ({
'';
# For OTP 27+ we need ex_doc to build the documentation
# When exdocSupport is enabled, grab the raw ex_doc executable from the exdoc
# When ex_docSupport is enabled, grab the raw ex_doc executable from the ex_doc
# derivation. Next, patch the first line to use the escript that will be
# built during the build phase of this derivation. Finally, building the
# documentation requires the erlang-logo.png asset.
preConfigure = ''
./otp_build autoconf
'' + optionalString exdocSupport ''
'' + optionalString ex_docSupport ''
mkdir -p $out/bin
cp ${exdoc}/bin/.ex_doc-wrapped $out/bin/ex_doc
cp ${ex_doc}/bin/.ex_doc-wrapped $out/bin/ex_doc
sed -i "1 s:^.*$:#!$out/bin/escript:" $out/bin/ex_doc
export EX_DOC=$out/bin/ex_doc

View File

@ -16529,6 +16529,12 @@ with pkgs;
wxSupport = false;
systemdSupport = false;
};
beam_nodocs = callPackage ./beam-packages.nix {
beam = beam_nodocs;
wxSupport = false;
systemdSupport = false;
ex_docSupport = false;
};
inherit (beam.interpreters)
erlang erlang_27 erlang_26 erlang_25 erlang_24

View File

@ -1,9 +1,11 @@
{ lib
, beam
, beam_nodocs
, callPackage
, wxGTK32
, buildPackages
, stdenv
, ex_docSupport ? true
, wxSupport ? true
, systemd
, systemdSupport ? lib.meta.availableOn stdenv.hostPlatform systemd
@ -30,9 +32,8 @@ in
wxGTK = wxGTK32;
parallelBuild = true;
autoconf = buildPackages.autoconf269;
exdocSupport = true;
exdoc = self.packages.erlang_26.ex_doc;
inherit wxSupport systemdSupport;
inherit (beam_nodocs.packages.erlang_27) ex_doc;
inherit ex_docSupport wxSupport systemdSupport;
};
erlang_26 = self.beamLib.callErlang ../development/interpreters/erlang/26.nix {