Skip to content

Commit

Permalink
Deleting coreutils dependence and replacing its uname by $OSTYPE
Browse files Browse the repository at this point in the history
…bash var (#835)

Fixes: #834
  • Loading branch information
Robertorosmaninho authored Sep 21, 2023
1 parent c603ac7 commit c64bbbb
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 7 deletions.
1 change: 0 additions & 1 deletion INSTALL.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@ brew update
brew install \
boost \
cmake \
coreutils \
flex \
fmt \
git \
Expand Down
6 changes: 3 additions & 3 deletions bin/llvm-kompile-clang
Original file line number Diff line number Diff line change
Expand Up @@ -34,11 +34,11 @@ HERE
infer_library_name() {
base_name="$(basename "$1")"
dir_name="$(dirname "$1")"

if [[ "$base_name" =~ \. ]]; then
echo "$1"
else
if [[ "$(uname)" == "Darwin" ]]; then
if [[ "$OSTYPE" == "darwin"* ]]; then
ext=".dylib"
else
ext=".so"
Expand Down Expand Up @@ -81,7 +81,7 @@ while [[ $# -gt 0 ]]; do
shift
;;
-save-temps)
save_temps=true
save_temps=true
;;
-o)
output=true
Expand Down
5 changes: 2 additions & 3 deletions nix/llvm-backend.nix
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{ lib, src, cmake, coreutils, flex, fmt, pkgconfig, llvm, libllvm, libcxxabi, stdenv, boost, gmp
{ lib, src, cmake, flex, fmt, pkgconfig, llvm, libllvm, libcxxabi, stdenv, boost, gmp
, jemalloc, libffi, libiconv, libyaml, mpfr, ncurses, python39, unixtools,
# Runtime dependencies:
host, perl,
Expand All @@ -14,7 +14,7 @@ stdenv.mkDerivation {
nativeBuildInputs = [ cmake flex llvm pkgconfig ];
buildInputs = [ libyaml ];
propagatedBuildInputs = [
boost coreutils fmt gmp jemalloc libffi mpfr ncurses python-env unixtools.xxd
boost fmt gmp jemalloc libffi mpfr ncurses python-env unixtools.xxd
] ++ lib.optional stdenv.isDarwin libiconv;

dontStrip = true;
Expand All @@ -32,7 +32,6 @@ stdenv.mkDerivation {
'extra_python_flags=($(${python-env}/bin/pybind11-config --includes))'
substituteInPlace bin/llvm-kompile-clang \
--replace 'uname' '${coreutils}/bin/uname' \
--replace '"-lgmp"' '"-I${gmp.dev}/include" "-L${gmp}/lib" "-lgmp"' \
--replace '"-lmpfr"' '-I${mpfr.dev}/include "-L${mpfr}/lib" "-lmpfr"' \
--replace '"-lffi"' '"-L${libffi}/lib" "-lffi"' \
Expand Down

0 comments on commit c64bbbb

Please sign in to comment.