Skip to content
Merged
Show file tree
Hide file tree
Changes from 5 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion pkgs/development/compilers/llvm/3.9/clang/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,9 @@ let
mv clang-tools-extra-* $sourceRoot/tools/extra
'';

buildInputs = [ cmake libedit libxml2 llvm python ];
nativeBuildInputs = [ cmake ];

buildInputs = [ libedit libxml2 llvm python ];

cmakeFlags = [
"-DCMAKE_CXX_FLAGS=-std=c++11"
Expand Down
23 changes: 22 additions & 1 deletion pkgs/development/compilers/llvm/3.9/llvm.nix
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,9 @@
, debugVersion ? false
, enableSharedLibraries ? true
, darwin
, buildPackages
, buildPlatform
, hostPlatform
}:

let
Expand All @@ -39,7 +42,16 @@ in stdenv.mkDerivation rec {

outputs = [ "out" ] ++ stdenv.lib.optional enableSharedLibraries "lib";

buildInputs = [ perl groff cmake libxml2 python libffi ]
nativeBuildInputs = [
perl
cmake
python
];

buildInputs = [
groff
libxml2
libffi ]

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not to be a big nit, but ] on the line below before ++ I think would be more idiomatic.

++ stdenv.lib.optionals stdenv.isDarwin [ libcxxabi ];

propagatedBuildInputs = [ ncurses zlib ];
Expand Down Expand Up @@ -72,6 +84,12 @@ in stdenv.mkDerivation rec {
preBuild = ''
mkdir -p $out/
ln -sv $PWD/lib $out
''
+ # This is a good candidate for using the `placeholder` primitive when it's released
# This should hopefully be unnecessary once
# https://github.com/NixOS/nixpkgs/pull/25047 is merged
stdenv.lib.optionalString (buildPlatform != hostPlatform && enableSharedLibraries) ''
export NIX_CROSS_LDFLAGS="-rpath $lib/lib -rpath $lib/lib64 $NIX_CROSS_LDFLAGS"
'';

cmakeFlags = with stdenv; [
Expand All @@ -88,6 +106,9 @@ in stdenv.mkDerivation rec {
++ stdenv.lib.optionals (isDarwin) [
"-DLLVM_ENABLE_LIBCXX=ON"
"-DCAN_TARGET_i386=false"
] ++ stdenv.lib.optionals (buildPlatform != hostPlatform) [
"-DCMAKE_CROSSCOMPILING=True"

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hmm, this is a general cmake thing? This could be generalized to be so added for all derivations with cmakeFlags I suppose.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"-DLLVM_TABLEGEN=${buildPackages.llvmPackages_39.llvm}/bin/llvm-tblgen"
];

postBuild = ''
Expand Down
3 changes: 2 additions & 1 deletion pkgs/tools/text/groff/default.nix
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
{ stdenv, fetchurl, perl, groff
, ghostscript #for postscript and html output
, psutils, netpbm #for html output
, buildPackages
}:

stdenv.mkDerivation rec {
Expand Down Expand Up @@ -49,7 +50,7 @@ stdenv.mkDerivation rec {
# Trick to get the build system find the proper 'native' groff
# http://www.mail-archive.com/bug-groff@gnu.org/msg01335.html
preBuild = ''
makeFlags="GROFF_BIN_PATH=${groff}/bin GROFFBIN=${groff}/bin/groff"
makeFlags="GROFF_BIN_PATH=${buildPackages.groff}/bin GROFFBIN=${buildPackages.groff}/bin/groff"
'';
};

Expand Down