Merge remote-tracking branch 'upstream/master' into racket-full-darwin

This commit is contained in:
Claes Wallin (韋嘉誠)
2018-11-16 15:41:48 +08:00
12435 changed files with 535553 additions and 310415 deletions
@@ -13,15 +13,19 @@ assert withTeensyduino -> withGui;
# xdotool script; the cause of this hang is not yet known.
# TODO: There is a fair chance that Teensyduino works with arm-linux, but it
# has not yet been tested.
if withTeensyduino && (stdenv.system != "x86_64-linux") then throw
if withTeensyduino && (stdenv.hostPlatform.system != "x86_64-linux") then throw
"Teensyduino is only supported on x86_64-linux at this time (patches welcome)."
else
let
externalDownloads = import ./downloads.nix {inherit fetchurl; inherit (lib) optionalAttrs; inherit (stdenv) system;};
externalDownloads = import ./downloads.nix {
inherit fetchurl;
inherit (lib) optionalAttrs;
inherit (stdenv.hostPlatform) system;
};
# Some .so-files are later copied from .jar-s to $HOME, so patch them beforehand
patchelfInJars =
lib.optional (stdenv.system == "x86_64-linux") {jar = "share/arduino/lib/jssc-2.8.0-arduino1.jar"; file = "libs/linux/libjSSC-2.8_x86_64.so";}
++ lib.optional (stdenv.system == "i686-linux") {jar = "share/arduino/lib/jssc-2.8.0-arduino1.jar"; file = "libs/linux/libjSSC-2.8_x86.so";}
lib.optional (stdenv.hostPlatform.system == "x86_64-linux") {jar = "share/arduino/lib/jssc-2.8.0-arduino1.jar"; file = "libs/linux/libjSSC-2.8_x86_64.so";}
++ lib.optional (stdenv.hostPlatform.system == "i686-linux") {jar = "share/arduino/lib/jssc-2.8.0-arduino1.jar"; file = "libs/linux/libjSSC-2.8_x86.so";}
;
# abiVersion 6 is default, but we need 5 for `avrdude_bin` executable
ncurses5 = ncurses.override { abiVersion = "5"; };
@@ -46,9 +50,9 @@ let
zlib
];
teensy_architecture =
lib.optionalString (stdenv.system == "x86_64-linux") "linux64"
+ lib.optionalString (stdenv.system == "i686-linux") "linux32"
+ lib.optionalString (stdenv.system == "arm-linux") "linuxarm";
lib.optionalString (stdenv.hostPlatform.system == "x86_64-linux") "linux64"
+ lib.optionalString (stdenv.hostPlatform.system == "i686-linux") "linux32"
+ lib.optionalString (stdenv.hostPlatform.system == "arm-linux") "linuxarm";
flavor = (if withTeensyduino then "teensyduino" else "arduino")
+ stdenv.lib.optionalString (!withGui) "-core";
@@ -1,23 +1,42 @@
{ stdenv, lib, buildFHSUserEnv
}:
{ lib, buildFHSUserEnv }:
let
pio-pkgs = pkgs: (with pkgs;
[
python27Packages.python
python27Packages.setuptools
python27Packages.pip
python27Packages.bottle
python27Packages.platformio
pio-pkgs = pkgs:
let
python = pkgs.python.override {
packageOverrides = self: super: {
# https://github.com/platformio/platformio-core/issues/349
click = super.click.overridePythonAttrs (oldAttrs: rec {
version = "5.1";
src = oldAttrs.src.override {
inherit version;
sha256 = "678c98275431fad324275dec63791e4a17558b40e5a110e20a82866139a85a5a";
};
patches = [];
});
platformio = self.callPackage ./core.nix { };
};
};
in (with pkgs; [
zlib
git
]) ++ (with python.pkgs; [
python
setuptools
pip
bottle
platformio
]);
in
buildFHSUserEnv {
in buildFHSUserEnv {
name = "platformio";
targetPkgs = pio-pkgs;
multiPkgs = pio-pkgs;
meta = with stdenv.lib; {
meta = with lib; {
description = "An open source ecosystem for IoT development";
homepage = http://platformio.org;
maintainers = with maintainers; [ mog ];
@@ -0,0 +1,83 @@
{ stdenv, lib, buildPythonApplication, fetchFromGitHub
, bottle, click, colorama
, lockfile, pyserial, requests
, pytest, semantic-version, tox
, git
}:
let
args = lib.concatStringsSep " " ((map (e: "--deselect tests/${e}") [
"commands/test_ci.py::test_ci_boards"
"commands/test_ci.py::test_ci_project_conf"
"commands/test_ci.py::test_ci_lib_and_board"
"commands/test_init.py::test_init_enable_auto_uploading"
"commands/test_init.py::test_init_custom_framework"
"commands/test_init.py::test_init_incorrect_board"
"commands/test_init.py::test_init_ide_atom"
"commands/test_init.py::test_init_ide_eclipse"
"commands/test_init.py::test_init_duplicated_boards"
"commands/test_init.py::test_init_special_board"
"commands/test_lib.py::test_search"
"commands/test_lib.py::test_install_duplicates"
"commands/test_lib.py::test_global_lib_update_check"
"commands/test_lib.py::test_global_lib_update"
"commands/test_lib.py::test_global_lib_uninstall"
"commands/test_lib.py::test_lib_show"
"commands/test_lib.py::test_lib_stats"
"commands/test_lib.py::test_global_install_registry"
"commands/test_lib.py::test_global_install_archive"
"commands/test_lib.py::test_global_install_repository"
"commands/test_lib.py::test_global_lib_list"
"commands/test_test.py::test_local_env"
"test_builder.py::test_build_flags"
"test_builder.py::test_build_unflags"
"test_misc.py::test_api_cache"
"test_misc.py::test_ping_internet_ips"
"test_pkgmanifest.py::test_packages"
]) ++ (map (e: "--ignore=tests/${e}") [
"commands/test_boards.py"
"commands/test_platform.py"
"commands/test_update.py"
"test_maintenance.py"
"test_ino2cpp.py"
]));
in buildPythonApplication rec {
pname = "platformio";
version = "3.6.1";
# pypi tarball doesn't contain tests
src = fetchFromGitHub {
owner = "platformio";
repo = "platformio-core";
rev = "v${version}";
sha256 = "01xz9figqrzb0m9467q14lg51vmgq0hbaap0xdx08n5v2ycmzj0v";
};
propagatedBuildInputs = [
bottle click colorama git lockfile
pyserial requests semantic-version
];
HOME = "/tmp";
checkInputs = [ pytest tox ];
checkPhase = ''
runHook preCheck
py.test -v tests ${args}
runHook postCheck
'';
patches = [ ./fix-searchpath.patch ];
meta = with stdenv.lib; {
broken = stdenv.isAarch64;
description = "An open source ecosystem for IoT development";
homepage = http://platformio.org;
license = licenses.asl20;
maintainers = with maintainers; [ mog makefu ];
};
}
@@ -1,5 +1,5 @@
{ pkgs, newScope }:
{ newScope }:
let
callPackage = newScope self;
+19 -14
View File
@@ -1,7 +1,7 @@
{ stdenv, pkgs, erlang }:
let
inherit (stdenv.lib) getVersion versionAtLeast makeExtensible;
inherit (stdenv.lib) makeExtensible;
lib = pkgs.callPackage ./lib.nix {};
@@ -42,27 +42,32 @@ let
buildMix = callPackage ./build-mix.nix {};
# BEAM-based languages.
elixir = elixir_1_6;
elixir = elixir_1_7;
elixir_1_7 = lib.callElixir ../interpreters/elixir/1.7.nix {
inherit rebar erlang;
debugInfo = true;
};
elixir_1_6 = lib.callElixir ../interpreters/elixir/1.6.nix {
inherit rebar erlang;
debugInfo = true;
};
inherit rebar erlang;
debugInfo = true;
};
elixir_1_5 = lib.callElixir ../interpreters/elixir/1.5.nix {
inherit rebar erlang;
debugInfo = true;
};
inherit rebar erlang;
debugInfo = true;
};
elixir_1_4 = lib.callElixir ../interpreters/elixir/1.4.nix {
inherit rebar erlang;
debugInfo = true;
};
inherit rebar erlang;
debugInfo = true;
};
elixir_1_3 = lib.callElixir ../interpreters/elixir/1.3.nix {
inherit rebar erlang;
debugInfo = true;
};
inherit rebar erlang;
debugInfo = true;
};
lfe = lfe_1_2;
lfe_1_2 = lib.callLFE ../interpreters/lfe/1.2.nix { inherit erlang buildRebar3 buildHex; };
@@ -2,15 +2,14 @@
stdenv.mkDerivation rec {
name = "hex-registry";
rev = "9f736e7";
version = "0.0.0+build.${rev}";
rev = "11d7a24e9f53f52490ce255a6248e71128e73aa1";
version = "20180712.${rev}";
# src = /home/gleber/code/erl/hex-pm-registry-snapshots;
src = fetchFromGitHub {
owner = "erlang-nix";
repo = "hex-pm-registry-snapshots";
inherit rev;
sha256 = "1xiw5yifyk3bbmr0cr82y1nc4c6zk11f6azdv07glb7yrgccrv79";
owner = "erlang-nix";
repo = "hex-pm-registry-snapshots";
sha256 = "0dbpcrdh6jqmvnm1ysmy7ixyc95vnbqmikyx5kk77qwgyd43fqgi";
};
installPhase = ''
-2
View File
@@ -49,7 +49,6 @@ rec {
*/
callElixir = drv: args:
let
inherit (stdenv.lib) versionAtLeast;
builder = callPackage ../interpreters/elixir/generic-builder.nix args;
in
callPackage drv {
@@ -71,7 +70,6 @@ rec {
*/
callLFE = drv: args:
let
inherit (stdenv.lib) versionAtLeast;
builder = callPackage ../interpreters/lfe/generic-builder.nix args;
in
callPackage drv {
@@ -1,41 +0,0 @@
{ stdenv, fetchurl, unzip }:
stdenv.mkDerivation rec {
name = "adobe-flex-sdk-4.0.0.14159-mpl";
src = fetchurl {
# This is the open source distribution
url = http://fpdownload.adobe.com/pub/flex/sdk/builds/flex4/flex_sdk_4.0.0.14159_mpl.zip;
sha256 = "1x12sji6g42bm1h7jndkda5vpah6vnkpc13qwq0c4xvbsh8757v5";
};
phases = "installPhase";
buildInputs = [ unzip ];
# Why do shell scripts have \r\n ??
# moving to /opt because jdk has lib/xercesImpl.jar as well
installPhase = ''
unzip ${src}
t=$out/opt/flex-sdk
mkdir -p $t $out/bin
mv * $t
rm $t/bin/*.exe $t/bin/*.bat
sed 's/$//' -i $t/bin/*
for i in $t/bin/*; do
b="$(basename "$i")";
cat > "$out/bin/$b" << EOF
#!/bin/sh
exec $t/bin/$b "\$@"
EOF
chmod +x $out/bin/$b $t/bin/$b
done
'';
meta = {
description = "Flex SDK for Adobe Flash / ActionScript";
homepage = "http://www.adobe.com/products/flex.html";
license = stdenv.lib.licenses.mpl11;
platforms = stdenv.lib.platforms.unix;
};
}
@@ -0,0 +1,59 @@
{ name
, url
, sha256
}:
{ swingSupport ? true # not used for now
, stdenv
, fetchurl
}:
let result = stdenv.mkDerivation rec {
inherit name;
src = fetchurl {
inherit url sha256;
};
# See: https://github.com/NixOS/patchelf/issues/10
dontStrip = 1;
installPhase = ''
cd ..
mv $sourceRoot $out
rm -rf $out/Home/demo
# Remove some broken manpages.
rm -rf $out/Home/man/ja*
# for backward compatibility
ln -s $out/Contents/Home $out/jre
ln -s $out/Contents/Home/* $out/
mkdir -p $out/nix-support
# Set JAVA_HOME automatically.
cat <<EOF >> $out/nix-support/setup-hook
if [ -z "\$JAVA_HOME" ]; then export JAVA_HOME=$out; fi
EOF
'';
# FIXME: use multiple outputs or return actual JRE package
passthru.jre = result;
passthru.home = result;
# for backward compatibility
passthru.architecture = "";
meta = with stdenv.lib; {
license = licenses.gpl2Classpath;
description = "AdoptOpenJDK, prebuilt OpenJDK binary";
platforms = [ "x86_64-darwin" ]; # some inherit jre.meta.platforms
maintainers = with stdenv.lib.maintainers; [ taku0 ];
};
}; in result
@@ -0,0 +1,119 @@
{ name
, url
, sha256
}:
{ swingSupport ? true
, stdenv
, fetchurl
, file
, xorg ? null
, glib
, libxml2
, ffmpeg_2
, libxslt
, libGL
, freetype
, fontconfig
, gtk2
, pango
, cairo
, alsaLib
, atk
, gdk_pixbuf
, zlib
, elfutils
}:
assert swingSupport -> xorg != null;
let
rSubPaths = [
"lib/jli"
"lib/server"
"lib/compressedrefs" # OpenJ9
"lib/j9vm" # OpenJ9
"lib"
];
libraries = [
stdenv.cc.libc glib libxml2 ffmpeg_2 libxslt libGL
xorg.libXxf86vm alsaLib fontconfig freetype pango gtk2 cairo gdk_pixbuf
atk zlib elfutils
] ++ (stdenv.lib.optionals swingSupport [
xorg.libX11 xorg.libXext xorg.libXtst xorg.libXi xorg.libXp xorg.libXt
xorg.libXrender
stdenv.cc.cc
]);
in
let result = stdenv.mkDerivation rec {
inherit name;
src = fetchurl {
inherit url sha256;
};
nativeBuildInputs = [ file ];
# See: https://github.com/NixOS/patchelf/issues/10
dontStrip = 1;
installPhase = ''
cd ..
# Set PaX markings
exes=$(file $sourceRoot/bin/* 2> /dev/null | grep -E 'ELF.*(executable|shared object)' | sed -e 's/: .*$//')
for file in $exes; do
paxmark m "$file"
# On x86 for heap sizes over 700MB disable SEGMEXEC and PAGEEXEC as well.
${stdenv.lib.optionalString stdenv.isi686 ''paxmark msp "$file"''}
done
mv $sourceRoot $out
rm -rf $out/demo
# Remove some broken manpages.
rm -rf $out/man/ja*
# for backward compatibility
ln -s $out $out/jre
mkdir -p $out/nix-support
# Set JAVA_HOME automatically.
cat <<EOF >> $out/nix-support/setup-hook
if [ -z "\$JAVA_HOME" ]; then export JAVA_HOME=$out; fi
EOF
'';
postFixup = ''
rpath+="''${rpath:+:}${stdenv.lib.concatStringsSep ":" (map (a: "$out/${a}") rSubPaths)}"
# set all the dynamic linkers
find $out -type f -perm -0100 \
-exec patchelf --interpreter "$(cat $NIX_CC/nix-support/dynamic-linker)" \
--set-rpath "$rpath" {} \;
find $out -name "*.so" -exec patchelf --set-rpath "$rpath" {} \;
'';
rpath = stdenv.lib.strings.makeLibraryPath libraries;
# FIXME: use multiple outputs or return actual JRE package
passthru.jre = result;
passthru.home = result;
# for backward compatibility
passthru.architecture = "";
meta = with stdenv.lib; {
license = licenses.gpl2Classpath;
description = "AdoptOpenJDK, prebuilt OpenJDK binary";
platforms = [ "x86_64-linux" ]; # some inherit jre.meta.platforms
maintainers = with stdenv.lib.maintainers; [ taku0 ];
};
}; in result
@@ -0,0 +1,43 @@
let
makePackage = { version, buildNumber, packageType, vmType, sha256 }: import ./jdk-darwin-base.nix {
name = if packageType == "jdk"
then
"adoptopenjdk-${vmType}-bin-${version}"
else
"adoptopenjdk-${packageType}-${vmType}-bin-${version}";
url = "https://github.com/AdoptOpenJDK/openjdk11-binaries/releases/download/jdk-${version}%2B${buildNumber}/OpenJDK11-${packageType}_x64_mac_${vmType}_${version}_${buildNumber}.tar.gz";
inherit sha256;
};
in
{
jdk-hotspot = makePackage {
version = "11";
buildNumber = "28";
packageType = "jdk";
vmType = "hotspot";
sha256 = "ca0ec49548c626904061b491cae0a29b9b4b00fb34d8973dc217e10ab21fb0f3";
};
jre-hotspot = makePackage {
version = "11";
buildNumber = "28";
packageType = "jre";
vmType = "hotspot";
sha256 = "ef4dbfe5aed6ab2278fcc14db6cc73abbaab56e95f6ebb023790a7ebc6d7f30c";
};
jdk-openj9 = makePackage {
version = "11.0.1";
buildNumber = "13";
packageType = "jdk";
vmType = "openj9";
sha256 = "c5e9b588b4ac5b0bd5b4edd69d59265d1199bb98af7ca3270e119b264ffb6e3f";
};
jre-openj9 = makePackage {
version = "11.0.1";
buildNumber = "13";
packageType = "jre";
vmType = "openj9";
sha256 = "0901dc5946fdf967f92f7b719ddfffdcdde5bd3fef86a83d7a3f2f39ddbef1f8";
};
}
@@ -0,0 +1,43 @@
let
makePackage = { version, buildNumber, packageType, vmType, sha256 }: import ./jdk-linux-base.nix {
name = if packageType == "jdk"
then
"adoptopenjdk-${vmType}-bin-${version}"
else
"adoptopenjdk-${packageType}-${vmType}-bin-${version}";
url = "https://github.com/AdoptOpenJDK/openjdk11-binaries/releases/download/jdk-${version}%2B${buildNumber}/OpenJDK11-${packageType}_x64_linux_${vmType}_${version}_${buildNumber}.tar.gz";
inherit sha256;
};
in
{
jdk-hotspot = makePackage {
version = "11";
buildNumber = "28";
packageType = "jdk";
vmType = "hotspot";
sha256 = "e1e18fc9ce2917473da3e0acb5a771bc651f600c0195a3cb40ef6f22f21660af";
};
jre-hotspot = makePackage {
version = "11";
buildNumber = "28";
packageType = "jre";
vmType = "hotspot";
sha256 = "346448142d46c6e51d0fadcaadbcde31251d7678922ec3eb010fcb1b6e17804c";
};
jdk-openj9 = makePackage {
version = "11.0.1";
buildNumber = "13";
packageType = "jdk";
vmType = "openj9";
sha256 = "765947ab9457a29d2aa9d11460a4849611343c1e0ea3b33b9c08409cd4672251";
};
jre-openj9 = makePackage {
version = "11.0.1";
buildNumber = "13";
packageType = "jre";
vmType = "openj9";
sha256 = "a016413fd8415429b42e543fed7a1bee5010b1dbaf71d29a26e1c699f334c6ff";
};
}
@@ -0,0 +1,56 @@
{ stdenv, fetchurl, makeWrapper, jre }:
let
playerglobal_ver = "27.0";
playerglobal = fetchurl {
url = "https://fpdownload.macromedia.com/get/flashplayer/updaters/27/playerglobal27_0.swc";
sha256 = "0qw2bgls8qsmp80j8vpd4c7s0c8anlrk0ac8z42w89bajcdbwk2f";
};
in stdenv.mkDerivation rec {
name = "apache-flex-sdk-${version}";
version = "4.16.1";
src = fetchurl {
url = "https://www.apache.org/dist/flex/${version}/binaries/${name}-bin.tar.gz";
sha256 = "13iq16dqvgcpb0p35x66hzxsq5pkbr2lbwr766nnqiryinnagz8p";
};
nativeBuildInputs = [ makeWrapper ];
buildInputs = [ jre ];
buildPhase = ":";
postPatch = ''
shopt -s extglob
for i in bin/!(aasdoc|acompc|amxmlc); do
substituteInPlace $i --replace "java " "${jre}/bin/java "
done
'';
installPhase = ''
t=$out/opt/apache-flex-sdk
mkdir -p $t $out/bin
mv * $t
rm $t/bin/*.bat
ln -s $t/bin/* $out/bin/
for i in $out/bin/!(aasdoc|acompc|amxmlc); do
wrapProgram $i \
--set FLEX_HOME $t \
--set PLAYERGLOBAL_HOME $t/frameworks/libs/player/
done
mkdir -p $t/frameworks/libs/player/${playerglobal_ver}/
cp ${playerglobal} $t/frameworks/libs/player/${playerglobal_ver}/playerglobal.swc
'';
fixupPhase = ":";
meta = with stdenv.lib; {
description = "Flex SDK for Adobe Flash / ActionScript";
homepage = "https://flex.apache.org/";
license = with licenses; [ asl20 ];
maintainers = with maintainers; [ dywedir ];
};
}
@@ -4,13 +4,13 @@ with builtins;
stdenv.mkDerivation rec {
name = "arachne-pnr-${version}";
version = "2018.02.14";
version = "2018.09.08";
src = fetchFromGitHub {
owner = "cseed";
repo = "arachne-pnr";
rev = "b54675413f9aac1d9a1fb0a8e9354bec2a2a8f3c";
sha256 = "06slsb239qk1r2g96n1g37yp8314cy7yi4g1yf86fr87fr11ml8l";
rev = "840bdfdeb38809f9f6af4d89dd7b22959b176fdd";
sha256 = "1dqvjvgvsridybishv4pnigw9gypxh7r7nrqp9z9qq92v7c5rxzl";
};
enableParallelBuilding = true;
@@ -1,98 +0,0 @@
{stdenv, fetchurl
, arm-frc-linux-gnueabi-binutils, arm-frc-linux-gnueabi-eglibc, arm-frc-linux-gnueabi-linux-api-headers
, elfutils
, libmpc, gmp, mpfr, zlib, isl_0_15, cloog}:
stdenv.mkDerivation rec {
_target = "arm-frc-linux-gnueabi";
version = "4.9.4";
name = "${_target}-gcc-${version}";
src = fetchurl {
url = "ftp://gcc.gnu.org/pub/gcc/releases/gcc-${version}/gcc-${version}.tar.bz2";
sha256 = "6c11d292cd01b294f9f84c9a59c230d80e9e4a47e5c6355f046bb36d4f358092";
};
patches = [
./minorSOname.patch
./no-nested-deprecated-warnings.patch
];
hardeningDisable = [ "format" ];
buildInputs = [
arm-frc-linux-gnueabi-binutils
arm-frc-linux-gnueabi-eglibc
arm-frc-linux-gnueabi-linux-api-headers
elfutils
libmpc
gmp
mpfr
zlib
isl_0_15
cloog
];
configurePhase = ''
mkdir gcc-build
cd gcc-build
../configure \
--prefix=$out \
--host=$CHOST \
--build=$CHOST \
--program-prefix=${_target}- \
--target=${_target} \
--enable-shared \
--disable-nls \
--enable-threads=posix \
--enable-languages=c,c++ \
--disable-multilib \
--disable-multiarch \
--with-sysroot=${arm-frc-linux-gnueabi-eglibc}/${_target} \
--with-build-sysroot=${arm-frc-linux-gnueabi-eglibc}/${_target} \
--with-as=${arm-frc-linux-gnueabi-binutils}/${_target}/bin/as \
--with-ld=${arm-frc-linux-gnueabi-binutils}/${_target}/bin/ld \
--with-cpu=cortex-a9 \
--with-float=softfp \
--with-fpu=vfp \
--with-specs='%{save-temps:-fverbose-asm} %{funwind-tables|fno-unwind-tables|mabi=*|ffreestanding|nostdlib:;:-funwind-tables}' \
--enable-lto \
--with-pkgversion='GCC-for-FRC' \
--with-cloog \
--enable-poison-system-directories \
--enable-plugin \
--with-system-zlib \
--disable-libmudflap \
--disable-libsanitizer
'';
makeFlags = [
"all-gcc"
"all-target-libgcc"
"all-target-libstdc++-v3"
];
installPhase = ''
make install-gcc install-target-libgcc install-target-libstdc++-v3
'';
postInstall = ''
rm -rf $out/share/{man/man7,info}/ "$out/share/gcc-${version}/python"
'';
meta = with stdenv.lib; {
description = "FRC cross compiler";
longDescription = ''
arm-frc-linux-gnueabi-gcc is a cross compiler for building
code for FIRST Robotics Competition. Used as a cross compiler
for the NI RoboRio.
'';
license = licenses.gpl2;
maintainers = [ maintainers.colescott ];
platforms = platforms.linux;
priority = 4;
};
}
@@ -1,49 +0,0 @@
Description: Make the default SONAME include minor numbers (c++)
This patch adds .0.20 to the end of the SONAME for libstdc++ to support
independent side-by-side usage of .17 and .20.
.
gcc-armel (4.9.1-0frc2) trusty; urgency=low
.
* Fixing dependency ambiguity yet again...
Author: Patrick Plenefisch <phplenefisch@wpi.edu>
---
--- gcc-armel-4.9.1.orig/libstdc++-v3/configure
+++ gcc-armel-4.9.1/libstdc++-v3/configure
@@ -10698,7 +10698,7 @@ gnu*)
need_lib_prefix=no
need_version=no
library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}'
- soname_spec='${libname}${release}${shared_ext}$major'
+ soname_spec='${libname}${release}${shared_ext}$versuffix'
shlibpath_var=LD_LIBRARY_PATH
hardcode_into_libs=yes
;;
@@ -10824,7 +10824,7 @@ linux* | k*bsd*-gnu | kopensolaris*-gnu)
need_lib_prefix=no
need_version=no
library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
- soname_spec='${libname}${release}${shared_ext}$major'
+ soname_spec='${libname}${release}${shared_ext}$versuffix'
finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir'
shlibpath_var=LD_LIBRARY_PATH
shlibpath_overrides_runpath=no
@@ -14382,7 +14382,7 @@ gnu*)
need_lib_prefix=no
need_version=no
library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}'
- soname_spec='${libname}${release}${shared_ext}$major'
+ soname_spec='${libname}${release}${shared_ext}$versuffix'
shlibpath_var=LD_LIBRARY_PATH
hardcode_into_libs=yes
;;
@@ -14508,7 +14508,7 @@ linux* | k*bsd*-gnu | kopensolaris*-gnu)
need_lib_prefix=no
need_version=no
library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
- soname_spec='${libname}${release}${shared_ext}$major'
+ soname_spec='${libname}${release}${shared_ext}$versuffix'
finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir'
shlibpath_var=LD_LIBRARY_PATH
shlibpath_overrides_runpath=no
@@ -1,22 +0,0 @@
Description: Get rid of recursive deprecated warnings.
As is, gcc gives warnings when a function with the
deprecated attribute calls another function with
the deprecated attribute.
See http://stackoverflow.com/questions/13459602/how-can-i-get-rid-of-deprecated-warnings-in-deprecated-functions-in-gcc
Author: James Kuszmaul <jbkuszmaul@wpi.edu>
--
--- gcc-armel-4.9.1.orig/gcc/tree.c
+++ gcc-armel-4.9.1/gcc/tree.c
@@ -12063,6 +12063,9 @@ warn_deprecated_use (tree node, tree attr)
if (node == 0 || !warn_deprecated_decl)
return;
+ if (current_function_decl && TREE_DEPRECATED(current_function_decl))
+ return;
+
if (!attr)
{
if (DECL_P (node))
+1 -2
View File
@@ -15,9 +15,8 @@ in stdenv.mkDerivation {
buildInputs = [ yacc ];
patches = [
# CVE-2012-0808
(fetchpatch {
name = "as31-mkstemps.patch";
name = "CVE-2012-0808.patch";
url = "https://bugs.debian.org/cgi-bin/bugreport.cgi?att=1;bug=655496;filename=as31-mkstemps.patch;msg=5";
sha256 = "0iia4wa8m141bwz4588yxb1dp2qwhapcii382sncm6jvwyngwh21";
})
+1 -1
View File
@@ -5,7 +5,7 @@ stdenv.mkDerivation rec {
version = "0.9.28";
src = fetchurl {
url = "http://lionet.info/soft/asn1c-${version}.tar.gz";
url = "https://lionet.info/soft/asn1c-${version}.tar.gz";
sha256 = "1fc64g45ykmv73kdndr4zdm4wxhimhrir4rxnygxvwkych5l81w0";
};
+4 -4
View File
@@ -3,11 +3,11 @@
, withContrib ? true }:
let
versionPkg = "0.3.7" ;
versionPkg = "0.3.12" ;
contrib = fetchurl {
url = "mirror://sourceforge/ats2-lang/ATS2-Postiats-contrib-${versionPkg}.tgz" ;
sha256 = "1w59ir9ij5bvvnxj6fb1rvzycfqa57i31wmpwawxbsb10bqwzyr6";
sha256 = "6e53e3070f50600373b857a73a76196adffcabc3c0d3173eaaf9a5f50f4596f4";
};
postInstallContrib = stdenv.lib.optionalString withContrib
@@ -31,7 +31,7 @@ stdenv.mkDerivation rec {
src = fetchurl {
url = "mirror://sourceforge/ats2-lang/ATS2-Postiats-${version}.tgz";
sha256 = "19nxyi39fn42sp38kl14a6pvbxq9wr8y405wx0zz7mqb77r0m0h5";
sha256 = "63eb02b225a11752745e8f08691140ed764288ab4ceda3710670cde24835b0d8";
};
buildInputs = [ gmp ];
@@ -52,6 +52,6 @@ stdenv.mkDerivation rec {
homepage = "http://www.ats-lang.org";
license = licenses.gpl3Plus;
platforms = platforms.linux;
maintainers = with maintainers; [ thoughtpolice ttuegel ];
maintainers = with maintainers; [ thoughtpolice ttuegel bbarker ];
};
}
+11 -5
View File
@@ -1,4 +1,4 @@
{ stdenv, fetchFromGitHub, zlib, jdk }:
{ stdenv, fetchFromGitHub, zlib, jdk, CoreServices, Foundation }:
stdenv.mkDerivation rec {
name = "avian-${version}";
@@ -11,10 +11,16 @@ stdenv.mkDerivation rec {
sha256 = "1j2y45cpqk3x6a743mgpg7z3ivwm7qc9jy6xirvay7ah1qyxmm48";
};
buildInputs = [
zlib
jdk
];
buildInputs = [ zlib jdk ]
++ stdenv.lib.optionals stdenv.isDarwin [ CoreServices Foundation ];
NIX_CFLAGS_COMPILE = "-Wno-error";
postPatch = ''
substituteInPlace makefile \
--replace 'g++' 'c++' \
--replace 'gcc' 'cc'
'';
installPhase = ''
mkdir -p $out/bin
@@ -1,14 +1,31 @@
{ stdenv, cmake, fetchFromGitHub }:
{ stdenv, cmake, fetchFromGitHub, emscriptenRev ? null }:
let
defaultVersion = "45";
# Map from git revs to SHA256 hashes
sha256s = {
"version_45" = "1wgzfzjjzkiaz0rf2lnwrcvlcsjvjhyvbyh58jxhqq43vi34zyjc";
"1.37.36" = "1wgzfzjjzkiaz0rf2lnwrcvlcsjvjhyvbyh58jxhqq43vi34zyjc";
};
in
stdenv.mkDerivation rec {
version = "42";
rev = "version_${version}";
version = if emscriptenRev == null
then defaultVersion
else "emscripten-${emscriptenRev}";
rev = if emscriptenRev == null
then "version_${version}"
else emscriptenRev;
name = "binaryen-${version}";
src = fetchFromGitHub {
owner = "WebAssembly";
repo = "binaryen";
sha256 = "0b8qc9cd7ncshgfjwv4hfapmwa81gmniaycnxmdkihq9bpm26x2k";
sha256 =
if builtins.hasAttr rev sha256s
then builtins.getAttr rev sha256s
else null;
inherit rev;
};
@@ -1,45 +0,0 @@
diff --git a/default.build b/default.build
index e48fd9e..b0dee4f 100644
--- a/default.build
+++ b/default.build
@@ -23,14 +23,14 @@
<property name="skip.ast" value="False" />
<property name="skip.vs" value="False" />
- <property name="gsv.name" value="gtksourceview-1.0" />
+ <property name="gsv.name" value="gtksourceview-2.0" />
<property name="build.dir" value="build" dynamic="True"/>
<property name="distrobuild.dir" value="distrobuild"/>
<property name="docs.dir" value="docs" />
<property name="examples.dir" value="examples" />
- <property name="install.prefix" value="/usr/local" />
+ <property name="install.prefix" value="$out" />
<property name="install.destdir" value="/" />
<property name="install.share" value="${path::combine(install.prefix,'share')}" />
@@ -575,9 +575,9 @@
key files for mime detection, etc
-->
- <property name="sharedmime.prefix" value="${pkg-config::get-variable('shared-mime-info','prefix')}" />
+ <property name="sharedmime.prefix" value="$out" />
<property name="fakeroot.sharedmime" value="${fakeroot}/${sharedmime.prefix}" />
- <property name="gsv.prefix" value="${pkg-config::get-variable(gsv.name,'prefix')}" />
+ <property name="gsv.prefix" value="$out" />
<property name="fakeroot.gsv" value="${fakeroot}/${gsv.prefix}" />
<mkdir dir="${fakeroot.boolib}"/>
@@ -707,9 +707,9 @@
key files for mime detection, etc
-->
- <property name="sharedmime.prefix" value="${pkg-config::get-variable('shared-mime-info','prefix')}" />
+ <property name="sharedmime.prefix" value="$out" />
<property name="fakeroot.sharedmime" value="${fakeroot}/${sharedmime.prefix}" />
- <property name="gsv.prefix" value="${pkg-config::get-variable(gsv.name,'prefix')}" />
+ <property name="gsv.prefix" value="$out" />
<property name="fakeroot.gsv" value="${fakeroot}/${gsv.prefix}" />
<foreach item="File" property="filename">
@@ -1,47 +0,0 @@
{ stdenv, fetchFromGitHub, pkgconfig, dbus, mono, makeWrapper, nant
, shared_mime_info, gtksourceview, gtk2
, targetVersion ? "4.5" }:
let
release = "alpha";
in stdenv.mkDerivation rec {
name = "boo-${version}";
version = "2013-10-21";
src = fetchFromGitHub {
owner = "boo-lang";
repo = "boo";
rev = "${release}";
sha256 = "174abdwfpq8i3ijx6bwqll16lx7xwici374rgsbymyk8g8mla094";
};
nativeBuildInputs = [ pkgconfig ];
buildInputs = [
mono makeWrapper nant shared_mime_info gtksourceview
gtk2
];
patches = [ ./config.patch ];
postPatch = ''
sed -e 's|\$out|'$out'|' -i default.build
'';
buildPhase = ''
nant -t:mono-4.5
'';
installPhase = ''
nant install
cp $out/lib/mono/boo/*.dll $out/lib/boo/
'';
dontStrip = true;
meta = with stdenv.lib; {
description = "The Boo Programming Language";
platforms = platforms.linux;
broken = true;
};
}
@@ -0,0 +1,47 @@
{ stdenv, fetchFromGitHub, makeWrapper, clang, haskellPackages }:
haskellPackages.mkDerivation rec {
pname = "carp";
version = "unstable-2018-09-15";
src = fetchFromGitHub {
owner = "carp-lang";
repo = "Carp";
rev = "cf9286c35cab1c170aa819f7b30b5871b9e812e6";
sha256 = "1k6kdxbbaclhi40b9p3fgbkc1x6pc4v0029xjm6gny6pcdci2cli";
};
buildDepends = [ makeWrapper ];
executableHaskellDepends = with haskellPackages; [
HUnit blaze-markup blaze-html split cmdargs
];
isExecutable = true;
# The carp executable must know where to find its core libraries and other
# files. Set the environment variable CARP_DIR so that it points to the root
# of the Carp repo. See:
# https://github.com/carp-lang/Carp/blob/master/docs/Install.md#setting-the-carp_dir
#
# Also, clang must be available run-time because carp is compiled to C which
# is then compiled with clang.
postInstall = ''
wrapProgram $out/bin/carp \
--set CARP_DIR $src \
--prefix PATH : ${clang}/bin
wrapProgram $out/bin/carp-header-parse \
--set CARP_DIR $src \
--prefix PATH : ${clang}/bin
'';
description = "A statically typed lisp, without a GC, for real-time applications";
homepage = https://github.com/carp-lang/Carp;
license = stdenv.lib.licenses.asl20;
maintainers = with stdenv.lib.maintainers; [ jluttine ];
# Windows not (yet) supported.
platforms = with stdenv.lib.platforms; unix ++ darwin;
}
+23 -8
View File
@@ -1,8 +1,8 @@
{ stdenv, fetchurl, gcc, glibc, m4, coreutils }:
{ stdenv, fetchurl, bootstrap_cmds, coreutils, glibc, m4 }:
let
options = rec {
/* TODO: there are also MacOS, FreeBSD and Windows versions */
/* TODO: there are also FreeBSD and Windows versions */
x86_64-linux = {
arch = "linuxx86";
sha256 = "0hs1f3z7crgzvinpj990kv9gvbsipxvcvwbmk54n51nasvc5025q";
@@ -21,13 +21,17 @@ let
runtime = "armcl";
kernel = "linuxarm";
};
x86_64-darwin = {
arch = "darwinx86";
sha256 = "5adbea3d8b4a2e29af30d141f781c6613844f468c0ccfa11bae908c3e9641939";
runtime = "dx86cl64";
kernel = "darwinx8664";
};
armv6l-linux = armv7l-linux;
};
cfg = options.${stdenv.system};
cfg = options."${stdenv.hostPlatform.system}" or (throw "missing source url for platform ${stdenv.hostPlatform.system}");
in
assert builtins.hasAttr stdenv.system options;
stdenv.mkDerivation rec {
name = "ccl-${version}";
version = "1.11.5";
@@ -37,12 +41,21 @@ stdenv.mkDerivation rec {
sha256 = cfg.sha256;
};
buildInputs = [ gcc glibc m4 ];
buildInputs = if stdenv.isDarwin then [ bootstrap_cmds m4 ] else [ glibc m4 ];
CCL_RUNTIME = cfg.runtime;
CCL_KERNEL = cfg.kernel;
postPatch = ''
postPatch = if stdenv.isDarwin then ''
substituteInPlace lisp-kernel/${CCL_KERNEL}/Makefile \
--replace "M4 = gm4" "M4 = m4" \
--replace "dtrace" "/usr/sbin/dtrace" \
--replace "/bin/rm" "${coreutils}/bin/rm" \
--replace "/bin/echo" "${coreutils}/bin/echo"
substituteInPlace lisp-kernel/m4macros.m4 \
--replace "/bin/pwd" "${coreutils}/bin/pwd"
'' else ''
substituteInPlace lisp-kernel/${CCL_KERNEL}/Makefile \
--replace "/bin/rm" "${coreutils}/bin/rm" \
--replace "/bin/echo" "${coreutils}/bin/echo"
@@ -63,11 +76,13 @@ stdenv.mkDerivation rec {
cp -r . "$out/share/ccl-installation"
mkdir -p "$out/bin"
echo -e '#!/bin/sh\n'"$out/share/ccl-installation/${CCL_RUNTIME}"' "$@"\n' > "$out"/bin/"${CCL_RUNTIME}"
echo -e '#!${stdenv.shell}\n'"$out/share/ccl-installation/${CCL_RUNTIME}"' "$@"\n' > "$out"/bin/"${CCL_RUNTIME}"
chmod a+x "$out"/bin/"${CCL_RUNTIME}"
ln -s "$out"/bin/"${CCL_RUNTIME}" "$out"/bin/ccl
'';
hardeningDisable = [ "format" ];
meta = with stdenv.lib; {
description = "Clozure Common Lisp";
homepage = https://ccl.clozure.com/;
+2 -1
View File
@@ -61,7 +61,8 @@ stdenv.mkDerivation rec {
**
** Ideally in the future this would be less of a hack and could be
** done by Chez itself. Alternatively, there could just be a big
** case statement matching to the different stdenv.platform values...
** case statement matching to the different stdenv.hostPlatform.platform
** values...
*/
postInstall = ''
m="$(ls ./work/boot)"
@@ -16,7 +16,7 @@ stdenv.mkDerivation {
binaryVersion = 8;
src = fetchurl {
url = "http://code.call-cc.org/releases/${version}/chicken-${version}.tar.gz";
url = "https://code.call-cc.org/releases/${version}/chicken-${version}.tar.gz";
sha256 = "0hvckhi5gfny3mlva6d7y9pmx7cbwvq0r7mk11k3sdiik9hlkmdd";
};
@@ -63,7 +63,7 @@ stdenv.mkDerivation {
homepage = http://www.call-cc.org/;
license = stdenv.lib.licenses.bsd3;
maintainers = with stdenv.lib.maintainers; [ the-kenny ];
platforms = with stdenv.lib.platforms; allBut darwin;
platforms = stdenv.lib.platforms.linux; # Maybe other non-darwin Unix
description = "A portable compiler for the Scheme programming language";
longDescription = ''
CHICKEN is a compiler for the Scheme programming language.
@@ -1,4 +1,4 @@
{ stdenv, fetchegg, chicken, makeWrapper }:
{ stdenv, chicken, makeWrapper }:
{ name, src
, buildInputs ? []
, chickenInstallFlags ? []
@@ -8,7 +8,6 @@
let
libPath = "${chicken}/var/lib/chicken/${toString chicken.binaryVersion}/";
overrides = import ./overrides.nix;
lib = stdenv.lib;
baseName = (builtins.parseDrvName name).name;
override = if builtins.hasAttr baseName overrides
then
+2 -1
View File
@@ -1,7 +1,7 @@
{stdenv, fetchFromGitHub
, llvmPackages
, cmake, boehmgc, gmp, zlib, ncurses, boost
, waf, python, git, sbcl
, python, git, sbcl
}:
stdenv.mkDerivation rec {
name = "${pname}-${version}";
@@ -70,5 +70,6 @@ stdenv.mkDerivation rec {
maintainers = [stdenv.lib.maintainers.raskin];
platforms = stdenv.lib.platforms.linux;
homepage = "https://github.com/drmeister/clasp";
broken = true; # 2018-09-08, no successful build since 2018-01-03
};
}
+3 -3
View File
@@ -4,12 +4,12 @@ stdenv.mkDerivation rec {
name = "clean-2.4";
src =
if stdenv.system == "i686-linux" then (fetchurl {
if stdenv.hostPlatform.system == "i686-linux" then (fetchurl {
url = "http://clean.cs.ru.nl/download/Clean24/linux/clean2.4_boot.tar.gz";
sha256 = "1w8vvmkwzq8g51639r62apcy75sj69nm08082a34xvqm9ymfgkq5";
})
else if stdenv.system == "x86_64-linux" then (fetchurl {
url = "http://clean.cs.ru.nl/download/Clean24/linux/clean2.4_64_boot.tar.gz";
else if stdenv.hostPlatform.system == "x86_64-linux" then (fetchurl {
url = "https://clean.cs.ru.nl/download/Clean24/linux/clean2.4_64_boot.tar.gz";
sha256 = "08gsa1pjl5wyzh4ah8ccfx8a7mdcn6ycsn1lzkrr9adygv1gmm7r";
})
else throw "Architecture not supported";
@@ -2,11 +2,11 @@
stdenv.mkDerivation rec {
name = "closure-compiler-${version}";
version = "20170910";
version = "20180910";
src = fetchurl {
url = "https://dl.google.com/closure-compiler/compiler-${version}.tar.gz";
sha256 = "0znzsks8ql9qajhcjzfkhmnpz8zs6b8cji04fhivyq973jpxxrak";
sha256 = "12k4cp9f8g03k3zf2g70pn6ybx8gk0hfh81ypiyb5hkfij95bi9k";
};
sourceRoot = ".";
@@ -10,10 +10,10 @@ stdenv.mkDerivation rec {
buildFlags = "build";
enableParallelBuilding = true;
nativeBuildInputs = stdenv.lib.optional doCheck python;
doCheck = true;
checkPhase = "python ./runCmdStanTests.py src/test/interface"; # see #5368
checkInputs = [ python ];
checkPhase = "python ./runCmdStanTests.py src/test/interface"; # see #5368
installPhase = ''
mkdir -p $out/opt $out/bin
+1 -1
View File
@@ -1,7 +1,7 @@
{stdenv, fetchurl}:
let
inherit (stdenv) system;
inherit (stdenv.hostPlatform) system;
version = "21b";
downloadUrl = arch:
"http://common-lisp.net/project/cmucl/downloads/release/" +
+3 -3
View File
@@ -2,11 +2,11 @@
stdenv.mkDerivation rec {
name = "colm-${version}";
version = "0.13.0.5";
version = "0.13.0.6";
src = fetchurl {
url = "http://www.colm.net/files/colm/${name}.tar.gz";
sha256 = "1320bx96ycd1xwww137cixrb983838wnrgkfsym8x5bnf5kj9rik";
url = "https://www.colm.net/files/colm/${name}.tar.gz";
sha256 = "0jd3qmqdm8yszy0yysbp3syk7pcbxvwzv9mibdwz7v9bv1nrai26";
};
nativeBuildInputs = [ makeWrapper asciidoc ];
@@ -1,5 +1,5 @@
{ stdenv, lib, fetchurl
, coq, ocamlPackages
{ stdenv, lib, fetchurl, fetchpatch
, coq, ocamlPackages, coq2html
, tools ? stdenv.cc
}:
@@ -7,22 +7,18 @@ assert lib.versionAtLeast ocamlPackages.ocaml.version "4.02";
stdenv.mkDerivation rec {
name = "compcert-${version}";
version = "3.2";
version = "3.4";
src = fetchurl {
url = "http://compcert.inria.fr/release/${name}.tgz";
sha256 = "11q4121s0rxva63njjwya7syfx9w0p4hzr6avh8s57vfbrcakc93";
sha256 = "12gchwvkzhd2bhrnwzfb4a06wc4hgv98z987k06vj7ga31ii763h";
};
buildInputs = [ coq ]
buildInputs = [ coq coq2html ]
++ (with ocamlPackages; [ ocaml findlib menhir ]);
enableParallelBuilding = true;
postPatch = ''
sed -i -e 's/8\.6\.1|8\.7\.0|8\.7\.1)/8.6.1|8.7.0|8.7.1|8.7.2)/' configure
'';
configurePhase = ''
substituteInPlace ./configure --replace '{toolprefix}gcc' '{toolprefix}cc'
./configure -clightgen -prefix $out -toolprefix ${tools}/bin/ '' +
+14 -5
View File
@@ -19,13 +19,13 @@
stdenv.mkDerivation rec {
name = "coreclr-${version}";
version = "2.0.0";
version = "2.0.7";
src = fetchFromGitHub {
owner = "dotnet";
repo = "coreclr";
rev = "v${version}";
sha256 = "16z58ix8kmk8csfy5qsqz8z30czhrap2vb8s8vdflmbcfnq31jcw";
sha256 = "0pzkrfgqywhpijbx7j1v4lxa6270h6whymb64jdkp7yj56ipqh2n";
};
patches = [
@@ -34,12 +34,20 @@ stdenv.mkDerivation rec {
url = https://github.com/dotnet/coreclr/commit/a8f83b615708c529b112898e7d2fbc3f618b26ee.patch;
sha256 = "047ph5gip4z2h7liwdxsmpnlaq0sd3hliaw4nyqjp647m80g3ffq";
})
(fetchpatch {
# clang 5
url = https://github.com/dotnet/coreclr/commit/9b22e1a767dee38f351001c5601f56d78766a43e.patch;
sha256 = "1w1lxw5ryvhq8m5m0kv880c4bh6y9xdgypkr76sqbh3v568yghzg";
})
];
buildInputs = [
nativeBuildInputs = [
which
cmake
clang
];
buildInputs = [
llvmPackages.llvm
llvmPackages.lldb
libunwind
@@ -68,7 +76,8 @@ stdenv.mkDerivation rec {
buildPhase = ''
runHook preBuild
./build.sh $BuildArch $BuildType
# disable -Werror which can potentially breaks with every compiler upgrade
./build.sh $BuildArch $BuildType cmakeargs "-DCLR_CMAKE_WARNINGS_ARE_ERRORS=OFF"
runHook postBuild
'';
@@ -83,7 +92,7 @@ stdenv.mkDerivation rec {
'';
meta = with stdenv.lib; {
homepage = https://dotnet.github.io/core/;
homepage = https://github.com/dotnet/core/;
description = ".NET is a general purpose development platform";
platforms = [ "x86_64-linux" ];
maintainers = with maintainers; [ kuznero ];
+119 -68
View File
@@ -1,91 +1,142 @@
{ stdenv, fetchurl, boehmgc, libatomic_ops, pcre, libevent, libiconv, llvm, makeWrapper }:
{ stdenv, lib, fetchFromGitHub, fetchurl, makeWrapper
, gmp, openssl, readline, tzdata, libxml2, libyaml
, boehmgc, libatomic_ops, pcre, libevent, libiconv, llvm, clang, which, zlib }:
stdenv.mkDerivation rec {
name = "crystal-${version}";
version = "0.24.1";
let
binaryVersion = "0.26.0";
releaseDate = "2018-08-29";
src = fetchurl {
url = "https://github.com/crystal-lang/crystal/archive/${version}.tar.gz";
sha256 = "1n375cwzb9rfqbjiimfbj4h5q4rsgh2rf6rmm2zbzizzm79a96a9";
};
prebuiltName = "crystal-0.24.1-2";
prebuiltSrc = let arch = {
"x86_64-linux" = "linux-x86_64";
"i686-linux" = "linux-i686";
arch = {
"x86_64-linux" = "linux-x86_64";
"i686-linux" = "linux-i686";
"x86_64-darwin" = "darwin-x86_64";
}."${stdenv.system}" or (throw "system ${stdenv.system} not supported");
in fetchurl {
url = "https://github.com/crystal-lang/crystal/releases/download/v0.24.1/${prebuiltName}-${arch}.tar.gz";
sha256 = {
"x86_64-linux" = "19xchfzsyxh0gqi89y6d73iqc06bl097idz6905jf0i35x9ghpdp";
"i686-linux" = "15zaxgc1yc9ixbsgy2d8g8d7x2w4vbnndi1ms3wf0ss8azmghiag";
"x86_64-darwin" = "1818ahalahcbh974ai09hyfsns6njkpph4sbn4xwv2235x35dqib";
}."${stdenv.system}";
checkInputs = [ gmp openssl readline libxml2 libyaml tzdata ];
# we could turn this into a function instead in case we cannot use the same
# binary to build multiple versions
binary = stdenv.mkDerivation rec {
name = "crystal-binary-${binaryVersion}";
src = fetchurl {
url = "https://github.com/crystal-lang/crystal/releases/download/${binaryVersion}/crystal-${binaryVersion}-1-${arch}.tar.gz";
sha256 = {
"x86_64-linux" = "1xban102yiiwmlklxvn3xp3q546bp8hlxxpakayajkhhnpl6yv45";
"i686-linux" = "1igspf1lrv7wpmz0pfrkbx8m1ykvnv4zhic53cav4nicppm2v0ic";
"x86_64-darwin" = "0hzc65ccajr0yhmvi5vbdgbzbp1gbjy56da24ds3zwwkam1ddk0k";
}."${stdenv.system}";
};
buildCommand = ''
mkdir -p $out
tar --strip-components=1 -C $out -xf ${src}
'';
};
unpackPhase = ''
mkdir ${prebuiltName}
tar --strip-components=1 -C ${prebuiltName} -xf ${prebuiltSrc}
tar xf ${src}
'';
generic = { version, sha256, doCheck ? true }:
stdenv.mkDerivation rec {
inherit doCheck;
name = "crystal-${version}";
# crystal on Darwin needs libiconv to build
libs = [
boehmgc libatomic_ops pcre libevent
] ++ stdenv.lib.optionals stdenv.isDarwin [
libiconv
];
src = fetchFromGitHub {
owner = "crystal-lang";
repo = "crystal";
rev = version;
inherit sha256;
};
nativeBuildInputs = [ makeWrapper ];
# the first bit can go when https://github.com/crystal-lang/crystal/pull/6788 is merged
postPatch = ''
substituteInPlace src/compiler/crystal/config.cr \
--replace '{{ `date "+%Y-%m-%d"`.stringify.chomp }}' '"${releaseDate}"'
ln -s spec/compiler spec/std
substituteInPlace spec/std/process_spec.cr \
--replace /bin/ /run/current-system/sw/bin
'';
buildInputs = libs ++ [ llvm ];
buildInputs = [
boehmgc libatomic_ops pcre libevent
llvm zlib openssl
] ++ stdenv.lib.optionals stdenv.isDarwin [
libiconv
];
libPath = stdenv.lib.makeLibraryPath libs;
nativeBuildInputs = [ binary makeWrapper which ];
sourceRoot = "${name}";
preBuild = ''
patchShebangs bin/crystal
patchShebangs ../${prebuiltName}/bin/crystal
export PATH="$(pwd)/../${prebuiltName}/bin:$PATH"
'';
makeFlags = [
"CRYSTAL_CONFIG_BUILD_DATE=${releaseDate}"
"CRYSTAL_CONFIG_VERSION=${version}"
];
makeFlags = [ "CRYSTAL_CONFIG_VERSION=${version}"
"FLAGS=--no-debug"
"release=1"
"all" "docs"
];
buildFlags = [
"all" "docs"
];
installPhase = ''
install -Dm755 .build/crystal $out/bin/crystal
wrapProgram $out/bin/crystal \
--suffix CRYSTAL_PATH : lib:$out/lib/crystal \
--suffix LIBRARY_PATH : $libPath
install -dm755 $out/lib/crystal
cp -r src/* $out/lib/crystal/
FLAGS = [
"--release"
"--single-module" # needed for deterministic builds
];
install -dm755 $out/share/doc/crystal/api
cp -r docs/* $out/share/doc/crystal/api/
cp -r samples $out/share/doc/crystal/
# We *have* to add `which` to the PATH or crystal is unable to build stuff
# later if which is not available.
installPhase = ''
runHook preInstall
install -Dm644 etc/completion.bash $out/share/bash-completion/completions/crystal
install -Dm644 etc/completion.zsh $out/share/zsh/site-functions/_crystal
install -Dm755 .build/crystal $out/bin/crystal
wrapProgram $out/bin/crystal \
--suffix PATH : ${lib.makeBinPath [ clang which ]} \
--suffix CRYSTAL_PATH : lib:$out/lib/crystal \
--suffix LIBRARY_PATH : ${lib.makeLibraryPath buildInputs}
install -dm755 $out/lib/crystal
cp -r src/* $out/lib/crystal/
install -Dm644 man/crystal.1 $out/share/man/man1/crystal.1
install -dm755 $out/share/doc/crystal/api
cp -r docs/* $out/share/doc/crystal/api/
cp -r samples $out/share/doc/crystal/
install -Dm644 LICENSE $out/share/licenses/crystal/LICENSE
'';
install -Dm644 etc/completion.bash $out/share/bash-completion/completions/crystal
install -Dm644 etc/completion.zsh $out/share/zsh/site-functions/_crystal
dontStrip = true;
install -Dm644 man/crystal.1 $out/share/man/man1/crystal.1
enableParallelBuilding = true;
install -Dm644 -t $out/share/licenses/crystal LICENSE README.md
meta = {
description = "A compiled language with Ruby like syntax and type inference";
homepage = https://crystal-lang.org/;
license = stdenv.lib.licenses.asl20;
maintainers = with stdenv.lib.maintainers; [ sifmelcara david50407 ];
platforms = [ "x86_64-linux" "i686-linux" "x86_64-darwin" ];
runHook postInstall
'';
enableParallelBuilding = true;
dontStrip = true;
checkTarget = "spec";
preCheck = ''
export LIBRARY_PATH=${lib.makeLibraryPath checkInputs}:$LIBRARY_PATH
'';
meta = with lib; {
description = "A compiled language with Ruby like syntax and type inference";
homepage = https://crystal-lang.org/;
license = licenses.asl20;
maintainers = with maintainers; [ manveru david50407 peterhoeg ];
platforms = [ "x86_64-linux" "i686-linux" "x86_64-darwin" ];
};
};
in rec {
crystal_0_25 = generic {
version = "0.25.1";
sha256 = "15xmbkalsdk9qpc6wfpkly3sifgw6a4ai5jzlv78dh3jp7glmgyl";
doCheck = false;
};
crystal_0_26 = generic {
version = "0.26.1";
sha256 = "0jwxrqm99zcjj82gyl6bzvnfj79nwzqf8sa1q3f66q9p50v44f84";
doCheck = false; # about 20 tests out of more than 14000 are failing
};
crystal = crystal_0_26;
}
@@ -1,5 +1,5 @@
{ lib, stdenv, makeWrapper, fetchurl, requireFile, patchelf, perl, ncurses, expat, python27, zlib
, gcc48, gcc49, gcc5, gcc6
{ lib, stdenv, makeWrapper, fetchurl, requireFile, perl, ncurses, expat, python27, zlib
, gcc48, gcc49, gcc5, gcc6, gcc7
, xorg, gtk2, glib, fontconfig, freetype, unixODBC, alsaLib, glibc
}:
@@ -11,11 +11,12 @@ let
, name ? ""
, developerProgram ? false
, python ? python27
, runPatches ? []
}:
stdenv.mkDerivation rec {
name = "cudatoolkit-${version}";
inherit (args) version;
inherit version runPatches;
dontPatchELF = true;
dontStrip = true;
@@ -27,7 +28,7 @@ let
This nix expression requires that ${args.name} is already part of the store.
Register yourself to NVIDIA Accelerated Computing Developer Program, retrieve the CUDA toolkit
at https://developer.nvidia.com/cuda-toolkit, and run the following command in the download directory:
nix-prefetch-url file://${args.name}
nix-prefetch-url file://\$PWD/${args.name}
'';
inherit (args) name sha256;
}
@@ -48,35 +49,34 @@ let
rpath = "${stdenv.lib.makeLibraryPath runtimeDependencies}:${stdenv.cc.cc.lib}/lib64";
phases = [ "unpackPhase" "installPhase" "fixupPhase" ];
unpackPhase = ''
sh $src --keep --noexec
cd pkg/run_files
sh cuda-linux*.run --keep --noexec
sh cuda-samples*.run --keep --noexec
cd pkg
'';
mv pkg ../../$(basename $src)
cd ../..
rm -rf pkg
buildPhase = ''
chmod -R u+w .
while IFS= read -r -d ''$'\0' i; do
if ! isELF "$i"; then continue; fi
echo "patching $i..."
if [[ ! $i =~ \.so ]]; then
patchelf \
--set-interpreter "''$(cat $NIX_CC/nix-support/dynamic-linker)" $i
fi
if [[ $i =~ libcudart ]]; then
rpath2=
else
rpath2=$rpath:$lib/lib:$out/jre/lib/amd64/jli:$out/lib:$out/lib64:$out/nvvm/lib:$out/nvvm/lib64
fi
patchelf --set-rpath $rpath2 --force-rpath $i
done < <(find . -type f -print0)
for patch in $runPatches; do
sh $patch --keep --noexec
mv pkg $(basename $patch)
done
'';
installPhase = ''
mkdir $out
cd $(basename $src)
perl ./install-linux.pl --prefix="$out"
cd ..
for patch in $runPatches; do
cd $(basename $patch)
perl ./install_patch.pl --silent --accept-eula --installdir="$out"
cd ..
done
rm $out/tools/CUDA_Occupancy_Calculator.xls # FIXME: why?
@@ -117,6 +117,23 @@ let
echo "NIX_CFLAGS_COMPILE+=' -D_FORCE_INLINES'" >> $out/nix-support/setup-hook
'';
preFixup = ''
while IFS= read -r -d ''$'\0' i; do
if ! isELF "$i"; then continue; fi
echo "patching $i..."
if [[ ! $i =~ \.so ]]; then
patchelf \
--set-interpreter "''$(cat $NIX_CC/nix-support/dynamic-linker)" $i
fi
if [[ $i =~ libcudart ]]; then
rpath2=
else
rpath2=$rpath:$lib/lib:$out/jre/lib/amd64/jli:$out/lib:$out/lib64:$out/nvvm/lib:$out/nvvm/lib64
fi
patchelf --set-rpath $rpath2 --force-rpath $i
done < <(find $out $lib $doc -type f -print0)
'';
passthru = {
cc = gcc;
majorVersion =
@@ -132,49 +149,98 @@ let
};
};
in {
cudatoolkit6 = common {
in rec {
cudatoolkit_6 = common {
version = "6.0.37";
url = "http://developer.download.nvidia.com/compute/cuda/6_0/rel/installers/cuda_6.0.37_linux_64.run";
sha256 = "991e436c7a6c94ec67cf44204d136adfef87baa3ded270544fa211179779bc40";
gcc = gcc48;
};
cudatoolkit65 = common {
cudatoolkit_6_5 = common {
version = "6.5.19";
url = "http://developer.download.nvidia.com/compute/cuda/6_5/rel/installers/cuda_6.5.19_linux_64.run";
sha256 = "1x9zdmk8z784d3d35vr2ak1l4h5v4jfjhpxfi9fl9dvjkcavqyaj";
gcc = gcc48;
};
cudatoolkit7 = common {
cudatoolkit_7 = common {
version = "7.0.28";
url = "http://developer.download.nvidia.com/compute/cuda/7_0/Prod/local_installers/cuda_7.0.28_linux.run";
sha256 = "1km5hpiimx11jcazg0h3mjzk220klwahs2vfqhjavpds5ff2wafi";
gcc = gcc49;
};
cudatoolkit75 = common {
cudatoolkit_7_5 = common {
version = "7.5.18";
url = "http://developer.download.nvidia.com/compute/cuda/7.5/Prod/local_installers/cuda_7.5.18_linux.run";
sha256 = "1v2ylzp34ijyhcxyh5p6i0cwawwbbdhni2l5l4qm21s1cx9ish88";
gcc = gcc49;
};
cudatoolkit8 = common {
version = "8.0.61";
cudatoolkit_8 = common {
version = "8.0.61.2";
url = "https://developer.nvidia.com/compute/cuda/8.0/Prod2/local_installers/cuda_8.0.61_375.26_linux-run";
sha256 = "1i4xrsqbad283qffvysn88w2pmxzxbbby41lw0j1113z771akv4w";
runPatches = [
(fetchurl {
url = "https://developer.nvidia.com/compute/cuda/8.0/Prod2/patches/2/cuda_8.0.61.2_linux-run";
sha256 = "1iaz5rrsnsb1p99qiqvxn6j3ksc7ry8xlr397kqcjzxqbljbqn9d";
})
];
gcc = gcc5;
};
cudatoolkit9 = common {
version = "9.0.176";
cudatoolkit_9_0 = common {
version = "9.0.176.1";
url = "https://developer.nvidia.com/compute/cuda/9.0/Prod/local_installers/cuda_9.0.176_384.81_linux-run";
sha256 = "0308rmmychxfa4inb1ird9bpgfppgr9yrfg1qp0val5azqik91ln";
gcc = gcc6;
};
}
cudatoolkit_9_1 = common {
version = "9.1.85.3";
url = "https://developer.nvidia.com/compute/cuda/9.1/Prod/local_installers/cuda_9.1.85_387.26_linux";
sha256 = "0lz9bwhck1ax4xf1fyb5nicb7l1kssslj518z64iirpy2qmwg5l4";
runPatches = [
(fetchurl {
url = "https://developer.nvidia.com/compute/cuda/9.1/Prod/patches/1/cuda_9.1.85.1_linux";
sha256 = "1f53ij5nb7g0vb5pcpaqvkaj1x4mfq3l0mhkfnqbk8sfrvby775g";
})
(fetchurl {
url = "https://developer.nvidia.com/compute/cuda/9.1/Prod/patches/2/cuda_9.1.85.2_linux";
sha256 = "16g0w09h3bqmas4hy1m0y6j5ffyharslw52fn25gql57bfihg7ym";
})
(fetchurl {
url = "https://developer.nvidia.com/compute/cuda/9.1/Prod/patches/3/cuda_9.1.85.3_linux";
sha256 = "12mcv6f8z33z8y41ja8bv5p5iqhv2vx91mv3b5z6fcj7iqv98422";
})
];
gcc = gcc6;
};
cudatoolkit_9_2 = common {
version = "9.2.148.1";
url = "https://developer.nvidia.com/compute/cuda/9.2/Prod2/local_installers/cuda_9.2.148_396.37_linux";
sha256 = "04c6v9b50l4awsf9w9zj5vnxvmc0hk0ypcfjksbh4vnzrz14wigm";
runPatches = [
(fetchurl {
url = "https://developer.nvidia.com/compute/cuda/9.2/Prod2/patches/1/cuda_9.2.148.1_linux";
sha256 = "1kx6l4yzsamk6q1f4vllcpywhbfr2j5wfl4h5zx8v6dgfpsjm2lw";
})
];
gcc = gcc7;
};
cudatoolkit_9 = cudatoolkit_9_2;
cudatoolkit_10_0 = common {
version = "10.0.130";
url = "https://developer.nvidia.com/compute/cuda/10.0/Prod/local_installers/cuda_10.0.130_410.48_linux";
sha256 = "16p3bv1lwmyqpxil8r951h385sy9asc578afrc7lssa68c71ydcj";
gcc = gcc7;
};
cudatoolkit_10 = cudatoolkit_10_0;
}
+51 -112
View File
@@ -1,34 +1,15 @@
{ stdenv, fetchFromGitHub, overrideCC, gcc5
{ stdenv, fetchFromGitHub
, makeWrapper, unzip, which
, curl, tzdata, gdb, darwin
, callPackage
, bootstrapVersion ? false
, version ? "2.078.2"
, dmdSha256 ? "0x9q4aw4jl36dz7m5111y2sm8jdaj3zg36zhj6vqg1lqpdn3bhls"
, druntimeSha256 ? "0nfqjcmwqc490bzi3582x1c3zigkf306g4nyd1cyd3vs8lfm6x66"
, phobosSha256 ? "08ircpf4ilznz638kra272hz8fi5ccvw2cswj5hqckssl1lyqzs8"
, callPackage, targetPackages, ldc
, version ? "2.081.2"
, dmdSha256 ? "1wwk4shqldvgyczv1ihmljpfj3yidq7mxcj69i9kjl7jqx54hw62"
, druntimeSha256 ? "0dqfsy34q2q7mk2gsi4ix3vgqg7szg3m067fghgx53vnvrzlpsc0"
, phobosSha256 ? "1dan59lc4wggsrv5aax7jsxnzg7fz37xah84k1cbwjb3xxhhkd9n"
}:
let
bootstrapDmd = if !bootstrapVersion then
# Versions 2.070.2 and up require a working dmd compiler to build so we just
# use the last dmd without any D code to bootstrap the actual build.
callPackage ./default.nix {
stdenv = if stdenv.hostPlatform.isDarwin then
stdenv
else
# Doesn't build with gcc6 on linux
overrideCC stdenv gcc5;
bootstrapVersion = true;
version = "2.067.1";
dmdSha256 = "0fm29lg8axfmzdaj0y6vg70lhwb5d9rv4aavnvdd15xjschinlcz";
druntimeSha256 = "1n2qfw9kmnql0fk2nxikispqs7vh85nhvyyr00fk227n9lgnqf02";
phobosSha256 = "0fywgds9xvjcgnqxmpwr67p3wi2m535619pvj159cgwv5y0nr3p1";
}
else
"";
dmdBuild = stdenv.mkDerivation rec {
name = "dmdBuild-${version}";
inherit version;
@@ -74,23 +55,7 @@ let
usePIC = "-fPIC";
ROOT_HOME_DIR = "$(echo ~root)";
datetimePath = if bootstrapVersion then
"phobos/std/datetime.d"
else
"phobos/std/datetime/timezone.d";
phobosPatches = ''
substituteInPlace ${datetimePath} \
--replace "import core.time;" "import core.time;import std.path;"
substituteInPlace ${datetimePath} \
--replace "tzName == \"leapseconds\"" "baseName(tzName) == \"leapseconds\""
# Ugly hack to fix the hardcoded path to zoneinfo in the source file.
# https://issues.dlang.org/show_bug.cgi?id=15391
substituteInPlace ${datetimePath} \
--replace /usr/share/zoneinfo/ ${tzdata}/share/zoneinfo/
# Ugly hack so the dlopen call has a chance to succeed.
# https://issues.dlang.org/show_bug.cgi?id=15391
substituteInPlace phobos/std/net/curl.d \
@@ -100,57 +65,24 @@ let
substituteInPlace phobos/posix.mak \
--replace "-soname=libcurl.so.4" "-soname=${curl.out}/lib/libcurl.so.4"
''
+ stdenv.lib.optionalString (bootstrapVersion) ''
substituteInPlace ${datetimePath} \
--replace "import std.traits;" "import std.traits;import std.path;"
substituteInPlace ${datetimePath} \
--replace "tzName == \"+VERSION\"" "baseName(tzName) == \"leapseconds\" || tzName == \"+VERSION\""
''
+ stdenv.lib.optionalString stdenv.hostPlatform.isLinux ''
# See https://github.com/dlang/phobos/pull/5960
substituteInPlace phobos/std/path.d \
--replace "\"/root" "\"${ROOT_HOME_DIR}"
'';
dmdPath = if bootstrapVersion then
"dmd/src"
else
"dmd";
postPatch = ''
# Use proper C++ compiler
substituteInPlace ${dmdPath}/posix.mak \
--replace g++ $CXX
''
+ stdenv.lib.optionalString (!bootstrapVersion) ''
substituteInPlace druntime/test/common.mak \
--replace "DFLAGS:=" "DFLAGS:=${usePIC} "
substituteInPlace dmd/src/posix.mak \
--replace "DFLAGS :=" "DFLAGS += -link-defaultlib-shared=false"
''
+ phobosPatches
+ stdenv.lib.optionalString (stdenv.hostPlatform.isLinux && bootstrapVersion) ''
substituteInPlace ${dmdPath}/root/port.c \
--replace "#include <bits/mathdef.h>" "#include <complex.h>"
''
+ stdenv.lib.optionalString stdenv.hostPlatform.isDarwin ''
substituteInPlace ${dmdPath}/posix.mak \
substituteInPlace dmd/posix.mak \
--replace MACOSX_DEPLOYMENT_TARGET MACOSX_DEPLOYMENT_TARGET_
''
+ stdenv.lib.optionalString (stdenv.hostPlatform.isDarwin && bootstrapVersion) ''
# Was not able to compile on darwin due to "__inline_isnanl"
# being undefined.
substituteInPlace ${dmdPath}/root/port.c --replace __inline_isnanl __inline_isnan
'';
nativeBuildInputs = [ bootstrapDmd makeWrapper unzip which gdb ]
nativeBuildInputs = [ ldc makeWrapper unzip which gdb ]
++ stdenv.lib.optional stdenv.hostPlatform.isDarwin (with darwin.apple_sdk.frameworks; [
Foundation
@@ -164,23 +96,22 @@ let
else
stdenv.hostPlatform.parsed.kernel.name;
top = "$(echo $NIX_BUILD_TOP)";
pathToDmd = if bootstrapVersion then
"${top}/dmd/src/dmd"
else
"${top}/dmd/generated/${osname}/release/${bits}/dmd";
pathToDmd = "${top}/dmd/generated/${osname}/release/${bits}/dmd";
# Buid and install are based on http://wiki.dlang.org/Building_DMD
buildPhase = ''
cd dmd
make -j$NIX_BUILD_CORES -f posix.mak INSTALL_DIR=$out
make -j$NIX_BUILD_CORES -f posix.mak INSTALL_DIR=$out BUILD=release ENABLE_RELEASE=1 PIC=1 HOST_DMD=ldmd2
cd ../druntime
make -j$NIX_BUILD_CORES -f posix.mak PIC=1 INSTALL_DIR=$out DMD=${pathToDmd}
make -j$NIX_BUILD_CORES -f posix.mak BUILD=release ENABLE_RELEASE=1 PIC=1 INSTALL_DIR=$out DMD=${pathToDmd}
cd ../phobos
make -j$NIX_BUILD_CORES -f posix.mak PIC=1 INSTALL_DIR=$out DMD=${pathToDmd}
make -j$NIX_BUILD_CORES -f posix.mak BUILD=release ENABLE_RELEASE=1 PIC=1 INSTALL_DIR=$out DMD=${pathToDmd} TZ_DATABASE_DIR=${tzdata}/share/zoneinfo/
cd ..
'';
doCheck = !bootstrapVersion;
# Disable tests on Darwin for now because of
# https://github.com/NixOS/nixpkgs/issues/41099
doCheck = !stdenv.hostPlatform.isDarwin;
checkPhase = ''
cd dmd
@@ -189,8 +120,10 @@ let
make -j$NIX_BUILD_CORES -f posix.mak unittest PIC=1 DMD=${pathToDmd} BUILD=release
cd ..
'';
extension = if stdenv.hostPlatform.isDarwin then "a" else "{a,so}";
dontStrip = true;
installPhase = ''
cd dmd
@@ -216,13 +149,13 @@ let
cp -r etc $out/include/d2
wrapProgram $out/bin/dmd \
--prefix PATH ":" "${stdenv.cc}/bin" \
--set-default CC "$CC"
--prefix PATH ":" "${targetPackages.stdenv.cc}/bin" \
--set-default CC "${targetPackages.stdenv.cc}/bin/cc"
cd $out/bin
tee dmd.conf << EOF
[Environment]
DFLAGS=-I$out/include/d2 -L-L$out/lib ${stdenv.lib.optionalString (!stdenv.cc.isClang) "-L--export-dynamic"} -fPIC
DFLAGS=-I$out/include/d2 -L-L$out/lib ${stdenv.lib.optionalString (!targetPackages.stdenv.cc.isClang) "-L--export-dynamic"} -fPIC
EOF
'';
@@ -239,34 +172,40 @@ let
# Need to test Phobos in a fixed-output derivation, otherwise the
# network stuff in Phobos would fail if sandbox mode is enabled.
phobosUnittests = stdenv.mkDerivation rec {
name = "phobosUnittests-${version}";
version = dmdBuild.version;
#
# Disable tests on Darwin for now because of
# https://github.com/NixOS/nixpkgs/issues/41099
phobosUnittests = if !stdenv.hostPlatform.isDarwin then
stdenv.mkDerivation rec {
name = "phobosUnittests-${version}";
version = dmdBuild.version;
enableParallelBuilding = dmdBuild.enableParallelBuilding;
preferLocalBuild = true;
inputString = dmdBuild.outPath;
outputHashAlgo = "sha256";
outputHash = builtins.hashString "sha256" inputString;
enableParallelBuilding = dmdBuild.enableParallelBuilding;
preferLocalBuild = true;
inputString = dmdBuild.outPath;
outputHashAlgo = "sha256";
outputHash = builtins.hashString "sha256" inputString;
srcs = dmdBuild.srcs;
srcs = dmdBuild.srcs;
sourceRoot = ".";
sourceRoot = ".";
postPatch = dmdBuild.phobosPatches;
postPatch = dmdBuild.phobosPatches;
nativeBuildInputs = dmdBuild.nativeBuildInputs;
buildInputs = dmdBuild.buildInputs;
nativeBuildInputs = dmdBuild.nativeBuildInputs;
buildInputs = dmdBuild.buildInputs;
buildPhase = ''
cd phobos
make -j$NIX_BUILD_CORES -f posix.mak unittest PIC=1 DMD=${dmdBuild}/bin/dmd BUILD=release
'';
buildPhase = ''
cd phobos
make -j$NIX_BUILD_CORES -f posix.mak unittest BUILD=release ENABLE_RELEASE=1 PIC=1 DMD=${dmdBuild}/bin/dmd TZ_DATABASE_DIR=${tzdata}/share/zoneinfo/
'';
installPhase = ''
echo -n $inputString > $out
'';
};
installPhase = ''
echo -n $inputString > $out
'';
}
else
"";
in
@@ -6,22 +6,27 @@
, libuuid
, zlib
, curl
, patchelf
}:
let
rpath = stdenv.lib.makeLibraryPath [ stdenv.cc.cc libunwind libuuid icu openssl zlib curl ];
in
stdenv.mkDerivation rec {
version = "2.0.3";
version = "2.1.403";
netCoreVersion = "2.1.5";
name = "dotnet-sdk-${version}";
src = fetchurl {
url = "https://dotnetcli.azureedge.net/dotnet/Sdk/2.0.3-servicing-007037/dotnet-sdk-2.0.3-servicing-007037-linux-x64.tar.gz";
sha256 = "0kqk1f0vfdfyb9mp7d4y83airkxyixmxb7lrx0h0hym2a9661ch8";
url = "https://dotnetcli.azureedge.net/dotnet/Sdk/${version}/dotnet-sdk-${version}-linux-x64.tar.gz";
# use sha512 from the download page
sha512 = "903a8a633aea9211ba36232a2decb3b34a59bb62bc145a0e7a90ca46dd37bb6c2da02bcbe2c50c17e08cdff8e48605c0f990786faf1f06be1ea4a4d373beb8a9";
};
unpackPhase = "tar xvzf $src";
unpackPhase = ''
mkdir src
cd src
tar xvzf $src
'';
buildPhase = ''
runHook preBuild
@@ -45,7 +50,7 @@ in
meta = with stdenv.lib; {
homepage = https://dotnet.github.io/;
description = ".NET Core SDK 2.0.2 with .NET Core 2.0.0";
description = ".NET Core SDK ${version} with .NET Core ${netCoreVersion}";
platforms = [ "x86_64-linux" ];
maintainers = with maintainers; [ kuznero ];
license = licenses.mit;
+1 -1
View File
@@ -5,7 +5,7 @@ stdenv.mkDerivation rec {
version = "1.4.5";
src = fetchgit {
url = "git://git.kernel.org/pub/scm/utils/dtc/dtc.git";
url = "https://git.kernel.org/pub/scm/utils/dtc/dtc.git";
rev = "refs/tags/v${version}";
sha256 = "10y5pbkcj5gkijcgnlvrh6q2prpnvsgihb9asz3zfp66mcjwzsy3";
};
+26 -2
View File
@@ -1,10 +1,14 @@
{stdenv, fetchurl
{ stdenv, fetchurl, fetchpatch
, libtool, autoconf, automake
, gmp, mpfr, libffi, makeWrapper
, noUnicode ? false
, gcc
, threadSupport ? true
, threadSupport ? false
, useBoehmgc ? true, boehmgc
}:
assert useBoehmgc -> boehmgc != null;
let
s = # Generated upstream information
rec {
@@ -19,6 +23,9 @@ let
];
propagatedBuildInputs = [
libffi gmp mpfr gcc
] ++ stdenv.lib.optionals useBoehmgc [
# replaces ecl's own gc which other packages can depend on, thus propagated
boehmgc
];
in
stdenv.mkDerivation {
@@ -39,6 +46,23 @@ stdenv.mkDerivation {
"--enable-unicode")
;
patches = [
(fetchpatch {
# Avoid infinite loop, see https://gitlab.com/embeddable-common-lisp/ecl/issues/43 (fixed upstream)
name = "avoid-infinite-loop.patch";
url = "https://gitlab.com/embeddable-common-lisp/ecl/commit/caba1989f40ef917e7486f41b9cd5c7e3c5c2d79.patch";
sha256 = "07vw91psbc9gdn8grql46ra8lq3bgkzg5v480chnbryna4sv6lbb";
})
(fetchpatch {
# Fix getcwd with long pathnames
# Rebased version of
# https://gitlab.com/embeddable-common-lisp/ecl/commit/ac5f011f57a85a38627af154bc3ee7580e7fecd4.patch
name = "getcwd.patch";
url = "https://git.sagemath.org/sage.git/plain/build/pkgs/ecl/patches/16.1.2-getcwd.patch?id=07d6c37d18811e2b377a9689790a7c5e24da16ba";
sha256 = "1fbi8gn7rv8nqff5mpaijsrch3k3z7qc5cn4h1vl8qrr8xwqlqhb";
})
];
hardeningDisable = [ "format" ];
postInstall = ''
@@ -4,6 +4,7 @@
, noUnicode ? false
, gcc
, threadSupport ? true
, useBoehmgc ? false, boehmgc
}:
let
s = # Generated upstream information
@@ -20,6 +21,10 @@ let
];
propagatedBuildInputs = [
libffi gmp mpfr gcc
# replaces ecl's own gc which other packages can depend on, thus propagated
] ++ stdenv.lib.optionals useBoehmgc [
# replaces ecl's own gc which other packages can depend on, thus propagated
boehmgc
];
in
stdenv.mkDerivation {
@@ -53,6 +58,7 @@ stdenv.mkDerivation {
meta = {
inherit (s) version;
description = "Lisp implementation aiming to be small, fast and easy to embed";
homepage = https://common-lisp.net/project/ecl/;
license = stdenv.lib.licenses.mit ;
maintainers = [stdenv.lib.maintainers.raskin];
platforms = stdenv.lib.platforms.linux;
+18 -9
View File
@@ -7,6 +7,8 @@ targetArch = if stdenv.isi686 then
"IA32"
else if stdenv.isx86_64 then
"X64"
else if stdenv.isAarch64 then
"AARCH64"
else
throw "Unsupported architecture";
@@ -23,8 +25,8 @@ edk2 = stdenv.mkDerivation {
patches = [
(fetchpatch {
name = "short-circuit-the-transfer-of-an-empty-S3_CONTEXT.patch";
url = "https://github.com/tianocore/edk2/commit/9e2a8e928995c3b1bb664b73fd59785055c6b5f6";
sha256 = "0mdqa9w1p6cmli6976v4wi0sw9r4p5prkj7lzfd1877wk11c9c73";
url = "https://github.com/tianocore/edk2/commit/9e2a8e928995c3b1bb664b73fd59785055c6b5f6.diff";
sha256 = "0x24npijhgpjpsn3n74wayf8qcbaj97vi4z2iyf4almavqq8qaz4";
})
];
@@ -48,7 +50,7 @@ edk2 = stdenv.mkDerivation {
homepage = https://sourceforge.net/projects/edk2/;
license = stdenv.lib.licenses.bsd2;
branch = "UDK2017";
platforms = ["x86_64-linux" "i686-linux"];
platforms = ["x86_64-linux" "i686-linux" "aarch64-linux"];
};
passthru = {
@@ -58,13 +60,20 @@ edk2 = stdenv.mkDerivation {
configurePhase = ''
mkdir -v Conf
sed -e 's|Nt32Pkg/Nt32Pkg.dsc|${projectDscPath}|' -e \
's|MYTOOLS|GCC49|' -e 's|IA32|${targetArch}|' -e 's|DEBUG|RELEASE|'\
< ${edk2}/BaseTools/Conf/target.template > Conf/target.txt
sed -e 's|DEFINE GCC48_IA32_PREFIX = /usr/bin/|DEFINE GCC48_IA32_PREFIX = ""|' \
cp ${edk2}/BaseTools/Conf/target.template Conf/target.txt
sed -i Conf/target.txt \
-e 's|Nt32Pkg/Nt32Pkg.dsc|${projectDscPath}|' \
-e 's|MYTOOLS|GCC49|' \
-e 's|IA32|${targetArch}|' \
-e 's|DEBUG|RELEASE|'\
cp ${edk2}/BaseTools/Conf/tools_def.template Conf/tools_def.txt
sed -i Conf/tools_def.txt \
-e 's|DEFINE GCC48_IA32_PREFIX = /usr/bin/|DEFINE GCC48_IA32_PREFIX = ""|' \
-e 's|DEFINE GCC48_X64_PREFIX = /usr/bin/|DEFINE GCC48_X64_PREFIX = ""|' \
-e 's|DEFINE UNIX_IASL_BIN = /usr/bin/iasl|DEFINE UNIX_IASL_BIN = ${iasl}/bin/iasl|' \
< ${edk2}/BaseTools/Conf/tools_def.template > Conf/tools_def.txt
-e 's|DEFINE UNIX_IASL_BIN = /usr/bin/iasl|DEFINE UNIX_IASL_BIN = ${iasl}/bin/iasl|'
export WORKSPACE="$PWD"
export EFI_SOURCE="$PWD/EdkCompatibilityPkg"
ln -sv ${edk2}/BaseTools BaseTools
@@ -0,0 +1,91 @@
{ stdenv
, fetchurl
, symlinkJoin
, makeWrapper
, tcl
, fontconfig
, tk
, ncurses
, xorg
, file
}:
let
# eli derives the location of the include folder from the location of the lib folder
tk_combined = symlinkJoin {
name = "tk_combined";
paths = [
tk
tk.dev
];
};
curses_combined = symlinkJoin {
name = "curses_combined";
paths = [
ncurses
ncurses.dev
];
};
in
stdenv.mkDerivation rec {
name = "eli-${version}";
version = "4.8.1";
src = fetchurl {
url = "mirror://sourceforge/project/eli-project/Eli/Eli%20${version}/${name}.tar.bz2";
sha256="1vran8583hbwrr5dciji4zkhz3f88w4mn8n9sdpr6zw0plpf1whj";
};
buildInputs = [
ncurses
fontconfig
] ++ (with xorg; [
libX11.dev
libXt.dev
libXaw.dev
libXext.dev
]);
nativeBuildInputs = [
file
makeWrapper
];
# skip interactive browser check
buildFlags = "nobrowsers";
preConfigure=''
configureFlagsArray=(
--with-tcltk="${tcl} ${tk_combined}"
--with-curses="${curses_combined}"
)
export ODIN_LOCALIPC=1
'';
postInstall = ''
wrapProgram "$out/bin/eli" \
--set ODIN_LOCALIPC 1
'';
# Test if eli starts
doInstallCheck = true;
installCheckPhase = ''
export HOME="$TMP/home"
mkdir -p "$HOME"
$out/bin/eli "!ls"
'';
meta = {
description = "Translator Construction Made Easy";
longDescription = ''
Eli is a programming environment that supports all phases of translator
construction with extensive libraries implementing common tasks, yet handling
arbitrary special cases. Output is the C subset of C++.
'';
homepage = http://eli-project.sourceforge.net/;
license = stdenv.lib.licenses.gpl2;
maintainers = with stdenv.lib.maintainers; [ timokau ];
platforms = stdenv.lib.platforms.linux;
};
}
+88 -69
View File
@@ -1,14 +1,58 @@
{ lib, stdenv, buildEnv, haskell, nodejs, fetchurl, fetchpatch, makeWrapper }:
{ lib, stdenv, buildEnv
, haskell, nodejs
, fetchurl, fetchpatch, makeWrapper, git }:
# To update:
# 1) Update versions in ./update-elm.rb and run it.
# 2) Checkout elm-reactor and run `elm-package install -y` inside.
# 3) Run ./elm2nix.rb in elm-reactor's directory.
# 4) Move the resulting 'package.nix' to 'packages/elm-reactor-elm.nix'.
# 1) Modify ./update.sh and run it
# 2) to generate versions.dat:
# 2.1) git clone https://github.com/elm/compiler.git
# 2.2) cd compiler
# 2.3) cabal2nix --shell . | sed 's/"default",/"ghc822",/' > shell.nix
# 2.4) nix-shell
# 2.5) mkdir .elm
# 2.6) export ELM_HOME=$(pwd)/.elm
# 2.7) cabal build
# 2.8) cp .elm/0.19.0/package/versions.dat ...
# 3) generate a template for elm-elm.nix with:
# (
# echo "{";
# jq '.dependencies | .direct, .indirect | to_entries | .[] | { (.key) : { version : .value, sha256: "" } } ' \
# < ui/browser/elm.json \
# | sed 's/:/ =/' \
# | sed 's/^[{}]//' \
# | sed -E 's/(["}]),?$/\1;/' \
# | sed -E 's/"(version|sha256)"/\1/' \
# | grep -v '^$';
# echo "}"
# )
#
# ... then fill in the sha256s
# Notes:
# the elm binary embeds a piece of pre-compiled elm code, used by 'elm
# reactor'. this means that the build process for 'elm' effectively
# executes 'elm make'. that in turn expects to retrieve the elm
# dependencies of that code (elm/core, etc.) from
# package.elm-lang.org, as well as a cached bit of metadata
# (versions.dat).
# the makeDotElm function lets us retrieve these dependencies in the
# standard nix way. we have to copy them in (rather than symlink) and
# make them writable because the elm compiler writes other .dat files
# alongside the source code. versions.dat was produced during an
# impure build of this same code; the build complains that it can't
# update this cache, but continues past that warning.
# finally, we set ELM_HOME to point to these pre-fetched artifacts so
# that the default of ~/.elm isn't used.
let
makeElmStuff = deps:
let json = builtins.toJSON (lib.mapAttrs (name: info: info.version) deps);
makeDotElm = ver: deps:
let versionsDat = ./versions.dat;
cmds = lib.mapAttrsToList (name: info: let
pkg = stdenv.mkDerivation {
@@ -29,77 +73,52 @@ let
};
in ''
mkdir -p elm-stuff/packages/${name}
ln -s ${pkg} elm-stuff/packages/${name}/${info.version}
mkdir -p .elm/${ver}/package/${name}
cp -R ${pkg} .elm/${ver}/package/${name}/${info.version}
'') deps;
in ''
export HOME=/tmp
mkdir elm-stuff
cat > elm-stuff/exact-dependencies.json <<EOF
${json}
EOF
'' + lib.concatStrings cmds;
in (lib.concatStrings cmds) + ''
mkdir -p .elm/${ver}/package;
cp ${versionsDat} .elm/${ver}/package/versions.dat;
chmod -R +w .elm
'';
hsPkgs = haskell.packages.ghc802.override {
overrides = self: super:
let hlib = haskell.lib;
elmRelease = import ./packages/release.nix { inherit (self) callPackage; };
elmPkgs' = elmRelease.packages;
elmPkgs = elmPkgs' // {
elm-reactor = hlib.overrideCabal elmPkgs'.elm-reactor (drv: {
buildTools = drv.buildTools or [] ++ [ self.elm-make ];
preConfigure = makeElmStuff (import ./packages/elm-reactor-elm.nix);
});
elm-repl = hlib.overrideCabal elmPkgs'.elm-repl (drv: {
doCheck = false;
hsPkgs = haskell.packages.ghc822.override {
overrides = self: super: with haskell.lib;
let elmPkgs = {
elm = overrideCabal (self.callPackage ./packages/elm.nix { }) (drv: {
# sadly with parallelism most of the time breaks compilation
enableParallelBuilding = false;
preConfigure = ''
export ELM_HOME=`pwd`/.elm
'' + (makeDotElm "0.19.0" (import ./packages/elm-elm.nix));
buildTools = drv.buildTools or [] ++ [ makeWrapper ];
postInstall =
let bins = lib.makeBinPath [ nodejs self.elm-make ];
in ''
wrapProgram $out/bin/elm-repl \
--prefix PATH ':' ${bins}
'';
patches = [
(fetchpatch {
url = "https://github.com/elm/compiler/pull/1784/commits/78d2d8eab310552b1b877a3e90e1e57e7a09ddec.patch";
sha256 = "0vdhk16xqm2hxw12s1b91a0bmi8w4wsxc086qlzglgnjxrl5b3w4";
})
];
postInstall = ''
wrapProgram $out/bin/elm \
--prefix PATH ':' ${lib.makeBinPath [ nodejs ]}
'';
});
/*
This is not a core Elm package, and it's hosted on GitHub.
To update, run:
cabal2nix --jailbreak --revision refs/tags/foo http://github.com/avh4/elm-format > packages/elm-format.nix
where foo is a tag for a new version, for example "0.3.1-alpha".
The elm-format expression is updated via a script in the https://github.com/avh4/elm-format repo:
`pacakge/nix/build.sh`
*/
elm-format = self.callPackage ./packages/elm-format.nix { };
elm-interface-to-json = self.callPackage ./packages/elm-interface-to-json.nix {
aeson-pretty = self.aeson-pretty_0_7_2;
};
elm-format = self.callPackage ./packages/elm-format.nix {};
};
in elmPkgs // {
inherit elmPkgs;
elmVersion = elmRelease.version;
# needed for elm-package
http-client = hlib.overrideCabal super.http-client (drv: {
version = "0.4.31.2";
sha256 = "12yq2l6bvmxg5w6cw5ravdh39g8smwn1j44mv36pfmkhm5402h8n";
});
http-client-tls = hlib.overrideCabal super.http-client-tls (drv: {
version = "0.2.4.1";
sha256 = "18wbca7jg15p0ds3339f435nqv2ng0fqc4bylicjzlsww625ij4d";
});
# https://github.com/elm-lang/elm-compiler/issues/1566
indents = hlib.overrideCabal super.indents (drv: {
version = "0.3.3";
sha256 = "16lz21bp9j14xilnq8yym22p3saxvc9fsgfcf5awn2a6i6n527xn";
libraryHaskellDepends = drv.libraryHaskellDepends ++ [super.concatenative];
});
elmVersion = elmPkgs.elm.version;
# Needed for elm-format
indents = self.callPackage ./packages/indents.nix {};
tasty-quickcheck = self.callPackage ./packages/tasty-quickcheck.nix {};
};
};
in hsPkgs.elmPkgs // {
elm = lib.hiPrio (buildEnv {
name = "elm-${hsPkgs.elmVersion}";
paths = lib.mapAttrsToList (name: pkg: pkg) hsPkgs.elmPkgs;
pathsToLink = [ "/bin" ];
});
}
in hsPkgs.elmPkgs
@@ -1,41 +0,0 @@
{ mkDerivation, aeson, aeson-pretty_0_7_2, ansi-terminal, ansi-wl-pprint
, base, binary, bytestring, containers, directory, edit-distance
, fetchgit, filemanip, filepath, HUnit, indents
, language-ecmascript, language-glsl, mtl, parsec, pretty, process
, QuickCheck, stdenv, test-framework, test-framework-hunit
, test-framework-quickcheck2, text, union-find
}:
mkDerivation {
pname = "elm-compiler";
version = "0.18";
src = fetchgit {
url = "https://github.com/elm-lang/elm-compiler";
sha256 = "09fmrbfpc1kzc3p9h79w57b9qjhajdswc4jfm9gyjw95vsiwasgh";
rev = "eb97f2a5dd5421c708a91b71442e69d02453cc80";
};
isLibrary = true;
isExecutable = true;
libraryHaskellDepends = [
aeson aeson-pretty_0_7_2 ansi-terminal ansi-wl-pprint base binary
bytestring containers directory edit-distance filepath indents
language-ecmascript language-glsl mtl parsec pretty process text
union-find
];
executableHaskellDepends = [
aeson base binary directory filepath process text
];
testHaskellDepends = [
aeson aeson-pretty_0_7_2 ansi-terminal ansi-wl-pprint base binary
bytestring containers directory edit-distance filemanip filepath
HUnit indents language-ecmascript language-glsl mtl parsec pretty
process QuickCheck test-framework test-framework-hunit
test-framework-quickcheck2 text union-find
];
jailbreak = true;
homepage = http://elm-lang.org;
description = "Values to help with elm-package, elm-make, and elm-lang.org.";
license = stdenv.lib.licenses.bsd3;
# added manually since tests are not passing
# https://travis-ci.org/elm-lang/elm-compiler/builds/176845852
doCheck = false;
}
@@ -0,0 +1,50 @@
{
"elm/browser" = {
version = "1.0.0";
sha256 = "1apmvyax93nvmagwj00y16zx10kfv640cxpi64xgqbgy7d2wphy4";
};
"elm/core" = {
version = "1.0.0";
sha256 = "10kr86h4v5h4p0586q406a5wbl8xvr1jyrf6097zp2wb8sv21ylw";
};
"elm/html" = {
version = "1.0.0";
sha256 = "1n3gpzmpqqdsldys4ipgyl1zacn0kbpc3g4v3hdpiyfjlgh8bf3k";
};
"elm/http" = {
version = "1.0.0";
sha256 = "1igmm89ialzrjib1j8xagkxalq1x2gj4l0hfxcd66mpwmvg7psl8";
};
"elm/json" = {
version = "1.0.0";
sha256 = "1g0hafkqf2q633r7ir9wxpb1lnlzskhpsyi0h5bkzj0gl072zfnb";
};
"elm/project-metadata-utils" = {
version = "1.0.0";
sha256 = "1d4rd4grrnbdvj9gf00h7dr6hbkjzawgkzpizfrkp1z1pyr3mvq9";
};
"elm/svg" = {
version = "1.0.0";
sha256 = "08x0v8p9wm699jjmsnbq69pxv3jh60j4f6fg7y6hyr7xxj85y390";
};
"elm-explorations/markdown" = {
version = "1.0.0";
sha256 = "0k3110ixa4wwf3vkkdplagwah9ypr965qxr1y147rnsc1xsxmr6y";
};
"elm/parser" = {
version = "1.0.0";
sha256 = "0k4zlq30lrvawqvzwbvsl0hrmwf9s832mb41z7fdspm4549dj7wc";
};
"elm/time" = {
version = "1.0.0";
sha256 = "0vch7i86vn0x8b850w1p69vplll1bnbkp8s383z7pinyg94cm2z1";
};
"elm/url" = {
version = "1.0.0";
sha256 = "0av8x5syid40sgpl5vd7pry2rq0q4pga28b4yykn9gd9v12rs3l4";
};
"elm/virtual-dom" = {
version = "1.0.0";
sha256 = "0hm8g92h7z39km325dlnhk8n00nlyjkqp3r3jppr37k2k13md6aq";
};
}
@@ -1,19 +1,21 @@
{ mkDerivation, ansi-terminal, ansi-wl-pprint, base, binary
, bytestring, Cabal, cmark, containers, directory, fetchgit
, filepath, free, HUnit, indents, json, mtl, optparse-applicative
, parsec, process, QuickCheck, quickcheck-io, split, stdenv, tasty
, tasty-golden, tasty-hunit, tasty-quickcheck, text
{ mkDerivation, fetchgit, ansi-terminal, ansi-wl-pprint, base, binary
, bytestring, Cabal, cmark, containers, directory, filepath, free
, HUnit, indents, json, mtl, optparse-applicative, parsec, process
, QuickCheck, quickcheck-io, split, stdenv, tasty, tasty-golden
, tasty-hunit, tasty-quickcheck, text
}:
mkDerivation {
pname = "elm-format";
version = "0.7.0";
version = "0.8.1";
src = fetchgit {
url = "http://github.com/avh4/elm-format";
sha256 = "1snl2lrrzdwgzi68agi3sdw84aslj04pzzxpm1mam9ic6dzhn3jf";
rev = "da4b415c6a2b7e77b7d9f00beca3e45230e603fb";
sha256 = "0p1dy1m6illsl7i04zsv5jqw7i4znv7pfpdfm53zy0k7mq0fk09j";
rev = "89694e858664329e3cbdaeb71b15c4456fd739ff";
};
doHaddock = false;
postPatch = ''
sed -i "s|desc <-.*||" ./Setup.hs
sed -i "s|gitDescribe = .*|gitDescribe = \\\\\"0.8.1\\\\\"\"|" ./Setup.hs
'';
isLibrary = true;
isExecutable = true;
setupHaskellDepends = [ base Cabal directory filepath process ];
@@ -27,15 +29,8 @@ mkDerivation {
base cmark containers HUnit mtl parsec QuickCheck quickcheck-io
split tasty tasty-golden tasty-hunit tasty-quickcheck text
];
jailbreak = true;
postInstall = ''
ln -s $out/bin/elm-format-0.18 $out/bin/elm-format
'';
postPatch = ''
sed -i "s|desc <-.*||" ./Setup.hs
sed -i "s|gitDescribe = .*|gitDescribe = \\\\\"da4b415c\\\\\"\"|" ./Setup.hs
'';
homepage = http://elm-lang.org;
doHaddock = false;
homepage = "http://elm-lang.org";
description = "A source code formatter for Elm";
license = stdenv.lib.licenses.bsd3;
}
@@ -1,24 +0,0 @@
{ mkDerivation, aeson, aeson-pretty, base, binary, bytestring
, concatenative, containers, directory, either, elm-compiler
, filemanip, filepath, indents, optparse-applicative, parsec
, stdenv, text, transformers, fetchgit
}:
mkDerivation {
pname = "elm-interface-to-json";
version = "0.1.0.0";
src = fetchgit {
url = "https://github.com/stoeffel/elm-interface-to-json";
sha256 = "1izc78w91m7nrc9i2b3lgy3kyjsy4d5mkkblx96ws0bp3dpm5f9k";
rev = "9884c1c997a55f11cf7c3d99a8afa72cf2e97323";
};
isLibrary = false;
isExecutable = true;
jailbreak = true;
executableHaskellDepends = [
aeson aeson-pretty base binary bytestring concatenative containers
directory either elm-compiler filemanip filepath indents
optparse-applicative parsec text transformers
];
homepage = "https://github.com/githubuser/elm-interface-to-json#readme";
license = stdenv.lib.licenses.bsd3;
}
@@ -1,26 +0,0 @@
{ mkDerivation, aeson, ansi-terminal, ansi-wl-pprint, base, binary
, blaze-html, blaze-markup, bytestring, containers, directory
, elm-compiler, elm-package, fetchgit, filepath, mtl
, optparse-applicative, raw-strings-qq, stdenv, text, time
}:
mkDerivation {
pname = "elm-make";
version = "0.18";
src = fetchgit {
url = "https://github.com/elm-lang/elm-make";
sha256 = "1yq4w4yqignlc2si5ns53pmz0a99gix5d2qgi6x7finf7i6sxyw2";
rev = "1a554833a70694ab142b9179bfac996143f68d9e";
};
isLibrary = false;
isExecutable = true;
executableHaskellDepends = [
aeson ansi-terminal ansi-wl-pprint base binary blaze-html
blaze-markup bytestring containers directory elm-compiler
elm-package filepath mtl optparse-applicative raw-strings-qq text
time
];
jailbreak = true;
homepage = http://elm-lang.org;
description = "A build tool for Elm projects";
license = stdenv.lib.licenses.bsd3;
}
@@ -1,35 +0,0 @@
{ mkDerivation, aeson, aeson-pretty_0_7_2, ansi-wl-pprint, base, binary
, bytestring, containers, directory, edit-distance, elm-compiler
, fetchgit, filepath, HTTP, http-client, http-client-tls
, http-types, mtl, network, optparse-applicative, parallel-io
, pretty, stdenv, text, time, unordered-containers, vector
, zip-archive
}:
mkDerivation {
pname = "elm-package";
version = "0.18";
src = fetchgit {
url = "https://github.com/elm-lang/elm-package";
sha256 = "19krnkjvfk02gmmic5h5i1i0lw7s30927bnd5g57cj8nqbigysv7";
rev = "8bd150314bacab5b6fc451927aa01deec2276fbf";
};
isLibrary = true;
isExecutable = true;
libraryHaskellDepends = [
aeson aeson-pretty_0_7_2 ansi-wl-pprint base binary bytestring containers
directory edit-distance elm-compiler filepath HTTP http-client
http-client-tls http-types mtl network parallel-io text time
unordered-containers vector zip-archive
];
executableHaskellDepends = [
aeson aeson-pretty_0_7_2 ansi-wl-pprint base binary bytestring containers
directory edit-distance elm-compiler filepath HTTP http-client
http-client-tls http-types mtl network optparse-applicative
parallel-io pretty text time unordered-containers vector
zip-archive
];
jailbreak = true;
homepage = https://github.com/elm-lang/elm-package;
description = "Package manager for Elm libraries";
license = stdenv.lib.licenses.bsd3;
}
@@ -1,22 +0,0 @@
{
"elm-lang/virtual-dom" = {
version = "2.0.1";
sha256 = "19nfjx072m7a7bx8flc50vbmiww172jmscyq9x91cr2kby5hvbw3";
};
"evancz/elm-markdown" = {
version = "3.0.1";
sha256 = "144lzpcapf2mhqiz90mkllmm4skrcs0iha1daps42qn3xps7hvmj";
};
"elm-lang/html" = {
version = "2.0.0";
sha256 = "05sqjd5n8jnq4lv5v0ipcg98b8im1isnnl4wns1zzn4w5nbrjjzi";
};
"elm-lang/svg" = {
version = "2.0.0";
sha256 = "1c7p967n1yhynravqwgh80vprwz7r2r1n0x3icn5wzk9iaqs069l";
};
"elm-lang/core" = {
version = "5.0.0";
sha256 = "0gqyc09bh43pi7r2cizyjm5y0zpgarv3is17dl325qvxb9s1y2gn";
};
}
@@ -1,28 +0,0 @@
{ mkDerivation, aeson, base, blaze-html, blaze-markup, bytestring
, cmdargs, containers, directory, elm-compiler, elm-package
, fetchgit, file-embed, filepath, fsnotify, mtl, process, snap-core
, snap-server, stdenv, template-haskell, text, time, transformers
, unordered-containers, utf8-string, websockets, websockets-snap
}:
mkDerivation {
pname = "elm-reactor";
version = "0.18";
src = fetchgit {
url = "https://github.com/elm-lang/elm-reactor";
sha256 = "0lpidsckyfcr8d6bln735d98dx7ga7j1vyssw0qsv8ijj18gxx65";
rev = "c519d4ec0aaf2f043a416fe858346b0181eca516";
};
isLibrary = false;
isExecutable = true;
executableHaskellDepends = [
aeson base blaze-html blaze-markup bytestring cmdargs containers
directory elm-compiler elm-package file-embed filepath fsnotify mtl
process snap-core snap-server template-haskell text time
transformers unordered-containers utf8-string websockets
websockets-snap
];
jailbreak = true;
homepage = http://elm-lang.org;
description = "Interactive development tool for Elm programs";
license = stdenv.lib.licenses.bsd3;
}
@@ -1,30 +0,0 @@
{ mkDerivation, base, binary, bytestring, bytestring-trie, cmdargs
, containers, directory, elm-compiler, elm-package, fetchgit
, filepath, haskeline, HUnit, mtl, parsec, QuickCheck, stdenv
, test-framework, test-framework-hunit, test-framework-quickcheck2
, text
}:
mkDerivation {
pname = "elm-repl";
version = "0.18";
src = fetchgit {
url = "https://github.com/elm-lang/elm-repl";
sha256 = "112fzykils4lqz4pc44q4mwvxg0px0zfwx511bfvblrxkwwqlfb5";
rev = "85f0bcfc28ea6c8a99a360d55c21ff25a556f9fe";
};
isLibrary = false;
isExecutable = true;
executableHaskellDepends = [
base binary bytestring bytestring-trie cmdargs containers directory
elm-compiler elm-package filepath haskeline mtl parsec text
];
testHaskellDepends = [
base bytestring bytestring-trie cmdargs directory elm-compiler
elm-package filepath haskeline HUnit mtl parsec QuickCheck
test-framework test-framework-hunit test-framework-quickcheck2
];
jailbreak = true;
homepage = https://github.com/elm-lang/elm-repl;
description = "a REPL for Elm";
license = stdenv.lib.licenses.bsd3;
}
@@ -0,0 +1,30 @@
{ mkDerivation, ansi-terminal, ansi-wl-pprint, base, binary
, bytestring, containers, directory, edit-distance, fetchgit
, file-embed, filepath, ghc-prim, haskeline, HTTP, http-client
, http-client-tls, http-types, language-glsl, logict, mtl, network
, parsec, process, raw-strings-qq, scientific, SHA, snap-core
, snap-server, stdenv, template-haskell, text, time
, unordered-containers, utf8-string, vector, zip-archive
}:
mkDerivation {
pname = "elm";
version = "0.19.0";
src = fetchgit {
url = "https://github.com/elm/compiler";
sha256 = "13jks6c6i80z71mjjfg46ri570g5ini0k3xw3857v6z66zcl56x4";
rev = "d5cbc41aac23da463236bbc250933d037da4055a";
};
isLibrary = false;
isExecutable = true;
executableHaskellDepends = [
ansi-terminal ansi-wl-pprint base binary bytestring containers
directory edit-distance file-embed filepath ghc-prim haskeline HTTP
http-client http-client-tls http-types language-glsl logict mtl
network parsec process raw-strings-qq scientific SHA snap-core
snap-server template-haskell text time unordered-containers
utf8-string vector zip-archive
];
homepage = "http://elm-lang.org";
description = "The `elm` command line interface";
license = stdenv.lib.licenses.bsd3;
}
@@ -0,0 +1,11 @@
{ mkDerivation, base, concatenative, mtl, parsec, stdenv }:
mkDerivation {
pname = "indents";
version = "0.3.3";
sha256 = "b61f51ac894609cb5571cc3ded12db5de97185a8de236c69ec24c87457109f9a";
libraryHaskellDepends = [ base concatenative mtl parsec ];
doCheck = false;
homepage = "http://patch-tag.com/r/salazar/indents";
description = "indentation sensitive parser-combinators for parsec";
license = stdenv.lib.licenses.bsd3;
}
@@ -1,13 +0,0 @@
# This file is auto-generated by ./update-elm.rb.
# Please, do not modify it by hand!
{ callPackage }:
{
version = "0.18.0";
packages = {
elm-compiler = callPackage ./elm-compiler.nix { };
elm-package = callPackage ./elm-package.nix { };
elm-make = callPackage ./elm-make.nix { };
elm-reactor = callPackage ./elm-reactor.nix { };
elm-repl = callPackage ./elm-repl.nix { };
};
}
@@ -0,0 +1,14 @@
{ mkDerivation, base, pcre-light, QuickCheck, random, stdenv
, tagged, tasty, tasty-hunit
}:
mkDerivation {
pname = "tasty-quickcheck";
version = "0.9.2";
sha256 = "c5920adeab6e283d5e3ab45f3c80a1b011bedfbe4a3246a52606da2e1da95873";
libraryHaskellDepends = [ base QuickCheck random tagged tasty ];
testHaskellDepends = [ base pcre-light tasty tasty-hunit ];
doCheck = false;
homepage = "https://github.com/feuerbach/tasty";
description = "QuickCheck support for the Tasty test framework";
license = stdenv.lib.licenses.mit;
}
@@ -1,28 +0,0 @@
#!/usr/bin/env ruby
# Take those from https://github.com/elm-lang/elm-platform/blob/master/installers/BuildFromSource.hs
$elm_version = "0.18.0"
$elm_packages = { "elm-compiler" => "0.18.0",
"elm-package" => "0.18.0",
"elm-make" => "0.18.0",
"elm-reactor" => "0.18.0",
"elm-repl" => "0.18.0"
}
for pkg, ver in $elm_packages
system "cabal2nix https://github.com/elm-lang/#{pkg} --revision refs/tags/#{ver} --jailbreak > packages/#{pkg}.nix"
end
File.open("packages/release.nix", 'w') do |file|
file.puts "# This file is auto-generated by ./update-elm.rb."
file.puts "# Please, do not modify it by hand!"
file.puts "{ callPackage }:"
file.puts "{"
file.puts " version = \"#{$elm_version}\";"
file.puts " packages = {"
for pkg, ver in $elm_packages
file.puts " #{pkg} = callPackage ./#{pkg}.nix { };"
end
file.puts " };"
file.puts "}"
end
+1
View File
@@ -0,0 +1 @@
cabal2nix https://github.com/elm/compiler --revision 32059a289d27e303fa1665e9ada0a52eb688f302 > packages/elm.nix
Binary file not shown.
@@ -1,10 +1,11 @@
{ stdenv, fetchFromGitHub, emscriptenfastcomp, python, nodejs, closurecompiler
, jre, binaryen, enableWasm ? true
{ emscriptenVersion, stdenv, fetchFromGitHub, emscriptenfastcomp, python, nodejs, closurecompiler
, jre, binaryen, enableWasm ? true , cmake
}:
let
rev = "1.37.16";
rev = emscriptenVersion;
appdir = "share/emscripten";
binaryenVersioned = binaryen.override { emscriptenRev = rev; };
in
stdenv.mkDerivation {
@@ -13,10 +14,12 @@ stdenv.mkDerivation {
src = fetchFromGitHub {
owner = "kripken";
repo = "emscripten";
sha256 = "1qyhjx5zza01vnwmj6qzxbkagxknn4kzb6gw12fqw5q8pa8fy4zy";
sha256 = "02p0cp86vd1mydlpq544xbydggpnrq9dhbxx7h08j235frjm5cdc";
inherit rev;
};
buildInputs = [ nodejs cmake python ];
buildCommand = ''
mkdir -p $out/${appdir}
cp -r $src/* $out/${appdir}
@@ -38,9 +41,23 @@ stdenv.mkDerivation {
echo "COMPILER_ENGINE = NODE_JS" >> $out/${appdir}/config
echo "CLOSURE_COMPILER = '${closurecompiler}/share/java/closure-compiler-v${closurecompiler.version}.jar'" >> $out/${appdir}/config
echo "JAVA = '${jre}/bin/java'" >> $out/${appdir}/config
# to make the test(s) below work
echo "SPIDERMONKEY_ENGINE = []" >> $out/${appdir}/config
''
+ stdenv.lib.optionalString enableWasm ''
echo "BINARYEN_ROOT = '${binaryen}'" >> $out/share/emscripten/config
echo "BINARYEN_ROOT = '${binaryenVersioned}'" >> $out/share/emscripten/config
''
+
''
echo "--------------- running test -----------------"
# quick hack to get the test working
HOME=$TMPDIR
cp $out/${appdir}/config $HOME/.emscripten
export PATH=$PATH:$out/bin
#export EMCC_DEBUG=2
${python}/bin/python $src/tests/runner.py test_hello_world
echo "--------------- /running test -----------------"
'';
meta = with stdenv.lib; {
@@ -1,4 +1,4 @@
{ newScope, stdenv, binutils-raw, wrapCCWith, symlinkJoin }:
{ newScope, stdenv, binutils, wrapCCWith, symlinkJoin }:
let
callPackage = newScope (self // {inherit stdenv;});
@@ -7,7 +7,7 @@ let
emscriptenfastcomp-wrapped = wrapCCWith {
cc = self.emscriptenfastcomp-unwrapped;
# Never want Apple's cctools for WASM target
bintools = binutils-raw;
bintools = binutils;
libc = stdenv.cc.libc;
extraBuildCommands = ''
# hardening flags break WASM support
@@ -15,7 +15,7 @@ let
'';
};
emscriptenfastcomp = symlinkJoin {
name = "emscriptenfastcomp";
name = "emscriptenfastcomp-${stdenv.lib.getVersion self.emscriptenfastcomp-unwrapped}";
paths = [ self.emscriptenfastcomp-wrapped self.emscriptenfastcomp-unwrapped ];
preferLocalBuild = false;
allowSubstitutes = true;
@@ -1,7 +1,7 @@
{ stdenv, fetchFromGitHub, cmake, python, ... }:
{ emscriptenVersion, stdenv, fetchFromGitHub, cmake, python, gtest, ... }:
let
rev = "1.37.16";
rev = emscriptenVersion;
gcc = if stdenv.cc.isGNU then stdenv.cc.cc else stdenv.cc.cc.gcc;
in
stdenv.mkDerivation rec {
@@ -10,18 +10,18 @@ stdenv.mkDerivation rec {
src = fetchFromGitHub {
owner = "kripken";
repo = "emscripten-fastcomp";
sha256 = "0wj9sc0gciaiidcjv6wb0qn6ks06xds7q34351masc7qpvd217by";
sha256 = "04j698gmp686b5lricjakm5hyh2z2kh28m1ffkghmkyz4zkzmx98";
inherit rev;
};
srcFL = fetchFromGitHub {
owner = "kripken";
repo = "emscripten-fastcomp-clang";
sha256 = "1akdgxzxhzjbhp4d14ajcrp9jrf39x004a726ly2gynqc185l4j7";
sha256 = "1ici51mmpgg80xk3y8f376nbbfak6rz27qdy98l8lxkrymklp5g5";
inherit rev;
};
nativeBuildInputs = [ cmake python ];
nativeBuildInputs = [ cmake python gtest ];
preConfigure = ''
cp -Lr ${srcFL} tools/clang
chmod +w -R tools/clang
@@ -30,9 +30,10 @@ stdenv.mkDerivation rec {
"-DCMAKE_BUILD_TYPE=Release"
"-DLLVM_TARGETS_TO_BUILD='X86;JSBackend'"
"-DLLVM_INCLUDE_EXAMPLES=OFF"
"-DLLVM_INCLUDE_TESTS=OFF"
# "-DCLANG_INCLUDE_EXAMPLES=OFF"
"-DCLANG_INCLUDE_TESTS=OFF"
"-DLLVM_INCLUDE_TESTS=ON"
#"-DLLVM_CONFIG=${llvm}/bin/llvm-config"
"-DLLVM_BUILD_TESTS=ON"
"-DCLANG_INCLUDE_TESTS=ON"
] ++ (stdenv.lib.optional stdenv.isLinux
# necessary for clang to find crtend.o
"-DGCC_INSTALL_PREFIX=${gcc}"
@@ -1,57 +1,58 @@
{ stdenv, fetchurl, fetchFromGitHub, glib, glibc, git,
{ stdenv, fetchurl, glib, glibc, git,
rlwrap, curl, pkgconfig, perl, makeWrapper, tzdata, ncurses,
libX11, pango, cairo, gtk2, gdk_pixbuf, gtkglext,
mesa_glu, libXmu, libXt, libICE, libSM }:
pango, cairo, gtk2, gdk_pixbuf, gtkglext,
mesa, xorg, openssl, unzip }:
stdenv.mkDerivation rec {
let
inherit (stdenv.lib) optional;
in stdenv.mkDerivation rec {
name = "factor-lang-${version}";
version = "0.97";
rev = "eb3ca179740e6cfba696b55a999caa13369e6182";
version = "0.98";
rev = "7999e72aecc3c5bc4019d43dc4697f49678cc3b4";
src = fetchFromGitHub {
owner = "factor";
repo = "factor";
rev = rev;
sha256 = "16zlbxbad3d19jq01nk824i19bypqzn8l3yfxys40z06vjjncapd";
src = fetchurl {
url = http://downloads.factorcode.org/releases/0.98/factor-src-0.98.zip;
sha256 = "01ip9mbnar4sv60d2wcwfz62qaamdvbykxw3gbhzqa25z36vi3ri";
};
factorimage = fetchurl {
url = http://downloads.factorcode.org/releases/0.97/factor-linux-x86-64-0.97.tar.gz;
sha256 = "06y125c8vbng54my5fxdr3crpxkvhhcng2n35cxddd3wcg6vhxhp";
name = "factorimage";
};
patches = [
./staging-command-line-0.98-pre.patch
./workdir-0.98-pre.patch
./fuel-dir.patch
];
nativeBuildInputs = [ pkgconfig ];
buildInputs = [ git rlwrap curl perl makeWrapper
buildInputs = with xorg; [ git rlwrap curl pkgconfig perl makeWrapper
libX11 pango cairo gtk2 gdk_pixbuf gtkglext
mesa_glu libXmu libXt libICE libSM ];
mesa libXmu libXt libICE libSM openssl unzip ];
buildPhase = ''
make $(bash ./build-support/factor.sh make-target) GIT_LABEL=heads/master-${rev}
sed -ie '4i GIT_LABEL = heads/master-${rev}' GNUmakefile
make linux-x86-64
# De-memoize xdg-* functions, otherwise they break the image.
sed -ie 's/^MEMO:/:/' basis/xdg/xdg.factor
'';
installPhase = ''
mkdir -p $out/bin $out/lib/factor
# First, get a workable image. Unfortunately, no boot-image
# is available with release info. So fetch a released image.
# The released image has library path info embedded, so we
# have to first recreate the boot image with Nix paths, and
# first have to recreate the boot image with Nix paths, and
# then use it to build the Nix release image.
zcat ${factorimage} | (cd $out/lib && tar -xvpf - factor/factor.image )
cp boot.unix-x86.64.image $out/lib/factor/factor.image
cp -r basis core extra unmaintained $out/lib/factor
cp -r basis core extra $out/lib/factor
# Factor uses the home directory for cache during compilation.
# We cant have that. So set it to $TMPDIR/.home
export HOME=$TMPDIR/.home && mkdir -p $HOME
# Factor uses XDG_CACHE_HOME for cache during compilation.
# We can't have that. So set it to $TMPDIR/.cache
export XDG_CACHE_HOME=$TMPDIR/.cache && mkdir -p $XDG_CACHE_HOME
# there is no ld.so.cache in NixOS so we construct one
# There is no ld.so.cache in NixOS so we construct one
# out of known libraries. The side effect is that find-lib
# will work only on the known libraries. There does not seem
# to be a generic solution here.
find $(echo ${stdenv.lib.makeLibraryPath [
find $(echo ${stdenv.lib.makeLibraryPath (with xorg; [
glib libX11 pango cairo gtk2 gdk_pixbuf gtkglext
mesa_glu libXmu libXt libICE libSM ]} | sed -e 's#:# #g') -name \*.so.\* > $TMPDIR/so.lst
mesa libXmu libXt libICE libSM ])} | sed -e 's#:# #g') -name \*.so.\* > $TMPDIR/so.lst
(echo $(cat $TMPDIR/so.lst | wc -l) "libs found in cache \`/etc/ld.so.cache'";
for l in $(<$TMPDIR/so.lst);
@@ -70,18 +71,29 @@ stdenv.mkDerivation rec {
cp ./factor $out/bin
wrapProgram $out/bin/factor --prefix LD_LIBRARY_PATH : \
"${stdenv.lib.makeLibraryPath [ glib
"${stdenv.lib.makeLibraryPath (with xorg; [ glib
libX11 pango cairo gtk2 gdk_pixbuf gtkglext
mesa_glu libXmu libXt libICE libSM ]}"
mesa libXmu libXt libICE libSM openssl])}"
sed -ie 's#/bin/.factor-wrapped#/lib/factor/factor#g' $out/bin/factor
mv $out/bin/.factor-wrapped $out/lib/factor/factor
# make a new bootstrap image
# build full factor image from boot image
(cd $out/bin && ./factor -script -e='"unix-x86.64" USING: system bootstrap.image memory ; make-image save 0 exit' )
mv $out/lib/factor/boot.unix-x86.64.image $out/lib/factor/factor.image
# now make the full system image, it overwrites $out/lib/factor/factor.image
$out/bin/factor -i=$out/lib/factor/factor.image
# make a new bootstrap image
(cd $out/bin && ./factor -script -e='"unix-x86.64" USING: system tools.deploy.backend ; make-boot-image 0 exit' )
# rebuild final full factor image to include all patched sources
(cd $out/lib/factor && ./factor -i=boot.unix-x86.64.image)
# install fuel mode for emacs
mkdir -p $out/share/emacs/site-lisp
# update default paths in factor-listener.el for fuel mode
substituteInPlace misc/fuel/fuel-listener.el \
--subst-var-by fuel_factor_root_dir $out/lib/factor \
--subst-var-by fuel_listener_factor_binary $out/bin/factor
cp misc/fuel/*.el $out/share/emacs/site-lisp/
'';
meta = with stdenv.lib; {
@@ -89,7 +101,7 @@ stdenv.mkDerivation rec {
license = licenses.bsd2;
description = "A concatenative, stack-based programming language";
maintainers = [ maintainers.vrthra ];
maintainers = [ maintainers.vrthra maintainers.spacefrogg ];
platforms = [ "x86_64-linux" ];
};
}
@@ -0,0 +1,20 @@
diff --git a/misc/fuel/fuel-listener.el b/misc/fuel/fuel-listener.el
index 2d1b182a75..bf2e573425 100644
--- a/misc/fuel/fuel-listener.el
+++ b/misc/fuel/fuel-listener.el
@@ -30,13 +30,13 @@
"Interacting with a Factor listener inside Emacs."
:group 'fuel)
-(defcustom fuel-factor-root-dir nil
+(defcustom fuel-factor-root-dir "@fuel_factor_root_dir@"
"Full path to the factor root directory when starting a listener."
:type 'directory
:group 'fuel-listener)
;;; Is factor.com still valid on Windows...?
-(defcustom fuel-listener-factor-binary nil
+(defcustom fuel-listener-factor-binary "@fuel_listener_factor_binary@"
"Full path to the factor executable to use when starting a listener."
:type '(file :must-match t)
:group 'fuel-listener)
@@ -0,0 +1,13 @@
diff --git a/basis/tools/deploy/backend/backend.factor b/basis/tools/deploy/backend/backend.factor
index ec86089dbe..b146168ec9 100644
--- a/basis/tools/deploy/backend/backend.factor
+++ b/basis/tools/deploy/backend/backend.factor
@@ -69,7 +69,7 @@ ERROR: can't-deploy-library-file library ;
[ staging-image-name "-output-image=" prepend , ]
[ " " join "-include=" prepend , ] bi
] [
- input-image-name "-i=" prepend ,
+ input-image-name resource-path "-i=" prepend ,
"-resource-path=" "" resource-path append ,
"-run=tools.deploy.restage" ,
] bi
@@ -0,0 +1,24 @@
diff --git a/core/io/pathnames/pathnames.factor b/core/io/pathnames/pathnames.factor
index 2d382e49d1..d4d9228d6c 100644
--- a/core/io/pathnames/pathnames.factor
+++ b/core/io/pathnames/pathnames.factor
@@ -144,7 +144,10 @@ GENERIC: vocab-path ( path -- newpath )
GENERIC: absolute-path ( path -- path' )
M: string absolute-path
- "resource:" ?head [
+ "resource:work" ?head [
+ trim-head-separators "/var/lib/factor" prepend-path
+ absolute-path ]
+ [ "resource:" ?head [
trim-head-separators resource-path
absolute-path
] [
@@ -158,6 +161,7 @@ M: string absolute-path
] [
current-directory get prepend-path
] if ] if
+ ] if
] if ;
M: object normalize-path ( path -- path' )
+24
View File
@@ -0,0 +1,24 @@
{ stdenvNoCC, lib, fetchurl }:
stdenvNoCC.mkDerivation rec {
name = "fasm-bin-${version}";
version = "1.73.04";
src = fetchurl {
url = "https://flatassembler.net/fasm-${version}.tgz";
sha256 = "0y0xkf9fzcm5gklhdi61wjpd1p8islpbcnkv5k16aqci3qsd0ia1";
};
installPhase = ''
install -D fasm${lib.optionalString stdenvNoCC.isx86_64 ".x64"} $out/bin/fasm
'';
meta = with lib; {
description = "x86(-64) macro assembler to binary, MZ, PE, COFF, and ELF";
homepage = https://flatassembler.net/download.php;
license = licenses.bsd2;
maintainers = with maintainers; [ orivej ];
platforms = [ "i686-linux" "x86_64-linux" ];
};
}
@@ -0,0 +1,28 @@
{ stdenv, lib, fasm-bin, isx86_64 }:
stdenv.mkDerivation rec {
inherit (fasm-bin) version src meta;
name = "fasm-${version}";
nativeBuildInputs = [ fasm-bin ];
buildPhase = ''
fasm source/Linux${lib.optionalString isx86_64 "/x64"}/fasm.asm fasm
for tool in listing prepsrc symbols; do
fasm tools/libc/$tool.asm
cc -o tools/libc/fasm-$tool tools/libc/$tool.o
done
'';
outputs = [ "out" "doc" ];
installPhase = ''
install -Dt $out/bin fasm tools/libc/fasm-*
docs=$doc/share/doc/fasm
mkdir -p $docs
cp -r examples/ *.txt tools/fas.txt $docs
cp tools/readme.txt $docs/tools.txt
'';
}
+3 -3
View File
@@ -4,17 +4,17 @@ stdenv.mkDerivation {
name = "fpc-2.6.0-binary";
src =
if stdenv.system == "i686-linux" then
if stdenv.hostPlatform.system == "i686-linux" then
fetchurl {
url = "mirror://sourceforge/project/freepascal/Linux/2.6.0/fpc-2.6.0.i386-linux.tar";
sha256 = "08yklvrfxvk59bxsd4rh1i6s3cjn0q06dzjs94h9fbq3n1qd5zdf";
}
else if stdenv.system == "x86_64-linux" then
else if stdenv.hostPlatform.system == "x86_64-linux" then
fetchurl {
url = "mirror://sourceforge/project/freepascal/Linux/2.6.0/fpc-2.6.0.x86_64-linux.tar";
sha256 = "0k9vi75k39y735fng4jc2vppdywp82j4qhzn7x4r6qjkad64d8lx";
}
else throw "Not supported on ${stdenv.system}.";
else throw "Not supported on ${stdenv.hostPlatform.system}.";
builder = ./binary-builder.sh;
+7 -5
View File
@@ -14,7 +14,7 @@ stdenv.mkDerivation rec {
buildInputs = [ startFPC gawk ];
preConfigure =
if stdenv.system == "i686-linux" || stdenv.system == "x86_64-linux" then ''
if stdenv.hostPlatform.system == "i686-linux" || stdenv.hostPlatform.system == "x86_64-linux" then ''
sed -e "s@'/lib/ld-linux[^']*'@'''@" -i fpcsrc/compiler/systems/t_linux.pas
sed -e "s@'/lib64/ld-linux[^']*'@'''@" -i fpcsrc/compiler/systems/t_linux.pas
'' else "";
@@ -22,7 +22,7 @@ stdenv.mkDerivation rec {
makeFlags = "NOGDB=1 FPC=${startFPC}/bin/fpc";
installFlags = "INSTALL_PREFIX=\${out}";
postInstall = ''
for i in $out/lib/fpc/*/ppc*; do
ln -fs $i $out/bin/$(basename $i)
@@ -35,10 +35,12 @@ stdenv.mkDerivation rec {
bootstrap = startFPC;
};
meta = {
meta = with stdenv.lib; {
description = "Free Pascal Compiler from a source distribution";
maintainers = [stdenv.lib.maintainers.raskin];
platforms = stdenv.lib.platforms.linux;
homepage = https://www.freepascal.org;
maintainers = [ maintainers.raskin ];
license = with licenses; [ gpl2 lgpl2 ];
platforms = platforms.linux;
inherit version;
};
}
+2 -2
View File
@@ -8,10 +8,10 @@ stdenv, fetchurl
let
s =
rec {
version = "1.8.0";
version = "1.8.4";
versionSuffix = "";
url = "mirror://sourceforge/lazarus/Lazarus%20Zip%20_%20GZip/Lazarus%20${version}/lazarus-${version}${versionSuffix}.tar.gz";
sha256 = "0i58ngrr1vjyazirfmz0cgikglc02z1m0gcrsfw9awpi3ax8h21j";
sha256 = "1s8hdip973fc1lynklddl0mvg2jd2lzkfk8hzb8jlchs6jn0362s";
name = "lazarus-${version}";
};
buildInputs = [
@@ -40,7 +40,7 @@ stdenv.mkDerivation rec {
meta = {
description = "A functional CLI language";
homepage = http://fsharp.org/;
homepage = https://fsharp.org/;
license = stdenv.lib.licenses.asl20;
maintainers = with stdenv.lib.maintainers; [ thoughtpolice raskin ];
platforms = with stdenv.lib.platforms; unix;
@@ -79,7 +79,7 @@ stdenv.mkDerivation rec {
meta = {
description = "A functional CLI language";
homepage = http://fsharp.org/;
homepage = https://fsharp.org/;
license = stdenv.lib.licenses.asl20;
maintainers = with stdenv.lib.maintainers; [ thoughtpolice raskin ];
platforms = with stdenv.lib.platforms; unix;
+6 -3
View File
@@ -2,13 +2,13 @@
stdenv.mkDerivation rec {
name = "fstar-${version}";
version = "0.9.5.0";
version = "0.9.6.0";
src = fetchFromGitHub {
owner = "FStarLang";
repo = "FStar";
rev = "v${version}";
sha256 = "1pi2ny3kpmvm85x8w98anhjf0hp0wccc51m7v697qypn5cl4ydqk";
sha256 = "0wix7l229afkn6c6sk4nwkfq0nznsiqdkds4ixi2yyf72immwmmb";
};
nativeBuildInputs = [ makeWrapper ];
@@ -16,6 +16,7 @@ stdenv.mkDerivation rec {
buildInputs = with ocamlPackages; [
z3 ocaml findlib batteries menhir stdint
zarith camlp4 yojson pprint
ulex ocaml-migrate-parsetree process ppx_deriving ppx_deriving_yojson ocamlbuild
];
makeFlags = [ "PREFIX=$(out)" ];
@@ -26,8 +27,10 @@ stdenv.mkDerivation rec {
'';
buildFlags = "-C src/ocaml-output";
preInstall = ''
mkdir -p $out/lib/ocaml/${ocamlPackages.ocaml.version}/site-lib/fstarlib
'';
installFlags = "-C src/ocaml-output";
postInstall = ''
wrapProgram $out/bin/fstar.exe --prefix PATH ":" "${z3}/bin"
'';
@@ -0,0 +1,55 @@
# Generated using `cabal2nix --hpack .`, then replace src
{ mkDerivation, alex, array, base, bifunctors, binary, blaze-html
, bytestring, containers, data-binary-ieee754, directory
, directory-tree, dlist, extra, file-embed, filepath, gitrev, happy
, haskeline, hpack, HUnit, json, language-c-quote, mainland-pretty
, markdown, mtl, neat-interpolation, parallel, parsec, process
, process-extras, QuickCheck, random, raw-strings-qq, regex-tdfa
, srcloc, stdenv, template-haskell, temporary, test-framework
, test-framework-hunit, test-framework-quickcheck2, text
, th-lift-instances, transformers, vector, vector-binary-instances
, zlib, fetchFromGitHub
}:
mkDerivation {
pname = "futhark";
version = "0.6.2";
src = fetchFromGitHub {
owner = "diku-dk";
repo = "futhark";
rev = "v0.6.2";
sha256 = "0yj7n01swpvqblybdnks3mjf0mzf1gdg2b2cpxdpxnrjw5j0pnq2";
};
isLibrary = true;
isExecutable = true;
libraryHaskellDepends = [
array base bifunctors binary blaze-html bytestring containers
data-binary-ieee754 directory directory-tree dlist extra file-embed
filepath gitrev language-c-quote mainland-pretty markdown mtl
neat-interpolation parallel parsec process raw-strings-qq
regex-tdfa srcloc template-haskell text th-lift-instances
transformers vector vector-binary-instances zlib
];
libraryToolDepends = [ alex happy hpack ];
executableHaskellDepends = [
array base bifunctors binary blaze-html bytestring containers
data-binary-ieee754 directory directory-tree dlist extra file-embed
filepath gitrev haskeline json language-c-quote mainland-pretty
markdown mtl neat-interpolation parallel parsec process
process-extras random raw-strings-qq regex-tdfa srcloc
template-haskell temporary text th-lift-instances transformers
vector vector-binary-instances zlib
];
testHaskellDepends = [
array base bifunctors binary blaze-html bytestring containers
data-binary-ieee754 directory directory-tree dlist extra file-embed
filepath gitrev HUnit language-c-quote mainland-pretty markdown mtl
neat-interpolation parallel parsec process QuickCheck
raw-strings-qq regex-tdfa srcloc template-haskell test-framework
test-framework-hunit test-framework-quickcheck2 text
th-lift-instances transformers vector vector-binary-instances zlib
];
preConfigure = "hpack";
homepage = "https://futhark-lang.org";
description = "An optimising compiler for a functional, array-oriented language";
license = stdenv.lib.licenses.isc;
}
@@ -2,12 +2,12 @@
stdenv.mkDerivation rec {
name = "gambit-bootstrap-${version}";
version = "4.8.8";
tarball_version = "v4_8_8";
version = "4.8.9";
tarball_version = "v4_8_9";
src = fetchurl {
url = "http://www.iro.umontreal.ca/~gambit/download/gambit/v4.8/source/gambit-${tarball_version}-devel.tgz";
sha256 = "075k2z04d6svxqf9paj3xvp0mm0xzy0vbma1y61s0lkywdim8xjz";
sha256 = "b7f86c794711792ca556ce41f8bc7043dffc395c01bb6d8d119bc2f454f89fbf";
};
buildInputs = [ autoconf ];
@@ -35,7 +35,7 @@ stdenv.mkDerivation rec {
description = "Optimizing Scheme to C compiler, bootstrap step";
homepage = "http://gambitscheme.org";
license = stdenv.lib.licenses.lgpl2;
platforms = stdenv.lib.platforms.linux;
platforms = stdenv.lib.platforms.unix;
maintainers = with stdenv.lib.maintainers; [ thoughtpolice raskin fare ];
};
}
@@ -0,0 +1,70 @@
{ stdenv, git, openssl, autoconf, pkgs, makeStaticLibraries, version, SRC }:
stdenv.mkDerivation rec {
name = "gambit-${version}";
src = SRC;
bootstrap = import ./bootstrap.nix ( pkgs );
# Use makeStaticLibraries to enable creation of statically linked binaries
buildInputs = [ git autoconf bootstrap openssl (makeStaticLibraries openssl)];
configurePhase = ''
options=(
--prefix=$out
--enable-single-host
--enable-c-opt=-O2
--enable-gcc-opts
--enable-shared
--enable-absolute-shared-libs # Yes, NixOS will want an absolute path, and fix it.
--enable-poll
--enable-openssl
--enable-default-runtime-options="f8,-8,t8" # Default to UTF-8 for source and all I/O
#--enable-debug # Nope: enables plenty of good stuff, but also the costly console.log
#--enable-multiple-versions # Nope, NixOS already does version multiplexing
#--enable-guide
#--enable-track-scheme
#--enable-high-res-timing
#--enable-max-processors=4
#--enable-multiple-vms
#--enable-dynamic-tls
#--enable-multiple-vms
#--enable-multiple-threaded-vms ## when SMP branch is merged in
#--enable-thread-system=posix ## default when --enable-multiple-vms is on.
#--enable-profile
#--enable-coverage
#--enable-inline-jumps
#--enable-char-size=1" ; default is 4
)
./configure ''${options[@]}
'';
buildPhase = ''
# Make bootstrap compiler, from release bootstrap
mkdir -p boot &&
cp -rp ${bootstrap}/. boot/. &&
chmod -R u+w boot &&
cd boot &&
cp ../gsc/makefile.in ../gsc/*.scm gsc && # */
./configure &&
for i in lib gsi gsc ; do (cd $i ; make ) ; done &&
cd .. &&
cp boot/gsc/gsc gsc-boot &&
# Now use the bootstrap compiler to build the real thing!
make -j2 from-scratch
'';
doCheck = true;
meta = {
description = "Optimizing Scheme to C compiler";
homepage = "http://gambitscheme.org";
license = stdenv.lib.licenses.lgpl2;
# NB regarding platforms: only actually tested on Linux, *should* work everywhere,
# but *might* need adaptation e.g. on macOS.
platforms = stdenv.lib.platforms.unix;
maintainers = with stdenv.lib.maintainers; [ thoughtpolice raskin fare ];
};
}
+7 -71
View File
@@ -1,75 +1,11 @@
{ stdenv, fetchurl, fetchgit, git, openssl, autoconf, pkgs, makeStaticLibraries }:
{ stdenv, callPackage, fetchurl }:
# TODO: distinct packages for gambit-release and gambit-devel
callPackage ./build.nix {
version = "4.9.0";
stdenv.mkDerivation rec {
name = "gambit-${version}";
version = "4.8.8-435-gd1991ba7";
bootstrap = import ./bootstrap.nix ( pkgs );
src = fetchgit {
url = "https://github.com/feeley/gambit.git";
rev = "d1991ba7e90ed0149964320f7cafa1a8289e61f0";
sha256 = "02harwcsqxxcxgn2yc1y9kyxdp32mampyvnbxrzg2jzfmnp5g6cm";
};
# Use makeStaticLibraries to enable creation of statically linked binaries
buildInputs = [ git autoconf bootstrap openssl (makeStaticLibraries openssl)];
configurePhase = ''
options=(
--prefix=$out
--enable-single-host
--enable-c-opt=-O2
--enable-gcc-opts
--enable-shared
--enable-absolute-shared-libs # Yes, NixOS will want an absolute path, and fix it.
--enable-poll
--enable-openssl
--enable-default-runtime-options="f8,-8,t8" # Default to UTF-8 for source and all I/O
#--enable-debug # Nope: enables plenty of good stuff, but also the costly console.log
#--enable-multiple-versions # Nope, NixOS already does version multiplexing
#--enable-guide
#--enable-track-scheme
#--enable-high-res-timing
#--enable-max-processors=4
#--enable-multiple-vms
#--enable-dynamic-tls
#--enable-multiple-vms
#--enable-multiple-threaded-vms ## when SMP branch is merged in
#--enable-thread-system=posix ## default when --enable-multiple-vms is on.
#--enable-profile
#--enable-coverage
#--enable-inline-jumps
#--enable-char-size=1" ; default is 4
)
./configure ''${options[@]}
'';
buildPhase = ''
# Make bootstrap compiler, from release bootstrap
mkdir -p boot &&
cp -rp ${bootstrap}/. boot/. &&
chmod -R u+w boot &&
cd boot &&
cp ../gsc/makefile.in ../gsc/*.scm gsc && # */
./configure &&
for i in lib gsi gsc ; do (cd $i ; make ) ; done &&
cd .. &&
cp boot/gsc/gsc gsc-boot &&
# Now use the bootstrap compiler to build the real thing!
make -j2 from-scratch
'';
doCheck = true;
meta = {
description = "Optimizing Scheme to C compiler";
homepage = "http://gambitscheme.org";
license = stdenv.lib.licenses.lgpl2;
platforms = stdenv.lib.platforms.linux;
maintainers = with stdenv.lib.maintainers; [ thoughtpolice raskin fare ];
SRC = fetchurl {
url = "http://www.iro.umontreal.ca/~gambit/download/gambit/v4.9/source/gambit-v4_9_0-devel.tgz";
sha256 = "0wyfpjs244zrbrdil9rfkdgcawvms84z0r77qwhwadghma4dqgjf";
};
inherit stdenv;
}
@@ -0,0 +1,12 @@
{ stdenv, callPackage, fetchgit }:
callPackage ./build.nix {
version = "unstable-2018-09-03";
# git-version = "4.9.0";
SRC = fetchgit {
url = "https://github.com/feeley/gambit.git";
rev = "7cdc7e7b9194b2c088c0667efaf7686a4ffd0d8a";
sha256 = "06mmi8jkinihfirz4gjfw2lhxhskiqf3d47sihzx10r60asyqcxg";
};
inherit stdenv;
}
@@ -1,45 +0,0 @@
{ stdenv, fetchurl, ncurses5, python27 }:
stdenv.mkDerivation rec {
name = "gcc-arm-embedded-${version}";
version = "6-2017-q2-update";
subdir = "6-2017q2";
platformString =
if stdenv.isLinux then "linux"
else if stdenv.isDarwin then "mac"
else throw "unsupported platform";
urlString = "https://developer.arm.com/-/media/Files/downloads/gnu-rm/${subdir}/gcc-arm-none-eabi-${version}-${platformString}.tar.bz2";
src =
if stdenv.isLinux then fetchurl { url=urlString; sha256="1hvwi02mx34al525sngnl0cm7dkmzxfkb1brq9kvbv28wcplp3p6"; }
else if stdenv.isDarwin then fetchurl { url=urlString; sha256="0019ylpq4inq7p5gydpmc9m8ni72fz2csrjlqmgx1698998q0c3x"; }
else throw "unsupported platform";
phases = [ "unpackPhase" "installPhase" "fixupPhase" ];
installPhase = ''
mkdir -p $out
cp -r * $out
'';
dontPatchELF = true;
dontStrip = true;
preFixup = ''
find $out -type f | while read f; do
patchelf $f > /dev/null 2>&1 || continue
patchelf --set-interpreter $(cat ${stdenv.cc}/nix-support/dynamic-linker) "$f" || true
patchelf --set-rpath ${stdenv.lib.makeLibraryPath [ "$out" stdenv.cc.cc ncurses5 python27 ]} "$f" || true
done
'';
meta = {
description = "Pre-built GNU toolchain from ARM Cortex-M & Cortex-R processors (Cortex-M0/M0+/M3/M4/M7, Cortex-R4/R5/R7/R8)";
homepage = https://developer.arm.com/open-source/gnu-toolchain/gnu-rm;
license = with stdenv.lib.licenses; [ bsd2 gpl2 gpl3 lgpl21 lgpl3 mit ];
maintainers = with stdenv.lib.maintainers; [ vinymeuh ];
platforms = with stdenv.lib.platforms; linux ++ darwin;
};
}
@@ -1,50 +0,0 @@
{ stdenv, bzip2, patchelf, glibc, gcc, fetchurl, version, releaseType, sha256, ncurses
, dirName ? null, subdirName ? null }:
with stdenv.lib;
let
versionParts = splitString "-" version; # 4.7 2013q3 20130916
majorVersion = elemAt versionParts 0; # 4.7
yearQuarter = elemAt versionParts 1; # 2013q3
underscoreVersion = replaceChars ["."] ["_"] version; # 4_7-2013q3-20130916
yearQuarterParts = splitString "q" yearQuarter; # 2013 3
year = elemAt yearQuarterParts 0; # 2013
quarter = elemAt yearQuarterParts 1; # 3
dirName_ = if dirName != null then dirName else majorVersion;
subdirName_ = if subdirName != null then subdirName
else "${majorVersion}-${year}-q${quarter}-${releaseType}"; # 4.7-2013-q3-update
in
stdenv.mkDerivation {
name = "gcc-arm-embedded-${version}";
src = fetchurl {
url = "https://launchpad.net/gcc-arm-embedded/${dirName_}/${subdirName_}/+download/gcc-arm-none-eabi-${underscoreVersion}-linux.tar.bz2";
sha256 = sha256;
};
buildInputs = [ bzip2 patchelf ];
dontPatchELF = true;
phases = "unpackPhase patchPhase installPhase";
installPhase = ''
mkdir -pv $out
cp -r ./* $out
for f in $(find $out); do
if [ -f "$f" ] && patchelf "$f" 2> /dev/null; then
patchelf --set-interpreter ${getLib glibc}/lib/ld-linux.so.2 \
--set-rpath ${stdenv.lib.makeLibraryPath [ "$out" gcc ncurses ]} \
"$f" || true
fi
done
'';
meta = with stdenv.lib; {
description = "Pre-built GNU toolchain from ARM Cortex-M & Cortex-R processors (Cortex-M0/M0+/M3/M4, Cortex-R4/R5/R7)";
homepage = https://launchpad.net/gcc-arm-embedded;
license = with licenses; [ bsd2 gpl2 gpl3 lgpl21 lgpl3 mit ];
maintainers = [ maintainers.rasendubi ];
platforms = platforms.linux;
};
}
@@ -1,472 +0,0 @@
{ stdenv, targetPackages, fetchurl, noSysDirs
, langC ? true, langCC ? true, langFortran ? false
, langJava ? false
, langAda ? false
, langVhdl ? false
, profiledCompiler ? false
, staticCompiler ? false
, enableShared ? true
, texinfo ? null
, perl ? null # optional, for texi2pod (then pod2man); required for Java
, gmp, mpfr, libmpc, gettext, which
, libelf # optional, for link-time optimizations (LTO)
, ppl ? null, cloogppl ? null # optional, for the Graphite optimization framework
, zlib ? null, boehmgc ? null
, zip ? null, unzip ? null, pkgconfig ? null, gtk2 ? null, libart_lgpl ? null
, libX11 ? null, libXt ? null, libSM ? null, libICE ? null, libXtst ? null
, libXrender ? null, xproto ? null, renderproto ? null, xextproto ? null
, libXrandr ? null, libXi ? null, inputproto ? null, randrproto ? null
, gnatboot ? null
, enableMultilib ? false
, name ? "gcc"
, libcCross ? null
, crossStageStatic ? false
, gnat ? null
, libpthread ? null, libpthreadCross ? null # required for GNU/Hurd
, stripped ? true
, buildPlatform, hostPlatform, targetPlatform
, buildPackages
}:
assert langJava -> zip != null && unzip != null
&& zlib != null && boehmgc != null
&& perl != null; # for `--enable-java-home'
assert langAda -> gnatboot != null;
assert langVhdl -> gnat != null;
# LTO needs libelf and zlib.
assert libelf != null -> zlib != null;
with stdenv.lib;
with builtins;
let version = "4.5.4";
javaEcj = fetchurl {
# The `$(top_srcdir)/ecj.jar' file is automatically picked up at
# `configure' time.
# XXX: Eventually we might want to take it from upstream.
url = "ftp://sourceware.org/pub/java/ecj-4.3.jar";
sha256 = "0jz7hvc0s6iydmhgh5h2m15yza7p2rlss2vkif30vm9y77m97qcx";
};
# Antlr (optional) allows the Java `gjdoc' tool to be built. We want a
# binary distribution here to allow the whole chain to be bootstrapped.
javaAntlr = fetchurl {
url = http://www.antlr.org/download/antlr-3.1.3.jar;
sha256 = "1f41j0y4kjydl71lqlvr73yagrs2jsg1fjymzjz66mjy7al5lh09";
};
xlibs = [
libX11 libXt libSM libICE libXtst libXrender libXrandr libXi
xproto renderproto xextproto inputproto randrproto
];
javaAwtGtk = langJava && gtk2 != null;
/* Platform flags */
platformFlags = let
gccArch = targetPlatform.platform.gcc.arch or null;
gccCpu = targetPlatform.platform.gcc.cpu or null;
gccAbi = targetPlatform.platform.gcc.abi or null;
gccFpu = targetPlatform.platform.gcc.fpu or null;
gccFloat = targetPlatform.platform.gcc.float or null;
gccMode = targetPlatform.platform.gcc.mode or null;
in
optional (gccArch != null) "--with-arch=${gccArch}" ++
optional (gccCpu != null) "--with-cpu=${gccCpu}" ++
optional (gccAbi != null) "--with-abi=${gccAbi}" ++
optional (gccFpu != null) "--with-fpu=${gccFpu}" ++
optional (gccFloat != null) "--with-float=${gccFloat}" ++
optional (gccMode != null) "--with-mode=${gccMode}";
/* Cross-gcc settings */
crossMingw = (targetPlatform != hostPlatform && targetPlatform.libc == "msvcrt");
crossConfigureFlags =
# Ensure that -print-prog-name is able to find the correct programs.
[ "--with-as=${targetPackages.stdenv.cc.bintools}/bin/${targetPlatform.config}-as"
"--with-ld=${targetPackages.stdenv.cc.bintools}/bin/${targetPlatform.config}-ld" ] ++
(if crossMingw && crossStageStatic then [
"--with-headers=${libcCross}/include"
"--with-gcc"
"--with-gnu-as"
"--with-gnu-ld"
"--with-gnu-ld"
"--disable-shared"
"--disable-nls"
"--disable-debug"
"--enable-sjlj-exceptions"
"--enable-threads=win32"
"--disable-win32-registry"
] else if crossStageStatic then [
"--disable-libssp"
"--disable-nls"
"--without-headers"
"--disable-threads"
"--disable-libmudflap"
"--disable-libgomp"
"--disable-shared"
"--disable-decimal-float" # libdecnumber requires libc
] else [
"--with-headers=${libcCross}/include"
"--enable-__cxa_atexit"
"--enable-long-long"
] ++
(if crossMingw then [
"--enable-threads=win32"
"--enable-sjlj-exceptions"
"--enable-hash-synchronization"
"--enable-version-specific-runtime-libs"
"--enable-libssp"
"--disable-nls"
"--with-dwarf2"
] else [
"--enable-threads=posix"
"--enable-nls"
"--disable-decimal-float" # No final libdecnumber (it may work only in 386)
]));
stageNameAddon = if crossStageStatic then "-stage-static" else
"-stage-final";
crossNameAddon = if targetPlatform != hostPlatform then "-${targetPlatform.config}" + stageNameAddon else "";
in
# We need all these X libraries when building AWT with GTK+.
assert gtk2 != null -> (filter (x: x == null) xlibs) == [];
stdenv.mkDerivation ({
name = "${name}-${version}" + crossNameAddon;
builder = ../builder.sh;
src = (import ./sources.nix) {
inherit fetchurl optional version;
inherit langC langCC langFortran langJava langAda;
};
hardeningDisable = [ "format" ] ++ optional (name != "gnat") "all";
outputs = [ "out" "man" "info" ]
++ optional (!(hostPlatform.is64bit && langAda)) "lib";
setOutputFlags = false;
NIX_NO_SELF_RPATH = true;
libc_dev = stdenv.cc.libc_dev;
patches =
[ ]
++ optional (targetPlatform != hostPlatform) ../libstdc++-target.patch
++ optional noSysDirs ./no-sys-dirs.patch
# The GNAT Makefiles did not pay attention to CFLAGS_FOR_TARGET for its
# target libraries and tools.
++ optional langAda ../gnat-cflags.patch
++ optional langVhdl ./ghdl-ortho-cflags.patch
++ [ ../struct-ucontext-4.5.patch ] # glibc-2.26
;
postPatch =
if (stdenv.system == "i586-pc-gnu"
|| (libcCross != null # e.g., building `gcc.crossDrv'
&& libcCross ? crossConfig
&& libcCross.crossConfig == "i586-pc-gnu")
|| (targetPlatform != hostPlatform && targetPlatform.config == "i586-pc-gnu"
&& libcCross != null))
then
# On GNU/Hurd glibc refers to Hurd & Mach headers and libpthread is not
# in glibc, so add the right `-I' flags to the default spec string.
assert libcCross != null -> libpthreadCross != null;
let
libc = if libcCross != null then libcCross else stdenv.glibc;
gnu_h = "gcc/config/gnu.h";
i386_gnu_h = "gcc/config/i386/gnu.h";
extraCPPDeps =
libc.propagatedBuildInputs
++ stdenv.lib.optional (libpthreadCross != null) libpthreadCross
++ stdenv.lib.optional (libpthread != null) libpthread;
extraCPPSpec =
concatStrings (intersperse " "
(map (x: "-I${x.dev or x}/include") extraCPPDeps));
extraLibSpec =
if libpthreadCross != null
then "-L${libpthreadCross}/lib ${libpthreadCross.TARGET_LDFLAGS}"
else "-L${libpthread}/lib";
in
'' echo "augmenting \`CPP_SPEC' in \`${i386_gnu_h}' with \`${extraCPPSpec}'..."
sed -i "${i386_gnu_h}" \
-es'|CPP_SPEC *"\(.*\)$|CPP_SPEC "${extraCPPSpec} \1|g'
echo "augmenting \`LIB_SPEC' in \`${gnu_h}' with \`${extraLibSpec}'..."
sed -i "${gnu_h}" \
-es'|LIB_SPEC *"\(.*\)$|LIB_SPEC "${extraLibSpec} \1|g'
echo "setting \`NATIVE_SYSTEM_HEADER_DIR' and \`STANDARD_INCLUDE_DIR' to \`${libc.dev}/include'..."
sed -i "${gnu_h}" \
-es'|#define STANDARD_INCLUDE_DIR.*$|#define STANDARD_INCLUDE_DIR "${libc.dev}/include"|g'
sed -i gcc/config/t-gnu \
-es'|NATIVE_SYSTEM_HEADER_DIR.*$|NATIVE_SYSTEM_HEADER_DIR = ${libc.dev}/include|g'
''
else if targetPlatform != hostPlatform || stdenv.cc.libc != null then
# On NixOS, use the right path to the dynamic linker instead of
# `/lib/ld*.so'.
let
libc = if libcCross != null then libcCross else stdenv.cc.libc;
in
'' echo "fixing the \`GLIBC_DYNAMIC_LINKER' and \`UCLIBC_DYNAMIC_LINKER' macros..."
for header in "gcc/config/"*-gnu.h "gcc/config/"*"/"*.h
do
grep -q LIBC_DYNAMIC_LINKER "$header" || continue
echo " fixing \`$header'..."
sed -i "$header" \
-e 's|define[[:blank:]]*\([UCG]\+\)LIBC_DYNAMIC_LINKER\([0-9]*\)[[:blank:]]"\([^\"]\+\)"$|define \1LIBC_DYNAMIC_LINKER\2 "${libc.out}\3"|g'
done
''
else null;
# TODO(@Ericson2314): Make passthru instead. Weird to avoid mass rebuild,
crossStageStatic = targetPlatform == hostPlatform || crossStageStatic;
inherit noSysDirs profiledCompiler staticCompiler langJava
libcCross crossMingw;
depsBuildBuild = [ buildPackages.stdenv.cc ];
nativeBuildInputs = [ texinfo which gettext ]
++ optional (perl != null) perl;
# For building runtime libs
depsBuildTarget =
if hostPlatform == buildPlatform then [
targetPackages.stdenv.cc.bintools # newly-built gcc will be used
] else assert targetPlatform == hostPlatform; [ # build != host == target
stdenv.cc
];
buildInputs = [
gmp mpfr libmpc libelf
targetPackages.stdenv.cc.bintools # For linking code at run-time
] ++ (optional (ppl != null) ppl)
++ (optional (cloogppl != null) cloogppl)
++ (optional (zlib != null) zlib)
++ (optional langJava boehmgc)
++ (optionals langJava [zip unzip])
++ (optionals javaAwtGtk ([gtk2 pkgconfig libart_lgpl] ++ xlibs))
++ (optionals (targetPlatform != hostPlatform) [targetPackages.stdenv.cc.bintools])
++ (optionals langAda [gnatboot])
++ (optionals langVhdl [gnat])
;
# TODO(@Ericson2314): Always pass "--target" and always prefix.
configurePlatforms =
# TODO(@Ericson2314): Figure out what's going wrong with Arm
if buildPlatform == hostPlatform && hostPlatform == targetPlatform && targetPlatform.isArm
then []
else [ "build" "host" ] ++ stdenv.lib.optional (targetPlatform != hostPlatform) "target";
configureFlags =
# Basic dependencies
[
"--with-gmp=${gmp.dev}"
"--with-mpfr=${mpfr.dev}"
"--with-mpc=${libmpc}"
] ++
optional (libelf != null) "--with-libelf=${libelf}" ++
optional (!(crossMingw && crossStageStatic))
"--with-native-system-header-dir=${getDev stdenv.cc.libc}/include" ++
# Basic configuration
[
"--disable-libstdcxx-pch"
"--without-included-gettext"
"--with-system-zlib"
"--enable-languages=${
concatStrings (intersperse ","
( optional langC "c"
++ optional langCC "c++"
++ optional langFortran "fortran"
++ optional langJava "java"
++ optional langAda "ada"
++ optional langVhdl "vhdl"
)
)
}"
] ++
optional (!enableMultilib) "--disable-multilib" ++
optional (!enableShared) "--disable-shared" ++
# Optional features
optional (cloogppl != null) "--with-cloog=${cloogppl}" ++
optional (ppl != null) "--with-ppl=${ppl}" ++
# Java options
optionals langJava [
"--with-ecj-jar=${javaEcj}"
# Follow Sun's layout for the convenience of IcedTea/OpenJDK. See
# <http://mail.openjdk.java.net/pipermail/distro-pkg-dev/2010-April/008888.html>.
"--enable-java-home"
"--with-java-home=\${prefix}/lib/jvm/jre"
] ++
optional javaAwtGtk "--enable-java-awt=gtk" ++
optional (langJava && javaAntlr != null) "--with-antlr-jar=${javaAntlr}" ++
# Ada
optional langAda "--enable-libada" ++
platformFlags ++
optional (targetPlatform != hostPlatform) crossConfigureFlags ++
# Platform-specific flags
optional (targetPlatform == hostPlatform && targetPlatform.isi686) "--with-arch=i686" ++
# Trick that should be taken out once we have a mips64el-linux not loongson2f
optional (targetPlatform == hostPlatform && stdenv.system == "mips64el-linux") "--with-arch=loongson2f"
;
targetConfig = if targetPlatform != hostPlatform then targetPlatform.config else null;
/* For cross-built gcc (build != host == target) */
crossAttrs = {
dontStrip = true;
};
# Setting $CPATH and $LIBRARY_PATH to make sure both `gcc' and `xgcc' find the
# library headers and binaries, regarless of the language being compiled.
#
# Note: When building the Java AWT GTK+ peer, the build system doesn't honor
# `--with-gmp' et al., e.g., when building
# `libjava/classpath/native/jni/java-math/gnu_java_math_GMP.c', so we just add
# them to $CPATH and $LIBRARY_PATH in this case.
#
# Likewise, the LTO code doesn't find zlib.
#
# Cross-compiling, we need gcc not to read ./specs in order to build the g++
# compiler (after the specs for the cross-gcc are created). Having
# LIBRARY_PATH= makes gcc read the specs from ., and the build breaks.
CPATH = optionals (targetPlatform == hostPlatform) (makeSearchPathOutput "dev" "include" ([]
++ optional (zlib != null) zlib
++ optional langJava boehmgc
++ optionals javaAwtGtk xlibs
++ optionals javaAwtGtk [ gmp mpfr ]
++ optional (libpthread != null) libpthread
++ optional (libpthreadCross != null) libpthreadCross
# On GNU/Hurd glibc refers to Mach & Hurd
# headers.
++ optionals (libcCross != null && libcCross ? propagatedBuildInputs)
libcCross.propagatedBuildInputs
));
LIBRARY_PATH = optionals (targetPlatform == hostPlatform) (makeLibraryPath ([]
++ optional (zlib != null) zlib
++ optional langJava boehmgc
++ optionals javaAwtGtk xlibs
++ optionals javaAwtGtk [ gmp mpfr ]
++ optional (libpthread != null) libpthread)
);
EXTRA_TARGET_FLAGS = optionals
(targetPlatform != hostPlatform && libcCross != null)
([
"-idirafter ${libcCross.dev}/include"
] ++ optionals (! crossStageStatic) [
"-B${libcCross.out}/lib"
]);
EXTRA_TARGET_LDFLAGS = optionals
(targetPlatform != hostPlatform && libcCross != null)
([
"-Wl,-L${libcCross.out}/lib"
] ++ (if crossStageStatic then [
"-B${libcCross.out}/lib"
] else [
"-Wl,-rpath,${libcCross.out}/lib"
"-Wl,-rpath-link,${libcCross.out}/lib"
]) ++ optionals (libpthreadCross != null) [
"-L${libpthreadCross}/lib"
"-Wl,${libpthreadCross.TARGET_LDFLAGS}"
]);
passthru = {
inherit langC langCC langAda langFortran langVhdl enableMultilib version;
isGNU = true;
hardeningUnsupportedFlags = [ "stackprotector" ];
};
enableParallelBuilding = !langAda;
meta = {
homepage = http://gcc.gnu.org/;
license = stdenv.lib.licenses.gpl3Plus; # runtime support libraries are typically LGPLv3+
description = "GNU Compiler Collection, version ${version}"
+ (if stripped then "" else " (with debugging info)");
longDescription = ''
The GNU Compiler Collection includes compiler front ends for C, C++,
Objective-C, Fortran, OpenMP for C/C++/Fortran, Java, and Ada, as well
as libraries for these languages (libstdc++, libgcj, libgomp,...).
GCC development is a part of the GNU Project, aiming to improve the
compiler used in the GNU system including the GNU/Linux variant.
'';
maintainers = [
stdenv.lib.maintainers.viric
];
# Volunteers needed for the {Cyg,Dar}win ports of *PPL.
# gnatboot is not available out of linux platforms, so we disable the darwin build
# for the gnat (ada compiler).
platforms = stdenv.lib.platforms.linux ++ optionals (langAda == false) [ "i686-darwin" ];
};
}
// optionalAttrs (targetPlatform != hostPlatform || libcCross != null) {
# `builder.sh' sets $CPP, which leads configure to use "gcc -E" instead of,
# say, "i586-pc-gnu-gcc -E" when building `gcc.crossDrv'.
# FIXME: Fix `builder.sh' directly in the next stdenv-update.
postUnpack = "unset CPP";
}
// optionalAttrs (targetPlatform != hostPlatform && targetPlatform.libc == "msvcrt" && crossStageStatic) {
makeFlags = [ "all-gcc" "all-target-libgcc" ];
installTargets = "install-gcc install-target-libgcc";
}
# GCC 4.5.2 doesn't support the `install-strip' target, so let `stdenv' do
# the stripping by default.
// optionalAttrs (!stripped) { dontStrip = true; }
// optionalAttrs langVhdl rec {
name = "ghdl-0.29";
ghdlSrc = fetchurl {
url = "http://ghdl.free.fr/ghdl-0.29.tar.bz2";
sha256 = "15mlinr1lwljwll9ampzcfcrk9bk0qpdks1kxlvb70xf9zhh2jva";
};
# Ghdl has some timestamps checks, storing file timestamps in '.cf' files.
# As we will change the timestamps to 1970-01-01 00:00:01, we also set the
# content of that .cf to that value. This way ghdl does not complain on
# the installed object files from the basic libraries (ieee, ...)
postInstallGhdl = ''
pushd $out
find . -name "*.cf" -exec \
sed 's/[0-9]*\.000" /19700101000001.000" /g' -i {} \;
popd
'';
postUnpack = ''
tar xvf ${ghdlSrc}
mv ghdl-*/vhdl gcc*/gcc
rm -Rf ghdl-*
'';
meta = {
homepage = http://ghdl.free.fr/;
license = stdenv.lib.licenses.gpl2Plus;
description = "Complete VHDL simulator, using the GCC technology (gcc ${version})";
maintainers = with stdenv.lib.maintainers; [viric];
platforms = with stdenv.lib.platforms; linux;
};
})
@@ -1,111 +0,0 @@
diff --git a/gcc/vhdl/Make-lang.in b/gcc/vhdl/Make-lang.in
index 8f481df..681ac59 100644
--- a/gcc/vhdl/Make-lang.in
+++ b/gcc/vhdl/Make-lang.in
@@ -96,7 +96,7 @@ AGCC_GCCOBJ_DIR=../
AGCC_INC_FLAGS=-I$(AGCC_GCCOBJ_DIR)/gcc -I$(AGCC_GCCSRC_DIR)/include \
-I$(AGCC_GCCSRC_DIR)/gcc -I$(AGCC_GCCSRC_DIR)/gcc/config \
-I$(AGCC_GCCSRC_DIR)/libcpp/include
-AGCC_CFLAGS=-g -Wall -DIN_GCC $(AGCC_INC_FLAGS)
+AGCC_CFLAGS=-g -Wall -DIN_GCC $(AGCC_INC_FLAGS) $(CFLAGS) $(INCLUDES)
AGCC_LOCAL_OBJS=ortho-lang.o
@@ -140,7 +140,7 @@ ghdl$(exeext): force
# Ghdl libraries.
ghdllib: ghdl$(exeext) $(GCC_PASSES) force
- $(MAKE_IN_VHDL) GRT_FLAGS="-O -g" ghdllib
+ $(MAKE_IN_VHDL) GRT_FLAGS="-O -g $(CFLAGS)" ghdllib
# Build hooks:
diff --git a/gcc/vhdl/Makefile.in b/gcc/vhdl/Makefile.in
index d754c6c..07abc4a 100644
--- a/gcc/vhdl/Makefile.in
+++ b/gcc/vhdl/Makefile.in
@@ -80,7 +80,8 @@ T_CPPFLAGS =
X_ADAFLAGS =
T_ADAFLAGS =
-ADAC = $(CC)
+# Never use the bootstrapped compiler, as it may not be built for ada
+ADAC = gcc
ECHO = echo
CHMOD = chmod
diff --git a/gcc/vhdl/ortho-lang.c b/gcc/vhdl/ortho-lang.c
index 84aeb92..8eddd42 100644
--- a/gcc/vhdl/ortho-lang.c
+++ b/gcc/vhdl/ortho-lang.c
@@ -16,6 +16,7 @@
#include "options.h"
#include "real.h"
-#include "tree-gimple.h"
+#include "gimple.h"
+#include "tree.h"
#include "function.h"
#include "cgraph.h"
#include "target.h"
@@ -680,38 +681,10 @@ type_for_mode (enum machine_mode mode, int unsignedp)
const struct lang_hooks lang_hooks = LANG_HOOKS_INITIALIZER;
-/* Tree code classes. */
-
-#define DEFTREECODE(SYM, NAME, TYPE, LENGTH) TYPE,
-
-const enum tree_code_class tree_code_type[] = {
-#include "tree.def"
- 'x'
-};
-#undef DEFTREECODE
-
-/* Table indexed by tree code giving number of expression
- operands beyond the fixed part of the node structure.
- Not used for types or decls. */
-
-#define DEFTREECODE(SYM, NAME, TYPE, LENGTH) LENGTH,
-
-const unsigned char tree_code_length[] = {
-#include "tree.def"
- 0
-};
-#undef DEFTREECODE
-
-#define DEFTREECODE(SYM, NAME, TYPE, LENGTH) NAME,
-const char * const tree_code_name[] = {
-#include "tree.def"
- "@@dummy"
-};
-#undef DEFTREECODE
union lang_tree_node
GTY((desc ("0"),
- chain_next ("(union lang_tree_node *) GENERIC_NEXT (&%h.generic)")))
+ chain_next ("(union lang_tree_node *) TREE_CHAIN (&%h.generic)")))
{
union tree_node GTY ((tag ("0"))) generic;
};
@@ -1162,7 +1135,7 @@ new_access_type (tree dtype)
res = make_node (POINTER_TYPE);
TREE_TYPE (res) = NULL_TREE;
/* Seems necessary. */
- TYPE_MODE (res) = Pmode;
+ SET_TYPE_MODE (res, Pmode);
layout_type (res);
return res;
}
diff --git a/gcc/vhdl/Make-lang.in b/gcc/vhdl/Make-lang.in
index e201f64..f36fb97 100644
--- a/gcc/vhdl/Make-lang.in
+++ b/gcc/vhdl/Make-lang.in
@@ -132,7 +132,7 @@ ghdl1$(exeext): $(AGCC_OBJS) $(AGCC_DEPS) force
-cargs $(CFLAGS) $(GHDL_ADAFLAGS)
$(GNATMAKE) -o $@ -aI$(srcdir)/vhdl -aOvhdl ortho_gcc-main \
-bargs -E -cargs $(CFLAGS) $(GHDL_ADAFLAGS) \
- -largs $(AGCC_OBJS) $(LIBS) $(GMPLIBS)
+ -largs $(AGCC_OBJS) $(LIBS) $(GMPLIBS) $(CLOOGLIBS) $(PPLLIBS)
# The driver for ghdl.
ghdl$(exeext): force
@@ -1,54 +0,0 @@
diff -ru gcc-4.3.1-orig/gcc/cppdefault.c gcc-4.3.1/gcc/cppdefault.c
--- gcc-4.3.1-orig/gcc/cppdefault.c 2007-07-26 10:37:01.000000000 +0200
+++ gcc-4.3.1/gcc/cppdefault.c 2008-06-25 17:48:23.000000000 +0200
@@ -41,6 +41,10 @@
# undef CROSS_INCLUDE_DIR
#endif
+#undef LOCAL_INCLUDE_DIR
+#undef SYSTEM_INCLUDE_DIR
+#undef STANDARD_INCLUDE_DIR
+
const struct default_include cpp_include_defaults[]
#ifdef INCLUDE_DEFAULTS
= INCLUDE_DEFAULTS;
diff -ru gcc-4.3.1-orig/gcc/gcc.c gcc-4.3.1/gcc/gcc.c
--- gcc-4.3.1-orig/gcc/gcc.c 2008-03-02 23:55:19.000000000 +0100
+++ gcc-4.3.1/gcc/gcc.c 2008-06-25 17:52:53.000000000 +0200
@@ -1478,10 +1478,10 @@
/* Default prefixes to attach to command names. */
#ifndef STANDARD_STARTFILE_PREFIX_1
-#define STANDARD_STARTFILE_PREFIX_1 "/lib/"
+#define STANDARD_STARTFILE_PREFIX_1 ""
#endif
#ifndef STANDARD_STARTFILE_PREFIX_2
-#define STANDARD_STARTFILE_PREFIX_2 "/usr/lib/"
+#define STANDARD_STARTFILE_PREFIX_2 ""
#endif
#ifdef CROSS_DIRECTORY_STRUCTURE /* Don't use these prefixes for a cross compiler. */
--- gcc-4.3.1-orig/gcc/Makefile.in 2008-05-11 20:54:15.000000000 +0200
+++ gcc-4.3.1/gcc/Makefile.in 2008-06-25 17:48:23.000000000 +0200
@@ -378,7 +378,11 @@
MD5_H = $(srcdir)/../include/md5.h
# Default native SYSTEM_HEADER_DIR, to be overridden by targets.
-NATIVE_SYSTEM_HEADER_DIR = /usr/include
+# Nix: we override NATIVE_SYSTEM_HEADER_DIR in order to prevent
+# `fixinc' from fixing header files in /usr/include. However,
+# NATIVE_SYSTEM_HEADER_DIR must point to an existing directory, so set
+# it to some dummy directory.
+NATIVE_SYSTEM_HEADER_DIR = $(NIX_FIXINC_DUMMY)
# Default cross SYSTEM_HEADER_DIR, to be overridden by targets.
CROSS_SYSTEM_HEADER_DIR = @CROSS_SYSTEM_HEADER_DIR@
@@ -3277,7 +3281,7 @@
-DGPLUSPLUS_INCLUDE_DIR=\"$(gcc_gxx_include_dir)\" \
-DGPLUSPLUS_TOOL_INCLUDE_DIR=\"$(gcc_gxx_include_dir)/$(target_noncanonical)\" \
-DGPLUSPLUS_BACKWARD_INCLUDE_DIR=\"$(gcc_gxx_include_dir)/backward\" \
- -DLOCAL_INCLUDE_DIR=\"$(local_includedir)\" \
+ -DLOCAL_INCLUDE_DIR=\"/no-such-dir\" \
-DCROSS_INCLUDE_DIR=\"$(CROSS_SYSTEM_HEADER_DIR)\" \
-DTOOL_INCLUDE_DIR=\"$(gcc_tooldir)/include\" \
-DPREFIX=\"$(prefix)/\" \
@@ -1,26 +0,0 @@
/* Automatically generated by `update-gcc.sh', do not edit.
For GCC 4.5.4. */
{ fetchurl, optional, version, langC, langCC, langFortran, langJava, langAda }:
assert version == "4.5.4";
optional /* langC */ true (fetchurl {
url = "mirror://gcc/releases/gcc-${version}/gcc-core-${version}.tar.bz2";
sha256 = "894d90f72cbfc8707e330fa2b1847c443fa97cf9b7f26e86be554709510e624a";
}) ++
optional langCC (fetchurl {
url = "mirror://gcc/releases/gcc-${version}/gcc-g++-${version}.tar.bz2";
sha256 = "f7e3bab5e22713fbce46c2acb35fb727748473a34a942ce00393d75e1b09b6b9";
}) ++
optional langFortran (fetchurl {
url = "mirror://gcc/releases/gcc-${version}/gcc-fortran-${version}.tar.bz2";
sha256 = "cf0803b4f5334a526dd8da1b2171d6724f50c17346b2d5c509b6abc973d2ef34";
}) ++
optional langJava (fetchurl {
url = "mirror://gcc/releases/gcc-${version}/gcc-java-${version}.tar.bz2";
sha256 = "c98398da6f8c4c7d1758e291089d99853fdd27112cd3f146b7a8c26e6d762a23";
}) ++
optional langAda (fetchurl {
url = "mirror://gcc/releases/gcc-${version}/gcc-ada-${version}.tar.bz2";
sha256 = "8abddae15be65572b4d639bd9818057019bb4a45da4decfc6451511c8d580c5e";
}) ++
[]
+49 -136
View File
@@ -1,10 +1,8 @@
{ stdenv, targetPackages, fetchurl, fetchpatch, noSysDirs
, langC ? true, langCC ? true, langFortran ? false
, langObjC ? targetPlatform.isDarwin
, langObjCpp ? targetPlatform.isDarwin
, langObjC ? stdenv.targetPlatform.isDarwin
, langObjCpp ? stdenv.targetPlatform.isDarwin
, langJava ? false
, langAda ? false
, langVhdl ? false
, langGo ? false
, profiledCompiler ? false
, staticCompiler ? false
@@ -21,26 +19,21 @@
, libXrender ? null, xproto ? null, renderproto ? null, xextproto ? null
, libXrandr ? null, libXi ? null, inputproto ? null, randrproto ? null
, x11Support ? langJava
, gnatboot ? null
, enableMultilib ? false
, enablePlugin ? hostPlatform == buildPlatform # Whether to support user-supplied plug-ins
, enablePlugin ? stdenv.hostPlatform == stdenv.buildPlatform # Whether to support user-supplied plug-ins
, name ? "gcc"
, libcCross ? null
, crossStageStatic ? false
, gnat ? null
, libpthread ? null, libpthreadCross ? null # required for GNU/Hurd
, stripped ? true
, # Strip kills static libs of other archs (hence no cross)
stripped ? stdenv.hostPlatform == stdenv.buildPlatform
&& stdenv.targetPlatform == stdenv.hostPlatform
, gnused ? null
, darwin ? null
, buildPlatform, hostPlatform, targetPlatform
, buildPackages
}:
assert langJava -> zip != null && unzip != null
&& zlib != null && boehmgc != null
&& perl != null; # for `--enable-java-home'
assert langAda -> gnatboot != null;
assert langVhdl -> gnat != null;
# We enable the isl cloog backend.
assert cloog != null -> isl != null;
@@ -49,7 +42,7 @@ assert cloog != null -> isl != null;
assert libelf != null -> zlib != null;
# Make sure we get GNU sed.
assert hostPlatform.isDarwin -> gnused != null;
assert stdenv.hostPlatform.isDarwin -> gnused != null;
# The go frontend is written in c++
assert langGo -> langCC;
@@ -59,18 +52,14 @@ with builtins;
let version = "4.8.5";
# Whether building a cross-compiler for GNU/Hurd.
crossGNU = targetPlatform != hostPlatform && targetPlatform.config == "i586-pc-gnu";
enableParallelBuilding = true;
inherit (stdenv) buildPlatform hostPlatform targetPlatform;
patches = [ ]
++ optional enableParallelBuilding ../parallel-bconfig.patch
++ optional (targetPlatform != hostPlatform) ../libstdc++-target.patch
++ optional noSysDirs ../no-sys-dirs.patch
# The GNAT Makefiles did not pay attention to CFLAGS_FOR_TARGET for its
# target libraries and tools.
++ optional langAda ../gnat-cflags.patch
++ optional langFortran ../gfortran-driving.patch
++ optional hostPlatform.isDarwin ../gfortran-darwin-NXConstStr.patch
++ [(fetchpatch {
@@ -108,22 +97,6 @@ let version = "4.8.5";
javaAwtGtk = langJava && x11Support;
/* Platform flags */
platformFlags = let
gccArch = targetPlatform.platform.gcc.arch or null;
gccCpu = targetPlatform.platform.gcc.cpu or null;
gccAbi = targetPlatform.platform.gcc.abi or null;
gccFpu = targetPlatform.platform.gcc.fpu or null;
gccFloat = targetPlatform.platform.gcc.float or null;
gccMode = targetPlatform.platform.gcc.mode or null;
in
optional (gccArch != null) "--with-arch=${gccArch}" ++
optional (gccCpu != null) "--with-cpu=${gccCpu}" ++
optional (gccAbi != null) "--with-abi=${gccAbi}" ++
optional (gccFpu != null) "--with-fpu=${gccFpu}" ++
optional (gccFloat != null) "--with-float=${gccFloat}" ++
optional (gccMode != null) "--with-mode=${gccMode}";
/* Cross-gcc settings (build == host != target) */
crossMingw = targetPlatform != hostPlatform && targetPlatform.libc == "msvcrt";
crossDarwin = targetPlatform != hostPlatform && targetPlatform.libc == "libSystem";
@@ -143,6 +116,7 @@ let version = "4.8.5";
"--enable-sjlj-exceptions"
"--enable-threads=win32"
"--disable-win32-registry"
"--disable-libmpx" # requires libc
] else if crossStageStatic then [
"--disable-libssp"
"--disable-nls"
@@ -151,11 +125,12 @@ let version = "4.8.5";
"--disable-libgomp"
"--disable-libquadmath"
"--disable-shared"
"--disable-libatomic" # libatomic requires libc
"--disable-decimal-float" # libdecnumber requires libc
"--disable-libatomic" # requires libc
"--disable-decimal-float" # requires libc
"--disable-libmpx" # requires libc
] else [
(if crossDarwin then "--with-sysroot=${getLib libcCross}/share/sysroot"
else "--with-headers=${getDev libcCross}/include")
else "--with-headers=${getDev libcCross}${libcCross.incdir or "/include"}")
"--enable-__cxa_atexit"
"--enable-long-long"
] ++
@@ -173,13 +148,18 @@ let version = "4.8.5";
# In uclibc cases, libgomp needs an additional '-ldl'
# and as I don't know how to pass it, I disable libgomp.
"--disable-libgomp"
] ++ [
"--enable-threads=posix"
"--enable-nls"
"--disable-decimal-float" # No final libdecnumber (it may work only in 386)
]
++ optional (targetPlatform.libc == "newlib") "--with-newlib"
++ optional (targetPlatform.libc == "avrlibc") "--with-avrlibc"
++ [
"--enable-threads=${if targetPlatform.isUnix then "posix"
else if targetPlatform.isWindows then "win32"
else "single"}"
"--enable-nls"
"--disable-decimal-float" # No final libdecnumber (it may work only in 386)
]));
stageNameAddon = if crossStageStatic then "-stage-static" else "-stage-final";
crossNameAddon = if targetPlatform != hostPlatform then "-${targetPlatform.config}" + stageNameAddon else "";
crossNameAddon = if targetPlatform != hostPlatform then "${targetPlatform.config}${stageNameAddon}-" else "";
bootstrap = targetPlatform == hostPlatform;
@@ -189,7 +169,7 @@ in
assert x11Support -> (filter (x: x == null) ([ gtk2 libart_lgpl ] ++ xlibs)) == [];
stdenv.mkDerivation ({
name = "${name}${if stripped then "" else "-debug"}-${version}" + crossNameAddon;
name = crossNameAddon + "${name}${if stripped then "" else "-debug"}-${version}";
builder = ../builder.sh;
@@ -200,7 +180,7 @@ stdenv.mkDerivation ({
inherit patches;
hardeningDisable = [ "format" ];
hardeningDisable = [ "format" ] ++ stdenv.lib.optional stdenv.targetPlatform.isMusl "pie";
outputs = [ "out" "lib" "man" "info" ];
setOutputFlags = false;
@@ -209,43 +189,7 @@ stdenv.mkDerivation ({
libc_dev = stdenv.cc.libc_dev;
postPatch =
if (hostPlatform.isHurd
|| (libcCross != null # e.g., building `gcc.crossDrv'
&& libcCross ? crossConfig
&& libcCross.crossConfig == "i586-pc-gnu")
|| (crossGNU && libcCross != null))
then
# On GNU/Hurd glibc refers to Hurd & Mach headers and libpthread is not
# in glibc, so add the right `-I' flags to the default spec string.
assert libcCross != null -> libpthreadCross != null;
let
libc = if libcCross != null then libcCross else stdenv.glibc;
gnu_h = "gcc/config/gnu.h";
extraCPPDeps =
libc.propagatedBuildInputs
++ stdenv.lib.optional (libpthreadCross != null) libpthreadCross
++ stdenv.lib.optional (libpthread != null) libpthread;
extraCPPSpec =
concatStrings (intersperse " "
(map (x: "-I${x.dev or x}/include") extraCPPDeps));
extraLibSpec =
if libpthreadCross != null
then "-L${libpthreadCross}/lib ${libpthreadCross.TARGET_LDFLAGS}"
else "-L${libpthread}/lib";
in
'' echo "augmenting \`CPP_SPEC' in \`${gnu_h}' with \`${extraCPPSpec}'..."
sed -i "${gnu_h}" \
-es'|CPP_SPEC *"\(.*\)$|CPP_SPEC "${extraCPPSpec} \1|g'
echo "augmenting \`LIB_SPEC' in \`${gnu_h}' with \`${extraLibSpec}'..."
sed -i "${gnu_h}" \
-es'|LIB_SPEC *"\(.*\)$|LIB_SPEC "${extraLibSpec} \1|g'
echo "setting \`NATIVE_SYSTEM_HEADER_DIR' and \`STANDARD_INCLUDE_DIR' to \`${libc.dev}/include'..."
sed -i "${gnu_h}" \
-es'|#define STANDARD_INCLUDE_DIR.*$|#define STANDARD_INCLUDE_DIR "${libc.dev}/include"|g'
''
else if targetPlatform != hostPlatform || stdenv.cc.libc != null then
if targetPlatform != hostPlatform || stdenv.cc.libc != null then
# On NixOS, use the right path to the dynamic linker instead of
# `/lib/ld*.so'.
let
@@ -262,9 +206,7 @@ stdenv.mkDerivation ({
''
else null;
# TODO(@Ericson2314): Make passthru instead. Weird to avoid mass rebuild,
crossStageStatic = targetPlatform == hostPlatform || crossStageStatic;
inherit noSysDirs staticCompiler langJava
inherit noSysDirs staticCompiler langJava crossStageStatic
libcCross crossMingw;
depsBuildBuild = [ buildPackages.stdenv.cc ];
@@ -279,8 +221,6 @@ stdenv.mkDerivation ({
++ (optionals langJava [ boehmgc zip unzip ])
++ (optionals javaAwtGtk ([ gtk2 libart_lgpl ] ++ xlibs))
++ (optionals (targetPlatform != hostPlatform) [targetPackages.stdenv.cc.bintools])
++ (optionals langAda [gnatboot])
++ (optionals langVhdl [gnat])
# The builder relies on GNU sed (for instance, Darwin's `sed' fails with
# "-i may not be used with stdin"), and `stdenvNative' doesn't provide it.
@@ -298,11 +238,7 @@ stdenv.mkDerivation ({
dontDisableStatic = true;
# TODO(@Ericson2314): Always pass "--target" and always prefix.
configurePlatforms =
# TODO(@Ericson2314): Figure out what's going wrong with Arm
if buildPlatform == hostPlatform && hostPlatform == targetPlatform && targetPlatform.isArm
then []
else [ "build" "host" ] ++ stdenv.lib.optional (targetPlatform != hostPlatform) "target";
configurePlatforms = [ "build" "host" ] ++ stdenv.lib.optional (targetPlatform != hostPlatform) "target";
configureFlags =
# Basic dependencies
@@ -330,8 +266,6 @@ stdenv.mkDerivation ({
++ optional langCC "c++"
++ optional langFortran "fortran"
++ optional langJava "java"
++ optional langAda "ada"
++ optional langVhdl "vhdl"
++ optional langGo "go"
++ optional langObjC "objc"
++ optional langObjCpp "obj-c++"
@@ -341,7 +275,7 @@ stdenv.mkDerivation ({
}"
] ++
(if enableMultilib
(if (enableMultilib || targetPlatform.isAvr)
then ["--enable-multilib" "--disable-libquadmath"]
else ["--disable-multilib"]) ++
optional (!enableShared) "--disable-shared" ++
@@ -369,10 +303,7 @@ stdenv.mkDerivation ({
optional javaAwtGtk "--enable-java-awt=gtk" ++
optional (langJava && javaAntlr != null) "--with-antlr-jar=${javaAntlr}" ++
# Ada
optional langAda "--enable-libada" ++
platformFlags ++
(import ../common/platform-flags.nix { inherit (stdenv) lib targetPlatform; }) ++
optional (targetPlatform != hostPlatform) crossConfigureFlags ++
optional (!bootstrap) "--disable-bootstrap" ++
@@ -387,21 +318,19 @@ stdenv.mkDerivation ({
targetConfig = if targetPlatform != hostPlatform then targetPlatform.config else null;
buildFlags = if bootstrap then
(if profiledCompiler then "profiledbootstrap" else "bootstrap")
else "";
buildFlags = optional
(bootstrap && hostPlatform == buildPlatform)
(if profiledCompiler then "profiledbootstrap" else "bootstrap");
dontStrip = !stripped;
doCheck = false; # requires a lot of tools, causes a dependency cycle for stdenv
installTargets =
if stripped
then "install-strip"
else "install";
/* For cross-built gcc (build != host == target) */
crossAttrs = {
dontStrip = true;
buildFlags = "";
};
# http://gcc.gnu.org/install/specific.html#x86-64-x-solaris210
${if hostPlatform.system == "x86_64-solaris" then "CC" else null} = "gcc -m64";
@@ -424,47 +353,36 @@ stdenv.mkDerivation ({
++ optional langJava boehmgc
++ optionals javaAwtGtk xlibs
++ optionals javaAwtGtk [ gmp mpfr ]
++ optional (libpthread != null) libpthread
++ optional (libpthreadCross != null) libpthreadCross
# On GNU/Hurd glibc refers to Mach & Hurd
# headers.
++ optionals (libcCross != null && libcCross ? propagatedBuildInputs)
libcCross.propagatedBuildInputs
));
LIBRARY_PATH = optionals (targetPlatform == hostPlatform) (makeLibraryPath ([]
++ optional (zlib != null) zlib
++ optional langJava boehmgc
++ optionals javaAwtGtk xlibs
++ optionals javaAwtGtk [ gmp mpfr ]
++ optional (libpthread != null) libpthread)
++ optionals javaAwtGtk [ gmp mpfr ])
);
EXTRA_TARGET_FLAGS = optionals
(targetPlatform != hostPlatform && libcCross != null)
([
"-idirafter ${libcCross.dev}/include"
"-idirafter ${getDev libcCross}${libcCross.incdir or "/include"}"
] ++ optionals (! crossStageStatic) [
"-B${libcCross.out}/lib"
"-B${libcCross.out}${libcCross.libdir or "/lib"}"
]);
EXTRA_TARGET_LDFLAGS = optionals
(targetPlatform != hostPlatform && libcCross != null)
([
"-Wl,-L${libcCross.out}/lib"
"-Wl,-L${libcCross.out}${libcCross.libdir or "/lib"}"
] ++ (if crossStageStatic then [
"-B${libcCross.out}/lib"
"-B${libcCross.out}${libcCross.libdir or "/lib"}"
] else [
"-Wl,-rpath,${libcCross.out}/lib"
"-Wl,-rpath-link,${libcCross.out}/lib"
]) ++ optionals (libpthreadCross != null) [
"-L${libpthreadCross}/lib"
"-Wl,${libpthreadCross.TARGET_LDFLAGS}"
]);
"-Wl,-rpath,${libcCross.out}${libcCross.libdir or "/lib"}"
"-Wl,-rpath-link,${libcCross.out}${libcCross.libdir or "/lib"}"
]));
passthru = {
inherit langC langCC langObjC langObjCpp langAda langFortran langVhdl langGo version;
inherit langC langCC langObjC langObjCpp langFortran langGo version;
isGNU = true;
hardeningUnsupportedFlags = [ "stackprotector" ];
};
@@ -488,15 +406,13 @@ stdenv.mkDerivation ({
compiler used in the GNU system including the GNU/Linux variant.
'';
maintainers = with stdenv.lib.maintainers; [ viric peti ];
maintainers = with stdenv.lib.maintainers; [ peti ];
# gnatboot is not available out of linux platforms, so we disable the darwin build
# for the gnat (ada compiler).
platforms =
stdenv.lib.platforms.linux ++
stdenv.lib.platforms.freebsd ++
stdenv.lib.platforms.illumos ++
optionals (langAda == false) stdenv.lib.platforms.darwin;
stdenv.lib.platforms.darwin;
};
}
@@ -505,8 +421,5 @@ stdenv.mkDerivation ({
installTargets = "install-gcc install-target-libgcc";
}
# Strip kills static libs of other archs (hence targetPlatform != hostPlatform)
// optionalAttrs (!stripped || targetPlatform != hostPlatform) { dontStrip = true; }
// optionalAttrs (enableMultilib) { dontMoveLib64 = true; }
)
+65 -140
View File
@@ -1,10 +1,8 @@
{ stdenv, targetPackages, fetchurl, noSysDirs
{ stdenv, targetPackages, fetchurl, noSysDirs, fetchpatch
, langC ? true, langCC ? true, langFortran ? false
, langObjC ? targetPlatform.isDarwin
, langObjCpp ? targetPlatform.isDarwin
, langObjC ? stdenv.targetPlatform.isDarwin
, langObjCpp ? stdenv.targetPlatform.isDarwin
, langJava ? false
, langAda ? false
, langVhdl ? false
, langGo ? false
, profiledCompiler ? false
, staticCompiler ? false
@@ -21,26 +19,21 @@
, libXrender ? null, xproto ? null, renderproto ? null, xextproto ? null
, libXrandr ? null, libXi ? null, inputproto ? null, randrproto ? null
, x11Support ? langJava
, gnatboot ? null
, enableMultilib ? false
, enablePlugin ? hostPlatform == buildPlatform # Whether to support user-supplied plug-ins
, enablePlugin ? stdenv.hostPlatform == stdenv.buildPlatform # Whether to support user-supplied plug-ins
, name ? "gcc"
, libcCross ? null
, crossStageStatic ? false
, gnat ? null
, libpthread ? null, libpthreadCross ? null # required for GNU/Hurd
, stripped ? true
, # Strip kills static libs of other archs (hence no cross)
stripped ? stdenv.hostPlatform == stdenv.buildPlatform
&& stdenv.targetPlatform == stdenv.hostPlatform
, gnused ? null
, darwin ? null
, buildPlatform, hostPlatform, targetPlatform
, buildPackages
}:
assert langJava -> zip != null && unzip != null
&& zlib != null && boehmgc != null
&& perl != null; # for `--enable-java-home'
assert langAda -> gnatboot != null;
assert langVhdl -> gnat != null;
# We enable the isl cloog backend.
assert cloog != null -> isl != null;
@@ -49,7 +42,7 @@ assert cloog != null -> isl != null;
assert libelf != null -> zlib != null;
# Make sure we get GNU sed.
assert hostPlatform.isDarwin -> gnused != null;
assert stdenv.hostPlatform.isDarwin -> gnused != null;
# The go frontend is written in c++
assert langGo -> langCC;
@@ -59,22 +52,32 @@ with builtins;
let version = "4.9.4";
# Whether building a cross-compiler for GNU/Hurd.
crossGNU = targetPlatform != hostPlatform && targetPlatform.config == "i586-pc-gnu";
enableParallelBuilding = true;
inherit (stdenv) buildPlatform hostPlatform targetPlatform;
patches =
[ ../use-source-date-epoch.patch ]
++ optionals enableParallelBuilding [ ../parallel-bconfig.patch ./parallel-strsignal.patch ]
++ optional (targetPlatform != hostPlatform) ../libstdc++-target.patch
++ optional noSysDirs ../no-sys-dirs.patch
# The GNAT Makefiles did not pay attention to CFLAGS_FOR_TARGET for its
# target libraries and tools.
++ optional langAda ../gnat-cflags.patch
++ optional langFortran ../gfortran-driving.patch
++ [ ../struct-ucontext.patch ../struct-sigaltstack-4.9.patch ] # glibc-2.26
;
# Retpoline patches pulled from the branch hjl/indirect/gcc-4_9-branch (by H.J. Lu, the author of GCC upstream retpoline commits)
++ builtins.map ({commit, sha256}: fetchpatch {url = "https://github.com/hjl-tools/gcc/commit/${commit}.patch"; inherit sha256;})
[{ commit = "e623d21608e96ecd6b65f0d06312117d20488a38"; sha256 = "1ix8i4d2r3ygbv7npmsdj790rhxqrnfwcqzv48b090r9c3ij8ay3"; }
{ commit = "2015a09e332309f12de1dadfe179afa6a29368b8"; sha256 = "0xcfs0cbb63llj2gbcdrvxim79ax4k4aswn0a3yjavxsj71s1n91"; }
{ commit = "6b11591f4494f705e8746e7d58b7f423191f4e92"; sha256 = "0aydyhsm2ig0khgbp27am7vq7liyqrq6kfhfi2ki0ij0ab1hfbga"; }
{ commit = "203c7d9c3e9cb0f88816b481ef8e7e87b3ecc373"; sha256 = "0wqn16y7wy5kg8ngfcni5qdwfphl01axczibbk49bxclwnzvldqa"; }
{ commit = "f039c6f284b2c9ce97c8353d6034978795c4872e"; sha256 = "13fkgdb17lpyxfksz1zanxhgpsm0jrss9w61nbl7an4im22hz7ci"; }
{ commit = "ed42606bdab1c5d9e5ad828cd6fe1a0557f193b7"; sha256 = "0gdnn8v3p03imj3qga2mzdhpgbmjcklkxdl97jvz5xia2ikzknxm"; }
{ commit = "5278e062ef292fd2fbf987d25389785f4c5c0f99"; sha256 = "0j81x758wf8v7j4rx5wc1cy7yhkvhlhv3wmnarwakxiwsspq0vrs"; }
{ commit = "76f1ffbbb6cd9f6ecde6c82cd16e20a27242e890"; sha256 = "1py56y6gp7fjf4f8bbsfwh5bs1gnmlqda1ycsmnwlzfm0cshdp0c"; }
{ commit = "4ca48b2b688b135c0390f54ea9077ef10aedd52c"; sha256 = "15r019pzr3k0lpgyvdc92c8fayw8b5lrzncna4bqmamcsdz7vsaw"; }
{ commit = "98c7bf9ddc80db965d69d61521b1c7a1cec32d9a"; sha256 = "1d7pfdv1q23nf0wadw7jbp6d6r7pnzjpbyxgbdfv7j1vr9l1bp60"; }
{ commit = "3dc76b53ad896494ca62550a7a752fecbca3f7a2"; sha256 = "0jvdzfpvfdmklfcjwqblwq1i22iqis7ljpvm7adra5d7zf2xk7xz"; }
{ commit = "1e961ed49b18e176c7457f53df2433421387c23b"; sha256 = "04dnqqs4qsvz4g8cq6db5id41kzys7hzhcaycwmc9rpqygs2ajwz"; }
{ commit = "e137c72d099f9b3b47f4cc718aa11eab14df1a9c"; sha256 = "1ms0dmz74yf6kwgjfs4d2fhj8y6mcp2n184r3jk44wx2xc24vgb2"; }];
javaEcj = fetchurl {
# The `$(top_srcdir)/ecj.jar' file is automatically picked up at
@@ -99,22 +102,6 @@ let version = "4.9.4";
javaAwtGtk = langJava && x11Support;
/* Platform flags */
platformFlags = let
gccArch = targetPlatform.platform.gcc.arch or null;
gccCpu = targetPlatform.platform.gcc.cpu or null;
gccAbi = targetPlatform.platform.gcc.abi or null;
gccFpu = targetPlatform.platform.gcc.fpu or null;
gccFloat = targetPlatform.platform.gcc.float or null;
gccMode = targetPlatform.platform.gcc.mode or null;
in
optional (gccArch != null) "--with-arch=${gccArch}" ++
optional (gccCpu != null) "--with-cpu=${gccCpu}" ++
optional (gccAbi != null) "--with-abi=${gccAbi}" ++
optional (gccFpu != null) "--with-fpu=${gccFpu}" ++
optional (gccFloat != null) "--with-float=${gccFloat}" ++
optional (gccMode != null) "--with-mode=${gccMode}";
/* Cross-gcc settings (build == host != target) */
crossMingw = targetPlatform != hostPlatform && targetPlatform.libc == "msvcrt";
crossDarwin = targetPlatform != hostPlatform && targetPlatform.libc == "libSystem";
@@ -134,6 +121,7 @@ let version = "4.9.4";
"--enable-sjlj-exceptions"
"--enable-threads=win32"
"--disable-win32-registry"
"--disable-libmpx" # requires libc
] else if crossStageStatic then [
"--disable-libssp"
"--disable-nls"
@@ -142,11 +130,12 @@ let version = "4.9.4";
"--disable-libgomp"
"--disable-libquadmath"
"--disable-shared"
"--disable-libatomic" # libatomic requires libc
"--disable-decimal-float" # libdecnumber requires libc
"--disable-libatomic" # requires libc
"--disable-decimal-float" # requires libc
"--disable-libmpx" # requires libc
] else [
(if crossDarwin then "--with-sysroot=${getLib libcCross}/share/sysroot"
else "--with-headers=${getDev libcCross}/include")
else "--with-headers=${getDev libcCross}${libcCross.incdir or "/include"}")
"--enable-__cxa_atexit"
"--enable-long-long"
] ++
@@ -167,13 +156,18 @@ let version = "4.9.4";
# In uclibc cases, libgomp needs an additional '-ldl'
# and as I don't know how to pass it, I disable libgomp.
"--disable-libgomp"
] ++ [
"--enable-threads=posix"
"--enable-nls"
"--disable-decimal-float" # No final libdecnumber (it may work only in 386)
]
++ optional (targetPlatform.libc == "newlib") "--with-newlib"
++ optional (targetPlatform.libc == "avrlibc") "--with-avrlibc"
++ [
"--enable-threads=${if targetPlatform.isUnix then "posix"
else if targetPlatform.isWindows then "win32"
else "single"}"
"--enable-nls"
"--disable-decimal-float" # No final libdecnumber (it may work only in 386)
]));
stageNameAddon = if crossStageStatic then "-stage-static" else "-stage-final";
crossNameAddon = if targetPlatform != hostPlatform then "-${targetPlatform.config}" + stageNameAddon else "";
crossNameAddon = if targetPlatform != hostPlatform then "${targetPlatform.config}${stageNameAddon}-" else "";
bootstrap = targetPlatform == hostPlatform;
@@ -183,7 +177,7 @@ in
assert x11Support -> (filter (x: x == null) ([ gtk2 libart_lgpl ] ++ xlibs)) == [];
stdenv.mkDerivation ({
name = "${name}${if stripped then "" else "-debug"}-${version}" + crossNameAddon;
name = crossNameAddon + "${name}${if stripped then "" else "-debug"}-${version}";
builder = ../builder.sh;
@@ -194,7 +188,7 @@ stdenv.mkDerivation ({
inherit patches;
hardeningDisable = [ "format" ];
hardeningDisable = [ "format" ] ++ stdenv.lib.optional stdenv.targetPlatform.isMusl "pie";
outputs = if langJava || langGo then ["out" "man" "info"]
else [ "out" "lib" "man" "info" ];
@@ -204,43 +198,7 @@ stdenv.mkDerivation ({
libc_dev = stdenv.cc.libc_dev;
postPatch =
if (hostPlatform.isHurd
|| (libcCross != null # e.g., building `gcc.crossDrv'
&& libcCross ? crossConfig
&& libcCross.crossConfig == "i586-pc-gnu")
|| (crossGNU && libcCross != null))
then
# On GNU/Hurd glibc refers to Hurd & Mach headers and libpthread is not
# in glibc, so add the right `-I' flags to the default spec string.
assert libcCross != null -> libpthreadCross != null;
let
libc = if libcCross != null then libcCross else stdenv.glibc;
gnu_h = "gcc/config/gnu.h";
extraCPPDeps =
libc.propagatedBuildInputs
++ stdenv.lib.optional (libpthreadCross != null) libpthreadCross
++ stdenv.lib.optional (libpthread != null) libpthread;
extraCPPSpec =
concatStrings (intersperse " "
(map (x: "-I${x.dev or x}/include") extraCPPDeps));
extraLibSpec =
if libpthreadCross != null
then "-L${libpthreadCross}/lib ${libpthreadCross.TARGET_LDFLAGS}"
else "-L${libpthread}/lib";
in
'' echo "augmenting \`CPP_SPEC' in \`${gnu_h}' with \`${extraCPPSpec}'..."
sed -i "${gnu_h}" \
-es'|CPP_SPEC *"\(.*\)$|CPP_SPEC "${extraCPPSpec} \1|g'
echo "augmenting \`LIB_SPEC' in \`${gnu_h}' with \`${extraLibSpec}'..."
sed -i "${gnu_h}" \
-es'|LIB_SPEC *"\(.*\)$|LIB_SPEC "${extraLibSpec} \1|g'
echo "setting \`NATIVE_SYSTEM_HEADER_DIR' and \`STANDARD_INCLUDE_DIR' to \`${libc.dev}/include'..."
sed -i "${gnu_h}" \
-es'|#define STANDARD_INCLUDE_DIR.*$|#define STANDARD_INCLUDE_DIR "${libc.dev}/include"|g'
''
else if targetPlatform != hostPlatform || stdenv.cc.libc != null then
if targetPlatform != hostPlatform || stdenv.cc.libc != null then
# On NixOS, use the right path to the dynamic linker instead of
# `/lib/ld*.so'.
let
@@ -257,9 +215,7 @@ stdenv.mkDerivation ({
''
else null;
# TODO(@Ericson2314): Make passthru instead. Weird to avoid mass rebuild,
crossStageStatic = targetPlatform == hostPlatform || crossStageStatic;
inherit noSysDirs staticCompiler langJava
inherit noSysDirs staticCompiler langJava crossStageStatic
libcCross crossMingw;
depsBuildBuild = [ buildPackages.stdenv.cc ];
@@ -284,8 +240,6 @@ stdenv.mkDerivation ({
++ (optionals langJava [ boehmgc zip unzip ])
++ (optionals javaAwtGtk ([ gtk2 libart_lgpl ] ++ xlibs))
++ (optionals (targetPlatform != hostPlatform) [targetPackages.stdenv.cc.bintools])
++ (optionals langAda [gnatboot])
++ (optionals langVhdl [gnat])
# The builder relies on GNU sed (for instance, Darwin's `sed' fails with
# "-i may not be used with stdin"), and `stdenvNative' doesn't provide it.
@@ -307,11 +261,7 @@ stdenv.mkDerivation ({
dontDisableStatic = true;
# TODO(@Ericson2314): Always pass "--target" and always prefix.
configurePlatforms =
# TODO(@Ericson2314): Figure out what's going wrong with Arm
if buildPlatform == hostPlatform && hostPlatform == targetPlatform && targetPlatform.isArm
then []
else [ "build" "host" ] ++ stdenv.lib.optional (targetPlatform != hostPlatform) "target";
configurePlatforms = [ "build" "host" ] ++ stdenv.lib.optional (targetPlatform != hostPlatform) "target";
configureFlags =
# Basic dependencies
@@ -338,8 +288,6 @@ stdenv.mkDerivation ({
++ optional langCC "c++"
++ optional langFortran "fortran"
++ optional langJava "java"
++ optional langAda "ada"
++ optional langVhdl "vhdl"
++ optional langGo "go"
++ optional langObjC "objc"
++ optional langObjCpp "obj-c++"
@@ -349,7 +297,7 @@ stdenv.mkDerivation ({
}"
] ++
(if enableMultilib
(if (enableMultilib || targetPlatform.isAvr)
then ["--enable-multilib" "--disable-libquadmath"]
else ["--disable-multilib"]) ++
optional (!enableShared) "--disable-shared" ++
@@ -377,10 +325,7 @@ stdenv.mkDerivation ({
optional javaAwtGtk "--enable-java-awt=gtk" ++
optional (langJava && javaAntlr != null) "--with-antlr-jar=${javaAntlr}" ++
# Ada
optional langAda "--enable-libada" ++
platformFlags ++
(import ../common/platform-flags.nix { inherit (stdenv) lib targetPlatform; }) ++
optional (targetPlatform != hostPlatform) crossConfigureFlags ++
optional (!bootstrap) "--disable-bootstrap" ++
@@ -395,21 +340,19 @@ stdenv.mkDerivation ({
targetConfig = if targetPlatform != hostPlatform then targetPlatform.config else null;
buildFlags = if bootstrap then
(if profiledCompiler then "profiledbootstrap" else "bootstrap")
else "";
buildFlags = optional
(bootstrap && hostPlatform == buildPlatform)
(if profiledCompiler then "profiledbootstrap" else "bootstrap");
dontStrip = !stripped;
doCheck = false; # requires a lot of tools, causes a dependency cycle for stdenv
installTargets =
if stripped
then "install-strip"
else "install";
/* For cross-built gcc (build != host == target) */
crossAttrs = {
dontStrip = true;
buildFlags = "";
};
# http://gcc.gnu.org/install/specific.html#x86-64-x-solaris210
${if hostPlatform.system == "x86_64-solaris" then "CC" else null} = "gcc -m64";
@@ -432,47 +375,35 @@ stdenv.mkDerivation ({
++ optional langJava boehmgc
++ optionals javaAwtGtk xlibs
++ optionals javaAwtGtk [ gmp mpfr ]
++ optional (libpthread != null) libpthread
++ optional (libpthreadCross != null) libpthreadCross
# On GNU/Hurd glibc refers to Mach & Hurd
# headers.
++ optionals (libcCross != null && libcCross ? propagatedBuildInputs)
libcCross.propagatedBuildInputs
));
LIBRARY_PATH = optionals (targetPlatform == hostPlatform) (makeLibraryPath ([]
++ optional (zlib != null) zlib
++ optional langJava boehmgc
++ optionals javaAwtGtk xlibs
++ optionals javaAwtGtk [ gmp mpfr ]
++ optional (libpthread != null) libpthread)
);
++ optionals javaAwtGtk [ gmp mpfr ]));
EXTRA_TARGET_FLAGS = optionals
(targetPlatform != hostPlatform && libcCross != null)
([
"-idirafter ${getDev libcCross}/include"
"-idirafter ${getDev libcCross}${libcCross.incdir or "/include"}"
] ++ optionals (! crossStageStatic) [
"-B${libcCross.out}/lib"
"-B${libcCross.out}${libcCross.libdir or "/lib"}"
]);
EXTRA_TARGET_LDFLAGS = optionals
(targetPlatform != hostPlatform && libcCross != null)
([
"-Wl,-L${libcCross.out}/lib"
"-Wl,-L${libcCross.out}${libcCross.libdir or "/lib"}"
] ++ (if crossStageStatic then [
"-B${libcCross.out}/lib"
"-B${libcCross.out}${libcCross.libdir or "/lib"}"
] else [
"-Wl,-rpath,${libcCross.out}/lib"
"-Wl,-rpath-link,${libcCross.out}/lib"
]) ++ optionals (libpthreadCross != null) [
"-L${libpthreadCross}/lib"
"-Wl,${libpthreadCross.TARGET_LDFLAGS}"
]);
"-Wl,-rpath,${libcCross.out}${libcCross.libdir or "/lib"}"
"-Wl,-rpath-link,${libcCross.out}${libcCross.libdir or "/lib"}"
]));
passthru =
{ inherit langC langCC langObjC langObjCpp langAda langFortran langVhdl langGo version; isGNU = true; };
{ inherit langC langCC langObjC langObjCpp langFortran langGo version; isGNU = true; };
inherit enableParallelBuilding enableMultilib;
@@ -493,15 +424,12 @@ stdenv.mkDerivation ({
compiler used in the GNU system including the GNU/Linux variant.
'';
maintainers = with stdenv.lib.maintainers; [ viric peti ];
maintainers = with stdenv.lib.maintainers; [ peti ];
# gnatboot is not available out of linux platforms, so we disable the darwin build
# for the gnat (ada compiler).
platforms =
stdenv.lib.platforms.linux ++
stdenv.lib.platforms.freebsd ++
stdenv.lib.platforms.illumos ++
optionals (langAda == false) stdenv.lib.platforms.darwin;
stdenv.lib.platforms.illumos;
};
}
@@ -510,9 +438,6 @@ stdenv.mkDerivation ({
installTargets = "install-gcc install-target-libgcc";
}
# Strip kills static libs of other archs (hence targetPlatform != hostPlatform)
// optionalAttrs (!stripped || targetPlatform != hostPlatform) { dontStrip = true; }
// optionalAttrs (enableMultilib) { dontMoveLib64 = true; }
// optionalAttrs (langJava) {
+57 -142
View File
@@ -1,10 +1,8 @@
{ stdenv, targetPackages, fetchurl, fetchpatch, noSysDirs
, langC ? true, langCC ? true, langFortran ? false
, langObjC ? targetPlatform.isDarwin
, langObjCpp ? targetPlatform.isDarwin
, langObjC ? stdenv.targetPlatform.isDarwin
, langObjCpp ? stdenv.targetPlatform.isDarwin
, langJava ? false
, langAda ? false
, langVhdl ? false
, langGo ? false
, profiledCompiler ? false
, staticCompiler ? false
@@ -21,33 +19,28 @@
, libXrender ? null, xproto ? null, renderproto ? null, xextproto ? null
, libXrandr ? null, libXi ? null, inputproto ? null, randrproto ? null
, x11Support ? langJava
, gnatboot ? null
, enableMultilib ? false
, enablePlugin ? hostPlatform == buildPlatform # Whether to support user-supplied plug-ins
, enablePlugin ? stdenv.hostPlatform == stdenv.buildPlatform # Whether to support user-supplied plug-ins
, name ? "gcc"
, libcCross ? null
, crossStageStatic ? false
, gnat ? null
, libpthread ? null, libpthreadCross ? null # required for GNU/Hurd
, stripped ? true
, # Strip kills static libs of other archs (hence no cross)
stripped ? stdenv.hostPlatform == stdenv.buildPlatform
&& stdenv.targetPlatform == stdenv.hostPlatform
, gnused ? null
, cloog # unused; just for compat with gcc4, as we override the parameter on some places
, darwin ? null
, buildPlatform, hostPlatform, targetPlatform
, buildPackages
}:
assert langJava -> zip != null && unzip != null
&& zlib != null && boehmgc != null
&& perl != null; # for `--enable-java-home'
assert langAda -> gnatboot != null;
assert langVhdl -> gnat != null;
# LTO needs libelf and zlib.
assert libelf != null -> zlib != null;
# Make sure we get GNU sed.
assert hostPlatform.isDarwin -> gnused != null;
assert stdenv.hostPlatform.isDarwin -> gnused != null;
# The go frontend is written in c++
assert langGo -> langCC;
@@ -58,23 +51,16 @@ with builtins;
let version = "5.5.0";
sha256 = "11zd1hgzkli3b2v70qsm2hyqppngd4616qc96lmm9zl2kl9yl32k";
# Whether building a cross-compiler for GNU/Hurd.
crossGNU = targetPlatform != hostPlatform && targetPlatform.config == "i586-pc-gnu";
enableParallelBuilding = true;
inherit (stdenv) buildPlatform hostPlatform targetPlatform;
patches =
[ ../use-source-date-epoch.patch ]
++ optional (targetPlatform != hostPlatform) ../libstdc++-target.patch
++ optional noSysDirs ../no-sys-dirs.patch
# The GNAT Makefiles did not pay attention to CFLAGS_FOR_TARGET for its
# target libraries and tools.
++ optional langAda ../gnat-cflags.patch
++ optional langFortran ../gfortran-driving.patch
# This could be applied unconditionally but I don't want to cause a full
# Linux rebuild.
++ optional stdenv.cc.isClang ./libcxx38-and-above.patch
++ optional (targetPlatform.libc == "musl") ../libgomp-dont-force-initial-exec.patch
++ optional stdenv.hostPlatform.isMusl (fetchpatch {
url = https://raw.githubusercontent.com/richfelker/musl-cross-make/e84b1bd1fc12a3def33111ca6df522cd6e5ec361/patches/gcc-5.3.0/0001-musl.diff;
sha256 = "0pppbf8myi2kjhm3z3479ihn1cm60kycfv60gj8yy1bs0pl1qcfm";
@@ -103,22 +89,6 @@ let version = "5.5.0";
javaAwtGtk = langJava && x11Support;
/* Platform flags */
platformFlags = let
gccArch = targetPlatform.platform.gcc.arch or null;
gccCpu = targetPlatform.platform.gcc.cpu or null;
gccAbi = targetPlatform.platform.gcc.abi or null;
gccFpu = targetPlatform.platform.gcc.fpu or null;
gccFloat = targetPlatform.platform.gcc.float or null;
gccMode = targetPlatform.platform.gcc.mode or null;
in
optional (gccArch != null) "--with-arch=${gccArch}" ++
optional (gccCpu != null) "--with-cpu=${gccCpu}" ++
optional (gccAbi != null) "--with-abi=${gccAbi}" ++
optional (gccFpu != null) "--with-fpu=${gccFpu}" ++
optional (gccFloat != null) "--with-float=${gccFloat}" ++
optional (gccMode != null) "--with-mode=${gccMode}";
/* Cross-gcc settings (build == host != target) */
crossMingw = targetPlatform != hostPlatform && targetPlatform.libc == "msvcrt";
crossDarwin = targetPlatform != hostPlatform && targetPlatform.libc == "libSystem";
@@ -138,6 +108,7 @@ let version = "5.5.0";
"--enable-sjlj-exceptions"
"--enable-threads=win32"
"--disable-win32-registry"
"--disable-libmpx" # requires libc
] else if crossStageStatic then [
"--disable-libssp"
"--disable-nls"
@@ -146,11 +117,12 @@ let version = "5.5.0";
"--disable-libgomp"
"--disable-libquadmath"
"--disable-shared"
"--disable-libatomic" # libatomic requires libc
"--disable-decimal-float" # libdecnumber requires libc
"--disable-libatomic" # requires libc
"--disable-decimal-float" # requires libc
"--disable-libmpx" # requires libc
] else [
(if crossDarwin then "--with-sysroot=${getLib libcCross}/share/sysroot"
else "--with-headers=${getDev libcCross}/include")
else "--with-headers=${getDev libcCross}${libcCross.incdir or "/include"}")
"--enable-__cxa_atexit"
"--enable-long-long"
] ++
@@ -171,13 +143,18 @@ let version = "5.5.0";
# In uclibc cases, libgomp needs an additional '-ldl'
# and as I don't know how to pass it, I disable libgomp.
"--disable-libgomp"
] ++ [
"--enable-threads=posix"
"--enable-nls"
"--disable-decimal-float" # No final libdecnumber (it may work only in 386)
]
++ optional (targetPlatform.libc == "newlib") "--with-newlib"
++ optional (targetPlatform.libc == "avrlibc") "--with-avrlibc"
++ [
"--enable-threads=${if targetPlatform.isUnix then "posix"
else if targetPlatform.isWindows then "win32"
else "single"}"
"--enable-nls"
"--disable-decimal-float" # No final libdecnumber (it may work only in 386)
]));
stageNameAddon = if crossStageStatic then "-stage-static" else "-stage-final";
crossNameAddon = if targetPlatform != hostPlatform then "-${targetPlatform.config}" + stageNameAddon else "";
crossNameAddon = if targetPlatform != hostPlatform then "${targetPlatform.config}${stageNameAddon}-" else "";
bootstrap = targetPlatform == hostPlatform;
@@ -187,7 +164,7 @@ in
assert x11Support -> (filter (x: x == null) ([ gtk2 libart_lgpl ] ++ xlibs)) == [];
stdenv.mkDerivation ({
name = "${name}${if stripped then "" else "-debug"}-${version}" + crossNameAddon;
name = crossNameAddon + "${name}${if stripped then "" else "-debug"}-${version}";
builder = ../builder.sh;
@@ -204,7 +181,7 @@ stdenv.mkDerivation ({
libc_dev = stdenv.cc.libc_dev;
hardeningDisable = [ "format" ];
hardeningDisable = [ "format" ] ++ stdenv.lib.optional stdenv.targetPlatform.isMusl "pie";
# This should kill all the stdinc frameworks that gcc and friends like to
# insert into default search paths.
@@ -220,43 +197,7 @@ stdenv.mkDerivation ({
'';
postPatch =
if (hostPlatform.isHurd
|| (libcCross != null # e.g., building `gcc.crossDrv'
&& libcCross ? crossConfig
&& libcCross.crossConfig == "i586-pc-gnu")
|| (crossGNU && libcCross != null))
then
# On GNU/Hurd glibc refers to Hurd & Mach headers and libpthread is not
# in glibc, so add the right `-I' flags to the default spec string.
assert libcCross != null -> libpthreadCross != null;
let
libc = if libcCross != null then libcCross else stdenv.glibc;
gnu_h = "gcc/config/gnu.h";
extraCPPDeps =
libc.propagatedBuildInputs
++ stdenv.lib.optional (libpthreadCross != null) libpthreadCross
++ stdenv.lib.optional (libpthread != null) libpthread;
extraCPPSpec =
concatStrings (intersperse " "
(map (x: "-I${x.dev or x}/include") extraCPPDeps));
extraLibSpec =
if libpthreadCross != null
then "-L${libpthreadCross}/lib ${libpthreadCross.TARGET_LDFLAGS}"
else "-L${libpthread}/lib";
in
'' echo "augmenting \`CPP_SPEC' in \`${gnu_h}' with \`${extraCPPSpec}'..."
sed -i "${gnu_h}" \
-es'|CPP_SPEC *"\(.*\)$|CPP_SPEC "${extraCPPSpec} \1|g'
echo "augmenting \`LIB_SPEC' in \`${gnu_h}' with \`${extraLibSpec}'..."
sed -i "${gnu_h}" \
-es'|LIB_SPEC *"\(.*\)$|LIB_SPEC "${extraLibSpec} \1|g'
echo "setting \`NATIVE_SYSTEM_HEADER_DIR' and \`STANDARD_INCLUDE_DIR' to \`${libc.dev}/include'..."
sed -i "${gnu_h}" \
-es'|#define STANDARD_INCLUDE_DIR.*$|#define STANDARD_INCLUDE_DIR "${libc.dev}/include"|g'
''
else if targetPlatform != hostPlatform || stdenv.cc.libc != null then
if targetPlatform != hostPlatform || stdenv.cc.libc != null then
# On NixOS, use the right path to the dynamic linker instead of
# `/lib/ld*.so'.
let
@@ -280,9 +221,7 @@ stdenv.mkDerivation ({
)
else null;
# TODO(@Ericson2314): Make passthru instead. Weird to avoid mass rebuild,
crossStageStatic = targetPlatform == hostPlatform || crossStageStatic;
inherit noSysDirs staticCompiler langJava
inherit noSysDirs staticCompiler langJava crossStageStatic
libcCross crossMingw;
depsBuildBuild = [ buildPackages.stdenv.cc ];
@@ -306,8 +245,6 @@ stdenv.mkDerivation ({
++ (optionals langJava [ boehmgc zip unzip ])
++ (optionals javaAwtGtk ([ gtk2 libart_lgpl ] ++ xlibs))
++ (optionals (targetPlatform != hostPlatform) [targetPackages.stdenv.cc.bintools])
++ (optionals langAda [gnatboot])
++ (optionals langVhdl [gnat])
# The builder relies on GNU sed (for instance, Darwin's `sed' fails with
# "-i may not be used with stdin"), and `stdenvNative' doesn't provide it.
@@ -327,11 +264,7 @@ stdenv.mkDerivation ({
dontDisableStatic = true;
# TODO(@Ericson2314): Always pass "--target" and always prefix.
configurePlatforms =
# TODO(@Ericson2314): Figure out what's going wrong with Arm
if buildPlatform == hostPlatform && hostPlatform == targetPlatform && targetPlatform.isArm
then []
else [ "build" "host" ] ++ stdenv.lib.optional (targetPlatform != hostPlatform) "target";
configurePlatforms = [ "build" "host" ] ++ stdenv.lib.optional (targetPlatform != hostPlatform) "target";
configureFlags =
# Basic dependencies
@@ -344,7 +277,7 @@ stdenv.mkDerivation ({
] ++
optional (libelf != null) "--with-libelf=${libelf}" ++
optional (!(crossMingw && crossStageStatic))
"--with-native-system-header-dir=${getDev stdenv.cc.libc}/include" ++
"--with-native-system-header-dir=${getDev stdenv.cc.libc}/include" ++
# Basic configuration
[
@@ -359,8 +292,6 @@ stdenv.mkDerivation ({
++ optional langCC "c++"
++ optional langFortran "fortran"
++ optional langJava "java"
++ optional langAda "ada"
++ optional langVhdl "vhdl"
++ optional langGo "go"
++ optional langObjC "objc"
++ optional langObjCpp "obj-c++"
@@ -370,7 +301,7 @@ stdenv.mkDerivation ({
}"
] ++
(if enableMultilib
(if (enableMultilib || targetPlatform.isAvr)
then ["--enable-multilib" "--disable-libquadmath"]
else ["--disable-multilib"]) ++
optional (!enableShared) "--disable-shared" ++
@@ -393,10 +324,7 @@ stdenv.mkDerivation ({
optional javaAwtGtk "--enable-java-awt=gtk" ++
optional (langJava && javaAntlr != null) "--with-antlr-jar=${javaAntlr}" ++
# Ada
optional langAda "--enable-libada" ++
platformFlags ++
(import ../common/platform-flags.nix { inherit (stdenv) lib targetPlatform; }) ++
optional (targetPlatform != hostPlatform) crossConfigureFlags ++
optional (!bootstrap) "--disable-bootstrap" ++
@@ -407,26 +335,29 @@ stdenv.mkDerivation ({
# On Illumos/Solaris GNU as is preferred
"--with-gnu-as" "--without-gnu-ld"
]
++ optional (targetPlatform == hostPlatform && targetPlatform.libc == "musl") "--disable-libsanitizer"
++ optionals (targetPlatform == hostPlatform && targetPlatform.libc == "musl") [
"--disable-libsanitizer"
"--disable-symvers"
"libat_cv_have_ifunc=no"
"--disable-gnu-indirect-function"
]
;
targetConfig = if targetPlatform != hostPlatform then targetPlatform.config else null;
buildFlags = if bootstrap then
(if profiledCompiler then "profiledbootstrap" else "bootstrap")
else "";
buildFlags = optional
(bootstrap && hostPlatform == buildPlatform)
(if profiledCompiler then "profiledbootstrap" else "bootstrap");
dontStrip = !stripped;
doCheck = false; # requires a lot of tools, causes a dependency cycle for stdenv
installTargets =
if stripped
then "install-strip"
else "install";
/* For cross-built gcc (build != host == target) */
crossAttrs = {
dontStrip = true;
buildFlags = "";
};
# http://gcc.gnu.org/install/specific.html#x86-64-x-solaris210
${if hostPlatform.system == "x86_64-solaris" then "CC" else null} = "gcc -m64";
@@ -449,13 +380,6 @@ stdenv.mkDerivation ({
++ optional langJava boehmgc
++ optionals javaAwtGtk xlibs
++ optionals javaAwtGtk [ gmp mpfr ]
++ optional (libpthread != null) libpthread
++ optional (libpthreadCross != null) libpthreadCross
# On GNU/Hurd glibc refers to Mach & Hurd
# headers.
++ optionals (libcCross != null && libcCross ? propagatedBuildInputs)
libcCross.propagatedBuildInputs
));
LIBRARY_PATH = optionals (targetPlatform == hostPlatform) (makeLibraryPath ([]
@@ -463,33 +387,29 @@ stdenv.mkDerivation ({
++ optional langJava boehmgc
++ optionals javaAwtGtk xlibs
++ optionals javaAwtGtk [ gmp mpfr ]
++ optional (libpthread != null) libpthread)
);
));
EXTRA_TARGET_FLAGS = optionals
(targetPlatform != hostPlatform && libcCross != null)
([
"-idirafter ${getDev libcCross}/include"
"-idirafter ${getDev libcCross}${libcCross.incdir or "/include"}"
] ++ optionals (! crossStageStatic) [
"-B${libcCross.out}/lib"
"-B${libcCross.out}${libcCross.libdir or "/lib"}"
]);
EXTRA_TARGET_LDFLAGS = optionals
(targetPlatform != hostPlatform && libcCross != null)
([
"-Wl,-L${libcCross.out}/lib"
"-Wl,-L${libcCross.out}${libcCross.libdir or "/lib"}"
] ++ (if crossStageStatic then [
"-B${libcCross.out}/lib"
"-B${libcCross.out}${libcCross.libdir or "/lib"}"
] else [
"-Wl,-rpath,${libcCross.out}/lib"
"-Wl,-rpath-link,${libcCross.out}/lib"
]) ++ optionals (libpthreadCross != null) [
"-L${libpthreadCross}/lib"
"-Wl,${libpthreadCross.TARGET_LDFLAGS}"
]);
"-Wl,-rpath,${libcCross.out}${libcCross.libdir or "/lib"}"
"-Wl,-rpath-link,${libcCross.out}${libcCross.libdir or "/lib"}"
]));
passthru =
{ inherit langC langCC langObjC langObjCpp langAda langFortran langVhdl langGo version; isGNU = true; };
{ inherit langC langCC langObjC langObjCpp langFortran langGo version; isGNU = true; };
inherit enableParallelBuilding enableMultilib;
@@ -510,14 +430,12 @@ stdenv.mkDerivation ({
compiler used in the GNU system including the GNU/Linux variant.
'';
maintainers = with stdenv.lib.maintainers; [ viric peti ];
maintainers = with stdenv.lib.maintainers; [ peti ];
# gnatboot is not available out of linux platforms, so we disable the darwin build
# for the gnat (ada compiler).
platforms =
stdenv.lib.platforms.linux ++
stdenv.lib.platforms.freebsd ++
optionals (langAda == false) stdenv.lib.platforms.darwin;
stdenv.lib.platforms.darwin;
};
}
@@ -526,8 +444,5 @@ stdenv.mkDerivation ({
installTargets = "install-gcc install-target-libgcc";
}
# Strip kills static libs of other archs (hence targetPlatform != hostPlatform)
// optionalAttrs (!stripped || targetPlatform != hostPlatform) { dontStrip = true; }
// optionalAttrs (enableMultilib) { dontMoveLib64 = true; }
)
@@ -1,46 +0,0 @@
This is a slightly modified version of https://svnweb.freebsd.org/ports/head/lang/gcc5/files/patch-libc%2B%2B?revision=432958&view=co&pathrev=432958,
which doesn't apply cleanly due to them using a slightly different format of patch from us. I just replaced the .orig file references with a/b paths.
--- a/gcc/auto-profile.c 2015-01-18 02:25:42 UTC
+++ b/gcc/auto-profile.c
@@ -19,11 +19,9 @@ along with GCC; see the file COPYING3.
<http://www.gnu.org/licenses/>. */
#include "config.h"
-#include "system.h"
-
-#include <string.h>
#include <map>
#include <set>
+#include "system.h"
#include "coretypes.h"
#include "hash-set.h"
--- a/gcc/graphite-isl-ast-to-gimple.c 2017-01-19 21:02:12 UTC
+++ b/gcc/graphite-isl-ast-to-gimple.c
@@ -38,6 +38,7 @@ extern "C" {
#endif
#endif
+#include <map>
#include "system.h"
#include "coretypes.h"
#include "hash-set.h"
@@ -75,7 +76,6 @@ extern "C" {
#include "tree-scalar-evolution.h"
#include "gimple-ssa.h"
#include "tree-into-ssa.h"
-#include <map>
#ifdef HAVE_isl
#include "graphite-poly.h"
--- a/gcc/system.h 2015-01-05 12:33:28 UTC
+++ b/gcc/system.h
@@ -217,6 +217,7 @@ extern int errno;
#ifdef __cplusplus
# include <algorithm>
# include <cstring>
+# include <new>
# include <utility>
#endif
+56 -140
View File
@@ -1,10 +1,8 @@
{ stdenv, targetPackages, fetchurl, noSysDirs
, langC ? true, langCC ? true, langFortran ? false
, langObjC ? targetPlatform.isDarwin
, langObjCpp ? targetPlatform.isDarwin
, langObjC ? stdenv.targetPlatform.isDarwin
, langObjCpp ? stdenv.targetPlatform.isDarwin
, langJava ? false
, langAda ? false
, langVhdl ? false
, langGo ? false
, profiledCompiler ? false
, staticCompiler ? false
@@ -21,33 +19,28 @@
, libXrender ? null, xproto ? null, renderproto ? null, xextproto ? null
, libXrandr ? null, libXi ? null, inputproto ? null, randrproto ? null
, x11Support ? langJava
, gnatboot ? null
, enableMultilib ? false
, enablePlugin ? hostPlatform == buildPlatform # Whether to support user-supplied plug-ins
, enablePlugin ? stdenv.hostPlatform == stdenv.buildPlatform # Whether to support user-supplied plug-ins
, name ? "gcc"
, libcCross ? null
, crossStageStatic ? false
, gnat ? null
, libpthread ? null, libpthreadCross ? null # required for GNU/Hurd
, stripped ? true
, # Strip kills static libs of other archs (hence no cross)
stripped ? stdenv.hostPlatform == stdenv.buildPlatform
&& stdenv.targetPlatform == stdenv.hostPlatform
, gnused ? null
, cloog # unused; just for compat with gcc4, as we override the parameter on some places
, darwin ? null
, buildPlatform, hostPlatform, targetPlatform
, buildPackages
}:
assert langJava -> zip != null && unzip != null
&& zlib != null && boehmgc != null
&& perl != null; # for `--enable-java-home'
assert langAda -> gnatboot != null;
assert langVhdl -> gnat != null;
# LTO needs libelf and zlib.
assert libelf != null -> zlib != null;
# Make sure we get GNU sed.
assert hostPlatform.isDarwin -> gnused != null;
assert stdenv.hostPlatform.isDarwin -> gnused != null;
# The go frontend is written in c++
assert langGo -> langCC;
@@ -57,21 +50,18 @@ with builtins;
let version = "6.4.0";
# Whether building a cross-compiler for GNU/Hurd.
crossGNU = targetPlatform != hostPlatform && targetPlatform.config == "i586-pc-gnu";
enableParallelBuilding = true;
inherit (stdenv) buildPlatform hostPlatform targetPlatform;
patches =
[ ../use-source-date-epoch.patch ]
++ optional (targetPlatform != hostPlatform) ../libstdc++-target.patch
++ optional noSysDirs ../no-sys-dirs.patch
# The GNAT Makefiles did not pay attention to CFLAGS_FOR_TARGET for its
# target libraries and tools.
++ optional langAda ../gnat-cflags.patch
++ optional langFortran ../gfortran-driving.patch
++ [ ../struct-ucontext.patch ../struct-sigaltstack.patch ] # glibc-2.26
++ optional langJava [ ../struct-ucontext-libjava.patch ] # glibc-2.26
++ optional (targetPlatform.libc == "musl") ../libgomp-dont-force-initial-exec.patch
;
javaEcj = fetchurl {
@@ -97,22 +87,6 @@ let version = "6.4.0";
javaAwtGtk = langJava && x11Support;
/* Platform flags */
platformFlags = let
gccArch = targetPlatform.platform.gcc.arch or null;
gccCpu = targetPlatform.platform.gcc.cpu or null;
gccAbi = targetPlatform.platform.gcc.abi or null;
gccFpu = targetPlatform.platform.gcc.fpu or null;
gccFloat = targetPlatform.platform.gcc.float or null;
gccMode = targetPlatform.platform.gcc.mode or null;
in
optional (gccArch != null) "--with-arch=${gccArch}" ++
optional (gccCpu != null) "--with-cpu=${gccCpu}" ++
optional (gccAbi != null) "--with-abi=${gccAbi}" ++
optional (gccFpu != null) "--with-fpu=${gccFpu}" ++
optional (gccFloat != null) "--with-float=${gccFloat}" ++
optional (gccMode != null) "--with-mode=${gccMode}";
/* Cross-gcc settings (build == host != target) */
crossMingw = targetPlatform != hostPlatform && targetPlatform.libc == "msvcrt";
crossDarwin = targetPlatform != hostPlatform && targetPlatform.libc == "libSystem";
@@ -132,6 +106,7 @@ let version = "6.4.0";
"--enable-sjlj-exceptions"
"--enable-threads=win32"
"--disable-win32-registry"
"--disable-libmpx" # requires libc
] else if crossStageStatic then [
"--disable-libssp"
"--disable-nls"
@@ -140,14 +115,12 @@ let version = "6.4.0";
"--disable-libgomp"
"--disable-libquadmath"
"--disable-shared"
"--disable-libatomic" # libatomic requires libc
"--disable-decimal-float" # libdecnumber requires libc
# maybe only needed on musl, PATH_MAX
# https://github.com/richfelker/musl-cross-make/blob/0867cdf300618d1e3e87a0a939fa4427207ad9d7/litecross/Makefile#L62
"--disable-libmpx"
"--disable-libatomic" # requires libc
"--disable-decimal-float" # requires libc
"--disable-libmpx" # requires libc
] else [
(if crossDarwin then "--with-sysroot=${getLib libcCross}/share/sysroot"
else "--with-headers=${getDev libcCross}/include")
else "--with-headers=${getDev libcCross}${libcCross.incdir or "/include"}")
"--enable-__cxa_atexit"
"--enable-long-long"
] ++
@@ -170,13 +143,18 @@ let version = "6.4.0";
"--disable-libgomp"
# musl at least, disable: https://git.buildroot.net/buildroot/commit/?id=873d4019f7fb00f6a80592224236b3ba7d657865
"--disable-libmpx"
] ++ [
"--enable-threads=posix"
"--enable-nls"
"--disable-decimal-float" # No final libdecnumber (it may work only in 386)
]
++ optional (targetPlatform.libc == "newlib") "--with-newlib"
++ optional (targetPlatform.libc == "avrlibc") "--with-avrlibc"
++ [
"--enable-threads=${if targetPlatform.isUnix then "posix"
else if targetPlatform.isWindows then "win32"
else "single"}"
"--enable-nls"
"--disable-decimal-float" # No final libdecnumber (it may work only in 386)
]));
stageNameAddon = if crossStageStatic then "-stage-static" else "-stage-final";
crossNameAddon = if targetPlatform != hostPlatform then "-${targetPlatform.config}" + stageNameAddon else "";
crossNameAddon = if targetPlatform != hostPlatform then "${targetPlatform.config}${stageNameAddon}-" else "";
bootstrap = targetPlatform == hostPlatform;
@@ -186,7 +164,7 @@ in
assert x11Support -> (filter (x: x == null) ([ gtk2 libart_lgpl ] ++ xlibs)) == [];
stdenv.mkDerivation ({
name = "${name}${if stripped then "" else "-debug"}-${version}" + crossNameAddon;
name = crossNameAddon + "${name}${if stripped then "" else "-debug"}-${version}";
builder = ../builder.sh;
@@ -204,7 +182,7 @@ stdenv.mkDerivation ({
libc_dev = stdenv.cc.libc_dev;
hardeningDisable = [ "format" ];
hardeningDisable = [ "format" ] ++ stdenv.lib.optional stdenv.targetPlatform.isMusl "pie";
# This should kill all the stdinc frameworks that gcc and friends like to
# insert into default search paths.
@@ -220,43 +198,7 @@ stdenv.mkDerivation ({
'';
postPatch =
if (hostPlatform.isHurd
|| (libcCross != null # e.g., building `gcc.crossDrv'
&& libcCross ? crossConfig
&& libcCross.crossConfig == "i586-pc-gnu")
|| (crossGNU && libcCross != null))
then
# On GNU/Hurd glibc refers to Hurd & Mach headers and libpthread is not
# in glibc, so add the right `-I' flags to the default spec string.
assert libcCross != null -> libpthreadCross != null;
let
libc = if libcCross != null then libcCross else stdenv.glibc;
gnu_h = "gcc/config/gnu.h";
extraCPPDeps =
libc.propagatedBuildInputs
++ stdenv.lib.optional (libpthreadCross != null) libpthreadCross
++ stdenv.lib.optional (libpthread != null) libpthread;
extraCPPSpec =
concatStrings (intersperse " "
(map (x: "-I${x.dev or x}/include") extraCPPDeps));
extraLibSpec =
if libpthreadCross != null
then "-L${libpthreadCross}/lib ${libpthreadCross.TARGET_LDFLAGS}"
else "-L${libpthread}/lib";
in
'' echo "augmenting \`CPP_SPEC' in \`${gnu_h}' with \`${extraCPPSpec}'..."
sed -i "${gnu_h}" \
-es'|CPP_SPEC *"\(.*\)$|CPP_SPEC "${extraCPPSpec} \1|g'
echo "augmenting \`LIB_SPEC' in \`${gnu_h}' with \`${extraLibSpec}'..."
sed -i "${gnu_h}" \
-es'|LIB_SPEC *"\(.*\)$|LIB_SPEC "${extraLibSpec} \1|g'
echo "setting \`NATIVE_SYSTEM_HEADER_DIR' and \`STANDARD_INCLUDE_DIR' to \`${libc.dev}/include'..."
sed -i "${gnu_h}" \
-es'|#define STANDARD_INCLUDE_DIR.*$|#define STANDARD_INCLUDE_DIR "${libc.dev}/include"|g'
''
else if targetPlatform != hostPlatform || stdenv.cc.libc != null then
if targetPlatform != hostPlatform || stdenv.cc.libc != null then
# On NixOS, use the right path to the dynamic linker instead of
# `/lib/ld*.so'.
let
@@ -280,9 +222,7 @@ stdenv.mkDerivation ({
)
else null;
# TODO(@Ericson2314): Make passthru instead. Weird to avoid mass rebuild,
crossStageStatic = targetPlatform == hostPlatform || crossStageStatic;
inherit noSysDirs staticCompiler langJava
inherit noSysDirs staticCompiler langJava crossStageStatic
libcCross crossMingw;
depsBuildBuild = [ buildPackages.stdenv.cc ];
@@ -306,8 +246,6 @@ stdenv.mkDerivation ({
++ (optionals langJava [ boehmgc zip unzip ])
++ (optionals javaAwtGtk ([ gtk2 libart_lgpl ] ++ xlibs))
++ (optionals (targetPlatform != hostPlatform) [targetPackages.stdenv.cc.bintools])
++ (optionals langAda [gnatboot])
++ (optionals langVhdl [gnat])
# The builder relies on GNU sed (for instance, Darwin's `sed' fails with
# "-i may not be used with stdin"), and `stdenvNative' doesn't provide it.
@@ -331,11 +269,7 @@ stdenv.mkDerivation ({
dontDisableStatic = true;
# TODO(@Ericson2314): Always pass "--target" and always prefix.
configurePlatforms =
# TODO(@Ericson2314): Figure out what's going wrong with Arm
if buildPlatform == hostPlatform && hostPlatform == targetPlatform && targetPlatform.isArm
then []
else [ "build" "host" ] ++ stdenv.lib.optional (targetPlatform != hostPlatform) "target";
configurePlatforms = [ "build" "host" ] ++ stdenv.lib.optional (targetPlatform != hostPlatform) "target";
configureFlags =
# Basic dependencies
@@ -363,8 +297,6 @@ stdenv.mkDerivation ({
++ optional langCC "c++"
++ optional langFortran "fortran"
++ optional langJava "java"
++ optional langAda "ada"
++ optional langVhdl "vhdl"
++ optional langGo "go"
++ optional langObjC "objc"
++ optional langObjCpp "obj-c++"
@@ -374,7 +306,7 @@ stdenv.mkDerivation ({
}"
] ++
(if enableMultilib
(if (enableMultilib || targetPlatform.isAvr)
then ["--enable-multilib" "--disable-libquadmath"]
else ["--disable-multilib"]) ++
optional (!enableShared) "--disable-shared" ++
@@ -397,10 +329,7 @@ stdenv.mkDerivation ({
optional javaAwtGtk "--enable-java-awt=gtk" ++
optional (langJava && javaAntlr != null) "--with-antlr-jar=${javaAntlr}" ++
# Ada
optional langAda "--enable-libada" ++
platformFlags ++
(import ../common/platform-flags.nix { inherit (stdenv) lib targetPlatform; }) ++
optional (targetPlatform != hostPlatform) crossConfigureFlags ++
optional (!bootstrap) "--disable-bootstrap" ++
@@ -411,25 +340,29 @@ stdenv.mkDerivation ({
# On Illumos/Solaris GNU as is preferred
"--with-gnu-as" "--without-gnu-ld"
]
++ optional (targetPlatform == hostPlatform && targetPlatform.libc == "musl") "--disable-libsanitizer"
++ optionals (targetPlatform == hostPlatform && targetPlatform.libc == "musl") [
"--disable-libsanitizer"
"--disable-symvers"
"libat_cv_have_ifunc=no"
"--disable-gnu-indirect-function"
]
;
targetConfig = if targetPlatform != hostPlatform then targetPlatform.config else null;
buildFlags =
optional bootstrap (if profiledCompiler then "profiledbootstrap" else "bootstrap");
buildFlags = optional
(bootstrap && hostPlatform == buildPlatform)
(if profiledCompiler then "profiledbootstrap" else "bootstrap");
dontStrip = !stripped;
doCheck = false; # requires a lot of tools, causes a dependency cycle for stdenv
installTargets =
if stripped
then "install-strip"
else "install";
/* For cross-built gcc (build != host == target) */
crossAttrs = {
dontStrip = true;
buildFlags = "";
};
# http://gcc.gnu.org/install/specific.html#x86-64-x-solaris210
${if hostPlatform.system == "x86_64-solaris" then "CC" else null} = "gcc -m64";
@@ -452,47 +385,35 @@ stdenv.mkDerivation ({
++ optional langJava boehmgc
++ optionals javaAwtGtk xlibs
++ optionals javaAwtGtk [ gmp mpfr ]
++ optional (libpthread != null) libpthread
++ optional (libpthreadCross != null) libpthreadCross
# On GNU/Hurd glibc refers to Mach & Hurd
# headers.
++ optionals (libcCross != null && libcCross ? propagatedBuildInputs)
libcCross.propagatedBuildInputs
));
LIBRARY_PATH = optionals (targetPlatform == hostPlatform) (makeLibraryPath ([]
++ optional (zlib != null) zlib
++ optional langJava boehmgc
++ optionals javaAwtGtk xlibs
++ optionals javaAwtGtk [ gmp mpfr ]
++ optional (libpthread != null) libpthread)
);
++ optionals javaAwtGtk [ gmp mpfr ]));
EXTRA_TARGET_FLAGS = optionals
(targetPlatform != hostPlatform && libcCross != null)
([
"-idirafter ${getDev libcCross}/include"
"-idirafter ${getDev libcCross}${libcCross.incdir or "/include"}"
] ++ optionals (! crossStageStatic) [
"-B${libcCross.out}/lib"
"-B${libcCross.out}${libcCross.libdir or "/lib"}"
]);
EXTRA_TARGET_LDFLAGS = optionals
(targetPlatform != hostPlatform && libcCross != null)
([
"-Wl,-L${libcCross.out}/lib"
"-Wl,-L${libcCross.out}${libcCross.libdir or "/lib"}"
] ++ (if crossStageStatic then [
"-B${libcCross.out}/lib"
"-B${libcCross.out}${libcCross.libdir or "/lib"}"
] else [
"-Wl,-rpath,${libcCross.out}/lib"
"-Wl,-rpath-link,${libcCross.out}/lib"
]) ++ optionals (libpthreadCross != null) [
"-L${libpthreadCross}/lib"
"-Wl,${libpthreadCross.TARGET_LDFLAGS}"
]);
"-Wl,-rpath,${libcCross.out}${libcCross.libdir or "/lib"}"
"-Wl,-rpath-link,${libcCross.out}${libcCross.libdir or "/lib"}"
]));
passthru =
{ inherit langC langCC langObjC langObjCpp langAda langFortran langVhdl langGo version; isGNU = true; };
{ inherit langC langCC langObjC langObjCpp langFortran langGo version; isGNU = true; };
inherit enableParallelBuilding enableMultilib;
@@ -513,14 +434,12 @@ stdenv.mkDerivation ({
compiler used in the GNU system including the GNU/Linux variant.
'';
maintainers = with stdenv.lib.maintainers; [ viric peti ];
maintainers = with stdenv.lib.maintainers; [ peti ];
# gnatboot is not available out of linux platforms, so we disable the darwin build
# for the gnat (ada compiler).
platforms =
stdenv.lib.platforms.linux ++
stdenv.lib.platforms.freebsd ++
optionals (langAda == false) stdenv.lib.platforms.darwin;
stdenv.lib.platforms.darwin;
};
}
@@ -529,9 +448,6 @@ stdenv.mkDerivation ({
installTargets = "install-gcc install-target-libgcc";
}
# Strip kills static libs of other archs (hence targetPlatform != hostPlatform)
// optionalAttrs (!stripped || targetPlatform != hostPlatform) { dontStrip = true; }
// optionalAttrs (enableMultilib) { dontMoveLib64 = true; }
// optionalAttrs (langJava) {
+84 -215
View File
@@ -1,53 +1,35 @@
{ stdenv, targetPackages, fetchurl, fetchpatch, noSysDirs
, langC ? true, langCC ? true, langFortran ? false
, langObjC ? targetPlatform.isDarwin
, langObjCpp ? targetPlatform.isDarwin
, langJava ? false
, langAda ? false
, langVhdl ? false
, langObjC ? stdenv.targetPlatform.isDarwin
, langObjCpp ? stdenv.targetPlatform.isDarwin
, langGo ? false
, profiledCompiler ? false
, staticCompiler ? false
, enableShared ? true
, texinfo ? null
, perl ? null # optional, for texi2pod (then pod2man); required for Java
, perl ? null # optional, for texi2pod (then pod2man)
, gmp, mpfr, libmpc, gettext, which
, libelf # optional, for link-time optimizations (LTO)
, isl ? null # optional, for the Graphite optimization framework.
, zlib ? null, boehmgc ? null
, zip ? null, unzip ? null, pkgconfig ? null
, gtk2 ? null, libart_lgpl ? null
, libX11 ? null, libXt ? null, libSM ? null, libICE ? null, libXtst ? null
, libXrender ? null, xproto ? null, renderproto ? null, xextproto ? null
, libXrandr ? null, libXi ? null, inputproto ? null, randrproto ? null
, x11Support ? langJava
, gnatboot ? null
, zlib ? null
, enableMultilib ? false
, enablePlugin ? hostPlatform == buildPlatform # Whether to support user-supplied plug-ins
, enablePlugin ? stdenv.hostPlatform == stdenv.buildPlatform # Whether to support user-supplied plug-ins
, name ? "gcc"
, libcCross ? null
, crossStageStatic ? false
, gnat ? null
, libpthread ? null, libpthreadCross ? null # required for GNU/Hurd
, stripped ? true
, # Strip kills static libs of other archs (hence no cross)
stripped ? stdenv.hostPlatform == stdenv.buildPlatform
&& stdenv.targetPlatform == stdenv.hostPlatform
, gnused ? null
, cloog # unused; just for compat with gcc4, as we override the parameter on some places
, darwin ? null
, buildPlatform, hostPlatform, targetPlatform
, buildPackages
}:
assert langJava -> zip != null && unzip != null
&& zlib != null && boehmgc != null
&& perl != null; # for `--enable-java-home'
assert langAda -> gnatboot != null;
assert langVhdl -> gnat != null;
# LTO needs libelf and zlib.
assert libelf != null -> zlib != null;
# Make sure we get GNU sed.
assert hostPlatform.isDarwin -> gnused != null;
assert stdenv.hostPlatform.isDarwin -> gnused != null;
# The go frontend is written in c++
assert langGo -> langCC;
@@ -57,62 +39,25 @@ with builtins;
let version = "7.3.0";
# Whether building a cross-compiler for GNU/Hurd.
crossGNU = targetPlatform != hostPlatform && targetPlatform.config == "i586-pc-gnu";
enableParallelBuilding = true;
inherit (stdenv) buildPlatform hostPlatform targetPlatform;
patches =
[ ]
[ # https://gcc.gnu.org/ml/gcc-patches/2018-02/msg00633.html
./riscv-pthread-reentrant.patch
# https://gcc.gnu.org/ml/gcc-patches/2018-03/msg00297.html
./riscv-no-relax.patch
]
++ optional (targetPlatform != hostPlatform) ../libstdc++-target.patch
++ optional noSysDirs ../no-sys-dirs.patch
++ optional (hostPlatform != buildPlatform) (fetchpatch { # XXX: Refine when this should be applied
url = "https://git.busybox.net/buildroot/plain/package/gcc/7.1.0/0900-remove-selftests.patch?id=11271540bfe6adafbc133caf6b5b902a816f5f02";
sha256 = "0mrvxsdwip2p3l17dscpc1x8vhdsciqw1z5q9i6p5g9yg1cqnmgs";
})
# The GNAT Makefiles did not pay attention to CFLAGS_FOR_TARGET for its
# target libraries and tools.
++ optional langAda ../gnat-cflags.patch
++ optional langFortran ../gfortran-driving.patch;
javaEcj = fetchurl {
# The `$(top_srcdir)/ecj.jar' file is automatically picked up at
# `configure' time.
# XXX: Eventually we might want to take it from upstream.
url = "ftp://sourceware.org/pub/java/ecj-4.3.jar";
sha256 = "0jz7hvc0s6iydmhgh5h2m15yza7p2rlss2vkif30vm9y77m97qcx";
};
# Antlr (optional) allows the Java `gjdoc' tool to be built. We want a
# binary distribution here to allow the whole chain to be bootstrapped.
javaAntlr = fetchurl {
url = http://www.antlr.org/download/antlr-4.4-complete.jar;
sha256 = "02lda2imivsvsis8rnzmbrbp8rh1kb8vmq4i67pqhkwz7lf8y6dz";
};
xlibs = [
libX11 libXt libSM libICE libXtst libXrender libXrandr libXi
xproto renderproto xextproto inputproto randrproto
];
javaAwtGtk = langJava && x11Support;
/* Platform flags */
platformFlags = let
gccArch = targetPlatform.platform.gcc.arch or null;
gccCpu = targetPlatform.platform.gcc.cpu or null;
gccAbi = targetPlatform.platform.gcc.abi or null;
gccFpu = targetPlatform.platform.gcc.fpu or null;
gccFloat = targetPlatform.platform.gcc.float or null;
gccMode = targetPlatform.platform.gcc.mode or null;
in
optional (gccArch != null) "--with-arch=${gccArch}" ++
optional (gccCpu != null) "--with-cpu=${gccCpu}" ++
optional (gccAbi != null) "--with-abi=${gccAbi}" ++
optional (gccFpu != null) "--with-fpu=${gccFpu}" ++
optional (gccFloat != null) "--with-float=${gccFloat}" ++
optional (gccMode != null) "--with-mode=${gccMode}";
++ optional langFortran ../gfortran-driving.patch
++ optional (targetPlatform.libc == "musl" && targetPlatform.isPower) ../ppc-musl.patch
++ optional (targetPlatform.libc == "musl") ../libgomp-dont-force-initial-exec.patch;
/* Cross-gcc settings (build == host != target) */
crossMingw = targetPlatform != hostPlatform && targetPlatform.libc == "msvcrt";
@@ -122,7 +67,7 @@ let version = "7.3.0";
[ "--with-as=${targetPackages.stdenv.cc.bintools}/bin/${targetPlatform.config}-as"
"--with-ld=${targetPackages.stdenv.cc.bintools}/bin/${targetPlatform.config}-ld" ] ++
(if crossMingw && crossStageStatic then [
"--with-headers=${libcCross}/include"
"--with-headers=${getDev libcCross}${libcCross.incdir or "/include"}"
"--with-gcc"
"--with-gnu-as"
"--with-gnu-ld"
@@ -133,6 +78,7 @@ let version = "7.3.0";
"--enable-sjlj-exceptions"
"--enable-threads=win32"
"--disable-win32-registry"
"--disable-libmpx" # requires libc
] else if crossStageStatic then [
"--disable-libssp"
"--disable-nls"
@@ -141,14 +87,12 @@ let version = "7.3.0";
"--disable-libgomp"
"--disable-libquadmath"
"--disable-shared"
"--disable-libatomic" # libatomic requires libc
"--disable-decimal-float" # libdecnumber requires libc
# maybe only needed on musl, PATH_MAX
# https://github.com/richfelker/musl-cross-make/blob/0867cdf300618d1e3e87a0a939fa4427207ad9d7/litecross/Makefile#L62
"--disable-libmpx"
"--disable-libatomic" # requires libc
"--disable-decimal-float" # requires libc
"--disable-libmpx" # requires libc
] else [
(if crossDarwin then "--with-sysroot=${getLib libcCross}/share/sysroot"
else "--with-headers=${getDev libcCross}/include")
else "--with-headers=${getDev libcCross}${libcCross.incdir or "/include"}")
"--enable-__cxa_atexit"
"--enable-long-long"
] ++
@@ -171,23 +115,26 @@ let version = "7.3.0";
"--disable-libgomp"
# musl at least, disable: https://git.buildroot.net/buildroot/commit/?id=873d4019f7fb00f6a80592224236b3ba7d657865
"--disable-libmpx"
] ++ [
"--enable-threads=posix"
"--enable-nls"
"--disable-decimal-float" # No final libdecnumber (it may work only in 386)
]));
]
++ optional (targetPlatform.libc == "newlib") "--with-newlib"
++ optional (targetPlatform.libc == "avrlibc") "--with-avrlibc"
++ [
"--enable-threads=${if targetPlatform.isUnix then "posix"
else if targetPlatform.isWindows then "win32"
else "single"}"
"--enable-nls"
# No final libdecnumber (it may work only in 386)
"--disable-decimal-float"
]));
stageNameAddon = if crossStageStatic then "-stage-static" else "-stage-final";
crossNameAddon = if targetPlatform != hostPlatform then "-${targetPlatform.config}" + stageNameAddon else "";
crossNameAddon = if targetPlatform != hostPlatform then "${targetPlatform.config}${stageNameAddon}-" else "";
bootstrap = targetPlatform == hostPlatform;
in
# We need all these X libraries when building AWT with GTK+.
assert x11Support -> (filter (x: x == null) ([ gtk2 libart_lgpl ] ++ xlibs)) == [];
stdenv.mkDerivation ({
name = "${name}${if stripped then "" else "-debug"}-${version}" + crossNameAddon;
name = crossNameAddon + "${name}${if stripped then "" else "-debug"}-${version}";
builder = ../builder.sh;
@@ -204,7 +151,7 @@ stdenv.mkDerivation ({
libc_dev = stdenv.cc.libc_dev;
hardeningDisable = [ "format" ];
hardeningDisable = [ "format" ] ++ stdenv.lib.optional stdenv.targetPlatform.isMusl "pie";
# This should kill all the stdinc frameworks that gcc and friends like to
# insert into default search paths.
@@ -219,44 +166,13 @@ stdenv.mkDerivation ({
--replace "-install_name \\\$rpath/\\\$soname" "-install_name $lib/lib/\\\$soname"
'';
postPatch =
if (hostPlatform.isHurd
|| (libcCross != null # e.g., building `gcc.crossDrv'
&& libcCross ? crossConfig
&& libcCross.crossConfig == "i586-pc-gnu")
|| (crossGNU && libcCross != null))
then
# On GNU/Hurd glibc refers to Hurd & Mach headers and libpthread is not
# in glibc, so add the right `-I' flags to the default spec string.
assert libcCross != null -> libpthreadCross != null;
let
libc = if libcCross != null then libcCross else stdenv.glibc;
gnu_h = "gcc/config/gnu.h";
extraCPPDeps =
libc.propagatedBuildInputs
++ stdenv.lib.optional (libpthreadCross != null) libpthreadCross
++ stdenv.lib.optional (libpthread != null) libpthread;
extraCPPSpec =
concatStrings (intersperse " "
(map (x: "-I${x.dev or x}/include") extraCPPDeps));
extraLibSpec =
if libpthreadCross != null
then "-L${libpthreadCross}/lib ${libpthreadCross.TARGET_LDFLAGS}"
else "-L${libpthread}/lib";
in
'' echo "augmenting \`CPP_SPEC' in \`${gnu_h}' with \`${extraCPPSpec}'..."
sed -i "${gnu_h}" \
-es'|CPP_SPEC *"\(.*\)$|CPP_SPEC "${extraCPPSpec} \1|g'
echo "augmenting \`LIB_SPEC' in \`${gnu_h}' with \`${extraLibSpec}'..."
sed -i "${gnu_h}" \
-es'|LIB_SPEC *"\(.*\)$|LIB_SPEC "${extraLibSpec} \1|g'
echo "setting \`NATIVE_SYSTEM_HEADER_DIR' and \`STANDARD_INCLUDE_DIR' to \`${libc.dev}/include'..."
sed -i "${gnu_h}" \
-es'|#define STANDARD_INCLUDE_DIR.*$|#define STANDARD_INCLUDE_DIR "${libc.dev}/include"|g'
''
else if targetPlatform != hostPlatform || stdenv.cc.libc != null then
postPatch = ''
configureScripts=$(find . -name configure)
for configureScript in $configureScripts; do
patchShebangs $configureScript
done
'' + (
if targetPlatform != hostPlatform || stdenv.cc.libc != null then
# On NixOS, use the right path to the dynamic linker instead of
# `/lib/ld*.so'.
let
@@ -278,17 +194,19 @@ stdenv.mkDerivation ({
sed -i gcc/config/linux.h -e '1i#undef LOCAL_INCLUDE_DIR'
''
)
else null;
else "")
+ stdenv.lib.optionalString targetPlatform.isAvr ''
makeFlagsArray+=(
'LIMITS_H_TEST=false'
)
'';
# TODO(@Ericson2314): Make passthru instead. Weird to avoid mass rebuild,
crossStageStatic = targetPlatform == hostPlatform || crossStageStatic;
inherit noSysDirs staticCompiler langJava
inherit noSysDirs staticCompiler crossStageStatic
libcCross crossMingw;
depsBuildBuild = [ buildPackages.stdenv.cc ];
nativeBuildInputs = [ texinfo which gettext ]
++ (optional (perl != null) perl)
++ (optional javaAwtGtk pkgconfig);
++ (optional (perl != null) perl);
# For building runtime libs
depsBuildTarget =
@@ -303,11 +221,7 @@ stdenv.mkDerivation ({
targetPackages.stdenv.cc.bintools # For linking code at run-time
] ++ (optional (isl != null) isl)
++ (optional (zlib != null) zlib)
++ (optionals langJava [ boehmgc zip unzip ])
++ (optionals javaAwtGtk ([ gtk2 libart_lgpl ] ++ xlibs))
++ (optionals (targetPlatform != hostPlatform) [targetPackages.stdenv.cc.bintools])
++ (optionals langAda [gnatboot])
++ (optionals langVhdl [gnat])
# The builder relies on GNU sed (for instance, Darwin's `sed' fails with
# "-i may not be used with stdin"), and `stdenvNative' doesn't provide it.
@@ -315,6 +229,7 @@ stdenv.mkDerivation ({
++ (optional hostPlatform.isDarwin targetPackages.stdenv.cc.bintools)
;
NIX_CFLAGS_COMPILE = stdenv.lib.optionalString (stdenv.cc.isClang && langFortran) "-Wno-unused-command-line-argument";
NIX_LDFLAGS = stdenv.lib.optionalString hostPlatform.isSunOS "-lm -ldl";
preConfigure = stdenv.lib.optionalString (hostPlatform.isSunOS && hostPlatform.is64bit) ''
@@ -327,11 +242,7 @@ stdenv.mkDerivation ({
dontDisableStatic = true;
# TODO(@Ericson2314): Always pass "--target" and always prefix.
configurePlatforms =
# TODO(@Ericson2314): Figure out what's going wrong with Arm
if buildPlatform == hostPlatform && hostPlatform == targetPlatform && targetPlatform.isArm
then []
else [ "build" "host" ] ++ stdenv.lib.optional (targetPlatform != hostPlatform) "target";
configurePlatforms = [ "build" "host" ] ++ stdenv.lib.optional (targetPlatform != hostPlatform) "target";
configureFlags =
# Basic dependencies
@@ -358,9 +269,6 @@ stdenv.mkDerivation ({
( optional langC "c"
++ optional langCC "c++"
++ optional langFortran "fortran"
++ optional langJava "java"
++ optional langAda "ada"
++ optional langVhdl "vhdl"
++ optional langGo "go"
++ optional langObjC "objc"
++ optional langObjCpp "obj-c++"
@@ -370,7 +278,7 @@ stdenv.mkDerivation ({
}"
] ++
(if enableMultilib
(if (enableMultilib || targetPlatform.isAvr)
then ["--enable-multilib" "--disable-libquadmath"]
else ["--disable-multilib"]) ++
optional (!enableShared) "--disable-shared" ++
@@ -381,22 +289,7 @@ stdenv.mkDerivation ({
# Optional features
optional (isl != null) "--with-isl=${isl}" ++
# Java options
optionals langJava [
"--with-ecj-jar=${javaEcj}"
# Follow Sun's layout for the convenience of IcedTea/OpenJDK. See
# <http://mail.openjdk.java.net/pipermail/distro-pkg-dev/2010-April/008888.html>.
"--enable-java-home"
"--with-java-home=\${prefix}/lib/jvm/jre"
] ++
optional javaAwtGtk "--enable-java-awt=gtk" ++
optional (langJava && javaAntlr != null) "--with-antlr-jar=${javaAntlr}" ++
# Ada
optional langAda "--enable-libada" ++
platformFlags ++
(import ../common/platform-flags.nix { inherit (stdenv) lib targetPlatform; }) ++
optional (targetPlatform != hostPlatform) crossConfigureFlags ++
optional (!bootstrap) "--disable-bootstrap" ++
@@ -407,36 +300,36 @@ stdenv.mkDerivation ({
# On Illumos/Solaris GNU as is preferred
"--with-gnu-as" "--without-gnu-ld"
]
++ optional (targetPlatform == hostPlatform && targetPlatform.libc == "musl") "--disable-libsanitizer"
++ optionals (targetPlatform == hostPlatform && targetPlatform.libc == "musl") [
"--disable-libsanitizer"
"--disable-symvers"
"libat_cv_have_ifunc=no"
"--disable-gnu-indirect-function"
]
++ optional (targetPlatform.isAarch64) "--enable-fix-cortex-a53-843419"
;
targetConfig = if targetPlatform != hostPlatform then targetPlatform.config else null;
buildFlags =
optional bootstrap (if profiledCompiler then "profiledbootstrap" else "bootstrap");
buildFlags = optional
(bootstrap && hostPlatform == buildPlatform)
(if profiledCompiler then "profiledbootstrap" else "bootstrap");
dontStrip = !stripped;
doCheck = false; # requires a lot of tools, causes a dependency cycle for stdenv
installTargets =
if stripped
then "install-strip"
else "install";
/* For cross-built gcc (build != host == target) */
crossAttrs = {
dontStrip = true;
buildFlags = "";
};
# http://gcc.gnu.org/install/specific.html#x86-64-x-solaris210
${if hostPlatform.system == "x86_64-solaris" then "CC" else null} = "gcc -m64";
# Setting $CPATH and $LIBRARY_PATH to make sure both `gcc' and `xgcc' find the
# library headers and binaries, regarless of the language being compiled.
#
# Note: When building the Java AWT GTK+ peer, the build system doesn't honor
# `--with-gmp' et al., e.g., when building
# `libjava/classpath/native/jni/java-math/gnu_java_math_GMP.c', so we just add
# them to $CPATH and $LIBRARY_PATH in this case.
#
# Likewise, the LTO code doesn't find zlib.
#
# Cross-compiling, we need gcc not to read ./specs in order to build the g++
@@ -445,50 +338,31 @@ stdenv.mkDerivation ({
CPATH = optionals (targetPlatform == hostPlatform) (makeSearchPathOutput "dev" "include" ([]
++ optional (zlib != null) zlib
++ optional langJava boehmgc
++ optionals javaAwtGtk xlibs
++ optionals javaAwtGtk [ gmp mpfr ]
++ optional (libpthread != null) libpthread
++ optional (libpthreadCross != null) libpthreadCross
# On GNU/Hurd glibc refers to Mach & Hurd
# headers.
++ optionals (libcCross != null && libcCross ? propagatedBuildInputs)
libcCross.propagatedBuildInputs
));
LIBRARY_PATH = optionals (targetPlatform == hostPlatform) (makeLibraryPath ([]
++ optional (zlib != null) zlib
++ optional langJava boehmgc
++ optionals javaAwtGtk xlibs
++ optionals javaAwtGtk [ gmp mpfr ]
++ optional (libpthread != null) libpthread)
);
LIBRARY_PATH = optionals (targetPlatform == hostPlatform) (makeLibraryPath (optional (zlib != null) zlib));
EXTRA_TARGET_FLAGS = optionals
(targetPlatform != hostPlatform && libcCross != null)
([
"-idirafter ${getDev libcCross}/include"
"-idirafter ${getDev libcCross}${libcCross.incdir or "/include"}"
] ++ optionals (! crossStageStatic) [
"-B${libcCross.out}/lib"
"-B${libcCross.out}${libcCross.libdir or "/lib"}"
]);
EXTRA_TARGET_LDFLAGS = optionals
(targetPlatform != hostPlatform && libcCross != null)
([
"-Wl,-L${libcCross.out}/lib"
"-Wl,-L${libcCross.out}${libcCross.libdir or "/lib"}"
] ++ (if crossStageStatic then [
"-B${libcCross.out}/lib"
"-B${libcCross.out}${libcCross.libdir or "/lib"}"
] else [
"-Wl,-rpath,${libcCross.out}/lib"
"-Wl,-rpath-link,${libcCross.out}/lib"
]) ++ optionals (libpthreadCross != null) [
"-L${libpthreadCross}/lib"
"-Wl,${libpthreadCross.TARGET_LDFLAGS}"
]);
"-Wl,-rpath,${libcCross.out}${libcCross.libdir or "/lib"}"
"-Wl,-rpath-link,${libcCross.out}${libcCross.libdir or "/lib"}"
]));
passthru =
{ inherit langC langCC langObjC langObjCpp langAda langFortran langVhdl langGo version; isGNU = true; };
{ inherit langC langCC langObjC langObjCpp langFortran langGo version; isGNU = true; };
inherit enableParallelBuilding enableMultilib;
@@ -502,8 +376,8 @@ stdenv.mkDerivation ({
longDescription = ''
The GNU Compiler Collection includes compiler front ends for C, C++,
Objective-C, Fortran, OpenMP for C/C++/Fortran, Java, and Ada, as well
as libraries for these languages (libstdc++, libgcj, libgomp,...).
Objective-C, Fortran, OpenMP for C/C++/Fortran, and Ada, as well as
libraries for these languages (libstdc++, libgomp,...).
GCC development is a part of the GNU Project, aiming to improve the
compiler used in the GNU system including the GNU/Linux variant.
@@ -511,12 +385,10 @@ stdenv.mkDerivation ({
maintainers = with stdenv.lib.maintainers; [ ];
# gnatboot is not available out of linux platforms, so we disable the darwin build
# for the gnat (ada compiler).
platforms =
stdenv.lib.platforms.linux ++
stdenv.lib.platforms.freebsd ++
optionals (langAda == false) stdenv.lib.platforms.darwin;
stdenv.lib.platforms.darwin;
};
}
@@ -525,8 +397,5 @@ stdenv.mkDerivation ({
installTargets = "install-gcc install-target-libgcc";
}
# Strip kills static libs of other archs (hence targetPlatform != hostPlatform)
// optionalAttrs (!stripped || targetPlatform != hostPlatform) { dontStrip = true; }
// optionalAttrs (enableMultilib) { dontMoveLib64 = true; }
)
@@ -0,0 +1,109 @@
commit e7c570f37384d824cb9725f237920e9691e57269
gpg: Signature made Tue 06 Mar 2018 04:52:46 PM PST
gpg: using RSA key 00CE76D1834960DFCE886DF8EF4CA1502CCBAB41
gpg: issuer "palmer@dabbelt.com"
gpg: Good signature from "Palmer Dabbelt <palmer@dabbelt.com>" [ultimate]
gpg: aka "Palmer Dabbelt <palmer@sifive.com>" [ultimate]
Author: Palmer Dabbelt <palmer@sifive.com>
Date: Thu Mar 1 12:01:06 2018 -0800
RISC-V: Add and document the "-mno-relax" option
RISC-V relies on aggressive linker relaxation to get good code size. As
a result no text symbol addresses can be known until link time, which
means that alignment must be handled during the link. This alignment
pass is essentially just another linker relaxation, so this has the
unfortunate side effect that linker relaxation is required for
correctness on many RISC-V targets.
The RISC-V assembler has supported an ".option norelax" for a long time
because there are situations in which linker relaxation is a bad idea --
the canonical example is when trying to materialize the initial value of
the global pointer into a register, which would otherwise be relaxed to
a NOP. We've been relying on users who want to disable relaxation for
an entire link to pass "-Wl,--no-relax", but that still relies on the
linker relaxing R_RISCV_ALIGN to handle alignment despite it not being
strictly necessary.
This patch adds a GCC option, "-mno-relax", that disable linker
relaxation by adding ".option norelax" to the top of every generated
assembly file. The assembler is smart enough to handle alignment at
assemble time for files that have never emitted a relaxable relocation,
so this is sufficient to really disable all relaxations in the linker,
which results in significantly faster link times for large objects.
This also has the side effect of allowing toolchains that don't support
linker relaxation (LLVM and the Linux module loader) to function
correctly. Toolchains that don't support linker relaxation should
default to "-mno-relax" and error when presented with any R_RISCV_ALIGN
relocation as those need to be handled for correctness.
gcc/ChangeLog
2018-03-01 Palmer Dabbelt <palmer@sifive.com>
* config/riscv/riscv.opt (mrelax): New option.
* config/riscv/riscv.c (riscv_file_start): Emit ".option
"norelax" when riscv_mrelax is disabled.
* doc/invoke.texi (RISC-V): Document "-mrelax" and "-mno-relax".
diff --git a/gcc/config/riscv/riscv.c b/gcc/config/riscv/riscv.c
index c38f6c394d54..3e81874de232 100644
--- a/gcc/config/riscv/riscv.c
+++ b/gcc/config/riscv/riscv.c
@@ -3979,6 +3979,11 @@ riscv_file_start (void)
/* Instruct GAS to generate position-[in]dependent code. */
fprintf (asm_out_file, "\t.option %spic\n", (flag_pic ? "" : "no"));
+
+ /* If the user specifies "-mno-relax" on the command line then disable linker
+ relaxation in the assembler. */
+ if (! riscv_mrelax)
+ fprintf (asm_out_file, "\t.option norelax\n");
}
/* Implement TARGET_ASM_OUTPUT_MI_THUNK. Generate rtl rather than asm text
diff --git a/gcc/config/riscv/riscv.opt b/gcc/config/riscv/riscv.opt
index 581a26bb5c1e..b37ac75d9bb4 100644
--- a/gcc/config/riscv/riscv.opt
+++ b/gcc/config/riscv/riscv.opt
@@ -106,6 +106,11 @@ mexplicit-relocs
Target Report Mask(EXPLICIT_RELOCS)
Use %reloc() operators, rather than assembly macros, to load addresses.
+mrelax
+Target Bool Var(riscv_mrelax) Init(1)
+Take advantage of linker relaxations to reduce the number of instructions
+required to materialize symbol addresses.
+
Mask(64BIT)
Mask(MUL)
diff --git a/gcc/doc/invoke.texi b/gcc/doc/invoke.texi
index 8d366c626bae..deb48af2ecad 100644
--- a/gcc/doc/invoke.texi
+++ b/gcc/doc/invoke.texi
@@ -1042,7 +1042,8 @@ See RS/6000 and PowerPC Options.
-msave-restore -mno-save-restore @gol
-mstrict-align -mno-strict-align @gol
-mcmodel=medlow -mcmodel=medany @gol
--mexplicit-relocs -mno-explicit-relocs @gol}
+-mexplicit-relocs -mno-explicit-relocs @gol
+-mrelax -mno-relax @gol}
@emph{RL78 Options}
@gccoptlist{-msim -mmul=none -mmul=g13 -mmul=g14 -mallregs @gol
@@ -23102,6 +23103,12 @@ Use or do not use assembler relocation operators when dealing with symbolic
addresses. The alternative is to use assembler macros instead, which may
limit optimization.
+@item -mrelax
+@itemx -mno-relax
+Take advantage of linker relaxations to reduce the number of instructions
+required to materialize symbol addresses. The default is to take advantage of
+linker relaxations.
+
@end table
@node RL78 Options
@@ -0,0 +1,13 @@
Index: gcc/config/riscv/linux.h
===================================================================
--- a/gcc/config/riscv/linux.h (revision 257620)
+++ b/gcc/config/riscv/linux.h (revision 257621)
@@ -47,6 +47,8 @@
#define ICACHE_FLUSH_FUNC "__riscv_flush_icache"
+#define CPP_SPEC "%{pthread:-D_REENTRANT}"
+
#define LINK_SPEC "\
-melf" XLEN_SPEC "lriscv \
%{shared} \
@@ -0,0 +1,379 @@
{ stdenv, targetPackages, fetchurl, noSysDirs
, langC ? true, langCC ? true, langFortran ? false
, langObjC ? stdenv.targetPlatform.isDarwin
, langObjCpp ? stdenv.targetPlatform.isDarwin
, langGo ? false
, profiledCompiler ? false
, staticCompiler ? false
, enableShared ? true
, texinfo ? null
, perl ? null # optional, for texi2pod (then pod2man)
, gmp, mpfr, libmpc, gettext, which
, libelf # optional, for link-time optimizations (LTO)
, isl ? null # optional, for the Graphite optimization framework.
, zlib ? null
, enableMultilib ? false
, enablePlugin ? stdenv.hostPlatform == stdenv.buildPlatform # Whether to support user-supplied plug-ins
, name ? "gcc"
, libcCross ? null
, crossStageStatic ? false
, # Strip kills static libs of other archs (hence no cross)
stripped ? stdenv.hostPlatform == stdenv.buildPlatform
&& stdenv.targetPlatform == stdenv.hostPlatform
, gnused ? null
, cloog # unused; just for compat with gcc4, as we override the parameter on some places
, buildPackages
}:
# LTO needs libelf and zlib.
assert libelf != null -> zlib != null;
# Make sure we get GNU sed.
assert stdenv.hostPlatform.isDarwin -> gnused != null;
# The go frontend is written in c++
assert langGo -> langCC;
with stdenv.lib;
with builtins;
let version = "8.2.0";
enableParallelBuilding = true;
inherit (stdenv) buildPlatform hostPlatform targetPlatform;
patches =
optional (targetPlatform != hostPlatform) ../libstdc++-target.patch
++ optional noSysDirs ../no-sys-dirs.patch
/* ++ optional (hostPlatform != buildPlatform) (fetchpatch { # XXX: Refine when this should be applied
url = "https://git.busybox.net/buildroot/plain/package/gcc/${version}/0900-remove-selftests.patch?id=11271540bfe6adafbc133caf6b5b902a816f5f02";
sha256 = ""; # TODO: uncomment and check hash when available.
}) */
++ optional langFortran ../gfortran-driving.patch
++ optional (targetPlatform.libc == "musl" && targetPlatform.isPower) ../ppc-musl.patch
++ optional (targetPlatform.libc == "musl") ../libgomp-dont-force-initial-exec.patch;
/* Cross-gcc settings (build == host != target) */
crossMingw = targetPlatform != hostPlatform && targetPlatform.libc == "msvcrt";
crossDarwin = targetPlatform != hostPlatform && targetPlatform.libc == "libSystem";
crossConfigureFlags =
# Ensure that -print-prog-name is able to find the correct programs.
[ "--with-as=${targetPackages.stdenv.cc.bintools}/bin/${targetPlatform.config}-as"
"--with-ld=${targetPackages.stdenv.cc.bintools}/bin/${targetPlatform.config}-ld" ] ++
(if crossMingw && crossStageStatic then [
"--with-headers=${libcCross}/include"
"--with-gcc"
"--with-gnu-as"
"--with-gnu-ld"
"--with-gnu-ld"
"--disable-shared"
"--disable-nls"
"--disable-debug"
"--enable-sjlj-exceptions"
"--enable-threads=win32"
"--disable-win32-registry"
"--disable-libmpx" # requires libc
] else if crossStageStatic then [
"--disable-libssp"
"--disable-nls"
"--without-headers"
"--disable-threads"
"--disable-libgomp"
"--disable-libquadmath"
"--disable-shared"
"--disable-libatomic" # requires libc
"--disable-decimal-float" # requires libc
"--disable-libmpx" # requires libc
] else [
(if crossDarwin then "--with-sysroot=${getLib libcCross}/share/sysroot"
else "--with-headers=${getDev libcCross}${libcCross.incdir or "/include"}")
"--enable-__cxa_atexit"
"--enable-long-long"
] ++
(if crossMingw then [
"--enable-threads=win32"
"--enable-sjlj-exceptions"
"--enable-hash-synchronization"
"--enable-libssp"
"--disable-nls"
"--with-dwarf2"
# To keep ABI compatibility with upstream mingw-w64
"--enable-fully-dynamic-string"
] else
optionals (targetPlatform.libc == "uclibc" || targetPlatform.libc == "musl") [
# libsanitizer requires netrom/netrom.h which is not
# available in uclibc.
"--disable-libsanitizer"
# In uclibc cases, libgomp needs an additional '-ldl'
# and as I don't know how to pass it, I disable libgomp.
"--disable-libgomp"
# musl at least, disable: https://git.buildroot.net/buildroot/commit/?id=873d4019f7fb00f6a80592224236b3ba7d657865
"--disable-libmpx"
]
++ optional (targetPlatform.libc == "newlib") "--with-newlib"
++ optional (targetPlatform.libc == "avrlibc") "--with-avrlibc"
++ [
"--enable-threads=${if targetPlatform.isUnix then "posix"
else if targetPlatform.isWindows then "win32"
else "single"}"
"--enable-nls"
"--disable-decimal-float" # No final libdecnumber (it may work only in 386)
]));
stageNameAddon = if crossStageStatic then "-stage-static" else "-stage-final";
crossNameAddon = if targetPlatform != hostPlatform then "-${targetPlatform.config}" + stageNameAddon else "";
bootstrap = targetPlatform == hostPlatform;
in
stdenv.mkDerivation ({
name = "${name}${if stripped then "" else "-debug"}-${version}" + crossNameAddon;
builder = ../builder.sh;
src = fetchurl {
url = "mirror://gcc/releases/gcc-${version}/gcc-${version}.tar.xz";
sha256 = "10007smilswiiv2ymazr3b6x2i933c0ycxrr529zh4r6p823qv0r";
};
inherit patches;
outputs = [ "out" "lib" "man" "info" ];
setOutputFlags = false;
NIX_NO_SELF_RPATH = true;
libc_dev = stdenv.cc.libc_dev;
hardeningDisable = [ "format" ] ++ stdenv.lib.optional stdenv.targetPlatform.isMusl "pie";
# This should kill all the stdinc frameworks that gcc and friends like to
# insert into default search paths.
prePatch = stdenv.lib.optionalString hostPlatform.isDarwin ''
substituteInPlace gcc/config/darwin-c.c \
--replace 'if (stdinc)' 'if (0)'
substituteInPlace libgcc/config/t-slibgcc-darwin \
--replace "-install_name @shlib_slibdir@/\$(SHLIB_INSTALL_NAME)" "-install_name $lib/lib/\$(SHLIB_INSTALL_NAME)"
substituteInPlace libgfortran/configure \
--replace "-install_name \\\$rpath/\\\$soname" "-install_name $lib/lib/\\\$soname"
'';
postPatch = ''
configureScripts=$(find . -name configure)
for configureScript in $configureScripts; do
patchShebangs $configureScript
done
'' + (
if targetPlatform != hostPlatform || stdenv.cc.libc != null then
# On NixOS, use the right path to the dynamic linker instead of
# `/lib/ld*.so'.
let
libc = if libcCross != null then libcCross else stdenv.cc.libc;
in
(
'' echo "fixing the \`GLIBC_DYNAMIC_LINKER', \`UCLIBC_DYNAMIC_LINKER', and \`MUSL_DYNAMIC_LINKER' macros..."
for header in "gcc/config/"*-gnu.h "gcc/config/"*"/"*.h
do
grep -q _DYNAMIC_LINKER "$header" || continue
echo " fixing \`$header'..."
sed -i "$header" \
-e 's|define[[:blank:]]*\([UCG]\+\)LIBC_DYNAMIC_LINKER\([0-9]*\)[[:blank:]]"\([^\"]\+\)"$|define \1LIBC_DYNAMIC_LINKER\2 "${libc.out}\3"|g' \
-e 's|define[[:blank:]]*MUSL_DYNAMIC_LINKER\([0-9]*\)[[:blank:]]"\([^\"]\+\)"$|define MUSL_DYNAMIC_LINKER\1 "${libc.out}\2"|g'
done
''
+ stdenv.lib.optionalString (targetPlatform.libc == "musl")
''
sed -i gcc/config/linux.h -e '1i#undef LOCAL_INCLUDE_DIR'
''
)
else "");
inherit noSysDirs staticCompiler crossStageStatic
libcCross crossMingw;
depsBuildBuild = [ buildPackages.stdenv.cc ];
nativeBuildInputs = [ texinfo which gettext ]
++ (optional (perl != null) perl);
# For building runtime libs
depsBuildTarget =
if hostPlatform == buildPlatform then [
targetPackages.stdenv.cc.bintools # newly-built gcc will be used
] else assert targetPlatform == hostPlatform; [ # build != host == target
stdenv.cc
];
buildInputs = [
gmp mpfr libmpc libelf
targetPackages.stdenv.cc.bintools # For linking code at run-time
] ++ (optional (isl != null) isl)
++ (optional (zlib != null) zlib)
++ (optionals (targetPlatform != hostPlatform) [targetPackages.stdenv.cc.bintools])
# The builder relies on GNU sed (for instance, Darwin's `sed' fails with
# "-i may not be used with stdin"), and `stdenvNative' doesn't provide it.
++ (optional hostPlatform.isDarwin gnused)
++ (optional hostPlatform.isDarwin targetPackages.stdenv.cc.bintools)
;
NIX_LDFLAGS = stdenv.lib.optionalString hostPlatform.isSunOS "-lm -ldl";
preConfigure = stdenv.lib.optionalString (hostPlatform.isSunOS && hostPlatform.is64bit) ''
export NIX_LDFLAGS=`echo $NIX_LDFLAGS | sed -e s~$prefix/lib~$prefix/lib/amd64~g`
export LDFLAGS_FOR_TARGET="-Wl,-rpath,$prefix/lib/amd64 $LDFLAGS_FOR_TARGET"
export CXXFLAGS_FOR_TARGET="-Wl,-rpath,$prefix/lib/amd64 $CXXFLAGS_FOR_TARGET"
export CFLAGS_FOR_TARGET="-Wl,-rpath,$prefix/lib/amd64 $CFLAGS_FOR_TARGET"
'';
dontDisableStatic = true;
# TODO(@Ericson2314): Always pass "--target" and always prefix.
configurePlatforms = [ "build" "host" ] ++ stdenv.lib.optional (targetPlatform != hostPlatform) "target";
configureFlags =
# Basic dependencies
[
"--with-gmp-include=${gmp.dev}/include"
"--with-gmp-lib=${gmp.out}/lib"
"--with-mpfr-include=${mpfr.dev}/include"
"--with-mpfr-lib=${mpfr.out}/lib"
"--with-mpc=${libmpc}"
] ++
optional (libelf != null) "--with-libelf=${libelf}" ++
optional (!(crossMingw && crossStageStatic))
"--with-native-system-header-dir=${getDev stdenv.cc.libc}/include" ++
# Basic configuration
[
"--enable-lto"
"--disable-libstdcxx-pch"
"--without-included-gettext"
"--with-system-zlib"
"--enable-static"
"--enable-languages=${
concatStrings (intersperse ","
( optional langC "c"
++ optional langCC "c++"
++ optional langFortran "fortran"
++ optional langGo "go"
++ optional langObjC "objc"
++ optional langObjCpp "obj-c++"
++ optionals crossDarwin [ "objc" "obj-c++" ]
)
)
}"
] ++
(if (enableMultilib || targetPlatform.isAvr)
then ["--enable-multilib" "--disable-libquadmath"]
else ["--disable-multilib"]) ++
optional (!enableShared) "--disable-shared" ++
(if enablePlugin
then ["--enable-plugin"]
else ["--disable-plugin"]) ++
# Optional features
optional (isl != null) "--with-isl=${isl}" ++
(import ../common/platform-flags.nix { inherit (stdenv) lib targetPlatform; }) ++
optional (targetPlatform != hostPlatform) crossConfigureFlags ++
optional (!bootstrap) "--disable-bootstrap" ++
# Platform-specific flags
optional (targetPlatform == hostPlatform && targetPlatform.isi686) "--with-arch=i686" ++
optionals hostPlatform.isSunOS [
"--enable-long-long" "--enable-libssp" "--enable-threads=posix" "--disable-nls" "--enable-__cxa_atexit"
# On Illumos/Solaris GNU as is preferred
"--with-gnu-as" "--without-gnu-ld"
]
++ optionals (targetPlatform == hostPlatform && targetPlatform.libc == "musl") [
"--disable-libsanitizer"
"--disable-symvers"
"libat_cv_have_ifunc=no"
"--disable-gnu-indirect-function"
]
;
targetConfig = if targetPlatform != hostPlatform then targetPlatform.config else null;
buildFlags = optional
(bootstrap && hostPlatform == buildPlatform)
(if profiledCompiler then "profiledbootstrap" else "bootstrap");
dontStrip = !stripped;
installTargets =
if stripped
then "install-strip"
else "install";
# http://gcc.gnu.org/install/specific.html#x86-64-x-solaris210
${if hostPlatform.system == "x86_64-solaris" then "CC" else null} = "gcc -m64";
# Setting $CPATH and $LIBRARY_PATH to make sure both `gcc' and `xgcc' find the
# library headers and binaries, regarless of the language being compiled.
#
# Likewise, the LTO code doesn't find zlib.
#
# Cross-compiling, we need gcc not to read ./specs in order to build the g++
# compiler (after the specs for the cross-gcc are created). Having
# LIBRARY_PATH= makes gcc read the specs from ., and the build breaks.
CPATH = optionals (targetPlatform == hostPlatform) (makeSearchPathOutput "dev" "include" ([]
++ optional (zlib != null) zlib
));
LIBRARY_PATH = optionals (targetPlatform == hostPlatform) (makeLibraryPath (optional (zlib != null) zlib));
EXTRA_TARGET_LDFLAGS = optionals
(targetPlatform != hostPlatform && libcCross != null)
([
"-Wl,-L${libcCross.out}${libcCross.libdir or "/lib"}"
] ++ (if crossStageStatic then [
"-B${libcCross.out}${libcCross.libdir or "/lib"}"
] else [
"-Wl,-rpath,${libcCross.out}${libcCross.libdir or "/lib"}"
"-Wl,-rpath-link,${libcCross.out}${libcCross.libdir or "/lib"}"
]));
passthru =
{ inherit langC langCC langObjC langObjCpp langFortran langGo version; isGNU = true; };
inherit enableParallelBuilding enableMultilib;
inherit (stdenv) is64bit;
meta = {
homepage = http://gcc.gnu.org/;
license = stdenv.lib.licenses.gpl3Plus; # runtime support libraries are typically LGPLv3+
description = "GNU Compiler Collection, version ${version}"
+ (if stripped then "" else " (with debugging info)");
longDescription = ''
The GNU Compiler Collection includes compiler front ends for C, C++,
Objective-C, Fortran, OpenMP for C/C++/Fortran, and Ada, as well as
libraries for these languages (libstdc++, libgomp,...).
GCC development is a part of the GNU Project, aiming to improve the
compiler used in the GNU system including the GNU/Linux variant.
'';
maintainers = with stdenv.lib.maintainers; [ synthetica ];
platforms =
stdenv.lib.platforms.linux ++
stdenv.lib.platforms.freebsd ++
stdenv.lib.platforms.darwin;
};
}
// optionalAttrs (targetPlatform != hostPlatform && targetPlatform.libc == "msvcrt" && crossStageStatic) {
makeFlags = [ "all-gcc" "all-target-libgcc" ];
installTargets = "install-gcc install-target-libgcc";
}
// optionalAttrs (enableMultilib) { dontMoveLib64 = true; }
)
+1 -3
View File
@@ -131,7 +131,7 @@ if test "$noSysDirs" = "1"; then
)
fi
if test -n "${targetConfig-}" -a "$crossStageStatic" == 1; then
if test "$crossStageStatic" == 1; then
# We don't want the gcc build to assume there will be a libc providing
# limits.h in this stagae
makeFlagsArray+=(
@@ -287,8 +287,6 @@ postInstall() {
# See https://bugs.gentoo.org/show_bug.cgi?id=301299#c31
paxmark r $out/libexec/gcc/*/*/{cc1,cc1plus}
eval "$postInstallGhdl"
# Two identical man pages are shipped (moving and compressing is done later)
ln -sf gcc.1 "$out"/share/man/man1/g++.1
}

Some files were not shown because too many files have changed in this diff Show More