mirror of
https://github.com/NixOS/nixpkgs.git
synced 2025-07-13 21:50:33 +03:00
yosys: fix build with clang
This commit is contained in:
parent
bd4ad008dd
commit
f13cb56360
1 changed files with 6 additions and 2 deletions
|
@ -35,14 +35,18 @@ stdenv.mkDerivation rec {
|
||||||
buildInputs = [ tcl readline libffi python3 bison flex ];
|
buildInputs = [ tcl readline libffi python3 bison flex ];
|
||||||
|
|
||||||
patchPhase = ''
|
patchPhase = ''
|
||||||
|
substituteInPlace ../yosys-abc/Makefile \
|
||||||
|
--replace 'CC := gcc' ""
|
||||||
substituteInPlace ./Makefile \
|
substituteInPlace ./Makefile \
|
||||||
|
--replace 'CXX = clang' "" \
|
||||||
|
--replace 'ABCMKARGS = CC="$(CXX)"' 'ABCMKARGS =' \
|
||||||
--replace 'echo UNKNOWN' 'echo ${substring 0 10 (elemAt srcs 0).rev}'
|
--replace 'echo UNKNOWN' 'echo ${substring 0 10 (elemAt srcs 0).rev}'
|
||||||
'';
|
'';
|
||||||
|
|
||||||
preBuild = ''
|
preBuild = ''
|
||||||
chmod -R u+w ../yosys-abc
|
chmod -R u+w ../yosys-abc
|
||||||
ln -s ../yosys-abc abc
|
ln -s ../yosys-abc abc
|
||||||
make config-gcc
|
make config-${if stdenv.cc.isClang or false then "clang" else "gcc"}
|
||||||
echo 'ABCREV := default' >> Makefile.conf
|
echo 'ABCREV := default' >> Makefile.conf
|
||||||
makeFlags="PREFIX=$out $makeFlags"
|
makeFlags="PREFIX=$out $makeFlags"
|
||||||
'';
|
'';
|
||||||
|
@ -61,6 +65,6 @@ stdenv.mkDerivation rec {
|
||||||
homepage = http://www.clifford.at/yosys/;
|
homepage = http://www.clifford.at/yosys/;
|
||||||
license = stdenv.lib.licenses.isc;
|
license = stdenv.lib.licenses.isc;
|
||||||
maintainers = with stdenv.lib.maintainers; [ shell thoughtpolice ];
|
maintainers = with stdenv.lib.maintainers; [ shell thoughtpolice ];
|
||||||
platforms = stdenv.lib.platforms.linux;
|
platforms = stdenv.lib.platforms.unix;
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue