Skip to content

Commit

Permalink
bump
Browse files Browse the repository at this point in the history
  • Loading branch information
angerman committed Jun 8, 2018
1 parent 3c044d2 commit 68d2d15
Show file tree
Hide file tree
Showing 7 changed files with 139 additions and 24 deletions.
28 changes: 28 additions & 0 deletions pkgs/development/compilers/gcc/7/default-ng.nix
Original file line number Diff line number Diff line change
Expand Up @@ -67,4 +67,32 @@ in stdenv.mkDerivation ({
# it should be a no-op mostly anyway, and would
# simplify the expression.
buildPhase = "";
} // optionalAttrs (component != "gcc") {
# alright, so if we do build the components
# separately, they still end up in
# $out/lib/gcc/<target>/<version>
# that's also where the include folder ends
# up in. As we'll only push $out/lib and
# $out/include into the NIX_CFLAGS and NIX_LDFLAGS
# we need to move them into place.
postInstall = ''
set -v
mv $out/lib $out/lib.old
mv $(ls -d $out/lib.old/gcc/*/*) $out/lib
mv $out/lib/include $out/include
mkdir -p $out/include
mv $out/*/lib/* $out/lib
mkdir -p $out/lib
ls $out
targetDir=$(find $out -name "*-*-*" -mindepth 1 -maxdepth 1 -type d)
if [[ -d "$targetDir/include" ]]; then
mv $targetDir/include/*/*/* $out/include
fi
targetDir2=$(find $out/include -name "*-*-*" -mindepth 1 -maxdepth 1 -type d)
if [[ -d "$targetDir2" ]]; then
cp -r $targetDir2/* $out/include
fi
rm -fR $out/lib.old
set +v
'';
})
4 changes: 2 additions & 2 deletions pkgs/development/compilers/ghc/8.2.1-binary.nix
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ stdenv.mkDerivation rec {
for exe in $(find . -type f -executable); do
isScript $exe && continue
ln -fs ${libiconv}/lib/libiconv.dylib $(dirname $exe)/libiconv.dylib
install_name_tool -change /usr/lib/libiconv.2.dylib @executable_path/libiconv.dylib -change /usr/local/lib/gcc/6/libgcc_s.1.dylib ${gcc.cc.lib}/lib/libgcc_s.1.dylib $exe
install_name_tool -change /usr/lib/libiconv.2.dylib @executable_path/libiconv.dylib $exe
done
'' +

Expand Down Expand Up @@ -131,7 +131,7 @@ stdenv.mkDerivation rec {
for exe in $(find "$out" -type f -executable); do
isScript $exe && continue
ln -fs ${libiconv}/lib/libiconv.dylib $(dirname $exe)/libiconv.dylib
install_name_tool -change /usr/lib/libiconv.2.dylib @executable_path/libiconv.dylib -change /usr/local/lib/gcc/6/libgcc_s.1.dylib ${gcc.cc.lib}/lib/libgcc_s.1.dylib $exe
install_name_tool -change /usr/lib/libiconv.2.dylib @executable_path/libiconv.dylib $exe
done
for file in $(find "$out" -name setup-config); do
Expand Down
3 changes: 1 addition & 2 deletions pkgs/development/compilers/ghc/8.4.2.nix
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,7 @@ let
include mk/flavours/\$(BuildFlavour).mk
endif
DYNAMIC_GHC_PROGRAMS = ${if enableShared then "YES" else "NO"}
'' + stdenv.lib.optionalString enableIntegerSimple ''
INTEGER_LIBRARY = integer-simple
INTEGER_LIBRARY = ${if enableIntegerSimple then "integer-simple" else "integer-gmp"}
'' + stdenv.lib.optionalString (targetPlatform != hostPlatform) ''
Stage1Only = YES
HADDOCK_DOCS = NO
Expand Down
15 changes: 13 additions & 2 deletions pkgs/development/libraries/gmp/6.x.nix
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
{ stdenv, fetchurl, m4, cxx ? true
, targetPlatform
, buildPackages
, withStatic ? false }:

let inherit (stdenv.lib) optional optionalString; in

let self = stdenv.mkDerivation rec {
let self = stdenv.mkDerivation (rec {
name = "gmp-6.1.2";

src = fetchurl { # we need to use bz2, others aren't in bootstrapping stdenv
Expand Down Expand Up @@ -78,5 +79,15 @@ let self = stdenv.mkDerivation rec {
platforms = platforms.all;
maintainers = [ maintainers.peti maintainers.vrthra ];
};
};
} // stdenv.lib.optionalAttrs targetPlatform.isWindows {
# NOTE: can not use stdenv.cc.isGNU / isClang, as that results in
# an infinite recursion at the gmp = gmp6 line in all-packages.
#
# do *not* pass CXXSTDLIB when cc is not clang, gcc doesn't understand
# -stdlib=libc++. If the buildPackages compiler is clang, we will
# inject this, and certainly do not want it for the cc compiler.
preConfigure = ''
export NIX_CXXSTDLIB_LINK=""
'';
});
in self
8 changes: 7 additions & 1 deletion pkgs/development/libraries/openssl/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,11 @@ let
# Parallel building is broken in OpenSSL.
enableParallelBuilding = false;

postInstall = ''
postInstall = (stdenv.lib.optionalString hostPlatform.isWindows ''
echo $out/*
echo $out/lib/*
echo $out/bin/*
'') + ''
# If we're building dynamic libraries, then don't install static
# libraries.
if [ -n "$(echo $out/lib/*.so $out/lib/*.dylib $out/lib/*.dll)" ]; then
Expand All @@ -93,6 +97,8 @@ let
rm -r $out/etc/ssl/misc
rmdir $out/etc/ssl/{certs,private}
'' + stdenv.lib.optionalString hostPlatform.isWindows ''
cp $bin/bin/*.dll $out/lib/
'';

postFixup = ''
Expand Down
45 changes: 36 additions & 9 deletions pkgs/development/libraries/rocksdb/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ stdenv.mkDerivation rec {
name = "rocksdb-${version}";
version = "5.11.3";

outputs = [ "dev" "out" "static" "bin" ];
# outputs = [ "dev" "out" "static" "bin" ];

src = fetchFromGitHub {
owner = "facebook";
Expand All @@ -40,17 +40,44 @@ stdenv.mkDerivation rec {
};

# cmakeFlags = "-DCMAKE_C_COMPILER=x86_64-w64-mingw32-gcc -DCMAKE_CXX_COMPILER=x86_64-w64-mingw32-g++ ";
cmakeFlags = "-DCMAKE_SYSTEM_NAME=Windows -DCMAKE_CXX_FLAGS=-std=c++11 -DCMAKE_CXX_FLAGS=-pthread";
buildFlags = "rocksdb VERBOSE=1 -j1";
cmakeFlags = "-DJNI=0 -DWITH_GFLAGS=0 -DCMAKE_SYSTEM_NAME=Windows";
buildFlags = "rocksdb-shared rocksdb";

# preInstall = ''
# mv librocksdb.a ..
# cd ..
# '';

installPhase = ''
install -d $out/lib
cd ..
for header_dir in `find "include/rocksdb" -type d`; do \
install -d $out/$header_dir; \
done
for header in `find "include/rocksdb" -type f -name "*.h"`; do \
install -C -m 644 $header $out/$header; \
done
cd build
for lib in `find . -type f -name "*rocksdb*.a"`; do \
install -C -m 755 $lib $out/lib
done
for lib in `find . -type f -name "*rocksdb*.dll"`; do \
install -C -m 755 $lib $out/lib
done
'';

NIX_CFLAGS_COMPILE = [ "-Wno-unused-but-set-variable" "-D_POSIX_C_SOURCE" "-static-libstdc++" ];

# postPatch = ''
# # Hack to fix typos
# sed -i 's,#inlcude,#include,g' build_tools/build_detect_platform
# '';

hardeningDisable = [ "format" "stackprotector" ];
# # Environment vars used for building certain configurations
PORTABLE = "1";
USE_SSE = "1";
# CMAKE_CXX_FLAGS = "-static-libstdc++";
# CXXFLAGS = "-static-libstdc++";
#CMAKE_CXX_FLAGS = "-std=c++11 -pthread -pthreads";
# JEMALLOC_LIB = stdenv.lib.optionalString (malloc == jemalloc) "-ljemalloc";

Expand All @@ -68,11 +95,11 @@ stdenv.mkDerivation rec {
# "static_lib"
# ] ++ tools ;

# installFlags = buildAndInstallFlags ++ [
# "INSTALL_PATH=\${out}"
# "install-shared"
# "install-static"
# ];
# installFlags = [
# "INSTALL_PATH=\${out}"
# "install-shared"
# "install-headers"
# ];

# postInstall = ''
# # Might eventually remove this when we are confident in the build process
Expand Down
60 changes: 52 additions & 8 deletions pkgs/top-level/all-packages.nix
Original file line number Diff line number Diff line change
Expand Up @@ -6092,7 +6092,7 @@ with pkgs;
gerbil-unstable = callPackage ../development/compilers/gerbil/unstable.nix { };

gccFun = callPackage ../development/compilers/gcc/7;
gcc = gcc7-ng-msvcrt;
gcc = gcc7-ng;
gcc-unwrapped = gcc.cc;

gccStdenv = if stdenv.cc.isGNU then stdenv else stdenv.override {
Expand Down Expand Up @@ -6160,7 +6160,12 @@ with pkgs;
crossLibcStdenv = buildPackages.makeStdenvCross {
inherit (buildPackages.buildPackages) stdenv;
inherit buildPlatform hostPlatform targetPlatform;
cc = buildPackages.gcc7-ng-msvcrt; #gccCrossStageStatic;
cc = buildPackages.gcc7-ng;#-msvcrt; #gccCrossStageStatic;
};
crossLibcStdenvNoLibgcc = buildPackages.makeStdenvCross {
inherit (buildPackages.buildPackages) stdenv;
inherit buildPlatform hostPlatform targetPlatform;
cc = buildPackages.gcc7-ng-msvcrt;#-msvcrt; #gccCrossStageStatic;
};
crossLibcStdenvNolibc = buildPackages.makeStdenvCross {
inherit (buildPackages.buildPackages) stdenv;
Expand Down Expand Up @@ -6280,6 +6285,18 @@ with pkgs;
# and build winpthreads
# - finish building the rest of gcc. (libgcc, ...)

# Dependencies:
#
#
# gcc7
# - gcc7-ng-msvcrt
# - mingw_w64
# - mingw_w64_headers
# - gcc7-ng-libgcc
# - bintools
# - mingw_w64
# - mingw_w64_pthreads

gcc7-ng-prebuilt =
let libc = targetPackages.windows.mingw_w64_headers;
bintools = wrapBintoolsWith { bintools = binutils-unwrapped; libc = libc; };
Expand All @@ -6298,6 +6315,19 @@ with pkgs;
let libc = targetPackages.windows.mingw_w64;
bintools = wrapBintoolsWith { bintools = binutils-unwrapped; libc = libc; };
in wrapCCWith {
extraPackages = [ libc targetPackages.windows.mingw_w64_headers ];
cc = callPackage ../development/compilers/gcc/7/default-ng.nix { gcc-prebuilt = gcc7-ng-prebuilt; component = "gcc"; };
libc = libc;
bintools = bintools;
};

gcc7-ng =
let libc = targetPackages.windows.mingw_w64;
bintools = wrapBintoolsWith { bintools = binutils-unwrapped; libc = libc; };
in wrapCCWith {
extraPackages = [ targetPackages.gcc7-ng-libgcc targetPackages.gcc7-ng-libssp targetPackages.gcc7-ng-libstdcpp-v3
libc targetPackages.windows.mingw_w64_headers targetPackages.windows.mingw_w64_pthreads
];
cc = callPackage ../development/compilers/gcc/7/default-ng.nix { gcc-prebuilt = gcc7-ng-prebuilt; component = "gcc"; };
libc = libc;
bintools = bintools;
Expand All @@ -6306,7 +6336,21 @@ with pkgs;
# this is a rather convoluted setup to achive the following:
# still use the build machiens CC, yet build a target library.
gcc7-ng-libgcc = callPackage ../development/compilers/gcc/7/default-ng.nix { gcc-prebuilt = buildPackages.gcc7-ng-prebuilt; component = "target-libgcc";
stdenv = buildPackages.stdenv; #crossLibcStdenv;
stdenv = buildPackages.stdenv;
extraBuildInputs = [ windows.mingw_w64 buildPackages.binutils-unwrapped windows.mingw_w64_pthreads ];
inherit (buildPackages) gmp mpfr libmpc;
};

# this is a rather convoluted setup to achive the following:
# still use the build machiens CC, yet build a target library.
gcc7-ng-libssp = callPackage ../development/compilers/gcc/7/default-ng.nix { gcc-prebuilt = buildPackages.gcc7-ng-prebuilt; component = "target-libssp";
stdenv = buildPackages.stdenv;
extraBuildInputs = [ windows.mingw_w64 buildPackages.binutils-unwrapped windows.mingw_w64_pthreads ];
inherit (buildPackages) gmp mpfr libmpc;
};

gcc7-ng-libstdcpp-v3 = callPackage ../development/compilers/gcc/7/default-ng.nix { gcc-prebuilt = buildPackages.gcc7-ng-prebuilt; component = "target-libstdc++-v3";
stdenv = buildPackages.stdenv;
extraBuildInputs = [ windows.mingw_w64 buildPackages.binutils-unwrapped windows.mingw_w64_pthreads ];
inherit (buildPackages) gmp mpfr libmpc;
};
Expand All @@ -6324,7 +6368,7 @@ with pkgs;

gcc-snapshot = lowPrio (wrapCC (callPackage ../development/compilers/gcc/snapshot {
inherit noSysDirs;

# PGO seems to speed up compilation by gcc by ~10%, see #445 discussion
profiledCompiler = with stdenv; (!isDarwin && (isi686 || isx86_64));

Expand Down Expand Up @@ -7025,7 +7069,7 @@ with pkgs;

wla-dx = callPackage ../development/compilers/wla-dx { };

wrapCCWith = { name ? "", cc, bintools, libc, extraBuildCommands ? "" }:
wrapCCWith = { name ? "", cc, bintools, libc, extraBuildCommands ? "", extraPackages ? [] }:
ccWrapperFun rec {
nativeTools = targetPlatform == hostPlatform && stdenv.cc.nativeTools or false;
nativeLibc = targetPlatform == hostPlatform && stdenv.cc.nativeLibc or false;
Expand All @@ -7035,7 +7079,7 @@ with pkgs;
isGNU = cc.isGNU or false;
isClang = cc.isClang or false;

inherit name cc bintools libc extraBuildCommands;
inherit name cc bintools libc extraBuildCommands extraPackages;
};

ccWrapperFun = callPackage ../build-support/cc-wrapper;
Expand Down Expand Up @@ -11482,7 +11526,7 @@ with pkgs;

rlog = callPackage ../development/libraries/rlog { };

rocksdb = callPackage ../development/libraries/rocksdb { stdenv = overrideCC stdenv gcc7-ng-msvcrt; jemalloc = jemalloc450; };
rocksdb = callPackage ../development/libraries/rocksdb { jemalloc = jemalloc450; };

rocksdb_lite = rocksdb.override { enableLite = true; };

Expand Down Expand Up @@ -14282,7 +14326,7 @@ with pkgs;
mingw_w64_headers = callPackage ../os-specific/windows/mingw-w64/headers.nix { };

mingw_w64_pthreads = callPackage ../os-specific/windows/mingw-w64/pthreads.nix {
stdenv = crossLibcStdenv;
stdenv = crossLibcStdenvNoLibgcc;
};

pthreads = callPackage ../os-specific/windows/pthread-w32 {
Expand Down

0 comments on commit 68d2d15

Please sign in to comment.