mblaze: fix mcom to use file utility. (#94881)

Co-authored-by: Sandro <sandro.jaeckel@gmail.com>
This commit is contained in:
Guillaume Chérel 2021-05-31 02:58:14 +02:00 committed by GitHub
parent 85d6f6f1f3
commit 34c6163ed9
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -1,10 +1,12 @@
{ stdenv, lib, fetchFromGitHub, installShellFiles, libiconv, ruby ? null }:
{ coreutils, fetchFromGitHub, fetchpatch, file, gawk, gnugrep, gnused
, installShellFiles, less, lib, libiconv, makeWrapper, nano, stdenv, ruby
}:
stdenv.mkDerivation rec {
pname = "mblaze";
version = "1.1";
nativeBuildInputs = [ installShellFiles ];
nativeBuildInputs = [ installShellFiles makeWrapper ];
buildInputs = [ ruby ] ++ lib.optionals stdenv.isDarwin [ libiconv ];
src = fetchFromGitHub {
@ -22,6 +24,24 @@ stdenv.mkDerivation rec {
installShellCompletion contrib/_mblaze
'' + lib.optionalString (ruby != null) ''
install -Dt $out/bin contrib/msuck contrib/mblow
# The following wrappings are used to preserve the executable
# names (the value of $0 in a script). The script mcom is
# designed to be run directly or via symlinks such as mrep. Using
# symlinks changes the value of $0 in the script, and makes it
# behave differently. When using the wrapProgram tool, the resulting
# wrapper breaks this behaviour. The following wrappers preserve it.
mkdir -p $out/wrapped
for x in mcom mbnc mfwd mrep; do
mv $out/bin/$x $out/wrapped
makeWrapper $out/wrapped/$x $out/bin/$x \
--argv0 $out/bin/$x \
--prefix PATH : $out/bin \
--prefix PATH : ${lib.makeBinPath [
coreutils file gawk gnugrep gnused
]}
done
'';
meta = with lib; {