From e26ecf5c72838aa45ce42c13a7cb89e518e04fc3 Mon Sep 17 00:00:00 2001 From: Wolfgang Walther Date: Sat, 19 Jul 2025 10:27:17 +0200 Subject: [PATCH] beamPackages.lfe: avoid throwing for incompatibility in CI Same reasoning as commit before. --- .../interpreters/lfe/generic-builder.nix | 152 +++++++++--------- 1 file changed, 79 insertions(+), 73 deletions(-) diff --git a/pkgs/development/interpreters/lfe/generic-builder.nix b/pkgs/development/interpreters/lfe/generic-builder.nix index 27d1c6d6c85d..9501d712785d 100644 --- a/pkgs/development/interpreters/lfe/generic-builder.nix +++ b/pkgs/development/interpreters/lfe/generic-builder.nix @@ -1,4 +1,5 @@ { + config, lib, fetchFromGitHub, erlang, @@ -37,6 +38,8 @@ let mainVersion = versions.major (getVersion erlang); + maxAssert = versionAtLeast maximumOTPVersion mainVersion; + proper = buildHex { name = "proper"; version = "1.4.0"; @@ -45,82 +48,85 @@ let }; in -assert (assertMsg (versionAtLeast maximumOTPVersion mainVersion)) '' - LFE ${version} is supported on OTP <=${maximumOTPVersion}, not ${mainVersion}. -''; - -buildRebar3 { - name = baseName; - - inherit src version; - - nativeBuildInputs = [ - makeWrapper - erlang - ]; - beamDeps = [ proper ]; - patches = [ - ./fix-rebar-config.patch - ./dedup-ebins.patch - ] ++ patches; - doCheck = true; - checkTarget = "travis"; - - makeFlags = [ - "-e" - "MANDB=''" - "PREFIX=$$out" - ]; - - # These installPhase tricks are based on Elixir's Makefile. - # TODO: Make, upload, and apply a patch. - installPhase = optionalString (versionOlder version "1.3") '' - local libdir=$out/lib/lfe - local ebindir=$libdir/ebin - local bindir=$libdir/bin - - rm -Rf $ebindir - install -m755 -d $ebindir - install -m644 _build/default/lib/lfe/ebin/* $ebindir - - install -m755 -d $bindir - - for bin in bin/lfe{,c,doc,script}; do install -m755 $bin $bindir; done - - install -m755 -d $out/bin - for file in $bindir/*; do ln -sf $file $out/bin/; done +if !config.allowAliases && !maxAssert then + # Don't throw without aliases to not break CI. + null +else + assert assertMsg maxAssert '' + LFE ${version} is supported on OTP <=${maximumOTPVersion}, not ${mainVersion}. ''; + buildRebar3 { + name = baseName; - # Thanks again, Elixir. - postFixup = '' - # LFE binaries are shell scripts which run erl and lfe. - # Add some stuff to PATH so the scripts can run without problems. - for f in $out/bin/*; do - wrapProgram $f \ - --prefix PATH ":" "${ - makeBinPath [ - erlang - coreutils - bash - ] - }:$out/bin" - substituteInPlace $f --replace "/usr/bin/env" "${coreutils}/bin/env" - done - ''; + inherit src version; - meta = with lib; { - description = "Best of Erlang and of Lisp; at the same time!"; - longDescription = '' - LFE, Lisp Flavoured Erlang, is a lisp syntax front-end to the Erlang - compiler. Code produced with it is compatible with "normal" Erlang - code. An LFE evaluator and shell is also included. + nativeBuildInputs = [ + makeWrapper + erlang + ]; + beamDeps = [ proper ]; + patches = [ + ./fix-rebar-config.patch + ./dedup-ebins.patch + ] ++ patches; + doCheck = true; + checkTarget = "travis"; + + makeFlags = [ + "-e" + "MANDB=''" + "PREFIX=$$out" + ]; + + # These installPhase tricks are based on Elixir's Makefile. + # TODO: Make, upload, and apply a patch. + installPhase = optionalString (versionOlder version "1.3") '' + local libdir=$out/lib/lfe + local ebindir=$libdir/ebin + local bindir=$libdir/bin + + rm -Rf $ebindir + install -m755 -d $ebindir + install -m644 _build/default/lib/lfe/ebin/* $ebindir + + install -m755 -d $bindir + + for bin in bin/lfe{,c,doc,script}; do install -m755 $bin $bindir; done + + install -m755 -d $out/bin + for file in $bindir/*; do ln -sf $file $out/bin/; done ''; - homepage = "https://lfe.io"; - downloadPage = "https://github.com/rvirding/lfe/releases"; + # Thanks again, Elixir. + postFixup = '' + # LFE binaries are shell scripts which run erl and lfe. + # Add some stuff to PATH so the scripts can run without problems. + for f in $out/bin/*; do + wrapProgram $f \ + --prefix PATH ":" "${ + makeBinPath [ + erlang + coreutils + bash + ] + }:$out/bin" + substituteInPlace $f --replace "/usr/bin/env" "${coreutils}/bin/env" + done + ''; - license = licenses.asl20; - teams = [ teams.beam ]; - platforms = platforms.unix; - }; -} + meta = with lib; { + description = "Best of Erlang and of Lisp; at the same time!"; + longDescription = '' + LFE, Lisp Flavoured Erlang, is a lisp syntax front-end to the Erlang + compiler. Code produced with it is compatible with "normal" Erlang + code. An LFE evaluator and shell is also included. + ''; + + homepage = "https://lfe.io"; + downloadPage = "https://github.com/rvirding/lfe/releases"; + + license = licenses.asl20; + teams = [ teams.beam ]; + platforms = platforms.unix; + }; + }