Merge remote-tracking branch 'channels/nixos-unstable' into jdk-13
Conflicts:
pkgs/development/compilers/adoptopenjdk-bin/sources.json
-- keep newer adoptopenjdk versions from HEAD^2
This commit is contained in:
@@ -1,11 +1,11 @@
|
||||
{stdenv, fetchurl, ant, jre, jdk}:
|
||||
stdenv.mkDerivation rec {
|
||||
pname = "abcl";
|
||||
version = "1.5.0";
|
||||
version = "1.6.0";
|
||||
# or fetchFromGitHub(owner,repo,rev) or fetchgit(rev)
|
||||
src = fetchurl {
|
||||
url = "https://common-lisp.net/project/armedbear/releases/${version}/${pname}-src-${version}.tar.gz";
|
||||
sha256 = "1hhvcg050nfpjbdmskc1cv2j38qi6qfl77a61b5cxx576kbff3lj";
|
||||
sha256 = "0hvbcsffr8n2xwdixc8wyw1bfl9fxn2gyy0c4nma7j9zbn0wwgw9";
|
||||
};
|
||||
configurePhase = ''
|
||||
mkdir nix-tools
|
||||
|
||||
@@ -28,16 +28,13 @@ let cpuName = stdenv.hostPlatform.parsed.cpu.name;
|
||||
# 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
|
||||
if [ -z "\''${JAVA_HOME-}" ]; then export JAVA_HOME=$out; fi
|
||||
EOF
|
||||
'';
|
||||
|
||||
|
||||
@@ -55,7 +55,7 @@ let result = stdenv.mkDerivation rec {
|
||||
|
||||
# Set JAVA_HOME automatically.
|
||||
cat <<EOF >> "$out/nix-support/setup-hook"
|
||||
if [ -z "\$JAVA_HOME" ]; then export JAVA_HOME=$out; fi
|
||||
if [ -z "\''${JAVA_HOME-}" ]; then export JAVA_HOME=$out; fi
|
||||
EOF
|
||||
'';
|
||||
|
||||
|
||||
@@ -4,68 +4,68 @@
|
||||
"jdk": {
|
||||
"hotspot": {
|
||||
"aarch64": {
|
||||
"build": "11",
|
||||
"sha256": "10e33e1862638e11a9158947b3d7b461727d8e396e378b171be1eb4dfe12f1ed",
|
||||
"url": "https://github.com/AdoptOpenJDK/openjdk11-binaries/releases/download/jdk-11.0.4%2B11/OpenJDK11U-jdk_aarch64_linux_hotspot_11.0.4_11.tar.gz",
|
||||
"version": "11.0.4"
|
||||
"build": "10",
|
||||
"sha256": "04b77f6754aed68528f39750c5cfd6a439190206aff216aa081d62a0e1a794fa",
|
||||
"url": "https://github.com/AdoptOpenJDK/openjdk11-binaries/releases/download/jdk-11.0.6%2B10/OpenJDK11U-jdk_aarch64_linux_hotspot_11.0.6_10.tar.gz",
|
||||
"version": "11.0.6"
|
||||
},
|
||||
"armv6l": {
|
||||
"build": "11",
|
||||
"sha256": "19f16c4b905055a13457d06ce9a107a54289d3828bf3ae378efc6deb908a5572",
|
||||
"url": "https://github.com/AdoptOpenJDK/openjdk11-binaries/releases/download/jdk-11.0.4%2B11/OpenJDK11U-jdk_arm_linux_hotspot_11.0.4_11.tar.gz",
|
||||
"version": "11.0.4"
|
||||
"build": "10",
|
||||
"sha256": "ab5b76203e54fe7a5221535f6f407efa43153de029a746f60af3cffb7cb5080b",
|
||||
"url": "https://github.com/AdoptOpenJDK/openjdk11-binaries/releases/download/jdk-11.0.6%2B10/OpenJDK11U-jdk_arm_linux_hotspot_11.0.6_10.tar.gz",
|
||||
"version": "11.0.6"
|
||||
},
|
||||
"armv7l": {
|
||||
"build": "11",
|
||||
"sha256": "19f16c4b905055a13457d06ce9a107a54289d3828bf3ae378efc6deb908a5572",
|
||||
"url": "https://github.com/AdoptOpenJDK/openjdk11-binaries/releases/download/jdk-11.0.4%2B11/OpenJDK11U-jdk_arm_linux_hotspot_11.0.4_11.tar.gz",
|
||||
"version": "11.0.4"
|
||||
"build": "10",
|
||||
"sha256": "ab5b76203e54fe7a5221535f6f407efa43153de029a746f60af3cffb7cb5080b",
|
||||
"url": "https://github.com/AdoptOpenJDK/openjdk11-binaries/releases/download/jdk-11.0.6%2B10/OpenJDK11U-jdk_arm_linux_hotspot_11.0.6_10.tar.gz",
|
||||
"version": "11.0.6"
|
||||
},
|
||||
"packageType": "jdk",
|
||||
"vmType": "hotspot",
|
||||
"x86_64": {
|
||||
"build": "11",
|
||||
"sha256": "90c33cf3f2ed0bd773f648815de7347e69cfbb3416ef3bf41616ab1c4aa0f5a8",
|
||||
"url": "https://github.com/AdoptOpenJDK/openjdk11-binaries/releases/download/jdk-11.0.4%2B11/OpenJDK11U-jdk_x64_linux_hotspot_11.0.4_11.tar.gz",
|
||||
"version": "11.0.4"
|
||||
"build": "10",
|
||||
"sha256": "330d19a2eaa07ed02757d7a785a77bab49f5ee710ea03b4ee2fa220ddd0feffc",
|
||||
"url": "https://github.com/AdoptOpenJDK/openjdk11-binaries/releases/download/jdk-11.0.6%2B10/OpenJDK11U-jdk_x64_linux_hotspot_11.0.6_10.tar.gz",
|
||||
"version": "11.0.6"
|
||||
}
|
||||
},
|
||||
"openj9": {
|
||||
"packageType": "jdk",
|
||||
"vmType": "openj9",
|
||||
"x86_64": {
|
||||
"build": "11",
|
||||
"sha256": "b1099cccc80a3f434728c9bc3b8a90395793b625f4680ca05267cf635143d64d",
|
||||
"url": "https://github.com/AdoptOpenJDK/openjdk11-binaries/releases/download/jdk-11.0.4%2B11_openj9-0.15.1/OpenJDK11U-jdk_x64_linux_openj9_11.0.4_11_openj9-0.15.1.tar.gz",
|
||||
"version": "11.0.4"
|
||||
"build": "10",
|
||||
"sha256": "1530172ee98edd129954fcdca1bf725f7b30c8bfc3cdc381c88de96b7d19e690",
|
||||
"url": "https://github.com/AdoptOpenJDK/openjdk11-binaries/releases/download/jdk-11.0.6%2B10_openj9-0.18.1/OpenJDK11U-jdk_x64_linux_openj9_11.0.6_10_openj9-0.18.1.tar.gz",
|
||||
"version": "11.0.6"
|
||||
}
|
||||
}
|
||||
},
|
||||
"jre": {
|
||||
"hotspot": {
|
||||
"aarch64": {
|
||||
"build": "11",
|
||||
"sha256": "5f7b5c110fc0f344a549cb11784a6d76838061a2b6f654f7841f60e0cd286c6a",
|
||||
"url": "https://github.com/AdoptOpenJDK/openjdk11-binaries/releases/download/jdk-11.0.4%2B11/OpenJDK11U-jre_aarch64_linux_hotspot_11.0.4_11.tar.gz",
|
||||
"version": "11.0.4"
|
||||
"build": "10",
|
||||
"sha256": "7ed04ed9ed7271528e7f03490f1fd7dfbbc2d391414bd6fe4dd80ec3bad76d30",
|
||||
"url": "https://github.com/AdoptOpenJDK/openjdk11-binaries/releases/download/jdk-11.0.6%2B10/OpenJDK11U-jre_aarch64_linux_hotspot_11.0.6_10.tar.gz",
|
||||
"version": "11.0.6"
|
||||
},
|
||||
"packageType": "jre",
|
||||
"vmType": "hotspot",
|
||||
"x86_64": {
|
||||
"build": "11",
|
||||
"sha256": "70d2cc675155476f1d8516a7ae6729d44681e4fad5a6fc8dfa65cab36a67b7e0",
|
||||
"url": "https://github.com/AdoptOpenJDK/openjdk11-binaries/releases/download/jdk-11.0.4%2B11/OpenJDK11U-jre_x64_linux_hotspot_11.0.4_11.tar.gz",
|
||||
"version": "11.0.4"
|
||||
"build": "10",
|
||||
"sha256": "c5a4e69e2be0e3e5f5bb7c759960b20650967d0f571baad4a7f15b2c03bda352",
|
||||
"url": "https://github.com/AdoptOpenJDK/openjdk11-binaries/releases/download/jdk-11.0.6%2B10/OpenJDK11U-jre_x64_linux_hotspot_11.0.6_10.tar.gz",
|
||||
"version": "11.0.6"
|
||||
}
|
||||
},
|
||||
"openj9": {
|
||||
"packageType": "jre",
|
||||
"vmType": "openj9",
|
||||
"x86_64": {
|
||||
"build": "11",
|
||||
"sha256": "c2601e7cb22af7a910e03883280cee805074656104d6d3dcaaf30e3bbb832690",
|
||||
"url": "https://github.com/AdoptOpenJDK/openjdk11-binaries/releases/download/jdk-11.0.4%2B11_openj9-0.15.1/OpenJDK11U-jre_x64_linux_openj9_11.0.4_11_openj9-0.15.1.tar.gz",
|
||||
"version": "11.0.4"
|
||||
"build": "10",
|
||||
"sha256": "056e4b5f7166f5daa44f36b06c735913bda52831d2e77fa2ac371505c66d10c1",
|
||||
"url": "https://github.com/AdoptOpenJDK/openjdk11-binaries/releases/download/jdk-11.0.6%2B10_openj9-0.18.1/OpenJDK11U-jre_x64_linux_openj9_11.0.6_10_openj9-0.18.1.tar.gz",
|
||||
"version": "11.0.6"
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -76,20 +76,20 @@
|
||||
"packageType": "jdk",
|
||||
"vmType": "hotspot",
|
||||
"x86_64": {
|
||||
"build": "11",
|
||||
"sha256": "0bf5a0572877ca628fb37c54c17ce5f3aad18d64bb999eff93e11875a603b1e3",
|
||||
"url": "https://github.com/AdoptOpenJDK/openjdk11-binaries/releases/download/jdk-11.0.4%2B11.4/OpenJDK11U-jdk_x64_mac_hotspot_11.0.4_11.tar.gz",
|
||||
"version": "11.0.4"
|
||||
"build": "10",
|
||||
"sha256": "b87102274d983bf6bb0aa6c2c623301d0ff5eb7f61043ffd04abb00f962c2dcd",
|
||||
"url": "https://github.com/AdoptOpenJDK/openjdk11-binaries/releases/download/jdk-11.0.6%2B10/OpenJDK11U-jdk_x64_mac_hotspot_11.0.6_10.tar.gz",
|
||||
"version": "11.0.6"
|
||||
}
|
||||
},
|
||||
"openj9": {
|
||||
"packageType": "jdk",
|
||||
"vmType": "openj9",
|
||||
"x86_64": {
|
||||
"build": "11",
|
||||
"sha256": "6c0c0f364b9eaf285d7ee9236135648ca9fc6889cb0486ce99f827bcdc21f941",
|
||||
"url": "https://github.com/AdoptOpenJDK/openjdk11-binaries/releases/download/jdk-11.0.4%2B11.4_openj9-0.15.1/OpenJDK11U-jdk_x64_mac_openj9_11.0.4_11_openj9-0.15.1.tar.gz",
|
||||
"version": "11.0.4"
|
||||
"build": "10",
|
||||
"sha256": "9a5c5b3bb51a82e666c46b2d1bbafa8c2bbc3aae50194858c8f96c5d43a96f64",
|
||||
"url": "https://github.com/AdoptOpenJDK/openjdk11-binaries/releases/download/jdk-11.0.6%2B10_openj9-0.18.1/OpenJDK11U-jdk_x64_mac_openj9_11.0.6_10_openj9-0.18.1.tar.gz",
|
||||
"version": "11.0.6"
|
||||
}
|
||||
}
|
||||
},
|
||||
@@ -98,20 +98,20 @@
|
||||
"packageType": "jre",
|
||||
"vmType": "hotspot",
|
||||
"x86_64": {
|
||||
"build": "11",
|
||||
"sha256": "800c421391e399518f6787a0b7a407c3b8efdfb73238dbd31c87bca5d899efec",
|
||||
"url": "https://github.com/AdoptOpenJDK/openjdk11-binaries/releases/download/jdk-11.0.4%2B11.4/OpenJDK11U-jre_x64_mac_hotspot_11.0.4_11.tar.gz",
|
||||
"version": "11.0.4"
|
||||
"build": "10",
|
||||
"sha256": "ab3c2038a32c62843500109d2efb8f5dacdfa1de3cbb713c8226f26dc603cc33",
|
||||
"url": "https://github.com/AdoptOpenJDK/openjdk11-binaries/releases/download/jdk-11.0.6%2B10/OpenJDK11U-jre_x64_mac_hotspot_11.0.6_10.tar.gz",
|
||||
"version": "11.0.6"
|
||||
}
|
||||
},
|
||||
"openj9": {
|
||||
"packageType": "jre",
|
||||
"vmType": "openj9",
|
||||
"x86_64": {
|
||||
"build": "11",
|
||||
"sha256": "d554d407f14d40056caf6474901eebfbe940296dd943afd05e6719b1bd15624f",
|
||||
"url": "https://github.com/AdoptOpenJDK/openjdk11-binaries/releases/download/jdk-11.0.4%2B11.4_openj9-0.15.1/OpenJDK11U-jre_x64_mac_openj9_11.0.4_11_openj9-0.15.1.tar.gz",
|
||||
"version": "11.0.4"
|
||||
"build": "10",
|
||||
"sha256": "130850133d9701393352c2ce13ab541b4f900ff1f5ddf8257cda624968aada9f",
|
||||
"url": "https://github.com/AdoptOpenJDK/openjdk11-binaries/releases/download/jdk-11.0.6%2B10_openj9-0.18.1/OpenJDK11U-jre_x64_mac_openj9_11.0.6_10_openj9-0.18.1.tar.gz",
|
||||
"version": "11.0.6"
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -240,10 +240,22 @@
|
||||
"jdk": {
|
||||
"hotspot": {
|
||||
"aarch64": {
|
||||
"build": "10",
|
||||
"sha256": "652776586ede124189dc218174b5922cc97feac81021ad81905900b349a352d2",
|
||||
"url": "https://github.com/AdoptOpenJDK/openjdk8-binaries/releases/download/jdk8u222-b10/OpenJDK8U-jdk_aarch64_linux_hotspot_8u222b10.tar.gz",
|
||||
"version": "8.0.222"
|
||||
"build": "9",
|
||||
"sha256": "35799a2fd4b467115aff1bc3a54853b5131ba9068e53e1ab0fbe5521a3f2ba83",
|
||||
"url": "https://github.com/AdoptOpenJDK/openjdk8-binaries/releases/download/jdk8u232-b09/OpenJDK8U-jdk_aarch64_linux_hotspot_8u232b09.tar.gz",
|
||||
"version": "8.0.232"
|
||||
},
|
||||
"armv6l": {
|
||||
"build": "9",
|
||||
"sha256": "fdd9f61f1b2df74242da54ee3b3231b0123782a917e9673351276da439c7cab1",
|
||||
"url": "https://github.com/AdoptOpenJDK/openjdk8-binaries/releases/download/jdk8u232-b09/OpenJDK8U-jdk_arm_linux_hotspot_8u232b09.tar.gz",
|
||||
"version": "8.0.232"
|
||||
},
|
||||
"armv7l": {
|
||||
"build": "9",
|
||||
"sha256": "fdd9f61f1b2df74242da54ee3b3231b0123782a917e9673351276da439c7cab1",
|
||||
"url": "https://github.com/AdoptOpenJDK/openjdk8-binaries/releases/download/jdk8u232-b09/OpenJDK8U-jdk_arm_linux_hotspot_8u232b09.tar.gz",
|
||||
"version": "8.0.232"
|
||||
},
|
||||
"armv6l": {
|
||||
"build": "10",
|
||||
@@ -260,30 +272,42 @@
|
||||
"packageType": "jdk",
|
||||
"vmType": "hotspot",
|
||||
"x86_64": {
|
||||
"build": "10",
|
||||
"sha256": "37356281345b93feb4212e6267109b4409b55b06f107619dde4960e402bafa77",
|
||||
"url": "https://github.com/AdoptOpenJDK/openjdk8-binaries/releases/download/jdk8u222-b10/OpenJDK8U-jdk_x64_linux_hotspot_8u222b10.tar.gz",
|
||||
"version": "8.0.222"
|
||||
"build": "8",
|
||||
"sha256": "f39b523c724d0e0047d238eb2bb17a9565a60574cf651206c867ee5fc000ab43",
|
||||
"url": "https://github.com/AdoptOpenJDK/openjdk8-binaries/releases/download/jdk8u242-b08/OpenJDK8U-jdk_x64_linux_hotspot_8u242b08.tar.gz",
|
||||
"version": "8.0.242"
|
||||
}
|
||||
},
|
||||
"openj9": {
|
||||
"packageType": "jdk",
|
||||
"vmType": "openj9",
|
||||
"x86_64": {
|
||||
"build": "10",
|
||||
"sha256": "20cff719c6de43f8bb58c7f59e251da7c1fa2207897c9a4768c8c669716dc819",
|
||||
"url": "https://github.com/AdoptOpenJDK/openjdk8-binaries/releases/download/jdk8u222-b10_openj9-0.15.1/OpenJDK8U-jdk_x64_linux_openj9_8u222b10_openj9-0.15.1.tar.gz",
|
||||
"version": "8.0.222"
|
||||
"build": "8",
|
||||
"sha256": "ca785af638b24f9d4df896f5a9f557cc9f1e5fa5e2b1174d6b906e3fd5474c2e",
|
||||
"url": "https://github.com/AdoptOpenJDK/openjdk8-binaries/releases/download/jdk8u242-b08_openj9-0.18.1/OpenJDK8U-jdk_x64_linux_openj9_8u242b08_openj9-0.18.1.tar.gz",
|
||||
"version": "8.0.242"
|
||||
}
|
||||
}
|
||||
},
|
||||
"jre": {
|
||||
"hotspot": {
|
||||
"aarch64": {
|
||||
"build": "10",
|
||||
"sha256": "dfaf5a121f7606c54bd6232793677a4267eddf65d29cde352b84d84edbccbb51",
|
||||
"url": "https://github.com/AdoptOpenJDK/openjdk8-binaries/releases/download/jdk8u222-b10/OpenJDK8U-jre_aarch64_linux_hotspot_8u222b10.tar.gz",
|
||||
"version": "8.0.222"
|
||||
"build": "9",
|
||||
"sha256": "4540db665260fdc84ae2f191e21beec9168a70a4227718bee5edd317707e2fda",
|
||||
"url": "https://github.com/AdoptOpenJDK/openjdk8-binaries/releases/download/jdk8u232-b09/OpenJDK8U-jre_aarch64_linux_hotspot_8u232b09.tar.gz",
|
||||
"version": "8.0.232"
|
||||
},
|
||||
"armv6l": {
|
||||
"build": "9",
|
||||
"sha256": "8ab786fc2fa0a282f5cf57f6040f1976c32c3c5e480e900ce5925de6543f6688",
|
||||
"url": "https://github.com/AdoptOpenJDK/openjdk8-binaries/releases/download/jdk8u232-b09/OpenJDK8U-jre_arm_linux_hotspot_8u232b09.tar.gz",
|
||||
"version": "8.0.232"
|
||||
},
|
||||
"armv7l": {
|
||||
"build": "9",
|
||||
"sha256": "8ab786fc2fa0a282f5cf57f6040f1976c32c3c5e480e900ce5925de6543f6688",
|
||||
"url": "https://github.com/AdoptOpenJDK/openjdk8-binaries/releases/download/jdk8u232-b09/OpenJDK8U-jre_arm_linux_hotspot_8u232b09.tar.gz",
|
||||
"version": "8.0.232"
|
||||
},
|
||||
"armv6l": {
|
||||
"build": "10",
|
||||
@@ -300,20 +324,20 @@
|
||||
"packageType": "jre",
|
||||
"vmType": "hotspot",
|
||||
"x86_64": {
|
||||
"build": "10",
|
||||
"sha256": "a418ce895c8bf3ca2e7b2f423f038b8b093941684c9430f2e40da0982e12b52d",
|
||||
"url": "https://github.com/AdoptOpenJDK/openjdk8-binaries/releases/download/jdk8u222-b10/OpenJDK8U-jre_x64_linux_hotspot_8u222b10.tar.gz",
|
||||
"version": "8.0.222"
|
||||
"build": "8",
|
||||
"sha256": "5edfaefdbb0469d8b24d61c8aef80c076611053b1738029c0232b9a632fe2708",
|
||||
"url": "https://github.com/AdoptOpenJDK/openjdk8-binaries/releases/download/jdk8u242-b08/OpenJDK8U-jre_x64_linux_hotspot_8u242b08.tar.gz",
|
||||
"version": "8.0.242"
|
||||
}
|
||||
},
|
||||
"openj9": {
|
||||
"packageType": "jre",
|
||||
"vmType": "openj9",
|
||||
"x86_64": {
|
||||
"build": "10",
|
||||
"sha256": "ae56994a7c8e8c19939c0c2ff8fe5a850eb2f23845c499aa5ede26deb3d5ad28",
|
||||
"url": "https://github.com/AdoptOpenJDK/openjdk8-binaries/releases/download/jdk8u222-b10_openj9-0.15.1/OpenJDK8U-jre_x64_linux_openj9_8u222b10_openj9-0.15.1.tar.gz",
|
||||
"version": "8.0.222"
|
||||
"build": "8",
|
||||
"sha256": "985d3134b64c6196d4c9ddbc87af0c62b0e643cef71b29f3d25a8c7811811745",
|
||||
"url": "https://github.com/AdoptOpenJDK/openjdk8-binaries/releases/download/jdk8u242-b08_openj9-0.18.1/OpenJDK8U-jre_x64_linux_openj9_8u242b08_openj9-0.18.1.tar.gz",
|
||||
"version": "8.0.242"
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -324,20 +348,20 @@
|
||||
"packageType": "jdk",
|
||||
"vmType": "hotspot",
|
||||
"x86_64": {
|
||||
"build": "10",
|
||||
"sha256": "9605fd00d2960934422437f601c7a9a1c5537309b9199d5bc75f84f20cd29a76",
|
||||
"url": "https://github.com/AdoptOpenJDK/openjdk8-binaries/releases/download/jdk8u222-b10/OpenJDK8U-jdk_x64_mac_hotspot_8u222b10.tar.gz",
|
||||
"version": "8.0.222"
|
||||
"build": "8",
|
||||
"sha256": "06675b7d65bce0313ee1f2e888dd44267e8afeced75e0b39b5ad1f5fdff54e0b",
|
||||
"url": "https://github.com/AdoptOpenJDK/openjdk8-binaries/releases/download/jdk8u242-b08/OpenJDK8U-jdk_x64_mac_hotspot_8u242b08.tar.gz",
|
||||
"version": "8.0.242"
|
||||
}
|
||||
},
|
||||
"openj9": {
|
||||
"packageType": "jdk",
|
||||
"vmType": "openj9",
|
||||
"x86_64": {
|
||||
"build": "10",
|
||||
"sha256": "df185e167756332163633a826b329db067f8a721f7d5d27f0b353a35fc415de0",
|
||||
"url": "https://github.com/AdoptOpenJDK/openjdk8-binaries/releases/download/jdk8u222-b10_openj9-0.15.1/OpenJDK8U-jdk_x64_mac_openj9_8u222b10_openj9-0.15.1.tar.gz",
|
||||
"version": "8.0.222"
|
||||
"build": "8",
|
||||
"sha256": "665dc9c8239b7270b007ab9dd7522570e2686e327d89caf57a6aa6e5c6450078",
|
||||
"url": "https://github.com/AdoptOpenJDK/openjdk8-binaries/releases/download/jdk8u242-b08_openj9-0.18.1/OpenJDK8U-jdk_x64_mac_openj9_8u242b08_openj9-0.18.1.tar.gz",
|
||||
"version": "8.0.242"
|
||||
}
|
||||
}
|
||||
},
|
||||
@@ -346,23 +370,23 @@
|
||||
"packageType": "jre",
|
||||
"vmType": "hotspot",
|
||||
"x86_64": {
|
||||
"build": "10",
|
||||
"sha256": "b3ac2436534cea932ccf665b317dbf5ffc0ee065efca808b22b6c2d795ca1b90",
|
||||
"url": "https://github.com/AdoptOpenJDK/openjdk8-binaries/releases/download/jdk8u222-b10/OpenJDK8U-jre_x64_mac_hotspot_8u222b10.tar.gz",
|
||||
"version": "8.0.222"
|
||||
"build": "8",
|
||||
"sha256": "fae3777e3441dc7384c339a9054aa7efc40cd2c501625a535c2d4648367ccca3",
|
||||
"url": "https://github.com/AdoptOpenJDK/openjdk8-binaries/releases/download/jdk8u242-b08/OpenJDK8U-jre_x64_mac_hotspot_8u242b08.tar.gz",
|
||||
"version": "8.0.242"
|
||||
}
|
||||
},
|
||||
"openj9": {
|
||||
"packageType": "jre",
|
||||
"vmType": "openj9",
|
||||
"x86_64": {
|
||||
"build": "10",
|
||||
"sha256": "d5754413d7bc3a3233aaa7f8465451fbdabaf2a0c2a91743155bf135a3047ec8",
|
||||
"url": "https://github.com/AdoptOpenJDK/openjdk8-binaries/releases/download/jdk8u222-b10_openj9-0.15.1/OpenJDK8U-jre_x64_mac_openj9_8u222b10_openj9-0.15.1.tar.gz",
|
||||
"version": "8.0.222"
|
||||
"build": "8",
|
||||
"sha256": "d4a924558ddda0aed671a67f71714b71c25871a7659fd4c505851cf5ee866de5",
|
||||
"url": "https://github.com/AdoptOpenJDK/openjdk8-binaries/releases/download/jdk8u242-b08_openj9-0.18.1/OpenJDK8U-jre_x64_mac_openj9_8u242b08_openj9-0.18.1.tar.gz",
|
||||
"version": "8.0.242"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -4,13 +4,13 @@ with builtins;
|
||||
|
||||
stdenv.mkDerivation rec {
|
||||
pname = "arachne-pnr";
|
||||
version = "2018.09.09";
|
||||
version = "2019.07.29";
|
||||
|
||||
src = fetchFromGitHub {
|
||||
owner = "yosyshq";
|
||||
repo = "arachne-pnr";
|
||||
rev = "840bdfdeb38809f9f6af4d89dd7b22959b176fdd";
|
||||
sha256 = "1dqvjvgvsridybishv4pnigw9gypxh7r7nrqp9z9qq92v7c5rxzl";
|
||||
rev = "c40fb2289952f4f120cc10a5a4c82a6fb88442dc";
|
||||
sha256 = "0lg9rccr486cvips3jf289af2b4a2j9chc8iqnkhykgi1hw4pszc";
|
||||
};
|
||||
|
||||
enableParallelBuilding = true;
|
||||
|
||||
@@ -0,0 +1,98 @@
|
||||
{ stdenv
|
||||
, fetchFromGitHub
|
||||
, fetchpatch
|
||||
, autoconf
|
||||
, automake
|
||||
, fontconfig
|
||||
, gmp
|
||||
, gperf
|
||||
, haskell
|
||||
, libX11
|
||||
, libpoly
|
||||
, perl
|
||||
, pkgconfig
|
||||
, verilog
|
||||
, xorg
|
||||
, zlib
|
||||
}:
|
||||
|
||||
let
|
||||
# yices wants a libgmp.a and fails otherwise
|
||||
gmpStatic = gmp.override { withStatic = true; };
|
||||
|
||||
# Compiling PreludeBSV fails with more recent GHC versions
|
||||
# > imperative statement (not BVI context)
|
||||
# https://github.com/B-Lang-org/bsc/issues/20#issuecomment-583724030
|
||||
ghcWithPackages = haskell.packages.ghc844.ghc.withPackages (g: (with g; [old-time regex-compat syb]));
|
||||
in stdenv.mkDerivation rec {
|
||||
pname = "bluespec";
|
||||
version = "unstable-2020.02.09";
|
||||
|
||||
src = fetchFromGitHub {
|
||||
owner = "B-Lang-org";
|
||||
repo = "bsc";
|
||||
rev = "05c8afb08078e437c635b9c708124b428ac51b3d";
|
||||
sha256 = "06yhpkz7wga1a0p9031cfjqbzw7205bj2jxgdghhfzmllaiphniy";
|
||||
fetchSubmodules = true;
|
||||
};
|
||||
|
||||
enableParallelBuilding = true;
|
||||
|
||||
buildInputs = [
|
||||
zlib
|
||||
gmpStatic gperf libpoly # yices
|
||||
libX11 # tcltk
|
||||
xorg.libXft
|
||||
fontconfig
|
||||
];
|
||||
|
||||
nativeBuildInputs = [
|
||||
automake autoconf
|
||||
perl
|
||||
pkgconfig
|
||||
ghcWithPackages
|
||||
];
|
||||
|
||||
checkInputs = [
|
||||
verilog
|
||||
];
|
||||
|
||||
patches = [
|
||||
# drop stp support https://github.com/B-Lang-org/bsc/pull/31
|
||||
(fetchpatch {
|
||||
url = "https://github.com/flokli/bsc/commit/0bd48ecc2561541dc1368918863c0b2f4915006f.patch";
|
||||
sha256 = "0bam9anld33zfi9d4gs502g94w49zhl5iqmbs2d1p5i19aqpy38l";
|
||||
})
|
||||
];
|
||||
|
||||
preBuild = ''
|
||||
patchShebangs \
|
||||
src/Verilog/copy_module.pl \
|
||||
src/comp/update-build-version.sh \
|
||||
src/comp/update-build-system.sh \
|
||||
src/comp/wrapper.sh
|
||||
|
||||
substituteInPlace src/comp/Makefile \
|
||||
--replace 'BINDDIR' 'BINDIR' \
|
||||
--replace 'install-bsc install-bluetcl' 'install-bsc install-bluetcl $(UTILEXES) install-utils'
|
||||
'';
|
||||
|
||||
makeFlags = [
|
||||
"NOGIT=1" # https://github.com/B-Lang-org/bsc/issues/12
|
||||
"LDCONFIG=ldconfig" # https://github.com/B-Lang-org/bsc/pull/43
|
||||
];
|
||||
|
||||
installPhase = "mv inst $out";
|
||||
|
||||
doCheck = true;
|
||||
|
||||
meta = {
|
||||
description = "Toolchain for the Bluespec Hardware Definition Language";
|
||||
homepage = "https://github.com/B-Lang-org/bsc";
|
||||
license = stdenv.lib.licenses.bsd3;
|
||||
platforms = [ "x86_64-linux" ];
|
||||
# darwin fails at https://github.com/B-Lang-org/bsc/pull/35#issuecomment-583731562
|
||||
# aarch64 fails, as GHC fails with "ghc: could not execute: opt"
|
||||
maintainers = with stdenv.lib.maintainers; [ flokli thoughtpolice ];
|
||||
};
|
||||
}
|
||||
@@ -0,0 +1,50 @@
|
||||
# This file is based on https://github.com/turboMaCk/bs-platform.nix/blob/master/build-bs-platform.nix
|
||||
# to make potential future updates simpler
|
||||
|
||||
{ stdenv, fetchFromGitHub, ninja, runCommand, nodejs, python3,
|
||||
ocaml-version, version, src,
|
||||
ocaml ? (import ./ocaml.nix {
|
||||
version = ocaml-version;
|
||||
inherit stdenv;
|
||||
src = "${src}/ocaml";
|
||||
}),
|
||||
custom-ninja ? (ninja.overrideAttrs (attrs: {
|
||||
src = runCommand "ninja-patched-source" {} ''
|
||||
mkdir -p $out
|
||||
tar zxvf ${src}/vendor/ninja.tar.gz -C $out
|
||||
'';
|
||||
patches = [];
|
||||
}))
|
||||
}:
|
||||
stdenv.mkDerivation {
|
||||
inherit src version;
|
||||
pname = "bs-platform";
|
||||
BS_RELEASE_BUILD = "true";
|
||||
buildInputs = [ nodejs python3 custom-ninja ];
|
||||
|
||||
patchPhase = ''
|
||||
sed -i 's:./configure.py --bootstrap:python3 ./configure.py --bootstrap:' ./scripts/install.js
|
||||
mkdir -p ./native/${ocaml-version}/bin
|
||||
ln -sf ${ocaml}/bin/* ./native/${ocaml-version}/bin
|
||||
rm -f vendor/ninja/snapshot/ninja.linux
|
||||
cp ${custom-ninja}/bin/ninja vendor/ninja/snapshot/ninja.linux
|
||||
'';
|
||||
|
||||
# avoid building the development version, will break aarch64 build
|
||||
dontConfigure = true;
|
||||
|
||||
buildPhase = ''
|
||||
# This is an unfortunate name, but it's actually how to build a release
|
||||
# binary for BuckleScript
|
||||
node scripts/install.js
|
||||
'';
|
||||
|
||||
installPhase = ''
|
||||
mkdir -p $out/bin
|
||||
cp -rf jscomp lib vendor odoc_gen native $out
|
||||
cp bsconfig.json package.json $out
|
||||
ln -s $out/lib/bsb $out/bin/bsb
|
||||
ln -s $out/lib/bsc $out/bin/bsc
|
||||
ln -s $out/lib/bsrefmt $out/bin/bsrefmt
|
||||
'';
|
||||
}
|
||||
@@ -0,0 +1,25 @@
|
||||
{ stdenv, runCommand, fetchFromGitHub, ninja, nodejs, python3, ... }:
|
||||
let
|
||||
build-bs-platform = import ./build-bs-platform.nix;
|
||||
in
|
||||
(build-bs-platform {
|
||||
inherit stdenv runCommand fetchFromGitHub ninja nodejs python3;
|
||||
version = "7.0.1";
|
||||
ocaml-version = "4.06.1";
|
||||
|
||||
src = fetchFromGitHub {
|
||||
owner = "BuckleScript";
|
||||
repo = "bucklescript";
|
||||
rev = "52770839e293ade2bcf187f2639000ca0a9a1d46";
|
||||
sha256 = "0s7g2zfhshsilv9zyp0246bypg34d294z27alpwz03ws9608yr7k";
|
||||
fetchSubmodules = true;
|
||||
};
|
||||
}).overrideAttrs (attrs: {
|
||||
meta = with stdenv.lib; {
|
||||
description = "A JavaScript backend for OCaml focused on smooth integration and clean generated code.";
|
||||
homepage = https://bucklescript.github.io;
|
||||
license = licenses.lgpl3;
|
||||
maintainers = with maintainers; [ turbomack gamb anmonteiro ];
|
||||
platforms = platforms.all;
|
||||
};
|
||||
})
|
||||
@@ -0,0 +1,16 @@
|
||||
{ stdenv, src, version }:
|
||||
stdenv.mkDerivation rec {
|
||||
inherit src version;
|
||||
name = "ocaml-${version}+bs";
|
||||
configurePhase = ''
|
||||
./configure -prefix $out
|
||||
'';
|
||||
buildPhase = ''
|
||||
make -j9 world.opt
|
||||
'';
|
||||
|
||||
meta = with stdenv.lib; {
|
||||
branch = "4.06";
|
||||
platforms = platforms.all;
|
||||
};
|
||||
}
|
||||
@@ -1,21 +1,22 @@
|
||||
{ stdenv, fetchFromGitHub, makeWrapper, clang, haskellPackages }:
|
||||
|
||||
haskellPackages.mkDerivation {
|
||||
haskellPackages.mkDerivation rec {
|
||||
|
||||
pname = "carp";
|
||||
version = "unstable-2018-09-15";
|
||||
version = "0.3.0";
|
||||
|
||||
src = fetchFromGitHub {
|
||||
owner = "carp-lang";
|
||||
repo = "Carp";
|
||||
rev = "cf9286c35cab1c170aa819f7b30b5871b9e812e6";
|
||||
sha256 = "1k6kdxbbaclhi40b9p3fgbkc1x6pc4v0029xjm6gny6pcdci2cli";
|
||||
rev = "v${version}";
|
||||
sha256 = "07yk3gy4l6h3k7sh8al7lgwk75a13zxwfp7siqpb5gnnqr1z3brc";
|
||||
};
|
||||
|
||||
buildDepends = [ makeWrapper ];
|
||||
|
||||
executableHaskellDepends = with haskellPackages; [
|
||||
HUnit blaze-markup blaze-html split cmdargs
|
||||
HUnit blaze-markup blaze-html split cmdargs ansi-terminal cmark
|
||||
edit-distance
|
||||
];
|
||||
|
||||
isExecutable = true;
|
||||
|
||||
@@ -20,7 +20,7 @@ stdenv.mkDerivation rec {
|
||||
|
||||
enableParallelBuilding = true;
|
||||
|
||||
NIX_CFLAGS_COMPILE = stdenv.lib.optional stdenv.cc.isGNU "-Wno-error=format-truncation";
|
||||
NIX_CFLAGS_COMPILE = stdenv.lib.optionalString stdenv.cc.isGNU "-Wno-error=format-truncation";
|
||||
|
||||
/*
|
||||
** We patch out a very annoying 'feature' in ./configure, which
|
||||
|
||||
@@ -23,8 +23,8 @@ stdenv.mkDerivation {
|
||||
|
||||
setupHook = lib.ifEnable (bootstrap-chicken != null) ./setup-hook.sh;
|
||||
|
||||
buildFlags = "PLATFORM=${platform} PREFIX=$(out) VARDIR=$(out)/var/lib";
|
||||
installFlags = "PLATFORM=${platform} PREFIX=$(out) VARDIR=$(out)/var/lib";
|
||||
buildFlags = [ "PLATFORM=${platform}" "PREFIX=$(out)" "VARDIR=$(out)/var/lib" ];
|
||||
installFlags = [ "PLATFORM=${platform}" "PREFIX=$(out)" "VARDIR=$(out)/var/lib" ];
|
||||
|
||||
# We need a bootstrap-chicken to regenerate the c-files after
|
||||
# applying a patch to add support for CHICKEN_REPOSITORY_EXTRA
|
||||
@@ -63,7 +63,7 @@ stdenv.mkDerivation {
|
||||
meta = {
|
||||
homepage = http://www.call-cc.org/;
|
||||
license = stdenv.lib.licenses.bsd3;
|
||||
maintainers = with stdenv.lib.maintainers; [ the-kenny ];
|
||||
maintainers = with stdenv.lib.maintainers; [ the-kenny corngood ];
|
||||
platforms = stdenv.lib.platforms.linux; # Maybe other non-darwin Unix
|
||||
description = "A portable compiler for the Scheme programming language";
|
||||
longDescription = ''
|
||||
|
||||
@@ -22,6 +22,6 @@ eggDerivation {
|
||||
homepage = https://github.com/the-kenny/egg2nix;
|
||||
license = stdenv.lib.licenses.bsd3;
|
||||
platforms = stdenv.lib.platforms.unix;
|
||||
maintainers = [ stdenv.lib.maintainers.the-kenny ];
|
||||
maintainers = with stdenv.lib.maintainers; [ the-kenny corngood ];
|
||||
};
|
||||
}
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
let
|
||||
libPath = "${chicken}/var/lib/chicken/${toString chicken.binaryVersion}/";
|
||||
overrides = import ./overrides.nix;
|
||||
baseName = (builtins.parseDrvName name).name;
|
||||
baseName = stdenv.lib.getName name;
|
||||
override = if builtins.hasAttr baseName overrides
|
||||
then
|
||||
builtins.getAttr baseName overrides
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
{ pkgs }:
|
||||
{ pkgs, stdenv }:
|
||||
rec {
|
||||
inherit (pkgs) eggDerivation fetchegg;
|
||||
|
||||
@@ -16,35 +16,6 @@ rec {
|
||||
];
|
||||
};
|
||||
|
||||
blob-utils = eggDerivation {
|
||||
name = "blob-utils-1.0.3";
|
||||
|
||||
src = fetchegg {
|
||||
name = "blob-utils";
|
||||
version = "1.0.3";
|
||||
sha256 = "17vdn02fnxnjx5ixgqimln93lqvzyq4y9w02fw7xnbdcjzqm0xml";
|
||||
};
|
||||
|
||||
buildInputs = [
|
||||
setup-helper
|
||||
string-utils
|
||||
];
|
||||
};
|
||||
|
||||
check-errors = eggDerivation {
|
||||
name = "check-errors-1.13.0";
|
||||
|
||||
src = fetchegg {
|
||||
name = "check-errors";
|
||||
version = "1.13.0";
|
||||
sha256 = "12a0sn82n98jybh72zb39fdddmr5k4785xglxb16750fhy8rmjwi";
|
||||
};
|
||||
|
||||
buildInputs = [
|
||||
setup-helper
|
||||
];
|
||||
};
|
||||
|
||||
defstruct = eggDerivation {
|
||||
name = "defstruct-1.6";
|
||||
|
||||
@@ -60,31 +31,29 @@ rec {
|
||||
};
|
||||
|
||||
http-client = eggDerivation {
|
||||
name = "http-client-0.7.1";
|
||||
name = "http-client-0.18";
|
||||
|
||||
src = fetchegg {
|
||||
name = "http-client";
|
||||
version = "0.7.1";
|
||||
sha256 = "1s03zgmb7kb99ld0f2ylqgicrab9qgza53fkgsqvg7bh5njmzhxr";
|
||||
version = "0.18";
|
||||
sha256 = "1b9x66kfcglld4xhm06vba00gw37vr07c859kj7lmwnk9nwhcplg";
|
||||
};
|
||||
|
||||
buildInputs = [
|
||||
intarweb
|
||||
uri-common
|
||||
message-digest
|
||||
md5
|
||||
string-utils
|
||||
simple-md5
|
||||
sendfile
|
||||
];
|
||||
};
|
||||
|
||||
intarweb = eggDerivation {
|
||||
name = "intarweb-1.3";
|
||||
name = "intarweb-1.7";
|
||||
|
||||
src = fetchegg {
|
||||
name = "intarweb";
|
||||
version = "1.3";
|
||||
sha256 = "0izlby78c25py29bdcbc0vapb6h7xgchqrzi6i51d0rb3mnwy88h";
|
||||
version = "1.7";
|
||||
sha256 = "1arjgn5g4jfdzj3nlrhxk235qwf6k6jxr14yhnncnfbgdb820xp8";
|
||||
};
|
||||
|
||||
buildInputs = [
|
||||
@@ -94,92 +63,13 @@ rec {
|
||||
];
|
||||
};
|
||||
|
||||
lookup-table = eggDerivation {
|
||||
name = "lookup-table-1.13.5";
|
||||
|
||||
src = fetchegg {
|
||||
name = "lookup-table";
|
||||
version = "1.13.5";
|
||||
sha256 = "1nzly6rhynawlvzlyilk8z8cxz57cf9n5iv20glkhh28pz2izmrb";
|
||||
};
|
||||
|
||||
buildInputs = [
|
||||
setup-helper
|
||||
check-errors
|
||||
miscmacros
|
||||
record-variants
|
||||
synch
|
||||
];
|
||||
};
|
||||
|
||||
matchable = eggDerivation {
|
||||
name = "matchable-3.3";
|
||||
name = "matchable-3.7";
|
||||
|
||||
src = fetchegg {
|
||||
name = "matchable";
|
||||
version = "3.3";
|
||||
sha256 = "07y3lpzgm4djiwi9y2adc796f9kwkmdr28fkfkw65syahdax8990";
|
||||
};
|
||||
|
||||
buildInputs = [
|
||||
|
||||
];
|
||||
};
|
||||
|
||||
md5 = eggDerivation {
|
||||
name = "md5-3.1.0";
|
||||
|
||||
src = fetchegg {
|
||||
name = "md5";
|
||||
version = "3.1.0";
|
||||
sha256 = "0bka43nx8x9b0b079qpvml2fl20km19ny0qjmhwzlh6rwmzazj2a";
|
||||
};
|
||||
|
||||
buildInputs = [
|
||||
message-digest
|
||||
];
|
||||
};
|
||||
|
||||
message-digest = eggDerivation {
|
||||
name = "message-digest-3.1.0";
|
||||
|
||||
src = fetchegg {
|
||||
name = "message-digest";
|
||||
version = "3.1.0";
|
||||
sha256 = "1w6bax19dwgih78vcimiws0rja7qsd8hmbm6qqg2hf9cw3vab21s";
|
||||
};
|
||||
|
||||
buildInputs = [
|
||||
setup-helper
|
||||
miscmacros
|
||||
check-errors
|
||||
variable-item
|
||||
blob-utils
|
||||
string-utils
|
||||
];
|
||||
};
|
||||
|
||||
miscmacros = eggDerivation {
|
||||
name = "miscmacros-2.96";
|
||||
|
||||
src = fetchegg {
|
||||
name = "miscmacros";
|
||||
version = "2.96";
|
||||
sha256 = "1ajdgjrni10i2hmhcp4rawnxajjxry3kmq1krdmah4sf0kjrgajc";
|
||||
};
|
||||
|
||||
buildInputs = [
|
||||
|
||||
];
|
||||
};
|
||||
|
||||
record-variants = eggDerivation {
|
||||
name = "record-variants-0.5.1";
|
||||
|
||||
src = fetchegg {
|
||||
name = "record-variants";
|
||||
version = "0.5.1";
|
||||
sha256 = "15wgysxkm8m4hx9nhhw9akchzipdnqc7yj3qd3zn0z7sxg4sld1h";
|
||||
version = "3.7";
|
||||
sha256 = "1vc9rpb44fhn0n91hzglin986dw9zj87fikvfrd7j308z22a41yh";
|
||||
};
|
||||
|
||||
buildInputs = [
|
||||
@@ -188,12 +78,12 @@ rec {
|
||||
};
|
||||
|
||||
sendfile = eggDerivation {
|
||||
name = "sendfile-1.7.29";
|
||||
name = "sendfile-1.8.3";
|
||||
|
||||
src = fetchegg {
|
||||
name = "sendfile";
|
||||
version = "1.7.29";
|
||||
sha256 = "1dc02cbkx5kixhbqjy26g6gs680vy7krc9qis1p1v4aa0b2lgj7k";
|
||||
version = "1.8.3";
|
||||
sha256 = "036x4xdndx7qly94afnag5b9idd1yymdm8d832w2cy054y7lxqsi";
|
||||
};
|
||||
|
||||
buildInputs = [
|
||||
@@ -201,13 +91,13 @@ rec {
|
||||
];
|
||||
};
|
||||
|
||||
setup-helper = eggDerivation {
|
||||
name = "setup-helper-1.5.4";
|
||||
simple-md5 = eggDerivation {
|
||||
name = "simple-md5-0.0.1";
|
||||
|
||||
src = fetchegg {
|
||||
name = "setup-helper";
|
||||
version = "1.5.4";
|
||||
sha256 = "1k644y0md2isdcvazqfm4nyc8rh3dby6b0j3r4na4w8ryspqp6gj";
|
||||
name = "simple-md5";
|
||||
version = "0.0.1";
|
||||
sha256 = "1h0b51p9wl1dl3pzs39hdq3hk2qnjgn8n750bgmh0651g4lzmq3i";
|
||||
};
|
||||
|
||||
buildInputs = [
|
||||
@@ -215,38 +105,6 @@ rec {
|
||||
];
|
||||
};
|
||||
|
||||
string-utils = eggDerivation {
|
||||
name = "string-utils-1.2.4";
|
||||
|
||||
src = fetchegg {
|
||||
name = "string-utils";
|
||||
version = "1.2.4";
|
||||
sha256 = "07alvghg0dahilrm4jg44bndl0x69sv1zbna9l20cbdvi35i0jp1";
|
||||
};
|
||||
|
||||
buildInputs = [
|
||||
setup-helper
|
||||
miscmacros
|
||||
lookup-table
|
||||
check-errors
|
||||
];
|
||||
};
|
||||
|
||||
synch = eggDerivation {
|
||||
name = "synch-2.1.2";
|
||||
|
||||
src = fetchegg {
|
||||
name = "synch";
|
||||
version = "2.1.2";
|
||||
sha256 = "1m9mnbq0m5jsxmd1a3rqpwpxj0l1b7vn1fknvxycc047pmlcyl00";
|
||||
};
|
||||
|
||||
buildInputs = [
|
||||
setup-helper
|
||||
check-errors
|
||||
];
|
||||
};
|
||||
|
||||
uri-common = eggDerivation {
|
||||
name = "uri-common-1.4";
|
||||
|
||||
@@ -264,32 +122,16 @@ rec {
|
||||
};
|
||||
|
||||
uri-generic = eggDerivation {
|
||||
name = "uri-generic-2.41";
|
||||
name = "uri-generic-2.46";
|
||||
|
||||
src = fetchegg {
|
||||
name = "uri-generic";
|
||||
version = "2.41";
|
||||
sha256 = "1r5jbzjllbnmhm5n0m3fcx0g6dc2c2jzp1dcndkfmxz0cl99zxac";
|
||||
version = "2.46";
|
||||
sha256 = "10ivf4xlmr6jcm00l2phq1y73hjv6g3qgr38ycc8rw56wv6sbm4g";
|
||||
};
|
||||
|
||||
buildInputs = [
|
||||
matchable
|
||||
defstruct
|
||||
];
|
||||
};
|
||||
|
||||
variable-item = eggDerivation {
|
||||
name = "variable-item-1.3.1";
|
||||
|
||||
src = fetchegg {
|
||||
name = "variable-item";
|
||||
version = "1.3.1";
|
||||
sha256 = "19b3mhb8kr892sz9yyzq79l0vv28dgilw9cf415kj6aq16yp4d5n";
|
||||
};
|
||||
|
||||
buildInputs = [
|
||||
setup-helper
|
||||
check-errors
|
||||
];
|
||||
};
|
||||
}
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
addChickenRepositoryPath() {
|
||||
addToSearchPathWithCustomDelimiter : CHICKEN_REPOSITORY_EXTRA "$1/lib/chicken/8/"
|
||||
# addToSearchPathWithCustomDelimiter \; CHICKEN_INCLUDE_PATH "$1/share/"
|
||||
export CHICKEN_INCLUDE_PATH="$1/share;$CHICKEN_INCLUDE_PATH"
|
||||
export CHICKEN_INCLUDE_PATH="$1/share${CHICKEN_INCLUDE_PATH:+;$CHICKEN_INCLUDE_PATH}"
|
||||
}
|
||||
|
||||
addEnvHooks "$targetOffset" addChickenRepositoryPath
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
{ stdenv, fetchurl, makeWrapper, bootstrap-chicken ? null }:
|
||||
|
||||
let
|
||||
version = "5.1.0";
|
||||
version = "5.2.0";
|
||||
platform = with stdenv;
|
||||
if isDarwin then "macosx"
|
||||
else if isCygwin then "cygwin"
|
||||
@@ -18,13 +18,13 @@ stdenv.mkDerivation {
|
||||
|
||||
src = fetchurl {
|
||||
url = "https://code.call-cc.org/releases/${version}/chicken-${version}.tar.gz";
|
||||
sha256 = "0jsbp3kp0134f318j3wpd1n85gf8qzh034fn198gvazsv2l024aw";
|
||||
sha256 = "1yl0hxm9cirgcp8jgxp6vv29lpswfvaw3zfkh6rsj0vkrv44k4c1";
|
||||
};
|
||||
|
||||
setupHook = lib.ifEnable (bootstrap-chicken != null) ./setup-hook.sh;
|
||||
|
||||
buildFlags = "PLATFORM=${platform} PREFIX=$(out)";
|
||||
installFlags = "PLATFORM=${platform} PREFIX=$(out)";
|
||||
buildFlags = [ "PLATFORM=${platform}" "PREFIX=$(out)" ];
|
||||
installFlags = [ "PLATFORM=${platform}" "PREFIX=$(out)" ];
|
||||
|
||||
buildInputs = [
|
||||
makeWrapper
|
||||
@@ -45,7 +45,7 @@ stdenv.mkDerivation {
|
||||
meta = {
|
||||
homepage = http://www.call-cc.org/;
|
||||
license = stdenv.lib.licenses.bsd3;
|
||||
maintainers = with stdenv.lib.maintainers; [ the-kenny ];
|
||||
maintainers = with stdenv.lib.maintainers; [ the-kenny corngood ];
|
||||
platforms = stdenv.lib.platforms.linux; # Maybe other non-darwin Unix
|
||||
description = "A portable compiler for the Scheme programming language";
|
||||
longDescription = ''
|
||||
|
||||
@@ -24,6 +24,6 @@ eggDerivation {
|
||||
homepage = https://github.com/the-kenny/egg2nix;
|
||||
license = stdenv.lib.licenses.bsd3;
|
||||
platforms = stdenv.lib.platforms.unix;
|
||||
maintainers = [ stdenv.lib.maintainers.the-kenny ];
|
||||
maintainers = with stdenv.lib.maintainers; [ the-kenny corngood ];
|
||||
};
|
||||
}
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
|
||||
let
|
||||
overrides = import ./overrides.nix;
|
||||
baseName = (builtins.parseDrvName name).name;
|
||||
baseName = stdenv.lib.getName name;
|
||||
override = if builtins.hasAttr baseName overrides
|
||||
then
|
||||
builtins.getAttr baseName overrides
|
||||
@@ -31,8 +31,8 @@ stdenv.mkDerivation ({
|
||||
for f in $out/bin/*
|
||||
do
|
||||
wrapProgram $f \
|
||||
--prefix CHICKEN_REPOSITORY_PATH : "$out/lib/chicken/${toString chicken.binaryVersion}/:$CHICKEN_REPOSITORY_PATH" \
|
||||
--prefix CHICKEN_INCLUDE_PATH : "$CHICKEN_INCLUDE_PATH:$out/share/" \
|
||||
--prefix CHICKEN_REPOSITORY_PATH : "$out/lib/chicken/${toString chicken.binaryVersion}:$CHICKEN_REPOSITORY_PATH" \
|
||||
--prefix CHICKEN_INCLUDE_PATH : "$CHICKEN_INCLUDE_PATH:$out/share" \
|
||||
--prefix PATH : "$out/bin:${chicken}/bin:$CHICKEN_REPOSITORY_PATH"
|
||||
done
|
||||
|
||||
|
||||
@@ -19,12 +19,12 @@ rec {
|
||||
};
|
||||
|
||||
matchable = eggDerivation {
|
||||
name = "matchable-1.0";
|
||||
name = "matchable-1.1";
|
||||
|
||||
src = fetchegg {
|
||||
name = "matchable";
|
||||
version = "1.0";
|
||||
sha256 = "01vy2ppq3sq0wirvsvl3dh0bwa5jqs1i6rdjdd7pnwj4nncxd1ga";
|
||||
version = "1.1";
|
||||
sha256 = "084hm5dvbvgnpb32ispkp3hjili8z02hamln860r99jx68jx6j2v";
|
||||
};
|
||||
|
||||
buildInputs = [
|
||||
@@ -47,12 +47,12 @@ rec {
|
||||
};
|
||||
|
||||
srfi-13 = eggDerivation {
|
||||
name = "srfi-13-0.2.1";
|
||||
name = "srfi-13-0.3";
|
||||
|
||||
src = fetchegg {
|
||||
name = "srfi-13";
|
||||
version = "0.2.1";
|
||||
sha256 = "0204i7fhc4dy0l89lbi2lv9cjndrvwyrk68z3wy7x445jb4ky1gq";
|
||||
version = "0.3";
|
||||
sha256 = "0yaw9i6zhpxl1794pirh168clprjgmsb0xlr96drirjzsslgm3zp";
|
||||
};
|
||||
|
||||
buildInputs = [
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
addChickenRepositoryPath() {
|
||||
addToSearchPathWithCustomDelimiter : CHICKEN_REPOSITORY_PATH "$1/lib/chicken/11/"
|
||||
addToSearchPathWithCustomDelimiter : CHICKEN_INCLUDE_PATH "$1/share/"
|
||||
addToSearchPathWithCustomDelimiter : CHICKEN_REPOSITORY_PATH "$1/lib/chicken/11"
|
||||
addToSearchPathWithCustomDelimiter : CHICKEN_INCLUDE_PATH "$1/share"
|
||||
}
|
||||
|
||||
addEnvHooks "$targetOffset" addChickenRepositoryPath
|
||||
|
||||
@@ -2,11 +2,11 @@
|
||||
|
||||
stdenv.mkDerivation rec {
|
||||
pname = "closure-compiler";
|
||||
version = "20190909";
|
||||
version = "20200224";
|
||||
|
||||
src = fetchurl {
|
||||
url = "https://dl.google.com/closure-compiler/compiler-${version}.tar.gz";
|
||||
sha256 = "0km45pz19dz1hi8vjj290hyxdhr379iixmml0rs8crr4gvs3685w";
|
||||
sha256 = "0qlnpnd64rrlyz7ybdnp7zk5ns2s0071zs1fcrcq9ba2lnhfbmmb";
|
||||
};
|
||||
|
||||
sourceRoot = ".";
|
||||
@@ -23,7 +23,7 @@ stdenv.mkDerivation rec {
|
||||
|
||||
meta = with stdenv.lib; {
|
||||
description = "A tool for making JavaScript download and run faster";
|
||||
homepage = https://developers.google.com/closure/compiler/;
|
||||
homepage = "https://developers.google.com/closure/compiler/";
|
||||
license = licenses.asl20;
|
||||
platforms = platforms.all;
|
||||
};
|
||||
|
||||
@@ -8,7 +8,7 @@ stdenv.mkDerivation {
|
||||
sha256 = "1vq1cnrkvrvbfl40j6ajc60jdrjcxag1fi6kff5pqmadfdz9564j";
|
||||
};
|
||||
|
||||
buildFlags = "build";
|
||||
buildFlags = [ "build" ];
|
||||
enableParallelBuilding = true;
|
||||
|
||||
doCheck = true;
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
}:
|
||||
|
||||
assert lib.versionAtLeast ocamlPackages.ocaml.version "4.02";
|
||||
assert lib.versionAtLeast coq.coq-version "8.6.1";
|
||||
assert lib.versionAtLeast coq.coq-version "8.8.0";
|
||||
|
||||
let
|
||||
ocaml-pkgs = with ocamlPackages; [ ocaml findlib menhir ];
|
||||
@@ -12,13 +12,13 @@ let
|
||||
in
|
||||
stdenv.mkDerivation rec {
|
||||
pname = "compcert";
|
||||
version = "3.5";
|
||||
version = "3.6";
|
||||
|
||||
src = fetchFromGitHub {
|
||||
owner = "AbsInt";
|
||||
repo = "CompCert";
|
||||
rev = "v${version}";
|
||||
sha256 = "1g8067a5x3vd0l47d04gjvy5yx49nghh55am5d1fbrjirfsnsz8j";
|
||||
sha256 = "1k9xhj7fgllhf7bn7rp3w6zfvs4clglnc4w39zp4678hrwvdcpha";
|
||||
};
|
||||
|
||||
nativeBuildInputs = [ makeWrapper ];
|
||||
@@ -27,7 +27,6 @@ stdenv.mkDerivation rec {
|
||||
|
||||
patchPhase = ''
|
||||
substituteInPlace ./configure \
|
||||
--replace '|8.9.0' '|8.9.0|8.9.1' \
|
||||
--replace '{toolprefix}gcc' '{toolprefix}cc'
|
||||
'';
|
||||
|
||||
|
||||
@@ -0,0 +1,52 @@
|
||||
{ stdenv
|
||||
, fetchzip
|
||||
, pkg-config
|
||||
, autoPatchelfHook
|
||||
, installShellFiles
|
||||
, ncurses5
|
||||
, ocl-icd
|
||||
, zlib
|
||||
}:
|
||||
|
||||
stdenv.mkDerivation rec {
|
||||
pname = "computecpp";
|
||||
version = "1.2.0";
|
||||
|
||||
src = fetchzip {
|
||||
url = "https://computecpp.codeplay.com/downloads/computecpp-ce/${version}/ubuntu-16.04-64bit.tar.gz";
|
||||
sha256 = "191kwvzxfg1sbaq6aw6f84chi7bhsibb2a63zsyz3gz8m0c0syr5";
|
||||
stripRoot = true;
|
||||
};
|
||||
|
||||
dontStrip = true;
|
||||
|
||||
buildInputs = [ stdenv.cc.cc.lib ncurses5 ocl-icd zlib ];
|
||||
nativeBuildInputs = [ autoPatchelfHook pkg-config installShellFiles ];
|
||||
|
||||
installPhase = ''
|
||||
runHook preInstall
|
||||
|
||||
find ./lib -type f -exec install -D -m 0755 {} -t $out/lib \;
|
||||
find ./bin -type l -exec install -D -m 0755 {} -t $out/bin \;
|
||||
find ./bin -type f -exec install -D -m 0755 {} -t $out/bin \;
|
||||
find ./doc -type f -exec install -D -m 0644 {} -t $out/doc \;
|
||||
find ./include -type f -exec install -D -m 0644 {} -t $out/include \;
|
||||
|
||||
runHook postInstall
|
||||
'';
|
||||
|
||||
passthru = {
|
||||
isClang = true;
|
||||
} // stdenv.lib.optionalAttrs (stdenv.targetPlatform.isLinux || (stdenv.cc.isGNU && stdenv.cc.cc ? gcc)) {
|
||||
gcc = if stdenv.cc.isGNU then stdenv.cc.cc else stdenv.cc.cc.gcc;
|
||||
};
|
||||
|
||||
meta = with stdenv.lib; {
|
||||
description =
|
||||
"Accelerate Complex C++ Applications on Heterogeneous Compute Systems using Open Standards";
|
||||
homepage = https://www.codeplay.com/products/computesuite/computecpp;
|
||||
license = licenses.unfree;
|
||||
maintainers = with maintainers; [ davidtwco ];
|
||||
platforms = [ "x86_64-linux" ];
|
||||
};
|
||||
}
|
||||
@@ -1,6 +1,6 @@
|
||||
{ stdenv, lib, fetchFromGitHub, fetchurl, makeWrapper
|
||||
, coreutils, git, gmp, nettools, openssl_1_0_2, readline, tzdata, libxml2, libyaml
|
||||
, boehmgc, libatomic_ops, pcre, libevent, libiconv, llvm, clang, which, zlib
|
||||
, coreutils, git, gmp, nettools, openssl, readline, tzdata, libxml2, libyaml
|
||||
, boehmgc, libatomic_ops, pcre, libevent, libiconv, llvm, clang, which, zlib, pkgconfig
|
||||
, callPackage }:
|
||||
|
||||
# We need multiple binaries as a given binary isn't always able to build
|
||||
@@ -20,7 +20,7 @@ let
|
||||
|
||||
arch = archs.${stdenv.system} or (throw "system ${stdenv.system} not supported");
|
||||
|
||||
checkInputs = [ git gmp openssl_1_0_2 readline libxml2 libyaml ];
|
||||
checkInputs = [ git gmp openssl readline libxml2 libyaml ];
|
||||
|
||||
genericBinary = { version, sha256s, rel ? 1 }:
|
||||
stdenv.mkDerivation rec {
|
||||
@@ -38,8 +38,14 @@ let
|
||||
'';
|
||||
};
|
||||
|
||||
generic = { version, sha256, binary, doCheck ? true }:
|
||||
let compiler = stdenv.mkDerivation rec {
|
||||
commonBuildInputs = extraBuildInputs: [
|
||||
boehmgc libatomic_ops pcre libevent libyaml zlib libxml2 openssl
|
||||
] ++ extraBuildInputs
|
||||
++ stdenv.lib.optionals stdenv.isDarwin [ libiconv ];
|
||||
|
||||
|
||||
generic = ({ version, sha256, binary, doCheck ? true, extraBuildInputs ? [] }:
|
||||
lib.fix (compiler: stdenv.mkDerivation {
|
||||
pname = "crystal";
|
||||
inherit doCheck version;
|
||||
|
||||
@@ -50,16 +56,19 @@ let
|
||||
inherit sha256;
|
||||
};
|
||||
|
||||
# we are almost able to run the full test suite now
|
||||
outputs = [ "out" "lib" "bin" ];
|
||||
|
||||
postPatch = ''
|
||||
substituteInPlace src/crystal/system/unix/time.cr \
|
||||
--replace /usr/share/zoneinfo ${tzdata}/share/zoneinfo
|
||||
|
||||
ln -s spec/compiler spec/std
|
||||
|
||||
mkdir /tmp/crystal
|
||||
substituteInPlace spec/std/file_spec.cr \
|
||||
--replace '/bin/ls' '${coreutils}/bin/ls' \
|
||||
--replace '/usr/share' '/tmp/test'
|
||||
--replace '/usr/share' '/tmp/crystal' \
|
||||
--replace '/usr' '/tmp'
|
||||
|
||||
substituteInPlace spec/std/process_spec.cr \
|
||||
--replace '/bin/cat' '${coreutils}/bin/cat' \
|
||||
@@ -68,18 +77,28 @@ let
|
||||
--replace '"env"' '"${coreutils}/bin/env"' \
|
||||
--replace '"/usr"' '"/tmp"'
|
||||
|
||||
substituteInPlace spec/std/socket/tcp_server_spec.cr \
|
||||
--replace '{% if flag?(:gnu) %}"listen: "{% else %}"bind: "{% end %}' '"bind: "'
|
||||
|
||||
substituteInPlace spec/std/system_spec.cr \
|
||||
--replace '`hostname`' '`${nettools}/bin/hostname`'
|
||||
|
||||
# See https://github.com/crystal-lang/crystal/pull/8640
|
||||
substituteInPlace spec/std/http/cookie_spec.cr \
|
||||
--replace '01 Jan 2020' '01 Jan #{Time.utc.year + 2}'
|
||||
|
||||
# See https://github.com/crystal-lang/crystal/issues/8629
|
||||
substituteInPlace spec/std/socket/udp_socket_spec.cr \
|
||||
--replace 'it "joins and transmits to multicast groups"' 'pending "joins and transmits to multicast groups"'
|
||||
|
||||
# See https://github.com/crystal-lang/crystal/pull/8699
|
||||
substituteInPlace spec/std/xml/xml_spec.cr \
|
||||
--replace 'it "handles errors"' 'pending "handles errors"'
|
||||
'';
|
||||
|
||||
buildInputs = [
|
||||
boehmgc libatomic_ops pcre libevent libyaml
|
||||
llvm zlib openssl_1_0_2
|
||||
] ++ stdenv.lib.optionals stdenv.isDarwin [
|
||||
libiconv
|
||||
];
|
||||
buildInputs = commonBuildInputs extraBuildInputs;
|
||||
|
||||
nativeBuildInputs = [ binary makeWrapper which ];
|
||||
nativeBuildInputs = [ binary makeWrapper which pkgconfig llvm ];
|
||||
|
||||
makeFlags = [
|
||||
"CRYSTAL_CONFIG_VERSION=${version}"
|
||||
@@ -91,22 +110,27 @@ let
|
||||
|
||||
FLAGS = [
|
||||
"--release"
|
||||
"--no-debug"
|
||||
"--single-module" # needed for deterministic builds
|
||||
];
|
||||
|
||||
# This makes sure we don't keep depending on the previous version of
|
||||
# crystal used to build this one.
|
||||
CRYSTAL_LIBRARY_PATH = "${placeholder "lib"}/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 -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 -Dm755 .build/crystal $bin/bin/crystal
|
||||
wrapProgram $bin/bin/crystal \
|
||||
--suffix PATH : ${lib.makeBinPath [ pkgconfig clang which ]} \
|
||||
--suffix CRYSTAL_PATH : lib:$lib/crystal \
|
||||
--suffix CRYSTAL_LIBRARY_PATH : ${
|
||||
lib.makeLibraryPath (commonBuildInputs extraBuildInputs)
|
||||
}
|
||||
install -dm755 $lib/crystal
|
||||
cp -r src/* $lib/crystal/
|
||||
|
||||
install -dm755 $out/share/doc/crystal/api
|
||||
cp -r docs/* $out/share/doc/crystal/api/
|
||||
@@ -119,6 +143,10 @@ let
|
||||
|
||||
install -Dm644 -t $out/share/licenses/crystal LICENSE README.md
|
||||
|
||||
mkdir -p $out
|
||||
ln -s $bin/bin $out/bin
|
||||
ln -s $lib $out/lib
|
||||
|
||||
runHook postInstall
|
||||
'';
|
||||
|
||||
@@ -147,18 +175,9 @@ let
|
||||
maintainers = with maintainers; [ manveru david50407 peterhoeg ];
|
||||
platforms = builtins.attrNames archs;
|
||||
};
|
||||
}; in compiler;
|
||||
}));
|
||||
|
||||
in rec {
|
||||
binaryCrystal_0_26 = genericBinary {
|
||||
version = "0.26.1";
|
||||
sha256s = {
|
||||
x86_64-linux = "1xban102yiiwmlklxvn3xp3q546bp8hlxxpakayajkhhnpl6yv45";
|
||||
i686-linux = "1igspf1lrv7wpmz0pfrkbx8m1ykvnv4zhic53cav4nicppm2v0ic";
|
||||
x86_64-darwin = "1mri8bfrcldl69gczxpihxpv1shn4bijx28m3qby8vnk0ii63n9s";
|
||||
};
|
||||
};
|
||||
|
||||
binaryCrystal_0_27 = genericBinary {
|
||||
version = "0.27.2";
|
||||
sha256s = {
|
||||
@@ -177,18 +196,22 @@ in rec {
|
||||
};
|
||||
};
|
||||
|
||||
crystal_0_25 = generic {
|
||||
version = "0.25.1";
|
||||
sha256 = "15xmbkalsdk9qpc6wfpkly3sifgw6a4ai5jzlv78dh3jp7glmgyl";
|
||||
doCheck = false;
|
||||
binary = binaryCrystal_0_26;
|
||||
binaryCrystal_0_30 = genericBinary {
|
||||
version = "0.30.1";
|
||||
sha256s = {
|
||||
x86_64-linux = "1k2mb74jh3ns3m7y73j4wpf571sayn73zbn6d7q81d09r280zrma";
|
||||
i686-linux = "0vsq1ayf922spydp2g2mmimc797jmm7nl5nljhfppcclrwygdyk2";
|
||||
x86_64-darwin = "1p3s4lwdgykb7h7aysjhrs7vm0zhinzw5d7rfv6jsyin4j8yxhzz";
|
||||
};
|
||||
};
|
||||
|
||||
crystal_0_26 = generic {
|
||||
version = "0.26.1";
|
||||
sha256 = "0jwxrqm99zcjj82gyl6bzvnfj79nwzqf8sa1q3f66q9p50v44f84";
|
||||
doCheck = false; # about 20 tests out of more than 14000 are failing
|
||||
binary = binaryCrystal_0_26;
|
||||
binaryCrystal_0_31 = genericBinary {
|
||||
version = "0.31.1";
|
||||
sha256s = {
|
||||
x86_64-linux = "0r8salf572xrnr4m6ll9q5hz6jj8q7ff1rljlhmqb1r26a8mi2ih";
|
||||
i686-linux = "0hridnis5vvrswflx0q67xfg5hryhz6ivlwrb9n4pryj5d1gwjrr";
|
||||
x86_64-darwin = "1dgxgv0s3swkc5cwawzgpbc6bcd2nx4hjxc7iw2h907y1vgmbipz";
|
||||
};
|
||||
};
|
||||
|
||||
crystal_0_27 = generic {
|
||||
@@ -212,7 +235,20 @@ in rec {
|
||||
binary = binaryCrystal_0_29;
|
||||
};
|
||||
|
||||
crystal = crystal_0_30;
|
||||
crystal_0_31 = generic {
|
||||
version = "0.31.1";
|
||||
sha256 = "1dswxa32w16gnc6yjym12xj7ibg0g6zk3ngvl76lwdjqb1h6lwz8";
|
||||
doCheck = false; # 5 checks are failing now
|
||||
binary = binaryCrystal_0_30;
|
||||
};
|
||||
|
||||
crystal_0_32 = generic {
|
||||
version = "0.32.1";
|
||||
sha256 = "120ndi3nhh2r52hjvhwfb49cdggr1bzdq6b8xg7irzavhjinfza6";
|
||||
binary = binaryCrystal_0_31;
|
||||
};
|
||||
|
||||
crystal = crystal_0_32;
|
||||
|
||||
crystal2nix = callPackage ./crystal2nix.nix {};
|
||||
}
|
||||
|
||||
@@ -0,0 +1,220 @@
|
||||
args@
|
||||
{ version
|
||||
, sha256
|
||||
, url ? ""
|
||||
, name ? ""
|
||||
, developerProgram ? false
|
||||
, runPatches ? []
|
||||
, addOpenGLRunpath
|
||||
, alsaLib
|
||||
, expat
|
||||
, fetchurl
|
||||
, fontconfig
|
||||
, freetype
|
||||
, gcc
|
||||
, gdk-pixbuf
|
||||
, glib
|
||||
, glibc
|
||||
, gtk2
|
||||
, lib
|
||||
, makeWrapper
|
||||
, ncurses5
|
||||
, perl
|
||||
, python27
|
||||
, requireFile
|
||||
, stdenv
|
||||
, unixODBC
|
||||
, xorg
|
||||
, zlib
|
||||
}:
|
||||
|
||||
stdenv.mkDerivation rec {
|
||||
pname = "cudatoolkit";
|
||||
inherit version runPatches;
|
||||
|
||||
dontPatchELF = true;
|
||||
dontStrip = true;
|
||||
|
||||
src =
|
||||
if developerProgram then
|
||||
requireFile {
|
||||
message = ''
|
||||
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://\$PWD/${args.name}
|
||||
'';
|
||||
inherit (args) name sha256;
|
||||
}
|
||||
else
|
||||
fetchurl {
|
||||
inherit (args) url sha256;
|
||||
};
|
||||
|
||||
outputs = [ "out" "lib" "doc" ];
|
||||
|
||||
nativeBuildInputs = [ perl makeWrapper addOpenGLRunpath ];
|
||||
buildInputs = [ gdk-pixbuf ]; # To get $GDK_PIXBUF_MODULE_FILE via setup-hook
|
||||
runtimeDependencies = [
|
||||
ncurses5 expat python27 zlib glibc
|
||||
xorg.libX11 xorg.libXext xorg.libXrender xorg.libXt xorg.libXtst xorg.libXi xorg.libXext
|
||||
gtk2 glib fontconfig freetype unixODBC alsaLib
|
||||
];
|
||||
|
||||
rpath = "${stdenv.lib.makeLibraryPath runtimeDependencies}:${stdenv.cc.cc.lib}/lib64";
|
||||
|
||||
unpackPhase = ''
|
||||
sh $src --keep --noexec
|
||||
|
||||
${lib.optionalString (lib.versionOlder version "10.1") ''
|
||||
cd pkg/run_files
|
||||
sh cuda-linux*.run --keep --noexec
|
||||
sh cuda-samples*.run --keep --noexec
|
||||
mv pkg ../../$(basename $src)
|
||||
cd ../..
|
||||
rm -rf pkg
|
||||
|
||||
for patch in $runPatches; do
|
||||
sh $patch --keep --noexec
|
||||
mv pkg $(basename $patch)
|
||||
done
|
||||
''}
|
||||
'';
|
||||
|
||||
installPhase = ''
|
||||
runHook preInstall
|
||||
mkdir $out
|
||||
${lib.optionalString (lib.versionOlder version "10.1") ''
|
||||
cd $(basename $src)
|
||||
export PERL5LIB=.
|
||||
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
|
||||
''}
|
||||
${lib.optionalString (lib.versionAtLeast version "10.1") ''
|
||||
cd pkg/builds/cuda-toolkit
|
||||
mv * $out/
|
||||
''}
|
||||
|
||||
rm $out/tools/CUDA_Occupancy_Calculator.xls # FIXME: why?
|
||||
|
||||
${lib.optionalString (lib.versionOlder version "10.1") ''
|
||||
# let's remove the 32-bit libraries, they confuse the lib64->lib mover
|
||||
rm -rf $out/lib
|
||||
''}
|
||||
|
||||
# Remove some cruft.
|
||||
${lib.optionalString ((lib.versionAtLeast version "7.0") && (lib.versionOlder version "10.1"))
|
||||
"rm $out/bin/uninstall*"}
|
||||
|
||||
# Fixup path to samples (needed for cuda 6.5 or else nsight will not find them)
|
||||
if [ -d "$out"/cuda-samples ]; then
|
||||
mv "$out"/cuda-samples "$out"/samples
|
||||
fi
|
||||
|
||||
# Change the #error on GCC > 4.9 to a #warning.
|
||||
sed -i $out/include/host_config.h -e 's/#error\(.*unsupported GNU version\)/#warning\1/'
|
||||
|
||||
# Fix builds with newer glibc version
|
||||
sed -i "1 i#define _BITS_FLOATN_H" "$out/include/host_defines.h"
|
||||
|
||||
# Ensure that cmake can find CUDA.
|
||||
mkdir -p $out/nix-support
|
||||
echo "cmakeFlags+=' -DCUDA_TOOLKIT_ROOT_DIR=$out'" >> $out/nix-support/setup-hook
|
||||
|
||||
# Move some libraries to the lib output so that programs that
|
||||
# depend on them don't pull in this entire monstrosity.
|
||||
mkdir -p $lib/lib
|
||||
mv -v $out/lib64/libcudart* $lib/lib/
|
||||
|
||||
# Remove OpenCL libraries as they are provided by ocl-icd and driver.
|
||||
rm -f $out/lib64/libOpenCL*
|
||||
${lib.optionalString (lib.versionAtLeast version "10.1") ''
|
||||
mv $out/lib64 $out/lib
|
||||
''}
|
||||
|
||||
# Set compiler for NVCC.
|
||||
wrapProgram $out/bin/nvcc \
|
||||
--prefix PATH : ${gcc}/bin
|
||||
|
||||
# nvprof do not find any program to profile if LD_LIBRARY_PATH is not set
|
||||
wrapProgram $out/bin/nvprof \
|
||||
--prefix LD_LIBRARY_PATH : $out/lib
|
||||
'' + lib.optionalString (lib.versionOlder version "8.0") ''
|
||||
# Hack to fix building against recent Glibc/GCC.
|
||||
echo "NIX_CFLAGS_COMPILE+=' -D_FORCE_INLINES'" >> $out/nix-support/setup-hook
|
||||
'' + ''
|
||||
runHook postInstall
|
||||
'';
|
||||
|
||||
postInstall = ''
|
||||
for b in nvvp nsight; do
|
||||
wrapProgram "$out/bin/$b" \
|
||||
--set GDK_PIXBUF_MODULE_FILE "$GDK_PIXBUF_MODULE_FILE"
|
||||
done
|
||||
'';
|
||||
|
||||
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)
|
||||
'';
|
||||
|
||||
# Set RPATH so that libcuda and other libraries in
|
||||
# /run/opengl-driver(-32)/lib can be found. See the explanation in
|
||||
# addOpenGLRunpath. Don't try to figure out which libraries really need
|
||||
# it, just patch all (but not the stubs libraries). Note that
|
||||
# --force-rpath prevents changing RPATH (set above) to RUNPATH.
|
||||
postFixup = ''
|
||||
addOpenGLRunpath --force-rpath {$out,$lib}/lib/lib*.so
|
||||
'';
|
||||
|
||||
# cuda-gdb doesn't run correctly when not using sandboxing, so
|
||||
# temporarily disabling the install check. This should be set to true
|
||||
# when we figure out how to get `cuda-gdb --version` to run correctly
|
||||
# when not using sandboxing.
|
||||
doInstallCheck = false;
|
||||
postInstallCheck = let
|
||||
in ''
|
||||
# Smoke test binaries
|
||||
pushd $out/bin
|
||||
for f in *; do
|
||||
case $f in
|
||||
crt) continue;;
|
||||
nvcc.profile) continue;;
|
||||
nsight_ee_plugins_manage.sh) continue;;
|
||||
uninstall_cuda_toolkit_6.5.pl) continue;;
|
||||
computeprof|nvvp|nsight) continue;; # GUIs don't feature "--version"
|
||||
*) echo "Executing '$f --version':"; ./$f --version;;
|
||||
esac
|
||||
done
|
||||
popd
|
||||
'';
|
||||
passthru = {
|
||||
cc = gcc;
|
||||
majorVersion = lib.versions.majorMinor version;
|
||||
};
|
||||
|
||||
meta = with stdenv.lib; {
|
||||
description = "A compiler for NVIDIA GPUs, math libraries, and tools";
|
||||
homepage = "https://developer.nvidia.com/cuda-toolkit";
|
||||
platforms = [ "x86_64-linux" ];
|
||||
license = licenses.unfree;
|
||||
};
|
||||
}
|
||||
|
||||
@@ -1,196 +1,13 @@
|
||||
{ lib, stdenv, makeWrapper, fetchurl, requireFile, perl, ncurses5, expat, python27, zlib
|
||||
, gcc48, gcc49, gcc5, gcc6, gcc7
|
||||
, xorg, gtk2, gdk-pixbuf, glib, fontconfig, freetype, unixODBC, alsaLib, glibc
|
||||
, addOpenGLRunpath
|
||||
{ lib
|
||||
, callPackage
|
||||
, fetchurl
|
||||
, gcc48
|
||||
, gcc6
|
||||
, gcc7
|
||||
}:
|
||||
|
||||
let
|
||||
|
||||
common =
|
||||
args@{ gcc, version, sha256
|
||||
, url ? ""
|
||||
, name ? ""
|
||||
, developerProgram ? false
|
||||
, python ? python27
|
||||
, runPatches ? []
|
||||
}:
|
||||
|
||||
stdenv.mkDerivation rec {
|
||||
pname = "cudatoolkit";
|
||||
inherit version runPatches;
|
||||
|
||||
dontPatchELF = true;
|
||||
dontStrip = true;
|
||||
|
||||
src =
|
||||
if developerProgram then
|
||||
requireFile {
|
||||
message = ''
|
||||
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://\$PWD/${args.name}
|
||||
'';
|
||||
inherit (args) name sha256;
|
||||
}
|
||||
else
|
||||
fetchurl {
|
||||
inherit (args) url sha256;
|
||||
};
|
||||
|
||||
outputs = [ "out" "lib" "doc" ];
|
||||
|
||||
nativeBuildInputs = [ perl makeWrapper addOpenGLRunpath ];
|
||||
buildInputs = [ gdk-pixbuf ]; # To get $GDK_PIXBUF_MODULE_FILE via setup-hook
|
||||
runtimeDependencies = [
|
||||
ncurses5 expat python zlib glibc
|
||||
xorg.libX11 xorg.libXext xorg.libXrender xorg.libXt xorg.libXtst xorg.libXi xorg.libXext
|
||||
gtk2 glib fontconfig freetype unixODBC alsaLib
|
||||
];
|
||||
|
||||
rpath = "${stdenv.lib.makeLibraryPath runtimeDependencies}:${stdenv.cc.cc.lib}/lib64";
|
||||
|
||||
unpackPhase = ''
|
||||
sh $src --keep --noexec
|
||||
|
||||
cd pkg/run_files
|
||||
sh cuda-linux*.run --keep --noexec
|
||||
sh cuda-samples*.run --keep --noexec
|
||||
mv pkg ../../$(basename $src)
|
||||
cd ../..
|
||||
rm -rf pkg
|
||||
|
||||
for patch in $runPatches; do
|
||||
sh $patch --keep --noexec
|
||||
mv pkg $(basename $patch)
|
||||
done
|
||||
'';
|
||||
|
||||
installPhase = ''
|
||||
runHook preInstall
|
||||
mkdir $out
|
||||
cd $(basename $src)
|
||||
export PERL5LIB=.
|
||||
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?
|
||||
|
||||
# let's remove the 32-bit libraries, they confuse the lib64->lib mover
|
||||
rm -rf $out/lib
|
||||
|
||||
# Remove some cruft.
|
||||
${lib.optionalString (lib.versionAtLeast version "7.0") "rm $out/bin/uninstall*"}
|
||||
|
||||
# Fixup path to samples (needed for cuda 6.5 or else nsight will not find them)
|
||||
if [ -d "$out"/cuda-samples ]; then
|
||||
mv "$out"/cuda-samples "$out"/samples
|
||||
fi
|
||||
|
||||
# Change the #error on GCC > 4.9 to a #warning.
|
||||
sed -i $out/include/host_config.h -e 's/#error\(.*unsupported GNU version\)/#warning\1/'
|
||||
|
||||
# Fix builds with newer glibc version
|
||||
sed -i "1 i#define _BITS_FLOATN_H" "$out/include/host_defines.h"
|
||||
|
||||
# Ensure that cmake can find CUDA.
|
||||
mkdir -p $out/nix-support
|
||||
echo "cmakeFlags+=' -DCUDA_TOOLKIT_ROOT_DIR=$out'" >> $out/nix-support/setup-hook
|
||||
|
||||
# Move some libraries to the lib output so that programs that
|
||||
# depend on them don't pull in this entire monstrosity.
|
||||
mkdir -p $lib/lib
|
||||
mv -v $out/lib64/libcudart* $lib/lib/
|
||||
|
||||
# Remove OpenCL libraries as they are provided by ocl-icd and driver.
|
||||
rm -f $out/lib64/libOpenCL*
|
||||
|
||||
# Set compiler for NVCC.
|
||||
wrapProgram $out/bin/nvcc \
|
||||
--prefix PATH : ${gcc}/bin
|
||||
|
||||
# nvprof do not find any program to profile if LD_LIBRARY_PATH is not set
|
||||
wrapProgram $out/bin/nvprof \
|
||||
--prefix LD_LIBRARY_PATH : $out/lib
|
||||
'' + lib.optionalString (lib.versionOlder version "8.0") ''
|
||||
# Hack to fix building against recent Glibc/GCC.
|
||||
echo "NIX_CFLAGS_COMPILE+=' -D_FORCE_INLINES'" >> $out/nix-support/setup-hook
|
||||
'' + ''
|
||||
runHook postInstall
|
||||
'';
|
||||
|
||||
postInstall = ''
|
||||
for b in nvvp nsight; do
|
||||
wrapProgram "$out/bin/$b" \
|
||||
--set GDK_PIXBUF_MODULE_FILE "$GDK_PIXBUF_MODULE_FILE"
|
||||
done
|
||||
'';
|
||||
|
||||
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)
|
||||
'';
|
||||
|
||||
# Set RPATH so that libcuda and other libraries in
|
||||
# /run/opengl-driver(-32)/lib can be found. See the explanation in
|
||||
# addOpenGLRunpath. Don't try to figure out which libraries really need
|
||||
# it, just patch all (but not the stubs libraries). Note that
|
||||
# --force-rpath prevents changing RPATH (set above) to RUNPATH.
|
||||
postFixup = ''
|
||||
addOpenGLRunpath --force-rpath {$out,$lib}/lib/lib*.so
|
||||
'';
|
||||
|
||||
# cuda-gdb doesn't run correctly when not using sandboxing, so
|
||||
# temporarily disabling the install check. This should be set to true
|
||||
# when we figure out how to get `cuda-gdb --version` to run correctly
|
||||
# when not using sandboxing.
|
||||
doInstallCheck = false;
|
||||
postInstallCheck = let
|
||||
in ''
|
||||
# Smoke test binaries
|
||||
pushd $out/bin
|
||||
for f in *; do
|
||||
case $f in
|
||||
crt) continue;;
|
||||
nvcc.profile) continue;;
|
||||
nsight_ee_plugins_manage.sh) continue;;
|
||||
uninstall_cuda_toolkit_6.5.pl) continue;;
|
||||
computeprof|nvvp|nsight) continue;; # GUIs don't feature "--version"
|
||||
*) echo "Executing '$f --version':"; ./$f --version;;
|
||||
esac
|
||||
done
|
||||
popd
|
||||
'';
|
||||
passthru = {
|
||||
cc = gcc;
|
||||
majorVersion = lib.versions.majorMinor version;
|
||||
};
|
||||
|
||||
meta = with stdenv.lib; {
|
||||
description = "A compiler for NVIDIA GPUs, math libraries, and tools";
|
||||
homepage = "https://developer.nvidia.com/cuda-toolkit";
|
||||
platforms = [ "x86_64-linux" ];
|
||||
license = licenses.unfree;
|
||||
};
|
||||
};
|
||||
|
||||
common = callPackage ./common.nix;
|
||||
in rec {
|
||||
cudatoolkit_6 = common {
|
||||
version = "6.0.37";
|
||||
@@ -210,14 +27,14 @@ in rec {
|
||||
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;
|
||||
gcc = gcc6;
|
||||
};
|
||||
|
||||
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;
|
||||
gcc = gcc6;
|
||||
};
|
||||
|
||||
cudatoolkit_8 = common {
|
||||
@@ -230,7 +47,7 @@ in rec {
|
||||
sha256 = "1iaz5rrsnsb1p99qiqvxn6j3ksc7ry8xlr397kqcjzxqbljbqn9d";
|
||||
})
|
||||
];
|
||||
gcc = gcc5;
|
||||
gcc = gcc6;
|
||||
};
|
||||
|
||||
cudatoolkit_9_0 = common {
|
||||
@@ -302,5 +119,21 @@ in rec {
|
||||
gcc = gcc7;
|
||||
};
|
||||
|
||||
cudatoolkit_10 = cudatoolkit_10_0;
|
||||
cudatoolkit_10_1 = common {
|
||||
version = "10.1.243";
|
||||
url = "https://developer.download.nvidia.com/compute/cuda/10.1/Prod/local_installers/cuda_10.1.243_418.87.00_linux.run";
|
||||
sha256 = "0caxhlv2bdq863dfp6wj7nad66ml81vasq2ayf11psvq2b12vhp7";
|
||||
|
||||
gcc = gcc7;
|
||||
};
|
||||
|
||||
cudatoolkit_10_2 = common {
|
||||
version = "10.2.89";
|
||||
url = "http://developer.download.nvidia.com/compute/cuda/10.2/Prod/local_installers/cuda_10.2.89_440.33.01_linux.run";
|
||||
sha256 = "04fasl9sjkb1jvchvqgaqxprnprcz7a8r52249zp2ijarzyhf3an";
|
||||
|
||||
gcc = gcc7;
|
||||
};
|
||||
|
||||
cudatoolkit_10 = cudatoolkit_10_2;
|
||||
}
|
||||
|
||||
@@ -3,12 +3,12 @@
|
||||
, cmake
|
||||
, pkgconfig
|
||||
, libffi
|
||||
, llvm_35
|
||||
, llvm_6
|
||||
, doCheck ? false
|
||||
, perl
|
||||
}:
|
||||
|
||||
let version = "20170519";
|
||||
let version = "20181024";
|
||||
|
||||
in stdenv.mkDerivation {
|
||||
pname = "dale";
|
||||
@@ -17,16 +17,14 @@ in stdenv.mkDerivation {
|
||||
src = fetchFromGitHub {
|
||||
owner = "tomhrr";
|
||||
repo = "dale";
|
||||
rev = "39e16d8e89fa070de65a673d4462e783d530f95a";
|
||||
sha256 = "0dc5cjahv7lzlp92hidlh83rwgrpgb6xz2pnba2pm5xrv2pnsskl";
|
||||
rev = "f5db8b486f4e7c423fc25941a8315f1209bc0e54";
|
||||
sha256 = "0v4ajrzrqvf279kd7wsd9flrpsav57lzxlwwimk9vnfwh7xpzf9v";
|
||||
};
|
||||
|
||||
nativeBuildInputs = [ pkgconfig ];
|
||||
buildInputs = [ cmake libffi llvm_35 ]
|
||||
buildInputs = [ cmake libffi llvm_6 ]
|
||||
++ stdenv.lib.optional doCheck perl;
|
||||
|
||||
patches = [ ./link-llvm.patch ];
|
||||
|
||||
inherit doCheck;
|
||||
|
||||
checkTarget = "tests";
|
||||
|
||||
@@ -1,10 +0,0 @@
|
||||
--- dale-39e16d8e89fa070de65a673d4462e783d530f95a-src.org/CMakeLists.txt 2017-06-22 08:01:05.839531242 +0100
|
||||
+++ dale-39e16d8e89fa070de65a673d4462e783d530f95a-src/CMakeLists.txt 2017-06-22 07:59:11.777566801 +0100
|
||||
@@ -78,6 +78,7 @@
|
||||
execute_process (COMMAND ${LLVM_CONFIG} --libs
|
||||
OUTPUT_VARIABLE LLVM_LIBS
|
||||
OUTPUT_STRIP_TRAILING_WHITESPACE)
|
||||
+STRING(REGEX REPLACE " " ";" LLVM_LIBS "${LLVM_LIBS}")
|
||||
if (${D_LLVM_VERSION_MINOR} GREATER 4)
|
||||
execute_process (COMMAND ${LLVM_CONFIG} --system-libs
|
||||
OUTPUT_VARIABLE LLVM_SYSTEM_LIBS
|
||||
@@ -11,7 +11,7 @@ stdenv.mkDerivation rec {
|
||||
|
||||
hardeningDisable = [ "format" ];
|
||||
|
||||
makeFlags = "PREFIX=$(out)";
|
||||
makeFlags = [ "PREFIX=$(out)" ];
|
||||
|
||||
meta = {
|
||||
description = "Linux 8086 development environment";
|
||||
|
||||
@@ -0,0 +1,68 @@
|
||||
{ type
|
||||
, version
|
||||
, sha512
|
||||
}:
|
||||
assert builtins.elem type [ "aspnetcore" "netcore" "sdk"];
|
||||
{ stdenv
|
||||
, fetchurl
|
||||
, libunwind
|
||||
, openssl
|
||||
, icu
|
||||
, libuuid
|
||||
, zlib
|
||||
, curl
|
||||
}:
|
||||
let pname = if type == "aspnetcore" then "aspnetcore-runtime" else if type == "netcore" then "dotnet-runtime" else "dotnet-sdk";
|
||||
urls = {
|
||||
aspnetcore = "https://dotnetcli.azureedge.net/dotnet/aspnetcore/Runtime/${version}/${pname}-${version}-linux-x64.tar.gz";
|
||||
netcore = "https://dotnetcli.azureedge.net/dotnet/Runtime/${version}/${pname}-${version}-linux-x64.tar.gz";
|
||||
sdk = "https://dotnetcli.azureedge.net/dotnet/Sdk/${version}/${pname}-${version}-linux-x64.tar.gz";
|
||||
};
|
||||
descriptions = {
|
||||
aspnetcore = "ASP .NET Core runtime ${version}";
|
||||
netcore = ".NET Core runtime ${version}";
|
||||
sdk = ".NET SDK ${version}";
|
||||
};
|
||||
in stdenv.mkDerivation rec {
|
||||
inherit pname version;
|
||||
|
||||
rpath = stdenv.lib.makeLibraryPath [ stdenv.cc.cc libunwind libuuid icu openssl zlib curl ];
|
||||
|
||||
src = fetchurl {
|
||||
url = builtins.getAttr type urls;
|
||||
inherit sha512;
|
||||
};
|
||||
|
||||
sourceRoot = ".";
|
||||
|
||||
dontPatchELF = true;
|
||||
noDumpEnvVars = true;
|
||||
|
||||
installPhase = ''
|
||||
runHook preInstall
|
||||
mkdir -p $out/bin
|
||||
cp -r ./ $out
|
||||
ln -s $out/dotnet $out/bin/dotnet
|
||||
runHook postInstall
|
||||
'';
|
||||
|
||||
postFixup = ''
|
||||
patchelf --set-interpreter "${stdenv.cc.bintools.dynamicLinker}" $out/dotnet
|
||||
patchelf --set-rpath "${rpath}" $out/dotnet
|
||||
find $out -type f -name "*.so" -exec patchelf --set-rpath '$ORIGIN:${rpath}' {} \;
|
||||
find $out -type f -name "apphost" -exec patchelf --set-interpreter "${stdenv.cc.bintools.dynamicLinker}" --set-rpath '$ORIGIN:${rpath}' {} \;
|
||||
'';
|
||||
|
||||
doInstallCheck = true;
|
||||
installCheckPhase = ''
|
||||
$out/bin/dotnet --info
|
||||
'';
|
||||
|
||||
meta = with stdenv.lib; {
|
||||
homepage = https://dotnet.github.io/;
|
||||
description = builtins.getAttr type descriptions;
|
||||
platforms = [ "x86_64-linux" ];
|
||||
maintainers = with maintainers; [ kuznero ];
|
||||
license = licenses.mit;
|
||||
};
|
||||
}
|
||||
@@ -0,0 +1,20 @@
|
||||
packages:
|
||||
{ buildEnv, lib }:
|
||||
let cli = builtins.head packages;
|
||||
in
|
||||
assert lib.assertMsg ((builtins.length packages) != 0)
|
||||
''You must include at least one package, e.g
|
||||
`with dotnetCorePackages; combinePackages {
|
||||
packages = [ sdk_3_0 aspnetcore_2_1 ];
|
||||
};`'' ;
|
||||
buildEnv {
|
||||
name = "dotnet-core-combined";
|
||||
paths = packages;
|
||||
pathsToLink = [ "/host" "/packs" "/sdk" "/shared" "/templates" ];
|
||||
ignoreCollisions = true;
|
||||
postBuild = ''
|
||||
cp ${cli}/dotnet $out/dotnet
|
||||
mkdir $out/bin
|
||||
ln -s $out/dotnet $out/bin/
|
||||
'';
|
||||
}
|
||||
@@ -0,0 +1,68 @@
|
||||
/*
|
||||
How to combine packages for use in development:
|
||||
dotnetCombined = with dotnetCorePackages; combinePackages [ sdk_3_1 sdk_2_2 sdk_3_0 sdk aspnetcore_2_1 ];
|
||||
*/
|
||||
{ callPackage }:
|
||||
let
|
||||
buildDotnet = attrs: callPackage (import ./buildDotnet.nix attrs) {};
|
||||
buildAspNetCore = attrs: buildDotnet (attrs // { type = "aspnetcore"; } );
|
||||
buildNetCore = attrs: buildDotnet (attrs // { type = "netcore"; } );
|
||||
buildNetCoreSdk = attrs: buildDotnet (attrs // { type = "sdk"; } );
|
||||
in rec {
|
||||
combinePackages = attrs: callPackage (import ./combinePackages.nix attrs) {};
|
||||
|
||||
# v2.1.15 (LTS)
|
||||
|
||||
aspnetcore_2_1 = buildAspNetCore {
|
||||
version = "2.1.16";
|
||||
sha512 = "0awdzi8dysbg8xcy4l8wx2sb8gaaklphmwv61qxh7dj6ih4nla34l02xdax1l8nw41znnnqzsa77avglnrz36pckm9mc52m7wc7877h";
|
||||
};
|
||||
|
||||
netcore_2_1 = buildNetCore {
|
||||
version = "2.1.16";
|
||||
sha512 = "07vvmza32hsblpw4zpcksm2gicy4agh0d1fwradqj16y6xbh3frdp87mqgbj5m54mmyfp5bc8c46v1w6dfm1w3y80v2y46aynild45l";
|
||||
};
|
||||
|
||||
sdk_2_1 = buildNetCoreSdk {
|
||||
version = "2.1.804";
|
||||
sha512 = "1kbzxcdgyvs94kkm6ikr1j0p0k3zq30d10sl69ig0rgbqbqm4rpqi6dq94jjbw7q3jlwz83vgq3549q38d2s9kalmzv9lmddn2kkc42";
|
||||
};
|
||||
|
||||
# v2.2
|
||||
|
||||
sdk_2_2 = throw "Dotnet SDK 2.2 is EOL, please use 3.1";
|
||||
|
||||
# v3.0.2 (Maintenance)
|
||||
|
||||
aspnetcore_3_0 = buildAspNetCore {
|
||||
version = "3.0.3";
|
||||
sha512 = "342v6kxxbxky09d1c392vvr9rm30lf75wccka1bk2h4advlcga5nlgv93g7vrq48bsyxfi5gc36r3b0dlwl1g409g5mlk1042n6d0yq";
|
||||
};
|
||||
|
||||
netcore_3_0 = buildNetCore {
|
||||
version = "3.0.3";
|
||||
sha512 = "32ykpcw2xx708r2lxcwcbxnmy4sk159rlfjfvkw990qh7n79pm3lm2qwa3zhqcslznmpg18kwxz8qb5fgsa0h49g843xx4kyai0n7rx";
|
||||
};
|
||||
|
||||
sdk_3_0 = buildNetCoreSdk {
|
||||
version = "3.0.103";
|
||||
sha512 = "2diiplgxs92fkb6ym68b02d79z4qn63x5qlky5lvr757c1zkh0vfpk3khawdg94kdn4qkn6dmyqr0msxqgmiqyhp63cadzqq4vx7b12";
|
||||
};
|
||||
|
||||
# v3.1.1 (LTS)
|
||||
|
||||
aspnetcore_3_1 = buildAspNetCore {
|
||||
version = "3.1.2";
|
||||
sha512 = "27708bk5liz8r39p4dzs41clgq298d49g8ipzdj56pz613vkfyv7bp91666ydz36aazm265j2g9ji3sk1f9kbgv6024zwrly5w9vqrm";
|
||||
};
|
||||
|
||||
netcore_3_1 = buildNetCore {
|
||||
version = "3.1.2";
|
||||
sha512 = "3zwg1anrcni9kagmjxn485bpjvb146hkm7irmikq3v879gjhd2fgpscg226ds83l4pxll3r7lwris6ij952xmy8lsqraapd9111ba14";
|
||||
};
|
||||
|
||||
sdk_3_1 = buildNetCoreSdk {
|
||||
version = "3.1.102";
|
||||
sha512 = "0lmz8ac5j0i4zcq4904kr6qibvyjcm2ckfg27kqyqfii00qmm80xb5sk3i7f06xqkbgkrqkbg9rsldk75akw6m5dxg932j602bxrb4w";
|
||||
};
|
||||
}
|
||||
@@ -1,54 +0,0 @@
|
||||
{ stdenv
|
||||
, fetchurl
|
||||
, libunwind
|
||||
, openssl
|
||||
, icu
|
||||
, libuuid
|
||||
, zlib
|
||||
, curl
|
||||
}:
|
||||
|
||||
let
|
||||
rpath = stdenv.lib.makeLibraryPath [ stdenv.cc.cc libunwind libuuid icu openssl zlib curl ];
|
||||
in
|
||||
stdenv.mkDerivation rec {
|
||||
version = "2.2.401";
|
||||
netCoreVersion = "2.2.6";
|
||||
pname = "dotnet-sdk";
|
||||
|
||||
src = fetchurl {
|
||||
url = "https://dotnetcli.azureedge.net/dotnet/Sdk/${version}/${pname}-${version}-linux-x64.tar.gz";
|
||||
# use sha512 from the download page
|
||||
sha512 = "05w3zk7bcd8sv3k4kplf20j906and2006g1fggq7y6kaxrlhdnpd6jhy6idm8v5bz48wfxga5b4yys9qx0fp3p8yl7wi67qljpzrq88";
|
||||
};
|
||||
|
||||
sourceRoot = ".";
|
||||
|
||||
buildPhase = ''
|
||||
runHook preBuild
|
||||
patchelf --set-interpreter "${stdenv.cc.bintools.dynamicLinker}" ./dotnet
|
||||
patchelf --set-rpath "${rpath}" ./dotnet
|
||||
find -type f -name "*.so" -exec patchelf --set-rpath '$ORIGIN:${rpath}' {} \;
|
||||
echo -n "dotnet-sdk version: "
|
||||
./dotnet --version
|
||||
runHook postBuild
|
||||
'';
|
||||
|
||||
dontPatchELF = true;
|
||||
|
||||
installPhase = ''
|
||||
runHook preInstall
|
||||
mkdir -p $out/bin
|
||||
cp -r ./ $out
|
||||
ln -s $out/dotnet $out/bin/dotnet
|
||||
runHook postInstall
|
||||
'';
|
||||
|
||||
meta = with stdenv.lib; {
|
||||
homepage = https://dotnet.github.io/;
|
||||
description = ".NET Core SDK ${version} with .NET Core ${netCoreVersion}";
|
||||
platforms = [ "x86_64-linux" ];
|
||||
maintainers = with maintainers; [ kuznero ];
|
||||
license = licenses.mit;
|
||||
};
|
||||
}
|
||||
@@ -1,5 +1,5 @@
|
||||
{ stdenv, lib, fetchgit, flex, bison, pkgconfig, which
|
||||
, pythonSupport ? stdenv.buildPlatform == stdenv.hostPlatform, python, swig
|
||||
, pythonSupport ? false, python, swig
|
||||
}:
|
||||
|
||||
stdenv.mkDerivation rec {
|
||||
|
||||
@@ -61,6 +61,7 @@ stdenv.mkDerivation {
|
||||
url = "https://git.sagemath.org/sage.git/plain/build/pkgs/ecl/patches/16.1.2-getcwd.patch?id=07d6c37d18811e2b377a9689790a7c5e24da16ba";
|
||||
sha256 = "1fbi8gn7rv8nqff5mpaijsrch3k3z7qc5cn4h1vl8qrr8xwqlqhb";
|
||||
})
|
||||
./ecl-1.16.2-libffi-3.3-abi.patch
|
||||
];
|
||||
|
||||
hardeningDisable = [ "format" ];
|
||||
|
||||
@@ -35,6 +35,10 @@ stdenv.mkDerivation {
|
||||
inherit (s) url sha256;
|
||||
};
|
||||
|
||||
patches = [
|
||||
./libffi-3.3-abi.patch
|
||||
];
|
||||
|
||||
configureFlags = [
|
||||
(if threadSupport then "--enable-threads" else "--disable-threads")
|
||||
"--with-gmp-prefix=${gmp.dev}"
|
||||
|
||||
@@ -0,0 +1,15 @@
|
||||
diff --git a/src/c/ffi.d b/src/c/ffi.d
|
||||
index 8861303e..8a959c23 100644
|
||||
--- a/src/c/ffi.d
|
||||
+++ b/src/c/ffi.d
|
||||
@@ -145,8 +145,8 @@ static struct {
|
||||
#elif defined(X86_WIN64)
|
||||
{@':win64', FFI_WIN64},
|
||||
#elif defined(X86_ANY) || defined(X86) || defined(X86_64)
|
||||
- {@':cdecl', FFI_SYSV},
|
||||
- {@':sysv', FFI_SYSV},
|
||||
+ {@':cdecl', FFI_UNIX64},
|
||||
+ {@':sysv', FFI_UNIX64},
|
||||
{@':unix64', FFI_UNIX64},
|
||||
#endif
|
||||
};
|
||||
@@ -0,0 +1,15 @@
|
||||
diff --git a/src/c/ffi.d b/src/c/ffi.d
|
||||
index 8174977a..caa69f39 100644
|
||||
--- a/src/c/ffi.d
|
||||
+++ b/src/c/ffi.d
|
||||
@@ -133,8 +133,8 @@ static struct {
|
||||
#elif defined(X86_WIN64)
|
||||
{@':win64', FFI_WIN64},
|
||||
#elif defined(X86_ANY) || defined(X86) || defined(X86_64)
|
||||
- {@':cdecl', FFI_SYSV},
|
||||
- {@':sysv', FFI_SYSV},
|
||||
+ {@':cdecl', FFI_UNIX64},
|
||||
+ {@':sysv', FFI_UNIX64},
|
||||
{@':unix64', FFI_UNIX64},
|
||||
#endif
|
||||
};
|
||||
@@ -14,13 +14,13 @@ else
|
||||
|
||||
edk2 = stdenv.mkDerivation {
|
||||
pname = "edk2";
|
||||
version = "201905";
|
||||
version = "201911";
|
||||
|
||||
# submodules
|
||||
src = fetchgit {
|
||||
url = "https://github.com/tianocore/edk2";
|
||||
rev = "edk2-stable${edk2.version}";
|
||||
sha256 = "0fk40h4nj4qg8shg0yd1zj4iyspslms5fx95ysi04akv90k5sqkn";
|
||||
sha256 = "1rmvb4w043v25cppsqxqrpzqqcay3yrzsrhhzm2q9bncrj56vm8q";
|
||||
};
|
||||
|
||||
buildInputs = [ libuuid pythonEnv ];
|
||||
|
||||
@@ -52,7 +52,7 @@ stdenv.mkDerivation rec {
|
||||
];
|
||||
|
||||
# skip interactive browser check
|
||||
buildFlags = "nobrowsers";
|
||||
buildFlags = [ "nobrowsers" ];
|
||||
|
||||
|
||||
preConfigure=''
|
||||
|
||||
@@ -4,31 +4,17 @@
|
||||
let
|
||||
fetchElmDeps = import ./fetchElmDeps.nix { inherit stdenv lib fetchurl; };
|
||||
|
||||
patchBinwrap = import ./packages/patch-binwrap.nix { inherit lib writeScriptBin stdenv; };
|
||||
|
||||
elmNodePackages =
|
||||
import ./packages/node-composition.nix {
|
||||
inherit nodejs pkgs;
|
||||
inherit (stdenv.hostPlatform) system;
|
||||
};
|
||||
|
||||
hsPkgs = haskell.packages.ghc865.override {
|
||||
hsPkgs = haskell.packages.ghc881.override {
|
||||
overrides = self: super: with haskell.lib;
|
||||
let elmPkgs = rec {
|
||||
elm = overrideCabal (self.callPackage ./packages/elm.nix { }) (drv: {
|
||||
# sadly with parallelism most of the time breaks compilation
|
||||
# also compilation is slower with increasing number of cores anyway (Tested on Ryzen 7 and i7)
|
||||
enableParallelBuilding = false;
|
||||
preConfigure = self.fetchElmDeps {
|
||||
elmPackages = (import ./packages/elm-srcs.nix);
|
||||
versionsDat = ./versions.dat;
|
||||
elmVersion = drv.version;
|
||||
registryDat = ./registry.dat;
|
||||
};
|
||||
patches = [
|
||||
(fetchpatch {
|
||||
url = "https://github.com/elm/compiler/pull/1886/commits/39d86a735e28da514be185d4c3256142c37c2a8a.patch";
|
||||
sha256 = "0nni5qx1523rjz1ja42z6z9pijxvi3fgbw1dhq5qi11mh1nb9ay7";
|
||||
})
|
||||
];
|
||||
buildTools = drv.buildTools or [] ++ [ makeWrapper ];
|
||||
jailbreak = true;
|
||||
postInstall = ''
|
||||
@@ -41,26 +27,31 @@ let
|
||||
The elm-format expression is updated via a script in the https://github.com/avh4/elm-format repo:
|
||||
`package/nix/build.sh`
|
||||
*/
|
||||
elm-format = justStaticExecutables (doJailbreak (self.callPackage ./packages/elm-format.nix {}));
|
||||
|
||||
elmi-to-json = justStaticExecutables (self.callPackage ./packages/elmi-to-json.nix {});
|
||||
elm-format = justStaticExecutables (overrideCabal (self.callPackage ./packages/elm-format.nix {}) (drv: {
|
||||
# GHC 8.8.1 support
|
||||
# https://github.com/avh4/elm-format/pull/640
|
||||
patches = [(
|
||||
fetchpatch {
|
||||
url = "https://github.com/turboMaCk/elm-format/commit/4f4abdc7117ed6ce3335f6cf39b6495b48067b7c.patch";
|
||||
sha256 = "1zqk6q6w0ph12mnwffgwzf4h1hcgqg0v09ws9q2g5bg2riq4rvd9";
|
||||
}
|
||||
)];
|
||||
# Tests are failing after upgrade to ghc881.
|
||||
# Cause is probably just a minor change in stdout output
|
||||
# see https://github.com/avh4/elm-format/pull/640
|
||||
doCheck = false;
|
||||
jailbreak = true;
|
||||
}));
|
||||
elmi-to-json = justStaticExecutables (overrideCabal (self.callPackage ./packages/elmi-to-json.nix {}) (drv: {
|
||||
prePatch = ''
|
||||
substituteInPlace package.yaml --replace "- -Werror" ""
|
||||
hpack
|
||||
'';
|
||||
jailbreak = true;
|
||||
}));
|
||||
|
||||
inherit fetchElmDeps;
|
||||
elmVersion = elmPkgs.elm.version;
|
||||
|
||||
/*
|
||||
Node/NPM based dependecies can be upgraded using script
|
||||
`packages/generate-node-packages.sh`.
|
||||
Packages which rely on `bin-wrap` will fail by default
|
||||
and can be patched using `patchBinwrap` function defined in `packages/patch-binwrap.nix`.
|
||||
*/
|
||||
elm-test = patchBinwrap [elmi-to-json] elmNodePackages.elm-test;
|
||||
elm-verify-examples = patchBinwrap [elmi-to-json] elmNodePackages.elm-verify-examples;
|
||||
elm-language-server = elmNodePackages."@elm-tooling/elm-language-server";
|
||||
|
||||
# elm-analyse@0.16.4 build is not working
|
||||
elm-analyse = elmNodePackages."elm-analyse-0.16.3";
|
||||
inherit (elmNodePackages) elm-doc-preview elm-live elm-upgrade elm-xref;
|
||||
};
|
||||
in elmPkgs // {
|
||||
inherit elmPkgs;
|
||||
@@ -69,4 +60,29 @@ let
|
||||
indents = self.callPackage ./packages/indents.nix {};
|
||||
};
|
||||
};
|
||||
in hsPkgs.elmPkgs
|
||||
|
||||
/*
|
||||
Node/NPM based dependecies can be upgraded using script
|
||||
`packages/generate-node-packages.sh`.
|
||||
Packages which rely on `bin-wrap` will fail by default
|
||||
and can be patched using `patchBinwrap` function defined in `packages/patch-binwrap.nix`.
|
||||
*/
|
||||
elmNodePackages =
|
||||
let
|
||||
nodePkgs = import ./packages/node-composition.nix {
|
||||
inherit nodejs pkgs;
|
||||
inherit (stdenv.hostPlatform) system;
|
||||
};
|
||||
in with hsPkgs.elmPkgs; {
|
||||
elm-test = patchBinwrap [elmi-to-json] nodePkgs.elm-test;
|
||||
elm-verify-examples = patchBinwrap [elmi-to-json] nodePkgs.elm-verify-examples;
|
||||
elm-language-server = nodePkgs."@elm-tooling/elm-language-server";
|
||||
|
||||
inherit (nodePkgs) elm-doc-preview elm-live elm-upgrade elm-xref elm-analyse;
|
||||
};
|
||||
|
||||
patchBinwrap = import ./packages/patch-binwrap.nix { inherit lib writeScriptBin stdenv; };
|
||||
|
||||
in hsPkgs.elmPkgs // elmNodePackages // {
|
||||
lib = { inherit patchBinwrap; };
|
||||
}
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
{stdenv, lib, fetchurl}:
|
||||
|
||||
{elmPackages, versionsDat}:
|
||||
{elmPackages, registryDat, elmVersion}:
|
||||
|
||||
let
|
||||
makeDotElm = import ./makeDotElm.nix {inherit stdenv lib fetchurl versionsDat;};
|
||||
makeDotElm = import ./makeDotElm.nix {inherit stdenv lib fetchurl registryDat;};
|
||||
|
||||
in
|
||||
''
|
||||
export ELM_HOME=`pwd`/.elm
|
||||
'' + (makeDotElm "0.19.0" elmPackages)
|
||||
'' + (makeDotElm elmVersion elmPackages)
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
{stdenv, lib, fetchurl, versionsDat}:
|
||||
{stdenv, lib, fetchurl, registryDat}:
|
||||
|
||||
ver: deps:
|
||||
let cmds = lib.mapAttrsToList (name: info: let
|
||||
@@ -11,20 +11,17 @@ ver: deps:
|
||||
inherit (info) sha256;
|
||||
};
|
||||
|
||||
phases = [ "unpackPhase" "installPhase" ];
|
||||
|
||||
installPhase = ''
|
||||
mkdir -p $out
|
||||
cp -r * $out
|
||||
'';
|
||||
|
||||
};
|
||||
in ''
|
||||
mkdir -p .elm/${ver}/package/${name}
|
||||
cp -R ${pkg} .elm/${ver}/package/${name}/${info.version}
|
||||
mkdir -p .elm/${ver}/packages/${name}
|
||||
cp -R ${pkg} .elm/${ver}/packages/${name}/${info.version}
|
||||
'') deps;
|
||||
in (lib.concatStrings cmds) + ''
|
||||
mkdir -p .elm/${ver}/package;
|
||||
cp ${versionsDat} .elm/${ver}/package/versions.dat;
|
||||
mkdir -p .elm/${ver}/packages;
|
||||
cp ${registryDat} .elm/${ver}/packages/registry.dat;
|
||||
chmod -R +w .elm
|
||||
''
|
||||
|
||||
@@ -6,11 +6,11 @@
|
||||
}:
|
||||
mkDerivation {
|
||||
pname = "elm-format";
|
||||
version = "0.8.2";
|
||||
version = "0.8.3";
|
||||
src = fetchgit {
|
||||
url = "https://github.com/avh4/elm-format";
|
||||
sha256 = "0ly37fszrfviwqgrww57ikdcr7i8lcpczhqm8xqp5s7mrlpdxv7z";
|
||||
rev = "ab3627cce01e5556b3fe8c2b5e3d92b80bfc74af";
|
||||
sha256 = "0n6lrqj6mq044hdyraj3ss5cg74dn8k4z05xmwn2apjpm146iaw8";
|
||||
rev = "b97e3593d564a1e069c0a022da8cbd98ca2c5a4b";
|
||||
};
|
||||
postPatch = ''
|
||||
mkdir -p ./generated
|
||||
@@ -18,7 +18,7 @@ mkDerivation {
|
||||
module Build_elm_format where
|
||||
|
||||
gitDescribe :: String
|
||||
gitDescribe = "0.8.2"
|
||||
gitDescribe = "0.8.3"
|
||||
EOHS
|
||||
'';
|
||||
isLibrary = false;
|
||||
|
||||
@@ -6,8 +6,8 @@
|
||||
};
|
||||
|
||||
"elm/json" = {
|
||||
sha256 = "1g0hafkqf2q633r7ir9wxpb1lnlzskhpsyi0h5bkzj0gl072zfnb";
|
||||
version = "1.0.0";
|
||||
sha256 = "1a107nmm905dih4w4mjjkkpdcjbgaf5qjvr7fl30kkpkckfjjnrw";
|
||||
version = "1.1.2";
|
||||
};
|
||||
|
||||
"elm/html" = {
|
||||
@@ -16,8 +16,8 @@
|
||||
};
|
||||
|
||||
"elm/svg" = {
|
||||
sha256 = "08x0v8p9wm699jjmsnbq69pxv3jh60j4f6fg7y6hyr7xxj85y390";
|
||||
version = "1.0.0";
|
||||
sha256 = "1cwcj73p61q45wqwgqvrvz3aypjyy3fw732xyxdyj6s256hwkn0k";
|
||||
version = "1.0.1";
|
||||
};
|
||||
|
||||
"elm/project-metadata-utils" = {
|
||||
@@ -26,23 +26,33 @@
|
||||
};
|
||||
|
||||
"elm/browser" = {
|
||||
sha256 = "1apmvyax93nvmagwj00y16zx10kfv640cxpi64xgqbgy7d2wphy4";
|
||||
version = "1.0.0";
|
||||
sha256 = "1zlmx672glg7fdgkvh5jm47y85pv7pdfr5mkhg6x7ar6k000vyka";
|
||||
version = "1.0.1";
|
||||
};
|
||||
|
||||
"elm/core" = {
|
||||
sha256 = "10kr86h4v5h4p0586q406a5wbl8xvr1jyrf6097zp2wb8sv21ylw";
|
||||
version = "1.0.0";
|
||||
sha256 = "1l0qdbczw91kzz8sx5d5zwz9x662bspy7p21dsr3f2rigxiix2as";
|
||||
version = "1.0.2";
|
||||
};
|
||||
|
||||
"elm/http" = {
|
||||
sha256 = "1igmm89ialzrjib1j8xagkxalq1x2gj4l0hfxcd66mpwmvg7psl8";
|
||||
version = "1.0.0";
|
||||
sha256 = "008bs76mnp48b4dw8qwjj4fyvzbxvlrl4xpa2qh1gg2kfwyw56v1";
|
||||
version = "2.0.0";
|
||||
};
|
||||
|
||||
"elm/bytes" = {
|
||||
sha256 = "040d7irrawcbnq9jxhzx8p9qacdlw5bncy6lgndd6inm53rvvwbp";
|
||||
version = "1.0.7";
|
||||
};
|
||||
|
||||
"elm/file" = {
|
||||
sha256 = "15vw1ilbg0msimq2k9magwigp8lwqrgvz3vk6qia6b3ldahvw8jr";
|
||||
version = "1.0.1";
|
||||
};
|
||||
|
||||
"elm/parser" = {
|
||||
sha256 = "0k4zlq30lrvawqvzwbvsl0hrmwf9s832mb41z7fdspm4549dj7wc";
|
||||
version = "1.0.0";
|
||||
sha256 = "0a3cxrvbm7mwg9ykynhp7vjid58zsw03r63qxipxp3z09qks7512";
|
||||
version = "1.1.0";
|
||||
};
|
||||
|
||||
"elm/url" = {
|
||||
@@ -56,7 +66,7 @@
|
||||
};
|
||||
|
||||
"elm/virtual-dom" = {
|
||||
sha256 = "0hm8g92h7z39km325dlnhk8n00nlyjkqp3r3jppr37k2k13md6aq";
|
||||
version = "1.0.0";
|
||||
sha256 = "0q1v5gi4g336bzz1lgwpn5b1639lrn63d8y6k6pimcyismp2i1yg";
|
||||
version = "1.0.2";
|
||||
};
|
||||
}
|
||||
|
||||
@@ -1,29 +1,29 @@
|
||||
{ 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
|
||||
, file-embed, filelock, filepath, ghc-prim, haskeline, HTTP
|
||||
, http-client, http-client-tls, http-types, language-glsl, mtl
|
||||
, network, parsec, process, raw-strings-qq, scientific, SHA
|
||||
, snap-core, snap-server, stdenv, template-haskell, time
|
||||
, unordered-containers, utf8-string, vector, zip-archive
|
||||
}:
|
||||
mkDerivation {
|
||||
pname = "elm";
|
||||
version = "0.19.0";
|
||||
version = "0.19.1";
|
||||
src = fetchgit {
|
||||
url = "https://github.com/elm/compiler";
|
||||
sha256 = "13jks6c6i80z71mjjfg46ri570g5ini0k3xw3857v6z66zcl56x4";
|
||||
rev = "d5cbc41aac23da463236bbc250933d037da4055a";
|
||||
sha256 = "1rdg3xp3js9xadclk3cdypkscm5wahgsfmm4ldcw3xswzhw6ri8w";
|
||||
rev = "c9aefb6230f5e0bda03205ab0499f6e4af924495";
|
||||
fetchSubmodules = true;
|
||||
};
|
||||
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
|
||||
directory edit-distance file-embed filelock filepath ghc-prim
|
||||
haskeline HTTP http-client http-client-tls http-types language-glsl
|
||||
mtl network parsec process raw-strings-qq scientific SHA snap-core
|
||||
snap-server template-haskell time unordered-containers utf8-string
|
||||
vector zip-archive
|
||||
];
|
||||
homepage = "https://elm-lang.org";
|
||||
description = "The `elm` command line interface";
|
||||
|
||||
@@ -1,27 +1,27 @@
|
||||
{ mkDerivation, aeson, async, base, binary, bytestring, containers
|
||||
, directory, filepath, hpack, optparse-applicative, safe-exceptions
|
||||
, stdenv, text, fetchgit
|
||||
{ mkDerivation, aeson, base, binary, bytestring, containers
|
||||
, directory, fetchgit, filepath, ghc-prim, hpack
|
||||
, optparse-applicative, stdenv, text, unliftio
|
||||
, unordered-containers
|
||||
}:
|
||||
mkDerivation {
|
||||
pname = "elmi-to-json";
|
||||
version = "0.19.4";
|
||||
version = "1.2.0";
|
||||
src = fetchgit {
|
||||
url = "https://github.com/stoeffel/elmi-to-json.git";
|
||||
rev = "357ad96f05e4c68023b036f27f6f65c4377c7427";
|
||||
sha256 = "0vj9fdqgg2zd1nxpll6v02fk6bcyhx00xhp3s8sd7ycvirwsim9n";
|
||||
sha256 = "1kxai87h2g0749yq0fkxwk3xaavydraaivhnavbwr62q2hw4wrj7";
|
||||
rev = "af08ceafe742a252f1f1f3c229b0ce3b3e00084d";
|
||||
fetchSubmodules = true;
|
||||
};
|
||||
isLibrary = true;
|
||||
isExecutable = true;
|
||||
libraryHaskellDepends = [
|
||||
aeson async base binary bytestring containers directory filepath
|
||||
optparse-applicative safe-exceptions text
|
||||
aeson base binary bytestring containers directory filepath ghc-prim
|
||||
optparse-applicative text unliftio unordered-containers
|
||||
];
|
||||
libraryToolDepends = [ hpack ];
|
||||
executableHaskellDepends = [ base ];
|
||||
testHaskellDepends = [ base ];
|
||||
preConfigure = "hpack";
|
||||
prePatch = "hpack";
|
||||
homepage = "https://github.com/stoeffel/elmi-to-json#readme";
|
||||
description = "Translates elmi binary files to JSON representation";
|
||||
license = stdenv.lib.licenses.bsd3;
|
||||
maintainers = with stdenv.lib.maintainers; [ turbomack ];
|
||||
}
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
"elm-verify-examples",
|
||||
"elm-doc-preview",
|
||||
"elm-upgrade",
|
||||
{ "elm-analyse": "0.16.3" },
|
||||
"elm-analyse",
|
||||
"elm-live",
|
||||
"elm-xref",
|
||||
"@elm-tooling/elm-language-server"
|
||||
|
||||
+952
-1369
File diff suppressed because it is too large
Load Diff
Binary file not shown.
@@ -1,8 +1,9 @@
|
||||
#!/usr/bin/env nix-shell
|
||||
#!nix-shell -p cabal2nix elm2nix -i bash ../../..
|
||||
|
||||
cabal2nix https://github.com/elm/compiler --revision d5cbc41aac23da463236bbc250933d037da4055a > packages/elm.nix
|
||||
elm2nix snapshot > versions.dat
|
||||
pushd "$(nix-build -A elmPackages.elm.src --no-out-link ../../../..)/ui/browser"
|
||||
cabal2nix https://github.com/elm/compiler --revision c9aefb6230f5e0bda03205ab0499f6e4af924495 > packages/elm.nix
|
||||
echo "need to manually copy registry.dat from an existing elm project"
|
||||
#elm2nix snapshot > registry.dat
|
||||
pushd "$(nix-build -A elmPackages.elm.src --no-out-link ../../../..)/reactor"
|
||||
elm2nix convert > $OLDPWD/packages/elm-srcs.nix
|
||||
popd
|
||||
|
||||
Binary file not shown.
@@ -11,7 +11,7 @@ stdenv.mkDerivation rec {
|
||||
|
||||
buildInputs = [ ecl qt4 xorgserver xkbcomp xkeyboard_config ];
|
||||
|
||||
NIX_CFLAGS_COMPILE = [ "-fPIC" ];
|
||||
NIX_CFLAGS_COMPILE = "-fPIC";
|
||||
|
||||
postPatch = ''
|
||||
sed -re 's@[(]in-home "gui/.command-history"[)]@(concatenate '"'"'string (ext:getenv "HOME") "/.eql-gui-command-history")@' -i gui/gui.lisp
|
||||
|
||||
@@ -9,7 +9,7 @@ stdenv.mkDerivation rec {
|
||||
rev = "7999e72aecc3c5bc4019d43dc4697f49678cc3b4";
|
||||
|
||||
src = fetchurl {
|
||||
url = http://downloads.factorcode.org/releases/0.98/factor-src-0.98.zip;
|
||||
url = https://downloads.factorcode.org/releases/0.98/factor-src-0.98.zip;
|
||||
sha256 = "01ip9mbnar4sv60d2wcwfz62qaamdvbykxw3gbhzqa25z36vi3ri";
|
||||
};
|
||||
|
||||
@@ -94,7 +94,7 @@ stdenv.mkDerivation rec {
|
||||
'';
|
||||
|
||||
meta = with stdenv.lib; {
|
||||
homepage = http://factorcode.org;
|
||||
homepage = https://factorcode.org;
|
||||
license = licenses.bsd2;
|
||||
description = "A concatenative, stack-based programming language";
|
||||
|
||||
|
||||
@@ -3,11 +3,11 @@
|
||||
stdenvNoCC.mkDerivation rec {
|
||||
pname = "fasm-bin";
|
||||
|
||||
version = "1.73.16";
|
||||
version = "1.73.22";
|
||||
|
||||
src = fetchurl {
|
||||
url = "https://flatassembler.net/fasm-${version}.tgz";
|
||||
sha256 = "1jaqm7w458ny37fsw3fln17kw31rcsk8kyadci45qcbw6jspmn7k";
|
||||
sha256 = "1pb0rcfdsb0h89khjjrbikz5wjdllavj3ajim0rcyh7x12xr1hw5";
|
||||
};
|
||||
|
||||
installPhase = ''
|
||||
|
||||
@@ -19,9 +19,9 @@ stdenv.mkDerivation rec {
|
||||
sed -e "s@'/lib64/ld-linux[^']*'@'''@" -i fpcsrc/compiler/systems/t_linux.pas
|
||||
'' else "";
|
||||
|
||||
makeFlags = "NOGDB=1 FPC=${startFPC}/bin/fpc";
|
||||
makeFlags = [ "NOGDB=1" "FPC=${startFPC}/bin/fpc" ];
|
||||
|
||||
installFlags = "INSTALL_PREFIX=\${out}";
|
||||
installFlags = [ "INSTALL_PREFIX=\${out}" ];
|
||||
|
||||
postInstall = ''
|
||||
for i in $out/lib/fpc/*/ppc*; do
|
||||
|
||||
@@ -25,12 +25,12 @@ stdenv.mkDerivation rec {
|
||||
patchShebangs src/tools
|
||||
patchShebangs bin
|
||||
'';
|
||||
buildFlags = "-C src/ocaml-output";
|
||||
buildFlags = [ "-C" "src/ocaml-output" ];
|
||||
|
||||
preInstall = ''
|
||||
mkdir -p $out/lib/ocaml/${ocamlPackages.ocaml.version}/site-lib/fstarlib
|
||||
'';
|
||||
installFlags = "-C src/ocaml-output";
|
||||
installFlags = [ "-C" "src/ocaml-output" ];
|
||||
postInstall = ''
|
||||
wrapProgram $out/bin/fstar.exe --prefix PATH ":" "${z3}/bin"
|
||||
'';
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
{ stdenv, fetchurl, autoconf, ... }:
|
||||
{ stdenv, fetchurl, autoconf, gcc, coreutils, ... }:
|
||||
|
||||
stdenv.mkDerivation {
|
||||
pname = "gambit-bootstrap";
|
||||
@@ -12,6 +12,10 @@ stdenv.mkDerivation {
|
||||
buildInputs = [ autoconf ];
|
||||
|
||||
configurePhase = ''
|
||||
export CC=${gcc}/bin/gcc CXX=${gcc}/bin/g++ \
|
||||
CPP=${gcc}/bin/cpp CXXCPP=${gcc}/bin/cpp LD=${gcc}/bin/ld \
|
||||
XMKMF=${coreutils}/bin/false
|
||||
unset CFLAGS LDFLAGS LIBS CPPFLAGS CXXFLAGS
|
||||
./configure --prefix=$out
|
||||
'';
|
||||
|
||||
|
||||
@@ -1,4 +1,19 @@
|
||||
{ stdenv, git, openssl, autoconf, pkgs, makeStaticLibraries, version, src }:
|
||||
{ stdenv, git, openssl, autoconf, pkgs, makeStaticLibraries, version, gcc, src, coreutils }:
|
||||
|
||||
# Note that according to a benchmark run by Marc Feeley on May 2018,
|
||||
# clang is 10x (with default settings) to 15% (with -O2) slower than GCC at compiling
|
||||
# Gambit output, producing code that is 3x slower. IIRC the benchmarks from Gambit@30,
|
||||
# the numbers were still heavily in favor of GCC in October 2019.
|
||||
# Thus we use GCC over clang, even on macOS.
|
||||
|
||||
# Also note that I (fare) just ran benchmarks from https://github.com/ecraven/r7rs-benchmarks
|
||||
# with Gambit 4.9.3 with -O1 vs -O2 vs -Os on Feb 2020. Which wins depends on the benchmark.
|
||||
# The fight is unclear between -O1 and -O2, where -O1 wins more often, by up to 17%,
|
||||
# but sometimes -O2 wins, once by up to 43%, so that overall -O2 is 5% faster.
|
||||
# However, -Os seems more consistent in winning slightly against both -O1 and -O2,
|
||||
# and is overall 15% faster than -O2. As for compile times, -O1 is fastest,
|
||||
# -Os is about 29%-33% slower than -O1, while -O2 is about 40%-50% slower than -O1.
|
||||
# Overall, -Os seems like the best choice, and that's what we now use.
|
||||
|
||||
stdenv.mkDerivation rec {
|
||||
pname = "gambit";
|
||||
@@ -7,38 +22,48 @@ stdenv.mkDerivation rec {
|
||||
|
||||
bootstrap = import ./bootstrap.nix ( pkgs );
|
||||
|
||||
# Use makeStaticLibraries to enable creation of statically linked binaries
|
||||
buildInputs = [ git autoconf bootstrap openssl (makeStaticLibraries openssl)];
|
||||
# TODO: if/when we can get all the library packages we depend on to have static versions,
|
||||
# we could use something like (makeStaticLibraries openssl) to enable creation
|
||||
# of statically linked binaries by gsc.
|
||||
buildInputs = [ git autoconf bootstrap openssl ];
|
||||
|
||||
configureFlags = [
|
||||
"--enable-single-host"
|
||||
"--enable-c-opt=-Os"
|
||||
"--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-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
|
||||
];
|
||||
|
||||
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
|
||||
export CC=${gcc}/bin/gcc CXX=${gcc}/bin/g++ \
|
||||
CPP=${gcc}/bin/cpp CXXCPP=${gcc}/bin/cpp LD=${gcc}/bin/ld \
|
||||
XMKMF=${coreutils}/bin/false
|
||||
unset CFLAGS LDFLAGS LIBS CPPFLAGS CXXFLAGS
|
||||
./configure --prefix=$out ${builtins.concatStringsSep " " configureFlags}
|
||||
|
||||
#--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[@]}
|
||||
# OS-specific paths are hardcoded in ./configure
|
||||
substituteInPlace config.status \
|
||||
--replace /usr/local/opt/openssl/lib "${openssl.out}/lib" \
|
||||
--replace /usr/local/opt/openssl@1.1/lib "${openssl.out}/lib"
|
||||
./config.status
|
||||
'';
|
||||
|
||||
buildPhase = ''
|
||||
|
||||
@@ -1,13 +1,13 @@
|
||||
{ stdenv, callPackage, fetchFromGitHub }:
|
||||
|
||||
callPackage ./build.nix {
|
||||
version = "unstable-2019-07-21";
|
||||
# git-version = "4.9.3-109-g3b5f74fa";
|
||||
version = "unstable-2020-02-24";
|
||||
# git-version = "4.9.3-979-gc69e9f70";
|
||||
src = fetchFromGitHub {
|
||||
owner = "feeley";
|
||||
repo = "gambit";
|
||||
rev = "3b5f74fae74b2159e3bf6923f29a18b31cc15dcc";
|
||||
sha256 = "07cb0d8754dqhxawkp5dp4y0bsa9kfald4dkj60j5yfnsp81y5mi";
|
||||
rev = "c69e9f70dfdc6545353b135a5d5e2f9234f1e1cc";
|
||||
sha256 = "1f69n7yzzdv3wpnjlrbck38xpa8115vbady43mc544l39ckklr0k";
|
||||
};
|
||||
inherit stdenv;
|
||||
}
|
||||
|
||||
@@ -0,0 +1,39 @@
|
||||
{ stdenv, fetchzip, fpc , lang ? "en" } :
|
||||
assert stdenv.lib.assertOneOf "lang" lang ["cn" "de" "en" "fr" "tr"];
|
||||
stdenv.mkDerivation rec {
|
||||
pname = "gavrasm";
|
||||
version = "4.5";
|
||||
|
||||
src = fetchzip {
|
||||
url ="http://www.avr-asm-tutorial.net/gavrasm/v45/gavrasm_sources_lin_45.zip";
|
||||
sha256 = "1f5g5ran74pznwj4g7vfqh2qhymaj3p26f2lvzbmlwq447iid52c";
|
||||
stripRoot=false;
|
||||
};
|
||||
|
||||
nativeBuildInputs = [ fpc ];
|
||||
|
||||
configurePhase = ''
|
||||
cp gavrlang_${lang}.pas gavrlang.pas
|
||||
'';
|
||||
|
||||
buildPhase = ''
|
||||
fpc gavrasm.pas
|
||||
'';
|
||||
|
||||
installPhase = ''
|
||||
mkdir -p $out/bin
|
||||
cp gavrasm $out/bin
|
||||
mkdir -p $out/doc
|
||||
cp instr.asm $out/doc
|
||||
cp ReadMe.Txt $out/doc
|
||||
cp LiesMich.Txt $out/doc
|
||||
'';
|
||||
|
||||
meta = with stdenv.lib; {
|
||||
homepage = http://www.avr-asm-tutorial.net/gavrasm;
|
||||
description = "AVR Assembler for ATMEL AVR-Processors";
|
||||
license = licenses.unfree;
|
||||
maintainers = with maintainers; [ mafo ];
|
||||
platforms = platforms.linux;
|
||||
};
|
||||
}
|
||||
@@ -1,22 +1,26 @@
|
||||
{ stdenv, fetchurl, ncurses5, python27 }:
|
||||
{ stdenv
|
||||
, fetchurl
|
||||
, ncurses5
|
||||
, python27
|
||||
}:
|
||||
|
||||
stdenv.mkDerivation rec {
|
||||
pname = "gcc-arm-embedded";
|
||||
version = "6-2017-q2-update";
|
||||
subdir = "6-2017q2";
|
||||
|
||||
src =
|
||||
if stdenv.isLinux then
|
||||
fetchurl {
|
||||
url = "https://developer.arm.com/-/media/Files/downloads/gnu-rm/${subdir}/gcc-arm-none-eabi-${version}-linux.tar.bz2";
|
||||
sha256="1hvwi02mx34al525sngnl0cm7dkmzxfkb1brq9kvbv28wcplp3p6";
|
||||
}
|
||||
else if stdenv.isDarwin then
|
||||
fetchurl {
|
||||
url = "https://developer.arm.com/-/media/Files/downloads/gnu-rm/${subdir}/gcc-arm-none-eabi-${version}-mac.tar.bz2";
|
||||
sha256="0019ylpq4inq7p5gydpmc9m8ni72fz2csrjlqmgx1698998q0c3x";
|
||||
}
|
||||
else throw "unsupported platform";
|
||||
suffix = {
|
||||
x86_64-darwin = "mac";
|
||||
x86_64-linux = "linux";
|
||||
}.${stdenv.hostPlatform.system} or (throw "Unsupported system: ${stdenv.hostPlatform.system}");
|
||||
|
||||
src = fetchurl {
|
||||
url = "https://developer.arm.com/-/media/Files/downloads/gnu-rm/${subdir}/gcc-arm-none-eabi-${version}-${suffix}.tar.bz2";
|
||||
sha256 = {
|
||||
x86_64-darwin = "0019ylpq4inq7p5gydpmc9m8ni72fz2csrjlqmgx1698998q0c3x";
|
||||
x86_64-linux = "1hvwi02mx34al525sngnl0cm7dkmzxfkb1brq9kvbv28wcplp3p6";
|
||||
}.${stdenv.hostPlatform.system} or (throw "Unsupported system: ${stdenv.hostPlatform.system}");
|
||||
};
|
||||
|
||||
phases = [ "unpackPhase" "installPhase" "fixupPhase" ];
|
||||
|
||||
@@ -37,11 +41,11 @@ stdenv.mkDerivation rec {
|
||||
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;
|
||||
meta = with stdenv.lib; {
|
||||
description = "Pre-built GNU toolchain from ARM Cortex-M & Cortex-R processors";
|
||||
homepage = "https://developer.arm.com/open-source/gnu-toolchain/gnu-rm";
|
||||
license = with licenses; [ bsd2 gpl2 gpl3 lgpl21 lgpl3 mit ];
|
||||
maintainers = with maintainers; [ prusnak ];
|
||||
platforms = [ "x86_64-linux" "x86_64-darwin" ];
|
||||
};
|
||||
}
|
||||
|
||||
@@ -1,24 +1,26 @@
|
||||
{ stdenv, lib, fetchurl, ncurses5, python27 }:
|
||||
|
||||
with lib;
|
||||
{ stdenv
|
||||
, fetchurl
|
||||
, ncurses5
|
||||
, python27
|
||||
}:
|
||||
|
||||
stdenv.mkDerivation rec {
|
||||
pname = "gcc-arm-embedded";
|
||||
version = "7-2018-q2-update";
|
||||
subdir = "7-2018q2";
|
||||
|
||||
src =
|
||||
if stdenv.isLinux then
|
||||
fetchurl {
|
||||
url = "https://developer.arm.com/-/media/Files/downloads/gnu-rm/${subdir}/gcc-arm-none-eabi-${version}-linux.tar.bz2";
|
||||
sha256="0sgysp3hfpgrkcbfiwkp0a7ymqs02khfbrjabm52b5z61sgi05xv";
|
||||
}
|
||||
else if stdenv.isDarwin then
|
||||
fetchurl {
|
||||
url = "https://developer.arm.com/-/media/Files/downloads/gnu-rm/${subdir}/gcc-arm-none-eabi-${version}-mac.tar.bz2";
|
||||
sha256="0nc7m0mpa39qyhfyydxkkyqm7spfc27xf6ygi2vd2aym4r9azi61";
|
||||
}
|
||||
else throw "unsupported platform";
|
||||
suffix = {
|
||||
x86_64-darwin = "mac";
|
||||
x86_64-linux = "linux";
|
||||
}.${stdenv.hostPlatform.system} or (throw "Unsupported system: ${stdenv.hostPlatform.system}");
|
||||
|
||||
src = fetchurl {
|
||||
url = "https://developer.arm.com/-/media/Files/downloads/gnu-rm/${subdir}/gcc-arm-none-eabi-${version}-${suffix}.tar.bz2";
|
||||
sha256 = {
|
||||
x86_64-darwin = "0nc7m0mpa39qyhfyydxkkyqm7spfc27xf6ygi2vd2aym4r9azi61";
|
||||
x86_64-linux = "0sgysp3hfpgrkcbfiwkp0a7ymqs02khfbrjabm52b5z61sgi05xv";
|
||||
}.${stdenv.hostPlatform.system} or (throw "Unsupported system: ${stdenv.hostPlatform.system}");
|
||||
};
|
||||
|
||||
phases = [ "unpackPhase" "installPhase" "fixupPhase" ];
|
||||
|
||||
@@ -39,11 +41,11 @@ stdenv.mkDerivation rec {
|
||||
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;
|
||||
meta = with stdenv.lib; {
|
||||
description = "Pre-built GNU toolchain from ARM Cortex-M & Cortex-R processors";
|
||||
homepage = "https://developer.arm.com/open-source/gnu-toolchain/gnu-rm";
|
||||
license = with licenses; [ bsd2 gpl2 gpl3 lgpl21 lgpl3 mit ];
|
||||
maintainers = with maintainers; [ prusnak ];
|
||||
platforms = platforms.linux;
|
||||
platforms = [ "x86_64-linux" "x86_64-darwin" ];
|
||||
};
|
||||
}
|
||||
|
||||
@@ -1,24 +1,26 @@
|
||||
{ stdenv, lib, fetchurl, ncurses5, python27 }:
|
||||
|
||||
with lib;
|
||||
{ stdenv
|
||||
, fetchurl
|
||||
, ncurses5
|
||||
, python27
|
||||
}:
|
||||
|
||||
stdenv.mkDerivation rec {
|
||||
pname = "gcc-arm-embedded";
|
||||
version = "8-2019-q3-update";
|
||||
subdir = "8-2019q3/RC1.1";
|
||||
|
||||
src =
|
||||
if stdenv.isLinux then
|
||||
fetchurl {
|
||||
url = "https://developer.arm.com/-/media/Files/downloads/gnu-rm/${subdir}/gcc-arm-none-eabi-${version}-linux.tar.bz2";
|
||||
sha256="b50b02b0a16e5aad8620e9d7c31110ef285c1dde28980b1a9448b764d77d8f92";
|
||||
}
|
||||
else if stdenv.isDarwin then
|
||||
fetchurl {
|
||||
url = "https://developer.arm.com/-/media/Files/downloads/gnu-rm/${subdir}/gcc-arm-none-eabi-${version}-mac.tar.bz2";
|
||||
sha256="fc235ce853bf3bceba46eff4b95764c5935ca07fc4998762ef5e5b7d05f37085";
|
||||
}
|
||||
else throw "unsupported platform";
|
||||
suffix = {
|
||||
x86_64-darwin = "mac";
|
||||
x86_64-linux = "linux";
|
||||
}.${stdenv.hostPlatform.system} or (throw "Unsupported system: ${stdenv.hostPlatform.system}");
|
||||
|
||||
src = fetchurl {
|
||||
url = "https://developer.arm.com/-/media/Files/downloads/gnu-rm/${subdir}/gcc-arm-none-eabi-${version}-${suffix}.tar.bz2";
|
||||
sha256 = {
|
||||
x86_64-darwin = "fc235ce853bf3bceba46eff4b95764c5935ca07fc4998762ef5e5b7d05f37085";
|
||||
x86_64-linux = "b50b02b0a16e5aad8620e9d7c31110ef285c1dde28980b1a9448b764d77d8f92";
|
||||
}.${stdenv.hostPlatform.system} or (throw "Unsupported system: ${stdenv.hostPlatform.system}");
|
||||
};
|
||||
|
||||
phases = [ "unpackPhase" "installPhase" "fixupPhase" ];
|
||||
|
||||
@@ -39,11 +41,11 @@ stdenv.mkDerivation rec {
|
||||
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;
|
||||
meta = with stdenv.lib; {
|
||||
description = "Pre-built GNU toolchain from ARM Cortex-M & Cortex-R processors";
|
||||
homepage = "https://developer.arm.com/open-source/gnu-toolchain/gnu-rm";
|
||||
license = with licenses; [ bsd2 gpl2 gpl3 lgpl21 lgpl3 mit ];
|
||||
maintainers = with maintainers; [ prusnak ];
|
||||
platforms = platforms.linux;
|
||||
platforms = [ "x86_64-linux" "x86_64-darwin" ];
|
||||
};
|
||||
}
|
||||
|
||||
@@ -0,0 +1,53 @@
|
||||
{ stdenv
|
||||
, fetchurl
|
||||
, ncurses5
|
||||
, python27
|
||||
}:
|
||||
|
||||
stdenv.mkDerivation rec {
|
||||
pname = "gcc-arm-embedded";
|
||||
version = "9-2019-q4-major";
|
||||
subdir = "9-2019q4/RC2.1";
|
||||
|
||||
suffix = {
|
||||
aarch64-linux = "aarch64-linux";
|
||||
x86_64-darwin = "mac";
|
||||
x86_64-linux = "x86_64-linux";
|
||||
}.${stdenv.hostPlatform.system} or (throw "Unsupported system: ${stdenv.hostPlatform.system}");
|
||||
|
||||
src = fetchurl {
|
||||
url = "https://developer.arm.com/-/media/Files/downloads/gnu-rm/${subdir}/gcc-arm-none-eabi-${version}-${suffix}.tar.bz2";
|
||||
sha256 = {
|
||||
aarch64-linux = "1f5b9309006737950b2218250e6bb392e2d68d4f1a764fe66be96e2a78888d83";
|
||||
x86_64-darwin = "1249f860d4155d9c3ba8f30c19e7a88c5047923cea17e0d08e633f12408f01f0";
|
||||
x86_64-linux = "bcd840f839d5bf49279638e9f67890b2ef3a7c9c7a9b25271e83ec4ff41d177a";
|
||||
}.${stdenv.hostPlatform.system} or (throw "Unsupported system: ${stdenv.hostPlatform.system}");
|
||||
};
|
||||
|
||||
phases = [ "unpackPhase" "installPhase" "fixupPhase" ];
|
||||
|
||||
installPhase = ''
|
||||
mkdir -p $out
|
||||
cp -r * $out
|
||||
ln -s $out/share/doc/gcc-arm-none-eabi/man $out/man
|
||||
'';
|
||||
|
||||
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 = with stdenv.lib; {
|
||||
description = "Pre-built GNU toolchain from ARM Cortex-M & Cortex-R processors";
|
||||
homepage = "https://developer.arm.com/open-source/gnu-toolchain/gnu-rm";
|
||||
license = with licenses; [ bsd2 gpl2 gpl3 lgpl21 lgpl3 mit ];
|
||||
maintainers = with maintainers; [ prusnak ];
|
||||
platforms = [ "x86_64-linux" "aarch64-linux" "x86_64-darwin" ];
|
||||
};
|
||||
}
|
||||
@@ -1,52 +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 {
|
||||
pname = "gcc-arm-embedded";
|
||||
inherit version;
|
||||
|
||||
src = fetchurl {
|
||||
url = "https://launchpad.net/gcc-arm-embedded/${dirName_}/${subdirName_}/+download/gcc-arm-none-eabi-${underscoreVersion}-linux.tar.bz2";
|
||||
sha256 = sha256;
|
||||
};
|
||||
|
||||
nativeBuildInputs = [ bzip2 patchelf ];
|
||||
|
||||
dontPatchELF = true;
|
||||
|
||||
phases = "unpackPhase patchPhase installPhase";
|
||||
|
||||
installPhase = ''
|
||||
mkdir -pv $out
|
||||
cp -r ./* $out
|
||||
ln -s $out/share/doc/gcc-arm-none-eabi/man $out/man
|
||||
|
||||
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;
|
||||
};
|
||||
}
|
||||
@@ -7,6 +7,7 @@
|
||||
, profiledCompiler ? false
|
||||
, staticCompiler ? false
|
||||
, enableShared ? true
|
||||
, enableLTO ? true
|
||||
, texinfo ? null
|
||||
, perl ? null # optional, for texi2pod (then pod2man); required for Java
|
||||
, gmp, mpfr, libmpc, gettext, which
|
||||
@@ -23,6 +24,7 @@
|
||||
, enablePlugin ? stdenv.hostPlatform == stdenv.buildPlatform # Whether to support user-supplied plug-ins
|
||||
, name ? "gcc"
|
||||
, libcCross ? null
|
||||
, threadsCross ? null # for MinGW
|
||||
, crossStageStatic ? false
|
||||
, # Strip kills static libs of other archs (hence no cross)
|
||||
stripped ? stdenv.hostPlatform == stdenv.buildPlatform
|
||||
@@ -47,10 +49,14 @@ assert stdenv.hostPlatform.isDarwin -> gnused != null;
|
||||
# The go frontend is written in c++
|
||||
assert langGo -> langCC;
|
||||
|
||||
# threadsCross is just for MinGW
|
||||
assert threadsCross != null -> stdenv.targetPlatform.isWindows;
|
||||
|
||||
with stdenv.lib;
|
||||
with builtins;
|
||||
|
||||
let version = "4.8.5";
|
||||
let majorVersion = "4";
|
||||
version = "${majorVersion}.8.5";
|
||||
|
||||
inherit (stdenv) buildPlatform hostPlatform targetPlatform;
|
||||
|
||||
@@ -96,69 +102,8 @@ let version = "4.8.5";
|
||||
|
||||
/* 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") [
|
||||
# In uclibc cases, libgomp needs an additional '-ldl'
|
||||
# and as I don't know how to pass it, I disable libgomp.
|
||||
"--disable-libgomp"
|
||||
]
|
||||
++ 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;
|
||||
stageNameAddon = if crossStageStatic then "stage-static" else "stage-final";
|
||||
crossNameAddon = optionalString (targetPlatform != hostPlatform) "${targetPlatform.config}-${stageNameAddon}-";
|
||||
|
||||
in
|
||||
|
||||
@@ -166,7 +111,8 @@ in
|
||||
assert x11Support -> (filter (x: x == null) ([ gtk2 libart_lgpl ] ++ xlibs)) == [];
|
||||
|
||||
stdenv.mkDerivation ({
|
||||
name = crossNameAddon + "${name}${if stripped then "" else "-debug"}-${version}";
|
||||
pname = "${crossNameAddon}${name}${if stripped then "" else "-debug"}";
|
||||
inherit version;
|
||||
|
||||
builder = ../builder.sh;
|
||||
|
||||
@@ -232,108 +178,54 @@ stdenv.mkDerivation ({
|
||||
++ (optional hostPlatform.isDarwin gnused)
|
||||
;
|
||||
|
||||
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"
|
||||
'';
|
||||
depsTargetTarget = optional (!crossStageStatic && threadsCross != null) threadsCross;
|
||||
|
||||
preConfigure = import ../common/pre-configure.nix {
|
||||
inherit (stdenv) lib;
|
||||
inherit version hostPlatform langJava langGo;
|
||||
};
|
||||
|
||||
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" ++
|
||||
configureFlags = import ../common/configure-flags.nix {
|
||||
inherit
|
||||
stdenv
|
||||
targetPackages
|
||||
crossStageStatic libcCross
|
||||
version
|
||||
|
||||
# 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 langJava "java"
|
||||
++ optional langGo "go"
|
||||
++ optional langObjC "objc"
|
||||
++ optional langObjCpp "obj-c++"
|
||||
++ optionals crossDarwin [ "objc" "obj-c++" ]
|
||||
)
|
||||
)
|
||||
}"
|
||||
] ++
|
||||
gmp mpfr libmpc libelf isl
|
||||
cloog
|
||||
|
||||
(if (enableMultilib || targetPlatform.isAvr)
|
||||
then ["--enable-multilib" "--disable-libquadmath"]
|
||||
else ["--disable-multilib"]) ++
|
||||
optional (!enableShared) "--disable-shared" ++
|
||||
(if enablePlugin
|
||||
then ["--enable-plugin"]
|
||||
else ["--disable-plugin"]) ++
|
||||
enableLTO
|
||||
enableMultilib
|
||||
enablePlugin
|
||||
enableShared
|
||||
|
||||
# Optional features
|
||||
optional (isl != null) "--with-isl=${isl}" ++
|
||||
optionals (cloog != null) [
|
||||
"--with-cloog=${cloog}"
|
||||
"--disable-cloog-version-check"
|
||||
"--enable-cloog-backend=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}" ++
|
||||
|
||||
(import ../common/platform-flags.nix { inherit (stdenv) lib targetPlatform; }) ++
|
||||
optional (targetPlatform != hostPlatform) crossConfigureFlags ++
|
||||
optional (!bootstrap) "--disable-bootstrap" ++
|
||||
|
||||
# Platform-specific flags
|
||||
optional (targetPlatform == hostPlatform && targetPlatform.isx86_32) "--with-arch=${stdenv.hostPlatform.parsed.cpu.name}" ++
|
||||
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"
|
||||
]
|
||||
;
|
||||
langC
|
||||
langCC
|
||||
langFortran
|
||||
langJava javaAwtGtk javaAntlr javaEcj
|
||||
langGo
|
||||
langObjC
|
||||
langObjCpp
|
||||
;
|
||||
};
|
||||
|
||||
targetConfig = if targetPlatform != hostPlatform then targetPlatform.config else null;
|
||||
|
||||
buildFlags = optional
|
||||
(bootstrap && hostPlatform == buildPlatform)
|
||||
(targetPlatform == hostPlatform && 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";
|
||||
installTargets = optional stripped "install-strip";
|
||||
|
||||
# https://gcc.gnu.org/install/specific.html#x86-64-x-solaris210
|
||||
${if hostPlatform.system == "x86_64-solaris" then "CC" else null} = "gcc -m64";
|
||||
@@ -366,24 +258,13 @@ stdenv.mkDerivation ({
|
||||
++ optionals javaAwtGtk [ gmp mpfr ]
|
||||
));
|
||||
|
||||
EXTRA_TARGET_FLAGS = optionals
|
||||
(targetPlatform != hostPlatform && libcCross != null)
|
||||
([
|
||||
"-idirafter ${getDev libcCross}${libcCross.incdir or "/include"}"
|
||||
] ++ optionals (! crossStageStatic) [
|
||||
"-B${libcCross.out}${libcCross.libdir or "/lib"}"
|
||||
]);
|
||||
|
||||
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"}"
|
||||
]));
|
||||
inherit
|
||||
(import ../common/extra-target-flags.nix {
|
||||
inherit stdenv crossStageStatic libcCross threadsCross;
|
||||
})
|
||||
EXTRA_TARGET_FLAGS
|
||||
EXTRA_TARGET_LDFLAGS
|
||||
;
|
||||
|
||||
passthru = {
|
||||
inherit langC langCC langObjC langObjCpp langFortran langGo version;
|
||||
|
||||
@@ -7,6 +7,7 @@
|
||||
, profiledCompiler ? false
|
||||
, staticCompiler ? false
|
||||
, enableShared ? true
|
||||
, enableLTO ? true
|
||||
, texinfo ? null
|
||||
, perl ? null # optional, for texi2pod (then pod2man); required for Java
|
||||
, gmp, mpfr, libmpc, gettext, which
|
||||
@@ -23,6 +24,7 @@
|
||||
, enablePlugin ? stdenv.hostPlatform == stdenv.buildPlatform # Whether to support user-supplied plug-ins
|
||||
, name ? "gcc"
|
||||
, libcCross ? null
|
||||
, threadsCross ? null # for MinGW
|
||||
, crossStageStatic ? false
|
||||
, # Strip kills static libs of other archs (hence no cross)
|
||||
stripped ? stdenv.hostPlatform == stdenv.buildPlatform
|
||||
@@ -47,15 +49,25 @@ assert stdenv.hostPlatform.isDarwin -> gnused != null;
|
||||
# The go frontend is written in c++
|
||||
assert langGo -> langCC;
|
||||
|
||||
# threadsCross is just for MinGW
|
||||
assert threadsCross != null -> stdenv.targetPlatform.isWindows;
|
||||
|
||||
with stdenv.lib;
|
||||
with builtins;
|
||||
|
||||
let version = "4.9.4";
|
||||
let majorVersion = "4";
|
||||
version = "${majorVersion}.9.4";
|
||||
|
||||
inherit (stdenv) buildPlatform hostPlatform targetPlatform;
|
||||
|
||||
patches =
|
||||
[ ../use-source-date-epoch.patch ../parallel-bconfig.patch ./parallel-strsignal.patch ]
|
||||
[ ../use-source-date-epoch.patch ../parallel-bconfig.patch ./parallel-strsignal.patch
|
||||
(fetchpatch {
|
||||
name = "avoid-ustat-glibc-2.28.patch";
|
||||
url = "https://gitweb.gentoo.org/proj/gcc-patches.git/plain/4.9.4/gentoo/100_all_avoid-ustat-glibc-2.28.patch?id=55fcb515620a8f7d3bb77eba938aa0fcf0d67c96";
|
||||
sha256 = "0b32sb4psv5lq0ij9fwhi1b4pjbwdjnv24nqprsk14dsc6xmi1g0";
|
||||
})
|
||||
]
|
||||
++ optional (targetPlatform != hostPlatform) ../libstdc++-target.patch
|
||||
++ optional noSysDirs ../no-sys-dirs.patch
|
||||
++ optional langFortran ../gfortran-driving.patch
|
||||
@@ -101,72 +113,8 @@ let version = "4.9.4";
|
||||
|
||||
/* 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"
|
||||
]
|
||||
++ 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;
|
||||
stageNameAddon = if crossStageStatic then "stage-static" else "stage-final";
|
||||
crossNameAddon = optionalString (targetPlatform != hostPlatform) "${targetPlatform.config}-${stageNameAddon}-";
|
||||
|
||||
in
|
||||
|
||||
@@ -174,7 +122,8 @@ in
|
||||
assert x11Support -> (filter (x: x == null) ([ gtk2 libart_lgpl ] ++ xlibs)) == [];
|
||||
|
||||
stdenv.mkDerivation ({
|
||||
name = crossNameAddon + "${name}${if stripped then "" else "-debug"}-${version}";
|
||||
pname = "${crossNameAddon}${name}${if stripped then "" else "-debug"}";
|
||||
inherit version;
|
||||
|
||||
builder = ../builder.sh;
|
||||
|
||||
@@ -241,112 +190,54 @@ stdenv.mkDerivation ({
|
||||
++ (optional hostPlatform.isDarwin gnused)
|
||||
;
|
||||
|
||||
preConfigure = stdenv.lib.optionalString (hostPlatform.isSunOS && hostPlatform.is64bit) ''
|
||||
sed -i -e "s/-lrt//g" libstdc++-v3/configure
|
||||
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"
|
||||
''
|
||||
+ stdenv.lib.optionalString (langJava || langGo) ''
|
||||
export lib=$out;
|
||||
'';
|
||||
depsTargetTarget = optional (!crossStageStatic && threadsCross != null) threadsCross;
|
||||
|
||||
preConfigure = import ../common/pre-configure.nix {
|
||||
inherit (stdenv) lib;
|
||||
inherit version hostPlatform langJava langGo;
|
||||
};
|
||||
|
||||
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" ++
|
||||
configureFlags = import ../common/configure-flags.nix {
|
||||
inherit
|
||||
stdenv
|
||||
targetPackages
|
||||
crossStageStatic libcCross
|
||||
version
|
||||
|
||||
# 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 langJava "java"
|
||||
++ optional langGo "go"
|
||||
++ optional langObjC "objc"
|
||||
++ optional langObjCpp "obj-c++"
|
||||
++ optionals crossDarwin [ "objc" "obj-c++" ]
|
||||
)
|
||||
)
|
||||
}"
|
||||
] ++
|
||||
gmp mpfr libmpc libelf isl
|
||||
cloog
|
||||
|
||||
(if (enableMultilib || targetPlatform.isAvr)
|
||||
then ["--enable-multilib" "--disable-libquadmath"]
|
||||
else ["--disable-multilib"]) ++
|
||||
optional (!enableShared) "--disable-shared" ++
|
||||
(if enablePlugin
|
||||
then ["--enable-plugin"]
|
||||
else ["--disable-plugin"]) ++
|
||||
enableLTO
|
||||
enableMultilib
|
||||
enablePlugin
|
||||
enableShared
|
||||
|
||||
# Optional features
|
||||
optional (isl != null) "--with-isl=${isl}" ++
|
||||
optionals (cloog != null) [
|
||||
"--with-cloog=${cloog}"
|
||||
"--disable-cloog-version-check"
|
||||
"--enable-cloog-backend=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}" ++
|
||||
|
||||
(import ../common/platform-flags.nix { inherit (stdenv) lib targetPlatform; }) ++
|
||||
optional (targetPlatform != hostPlatform) crossConfigureFlags ++
|
||||
optional (!bootstrap) "--disable-bootstrap" ++
|
||||
|
||||
# Platform-specific flags
|
||||
optional (targetPlatform == hostPlatform && targetPlatform.isx86_32) "--with-arch=${stdenv.hostPlatform.parsed.cpu.name}" ++
|
||||
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"
|
||||
]
|
||||
;
|
||||
langC
|
||||
langCC
|
||||
langFortran
|
||||
langJava javaAwtGtk javaAntlr javaEcj
|
||||
langGo
|
||||
langObjC
|
||||
langObjCpp
|
||||
;
|
||||
};
|
||||
|
||||
targetConfig = if targetPlatform != hostPlatform then targetPlatform.config else null;
|
||||
|
||||
buildFlags = optional
|
||||
(bootstrap && hostPlatform == buildPlatform)
|
||||
(targetPlatform == hostPlatform && 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";
|
||||
installTargets = optional stripped "install-strip";
|
||||
|
||||
# https://gcc.gnu.org/install/specific.html#x86-64-x-solaris210
|
||||
${if hostPlatform.system == "x86_64-solaris" then "CC" else null} = "gcc -m64";
|
||||
@@ -379,24 +270,13 @@ stdenv.mkDerivation ({
|
||||
++ optionals javaAwtGtk [ gmp mpfr ]
|
||||
));
|
||||
|
||||
EXTRA_TARGET_FLAGS = optionals
|
||||
(targetPlatform != hostPlatform && libcCross != null)
|
||||
([
|
||||
"-idirafter ${getDev libcCross}${libcCross.incdir or "/include"}"
|
||||
] ++ optionals (! crossStageStatic) [
|
||||
"-B${libcCross.out}${libcCross.libdir or "/lib"}"
|
||||
]);
|
||||
|
||||
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"}"
|
||||
]));
|
||||
inherit
|
||||
(import ../common/extra-target-flags.nix {
|
||||
inherit stdenv crossStageStatic libcCross threadsCross;
|
||||
})
|
||||
EXTRA_TARGET_FLAGS
|
||||
EXTRA_TARGET_LDFLAGS
|
||||
;
|
||||
|
||||
passthru = {
|
||||
inherit langC langCC langObjC langObjCpp langFortran langGo version;
|
||||
@@ -423,7 +303,7 @@ stdenv.mkDerivation ({
|
||||
compiler used in the GNU system including the GNU/Linux variant.
|
||||
'';
|
||||
|
||||
maintainers = with stdenv.lib.maintainers; [ peti ];
|
||||
maintainers = with stdenv.lib.maintainers; [ peti veprbl ];
|
||||
|
||||
platforms =
|
||||
stdenv.lib.platforms.linux ++
|
||||
|
||||
@@ -1,448 +0,0 @@
|
||||
{ stdenv, targetPackages, fetchurl, fetchpatch, noSysDirs
|
||||
, langC ? true, langCC ? true, langFortran ? false
|
||||
, langObjC ? stdenv.targetPlatform.isDarwin
|
||||
, langObjCpp ? stdenv.targetPlatform.isDarwin
|
||||
, langJava ? false
|
||||
, langGo ? 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)
|
||||
, 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, xorgproto ? null
|
||||
, libXrandr ? null, libXi ? null
|
||||
, x11Support ? langJava
|
||||
, 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
|
||||
}:
|
||||
|
||||
assert langJava -> zip != null && unzip != null
|
||||
&& zlib != null && boehmgc != null
|
||||
&& perl != null; # for `--enable-java-home'
|
||||
|
||||
# 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 = "5.5.0";
|
||||
|
||||
inherit (stdenv) buildPlatform hostPlatform targetPlatform;
|
||||
|
||||
patches =
|
||||
[ ../use-source-date-epoch.patch ]
|
||||
++ optional (targetPlatform != hostPlatform) ../libstdc++-target.patch
|
||||
++ optional noSysDirs ../no-sys-dirs.patch
|
||||
++ optional langFortran ../gfortran-driving.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";
|
||||
});
|
||||
|
||||
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 = https://www.antlr.org/download/antlr-4.4-complete.jar;
|
||||
sha256 = "02lda2imivsvsis8rnzmbrbp8rh1kb8vmq4i67pqhkwz7lf8y6dz";
|
||||
};
|
||||
|
||||
xlibs = [
|
||||
libX11 libXt libSM libICE libXtst libXrender libXrandr libXi
|
||||
xorgproto
|
||||
];
|
||||
|
||||
javaAwtGtk = langJava && x11Support;
|
||||
|
||||
/* 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"
|
||||
]
|
||||
++ 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
|
||||
|
||||
# We need all these X libraries when building AWT with GTK.
|
||||
assert x11Support -> (filter (x: x == null) ([ gtk2 libart_lgpl ] ++ xlibs)) == [];
|
||||
|
||||
stdenv.mkDerivation ({
|
||||
name = crossNameAddon + "${name}${if stripped then "" else "-debug"}-${version}";
|
||||
|
||||
builder = ../builder.sh;
|
||||
|
||||
src = fetchurl {
|
||||
url = "mirror://gnu/gcc/gcc-${version}/gcc-${version}.tar.xz";
|
||||
sha256 = "11zd1hgzkli3b2v70qsm2hyqppngd4616qc96lmm9zl2kl9yl32k";
|
||||
};
|
||||
|
||||
inherit patches;
|
||||
|
||||
outputs = [ "out" "lib" "man" "info" ];
|
||||
setOutputFlags = false;
|
||||
NIX_NO_SELF_RPATH = true;
|
||||
|
||||
libc_dev = stdenv.cc.libc_dev;
|
||||
|
||||
hardeningDisable = [ "format" "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 =
|
||||
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 null;
|
||||
|
||||
inherit noSysDirs staticCompiler langJava crossStageStatic
|
||||
libcCross crossMingw;
|
||||
|
||||
depsBuildBuild = [ buildPackages.stdenv.cc ];
|
||||
nativeBuildInputs = [ texinfo which gettext ]
|
||||
++ (optional (perl != null) perl)
|
||||
++ (optional javaAwtGtk pkgconfig);
|
||||
|
||||
# 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 langJava [ boehmgc zip unzip ])
|
||||
++ (optionals javaAwtGtk ([ gtk2 libart_lgpl ] ++ xlibs))
|
||||
|
||||
# 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)
|
||||
;
|
||||
|
||||
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 langJava "java"
|
||||
++ 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}" ++
|
||||
|
||||
# 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}" ++
|
||||
|
||||
(import ../common/platform-flags.nix { inherit (stdenv) lib targetPlatform; }) ++
|
||||
optional (targetPlatform != hostPlatform) crossConfigureFlags ++
|
||||
optional (!bootstrap) "--disable-bootstrap" ++
|
||||
|
||||
# Platform-specific flags
|
||||
optional (targetPlatform == hostPlatform && targetPlatform.isx86_32) "--with-arch=${stdenv.hostPlatform.parsed.cpu.name}" ++
|
||||
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;
|
||||
|
||||
doCheck = false; # requires a lot of tools, causes a dependency cycle for stdenv
|
||||
|
||||
installTargets =
|
||||
if stripped
|
||||
then "install-strip"
|
||||
else "install";
|
||||
|
||||
# https://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++
|
||||
# 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 ]
|
||||
));
|
||||
|
||||
LIBRARY_PATH = optionals (targetPlatform == hostPlatform) (makeLibraryPath ([]
|
||||
++ optional (zlib != null) zlib
|
||||
++ optional langJava boehmgc
|
||||
++ optionals javaAwtGtk xlibs
|
||||
++ optionals javaAwtGtk [ gmp mpfr ]
|
||||
));
|
||||
|
||||
EXTRA_TARGET_FLAGS = optionals
|
||||
(targetPlatform != hostPlatform && libcCross != null)
|
||||
([
|
||||
"-idirafter ${getDev libcCross}${libcCross.incdir or "/include"}"
|
||||
] ++ optionals (! crossStageStatic) [
|
||||
"-B${libcCross.out}${libcCross.libdir or "/lib"}"
|
||||
]);
|
||||
|
||||
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;
|
||||
};
|
||||
|
||||
enableParallelBuilding = true;
|
||||
inherit enableMultilib;
|
||||
|
||||
inherit (stdenv) is64bit;
|
||||
|
||||
meta = {
|
||||
homepage = https://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 = with stdenv.lib.maintainers; [ peti ];
|
||||
|
||||
platforms =
|
||||
stdenv.lib.platforms.linux ++
|
||||
stdenv.lib.platforms.freebsd ++
|
||||
stdenv.lib.platforms.illumos ++
|
||||
stdenv.lib.platforms.darwin;
|
||||
badPlatforms = [ "x86_64-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,4 +1,4 @@
|
||||
{ stdenv, targetPackages, fetchurl, noSysDirs
|
||||
{ stdenv, targetPackages, fetchurl, fetchpatch, fetchFromGitHub, noSysDirs
|
||||
, langC ? true, langCC ? true, langFortran ? false
|
||||
, langObjC ? stdenv.targetPlatform.isDarwin
|
||||
, langObjCpp ? stdenv.targetPlatform.isDarwin
|
||||
@@ -7,7 +7,9 @@
|
||||
, profiledCompiler ? false
|
||||
, staticCompiler ? false
|
||||
, enableShared ? true
|
||||
, enableLTO ? true
|
||||
, texinfo ? null
|
||||
, flex
|
||||
, perl ? null # optional, for texi2pod (then pod2man); required for Java
|
||||
, gmp, mpfr, libmpc, gettext, which
|
||||
, libelf # optional, for link-time optimizations (LTO)
|
||||
@@ -23,6 +25,7 @@
|
||||
, enablePlugin ? stdenv.hostPlatform == stdenv.buildPlatform # Whether to support user-supplied plug-ins
|
||||
, name ? "gcc"
|
||||
, libcCross ? null
|
||||
, threadsCross ? null # for MinGW
|
||||
, crossStageStatic ? false
|
||||
, # Strip kills static libs of other archs (hence no cross)
|
||||
stripped ? stdenv.hostPlatform == stdenv.buildPlatform
|
||||
@@ -45,10 +48,14 @@ assert stdenv.hostPlatform.isDarwin -> gnused != null;
|
||||
# The go frontend is written in c++
|
||||
assert langGo -> langCC;
|
||||
|
||||
# threadsCross is just for MinGW
|
||||
assert threadsCross != null -> stdenv.targetPlatform.isWindows;
|
||||
|
||||
with stdenv.lib;
|
||||
with builtins;
|
||||
|
||||
let version = "6.5.0";
|
||||
let majorVersion = "6";
|
||||
version = "${majorVersion}.5.0";
|
||||
|
||||
inherit (stdenv) buildPlatform hostPlatform targetPlatform;
|
||||
|
||||
@@ -58,7 +65,10 @@ let version = "6.5.0";
|
||||
++ optional noSysDirs ../no-sys-dirs.patch
|
||||
++ optional langFortran ../gfortran-driving.patch
|
||||
++ optional (targetPlatform.libc == "musl") ../libgomp-dont-force-initial-exec.patch
|
||||
;
|
||||
++ optional (!crossStageStatic && targetPlatform.isMinGW) (fetchpatch {
|
||||
url = "https://raw.githubusercontent.com/lhmouse/MINGW-packages/${import ../common/mfcgthreads-patches-repo.nix}/mingw-w64-gcc-git/9000-gcc-${majorVersion}-branch-Added-mcf-thread-model-support-from-mcfgthread.patch";
|
||||
sha256 = "1c449jgm1vx9g4kv82bxmvlgrwb8f6kwkl0gqmjlmhf7f4hjy2nr";
|
||||
});
|
||||
|
||||
javaEcj = fetchurl {
|
||||
# The `$(top_srcdir)/ecj.jar' file is automatically picked up at
|
||||
@@ -85,74 +95,8 @@ let version = "6.5.0";
|
||||
|
||||
/* 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;
|
||||
stageNameAddon = if crossStageStatic then "stage-static" else "stage-final";
|
||||
crossNameAddon = optionalString (targetPlatform != hostPlatform) "${targetPlatform.config}-${stageNameAddon}-";
|
||||
|
||||
in
|
||||
|
||||
@@ -160,11 +104,17 @@ in
|
||||
assert x11Support -> (filter (x: x == null) ([ gtk2 libart_lgpl ] ++ xlibs)) == [];
|
||||
|
||||
stdenv.mkDerivation ({
|
||||
name = crossNameAddon + "${name}${if stripped then "" else "-debug"}-${version}";
|
||||
pname = "${crossNameAddon}${name}${if stripped then "" else "-debug"}";
|
||||
inherit version;
|
||||
|
||||
builder = ../builder.sh;
|
||||
|
||||
src = fetchurl {
|
||||
src = if stdenv.targetPlatform.isVc4 then fetchFromGitHub {
|
||||
owner = "itszor";
|
||||
repo = "gcc-vc4";
|
||||
rev = "e90ff43f9671c760cf0d1dd62f569a0fb9bf8918";
|
||||
sha256 = "0gxf66hwqk26h8f853sybphqa5ca0cva2kmrw5jsiv6139g0qnp8";
|
||||
} else fetchurl {
|
||||
url = "mirror://gnu/gcc/gcc-${version}/gcc-${version}.tar.xz";
|
||||
sha256 = "0i89fksfp6wr1xg9l8296aslcymv2idn60ip31wr9s4pwin7kwby";
|
||||
};
|
||||
@@ -229,7 +179,8 @@ stdenv.mkDerivation ({
|
||||
depsBuildBuild = [ buildPackages.stdenv.cc ];
|
||||
nativeBuildInputs = [ texinfo which gettext ]
|
||||
++ (optional (perl != null) perl)
|
||||
++ (optional javaAwtGtk pkgconfig);
|
||||
++ (optional javaAwtGtk pkgconfig)
|
||||
++ (optional (stdenv.targetPlatform.isVc4) flex);
|
||||
|
||||
# For building runtime libs
|
||||
depsBuildTarget =
|
||||
@@ -251,114 +202,55 @@ stdenv.mkDerivation ({
|
||||
++ (optional hostPlatform.isDarwin gnused)
|
||||
;
|
||||
|
||||
depsTargetTarget = optional (!crossStageStatic && threadsCross != null) threadsCross;
|
||||
|
||||
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"
|
||||
''
|
||||
+ stdenv.lib.optionalString (langJava || langGo) ''
|
||||
export lib=$out;
|
||||
'';
|
||||
preConfigure = import ../common/pre-configure.nix {
|
||||
inherit (stdenv) lib;
|
||||
inherit version hostPlatform langJava langGo;
|
||||
};
|
||||
|
||||
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" ++
|
||||
configureFlags = import ../common/configure-flags.nix {
|
||||
inherit
|
||||
stdenv
|
||||
targetPackages
|
||||
crossStageStatic libcCross
|
||||
version
|
||||
|
||||
# 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 langJava "java"
|
||||
++ optional langGo "go"
|
||||
++ optional langObjC "objc"
|
||||
++ optional langObjCpp "obj-c++"
|
||||
++ optionals crossDarwin [ "objc" "obj-c++" ]
|
||||
)
|
||||
)
|
||||
}"
|
||||
] ++
|
||||
gmp mpfr libmpc libelf isl
|
||||
|
||||
(if (enableMultilib || targetPlatform.isAvr)
|
||||
then ["--enable-multilib" "--disable-libquadmath"]
|
||||
else ["--disable-multilib"]) ++
|
||||
optional (!enableShared) "--disable-shared" ++
|
||||
(if enablePlugin
|
||||
then ["--enable-plugin"]
|
||||
else ["--disable-plugin"]) ++
|
||||
enableLTO
|
||||
enableMultilib
|
||||
enablePlugin
|
||||
enableShared
|
||||
|
||||
# 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}" ++
|
||||
|
||||
(import ../common/platform-flags.nix { inherit (stdenv) lib targetPlatform; }) ++
|
||||
optional (targetPlatform != hostPlatform) crossConfigureFlags ++
|
||||
optional (!bootstrap) "--disable-bootstrap" ++
|
||||
|
||||
# Platform-specific flags
|
||||
optional (targetPlatform == hostPlatform && targetPlatform.isx86_32) "--with-arch=${stdenv.hostPlatform.parsed.cpu.name}" ++
|
||||
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"
|
||||
]
|
||||
;
|
||||
langC
|
||||
langCC
|
||||
langFortran
|
||||
langJava javaAwtGtk javaAntlr javaEcj
|
||||
langGo
|
||||
langObjC
|
||||
langObjCpp
|
||||
;
|
||||
};
|
||||
|
||||
targetConfig = if targetPlatform != hostPlatform then targetPlatform.config else null;
|
||||
|
||||
buildFlags = optional
|
||||
(bootstrap && hostPlatform == buildPlatform)
|
||||
(targetPlatform == hostPlatform && 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";
|
||||
installTargets = optional stripped "install-strip";
|
||||
|
||||
# https://gcc.gnu.org/install/specific.html#x86-64-x-solaris210
|
||||
${if hostPlatform.system == "x86_64-solaris" then "CC" else null} = "gcc -m64";
|
||||
@@ -391,24 +283,13 @@ stdenv.mkDerivation ({
|
||||
++ optionals javaAwtGtk [ gmp mpfr ]
|
||||
));
|
||||
|
||||
EXTRA_TARGET_FLAGS = optionals
|
||||
(targetPlatform != hostPlatform && libcCross != null)
|
||||
([
|
||||
"-idirafter ${getDev libcCross}${libcCross.incdir or "/include"}"
|
||||
] ++ optionals (! crossStageStatic) [
|
||||
"-B${libcCross.out}${libcCross.libdir or "/lib"}"
|
||||
]);
|
||||
|
||||
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"}"
|
||||
]));
|
||||
inherit
|
||||
(import ../common/extra-target-flags.nix {
|
||||
inherit stdenv crossStageStatic libcCross threadsCross;
|
||||
})
|
||||
EXTRA_TARGET_FLAGS
|
||||
EXTRA_TARGET_LDFLAGS
|
||||
;
|
||||
|
||||
passthru = {
|
||||
inherit langC langCC langObjC langObjCpp langFortran langGo version;
|
||||
|
||||
@@ -6,6 +6,7 @@
|
||||
, profiledCompiler ? false
|
||||
, staticCompiler ? false
|
||||
, enableShared ? true
|
||||
, enableLTO ? true
|
||||
, texinfo ? null
|
||||
, perl ? null # optional, for texi2pod (then pod2man)
|
||||
, gmp, mpfr, libmpc, gettext, which
|
||||
@@ -16,6 +17,7 @@
|
||||
, enablePlugin ? stdenv.hostPlatform == stdenv.buildPlatform # Whether to support user-supplied plug-ins
|
||||
, name ? "gcc"
|
||||
, libcCross ? null
|
||||
, threadsCross ? null # for MinGW
|
||||
, crossStageStatic ? false
|
||||
, # Strip kills static libs of other archs (hence no cross)
|
||||
stripped ? stdenv.hostPlatform == stdenv.buildPlatform
|
||||
@@ -34,10 +36,14 @@ assert stdenv.hostPlatform.isDarwin -> gnused != null;
|
||||
# The go frontend is written in c++
|
||||
assert langGo -> langCC;
|
||||
|
||||
# threadsCross is just for MinGW
|
||||
assert threadsCross != null -> stdenv.targetPlatform.isWindows;
|
||||
|
||||
with stdenv.lib;
|
||||
with builtins;
|
||||
|
||||
let version = "7.4.0";
|
||||
let majorVersion = "7";
|
||||
version = "${majorVersion}.5.0";
|
||||
|
||||
inherit (stdenv) buildPlatform hostPlatform targetPlatform;
|
||||
|
||||
@@ -58,90 +64,28 @@ let version = "7.4.0";
|
||||
})
|
||||
++ optional langFortran ../gfortran-driving.patch
|
||||
++ optional (targetPlatform.libc == "musl" && targetPlatform.isPower) ../ppc-musl.patch
|
||||
++ optional (targetPlatform.libc == "musl") ../libgomp-dont-force-initial-exec.patch;
|
||||
++ optional (targetPlatform.libc == "musl") ../libgomp-dont-force-initial-exec.patch
|
||||
++ optional (!crossStageStatic && targetPlatform.isMinGW) (fetchpatch {
|
||||
url = "https://raw.githubusercontent.com/lhmouse/MINGW-packages/${import ../common/mfcgthreads-patches-repo.nix}/mingw-w64-gcc-git/9000-gcc-${majorVersion}-branch-Added-mcf-thread-model-support-from-mcfgthread.patch";
|
||||
sha256 = "1nyjnshpq5gbcbbpfv27hy4ajvycmgkpiabkjlxnnrnq1d99k1ay";
|
||||
});
|
||||
|
||||
/* 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=${getDev libcCross}${libcCross.incdir or "/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"
|
||||
# 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 "";
|
||||
|
||||
bootstrap = targetPlatform == hostPlatform;
|
||||
stageNameAddon = if crossStageStatic then "stage-static" else "stage-final";
|
||||
crossNameAddon = optionalString (targetPlatform != hostPlatform) "${targetPlatform.config}-${stageNameAddon}-";
|
||||
|
||||
in
|
||||
|
||||
stdenv.mkDerivation ({
|
||||
name = crossNameAddon + "${name}${if stripped then "" else "-debug"}-${version}";
|
||||
pname = "${crossNameAddon}${name}${if stripped then "" else "-debug"}";
|
||||
inherit version;
|
||||
|
||||
builder = ../builder.sh;
|
||||
|
||||
src = fetchurl {
|
||||
url = "mirror://gcc/releases/gcc-${version}/gcc-${version}.tar.xz";
|
||||
sha256 = "0lgy170b0pp60j9cczqkmaqyjjb584vfamj4c30swd7k0j6y5pgd";
|
||||
sha256 = "0qg6kqc5l72hpnj4vr6l0p69qav0rh4anlkk3y55540zy3klc6dq";
|
||||
};
|
||||
|
||||
inherit patches;
|
||||
@@ -227,101 +171,57 @@ stdenv.mkDerivation ({
|
||||
++ (optional hostPlatform.isDarwin gnused)
|
||||
;
|
||||
|
||||
depsTargetTarget = optional (!crossStageStatic && threadsCross != null) threadsCross;
|
||||
|
||||
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) ''
|
||||
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"
|
||||
'';
|
||||
preConfigure = import ../common/pre-configure.nix {
|
||||
inherit (stdenv) lib;
|
||||
inherit version hostPlatform langGo;
|
||||
};
|
||||
|
||||
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" ++
|
||||
configureFlags = import ../common/configure-flags.nix {
|
||||
inherit
|
||||
stdenv
|
||||
targetPackages
|
||||
crossStageStatic libcCross
|
||||
version
|
||||
|
||||
# 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++" ]
|
||||
)
|
||||
)
|
||||
}"
|
||||
] ++
|
||||
gmp mpfr libmpc libelf isl
|
||||
|
||||
(if (enableMultilib || targetPlatform.isAvr)
|
||||
then ["--enable-multilib" "--disable-libquadmath"]
|
||||
else ["--disable-multilib"]) ++
|
||||
optional (!enableShared) "--disable-shared" ++
|
||||
(if enablePlugin
|
||||
then ["--enable-plugin"]
|
||||
else ["--disable-plugin"]) ++
|
||||
enableLTO
|
||||
enableMultilib
|
||||
enablePlugin
|
||||
enableShared
|
||||
|
||||
# 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.isx86_32) "--with-arch=${stdenv.hostPlatform.parsed.cpu.name}" ++
|
||||
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"
|
||||
]
|
||||
++ optional (targetPlatform.isAarch64) "--enable-fix-cortex-a53-843419"
|
||||
langC
|
||||
langCC
|
||||
langFortran
|
||||
langGo
|
||||
langObjC
|
||||
langObjCpp
|
||||
;
|
||||
} ++ optional (targetPlatform.isAarch64) "--enable-fix-cortex-a53-843419"
|
||||
++ optional targetPlatform.isNetBSD "--disable-libcilkrts"
|
||||
;
|
||||
|
||||
targetConfig = if targetPlatform != hostPlatform then targetPlatform.config else null;
|
||||
|
||||
buildFlags = optional
|
||||
(bootstrap && hostPlatform == buildPlatform)
|
||||
(targetPlatform == hostPlatform && 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";
|
||||
installTargets = optional stripped "install-strip";
|
||||
|
||||
# https://gcc.gnu.org/install/specific.html#x86-64-x-solaris210
|
||||
${if hostPlatform.system == "x86_64-solaris" then "CC" else null} = "gcc -m64";
|
||||
@@ -341,24 +241,13 @@ stdenv.mkDerivation ({
|
||||
|
||||
LIBRARY_PATH = optionals (targetPlatform == hostPlatform) (makeLibraryPath (optional (zlib != null) zlib));
|
||||
|
||||
EXTRA_TARGET_FLAGS = optionals
|
||||
(targetPlatform != hostPlatform && libcCross != null)
|
||||
([
|
||||
"-idirafter ${getDev libcCross}${libcCross.incdir or "/include"}"
|
||||
] ++ optionals (! crossStageStatic) [
|
||||
"-B${libcCross.out}${libcCross.libdir or "/lib"}"
|
||||
]);
|
||||
|
||||
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"}"
|
||||
]));
|
||||
inherit
|
||||
(import ../common/extra-target-flags.nix {
|
||||
inherit stdenv crossStageStatic libcCross threadsCross;
|
||||
})
|
||||
EXTRA_TARGET_FLAGS
|
||||
EXTRA_TARGET_LDFLAGS
|
||||
;
|
||||
|
||||
passthru = {
|
||||
inherit langC langCC langObjC langObjCpp langFortran langGo version;
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
{ stdenv, targetPackages, fetchurl, noSysDirs
|
||||
{ stdenv, targetPackages, fetchurl, fetchpatch, noSysDirs
|
||||
, langC ? true, langCC ? true, langFortran ? false
|
||||
, langObjC ? stdenv.targetPlatform.isDarwin
|
||||
, langObjCpp ? stdenv.targetPlatform.isDarwin
|
||||
@@ -6,6 +6,7 @@
|
||||
, profiledCompiler ? false
|
||||
, staticCompiler ? false
|
||||
, enableShared ? true
|
||||
, enableLTO ? true
|
||||
, texinfo ? null
|
||||
, perl ? null # optional, for texi2pod (then pod2man)
|
||||
, gmp, mpfr, libmpc, gettext, which
|
||||
@@ -16,6 +17,7 @@
|
||||
, enablePlugin ? stdenv.hostPlatform == stdenv.buildPlatform # Whether to support user-supplied plug-ins
|
||||
, name ? "gcc"
|
||||
, libcCross ? null
|
||||
, threadsCross ? null # for MinGW
|
||||
, crossStageStatic ? false
|
||||
, # Strip kills static libs of other archs (hence no cross)
|
||||
stripped ? stdenv.hostPlatform == stdenv.buildPlatform
|
||||
@@ -34,10 +36,14 @@ assert stdenv.hostPlatform.isDarwin -> gnused != null;
|
||||
# The go frontend is written in c++
|
||||
assert langGo -> langCC;
|
||||
|
||||
# threadsCross is just for MinGW
|
||||
assert threadsCross != null -> stdenv.targetPlatform.isWindows;
|
||||
|
||||
with stdenv.lib;
|
||||
with builtins;
|
||||
|
||||
let version = "8.3.0";
|
||||
let majorVersion = "8";
|
||||
version = "${majorVersion}.3.0";
|
||||
|
||||
inherit (stdenv) buildPlatform hostPlatform targetPlatform;
|
||||
|
||||
@@ -50,83 +56,22 @@ let version = "8.3.0";
|
||||
}) */
|
||||
++ optional langFortran ../gfortran-driving.patch
|
||||
++ optional (targetPlatform.libc == "musl" && targetPlatform.isPower) ../ppc-musl.patch
|
||||
++ optional (targetPlatform.libc == "musl") ../libgomp-dont-force-initial-exec.patch;
|
||||
++ optional (targetPlatform.libc == "musl") ../libgomp-dont-force-initial-exec.patch
|
||||
++ optional (!crossStageStatic && targetPlatform.isMinGW) (fetchpatch {
|
||||
url = "https://raw.githubusercontent.com/lhmouse/MINGW-packages/${import ../common/mfcgthreads-patches-repo.nix}/mingw-w64-gcc-git/9000-gcc-${majorVersion}-branch-Added-mcf-thread-model-support-from-mcfgthread.patch";
|
||||
sha256 = "1in5kvcknlpi9z1vvjw6jfmwy8k12zvbqlqfnq84qpm99r0rh00a";
|
||||
});
|
||||
|
||||
/* 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;
|
||||
stageNameAddon = if crossStageStatic then "stage-static" else "stage-final";
|
||||
crossNameAddon = optionalString (targetPlatform != hostPlatform) "${targetPlatform.config}-${stageNameAddon}-";
|
||||
|
||||
in
|
||||
|
||||
stdenv.mkDerivation ({
|
||||
name = "${name}${if stripped then "" else "-debug"}-${version}" + crossNameAddon;
|
||||
pname = "${crossNameAddon}${name}${if stripped then "" else "-debug"}";
|
||||
inherit version;
|
||||
|
||||
builder = ../builder.sh;
|
||||
|
||||
@@ -218,96 +163,52 @@ stdenv.mkDerivation ({
|
||||
++ (optional hostPlatform.isDarwin gnused)
|
||||
;
|
||||
|
||||
depsTargetTarget = optional (!crossStageStatic && threadsCross != null) threadsCross;
|
||||
|
||||
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"
|
||||
'';
|
||||
preConfigure = import ../common/pre-configure.nix {
|
||||
inherit (stdenv) lib;
|
||||
inherit version hostPlatform langGo;
|
||||
};
|
||||
|
||||
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" ++
|
||||
configureFlags = import ../common/configure-flags.nix {
|
||||
inherit
|
||||
stdenv
|
||||
targetPackages
|
||||
crossStageStatic libcCross
|
||||
version
|
||||
|
||||
# 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++" ]
|
||||
)
|
||||
)
|
||||
}"
|
||||
] ++
|
||||
gmp mpfr libmpc libelf isl
|
||||
|
||||
(if (enableMultilib || targetPlatform.isAvr)
|
||||
then ["--enable-multilib" "--disable-libquadmath"]
|
||||
else ["--disable-multilib"]) ++
|
||||
optional (!enableShared) "--disable-shared" ++
|
||||
(if enablePlugin
|
||||
then ["--enable-plugin"]
|
||||
else ["--disable-plugin"]) ++
|
||||
enableLTO
|
||||
enableMultilib
|
||||
enablePlugin
|
||||
enableShared
|
||||
|
||||
# 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.isx86_32) "--with-arch=${stdenv.hostPlatform.parsed.cpu.name}" ++
|
||||
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"
|
||||
]
|
||||
;
|
||||
langC
|
||||
langCC
|
||||
langFortran
|
||||
langGo
|
||||
langObjC
|
||||
langObjCpp
|
||||
;
|
||||
};
|
||||
|
||||
targetConfig = if targetPlatform != hostPlatform then targetPlatform.config else null;
|
||||
|
||||
buildFlags = optional
|
||||
(bootstrap && hostPlatform == buildPlatform)
|
||||
(targetPlatform == hostPlatform && hostPlatform == buildPlatform)
|
||||
(if profiledCompiler then "profiledbootstrap" else "bootstrap");
|
||||
|
||||
dontStrip = !stripped;
|
||||
|
||||
installTargets =
|
||||
if stripped
|
||||
then "install-strip"
|
||||
else "install";
|
||||
installTargets = optional stripped "install-strip";
|
||||
|
||||
# https://gcc.gnu.org/install/specific.html#x86-64-x-solaris210
|
||||
${if hostPlatform.system == "x86_64-solaris" then "CC" else null} = "gcc -m64";
|
||||
@@ -327,24 +228,13 @@ stdenv.mkDerivation ({
|
||||
|
||||
LIBRARY_PATH = optionals (targetPlatform == hostPlatform) (makeLibraryPath (optional (zlib != null) zlib));
|
||||
|
||||
EXTRA_TARGET_FLAGS = optionals
|
||||
(targetPlatform != hostPlatform && libcCross != null)
|
||||
([
|
||||
"-idirafter ${getDev libcCross}${libcCross.incdir or "/include"}"
|
||||
] ++ optionals (! crossStageStatic) [
|
||||
"-B${libcCross.out}${libcCross.libdir or "/lib"}"
|
||||
]);
|
||||
|
||||
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"}"
|
||||
]));
|
||||
inherit
|
||||
(import ../common/extra-target-flags.nix {
|
||||
inherit stdenv crossStageStatic libcCross threadsCross;
|
||||
})
|
||||
EXTRA_TARGET_FLAGS
|
||||
EXTRA_TARGET_LDFLAGS
|
||||
;
|
||||
|
||||
passthru = {
|
||||
inherit langC langCC langObjC langObjCpp langFortran langGo version;
|
||||
@@ -378,9 +268,6 @@ stdenv.mkDerivation ({
|
||||
stdenv.lib.platforms.freebsd ++
|
||||
stdenv.lib.platforms.illumos ++
|
||||
stdenv.lib.platforms.darwin;
|
||||
|
||||
# See #40038
|
||||
broken = stdenv.isDarwin;
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
{ stdenv, targetPackages, fetchurl, noSysDirs
|
||||
{ stdenv, targetPackages, fetchurl, fetchpatch, noSysDirs
|
||||
, langC ? true, langCC ? true, langFortran ? false
|
||||
, langObjC ? stdenv.targetPlatform.isDarwin
|
||||
, langObjCpp ? stdenv.targetPlatform.isDarwin
|
||||
@@ -6,6 +6,7 @@
|
||||
, profiledCompiler ? false
|
||||
, staticCompiler ? false
|
||||
, enableShared ? true
|
||||
, enableLTO ? true
|
||||
, texinfo ? null
|
||||
, perl ? null # optional, for texi2pod (then pod2man)
|
||||
, gmp, mpfr, libmpc, gettext, which
|
||||
@@ -16,6 +17,7 @@
|
||||
, enablePlugin ? stdenv.hostPlatform == stdenv.buildPlatform # Whether to support user-supplied plug-ins
|
||||
, name ? "gcc"
|
||||
, libcCross ? null
|
||||
, threadsCross ? null # for MinGW
|
||||
, crossStageStatic ? false
|
||||
, # Strip kills static libs of other archs (hence no cross)
|
||||
stripped ? stdenv.hostPlatform == stdenv.buildPlatform
|
||||
@@ -34,10 +36,14 @@ assert stdenv.hostPlatform.isDarwin -> gnused != null;
|
||||
# The go frontend is written in c++
|
||||
assert langGo -> langCC;
|
||||
|
||||
# threadsCross is just for MinGW
|
||||
assert threadsCross != null -> stdenv.targetPlatform.isWindows;
|
||||
|
||||
with stdenv.lib;
|
||||
with builtins;
|
||||
|
||||
let version = "9.2.0";
|
||||
let majorVersion = "9";
|
||||
version = "${majorVersion}.2.0";
|
||||
|
||||
inherit (stdenv) buildPlatform hostPlatform targetPlatform;
|
||||
|
||||
@@ -49,83 +55,22 @@ let version = "9.2.0";
|
||||
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" && targetPlatform.isPower) ../ppc-musl.patch
|
||||
++ optional (!crossStageStatic && targetPlatform.isMinGW) (fetchpatch {
|
||||
url = "https://raw.githubusercontent.com/lhmouse/MINGW-packages/${import ../common/mfcgthreads-patches-repo.nix}/mingw-w64-gcc-git/9000-gcc-${majorVersion}-branch-Added-mcf-thread-model-support-from-mcfgthread.patch";
|
||||
sha256 = "1in5kvcknlpi9z1vvjw6jfmwy8k12zvbqlqfnq84qpm99r0rh00a";
|
||||
});
|
||||
|
||||
/* 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;
|
||||
stageNameAddon = if crossStageStatic then "stage-static" else "stage-final";
|
||||
crossNameAddon = optionalString (targetPlatform != hostPlatform) "${targetPlatform.config}-${stageNameAddon}-";
|
||||
|
||||
in
|
||||
|
||||
stdenv.mkDerivation ({
|
||||
name = "${name}${if stripped then "" else "-debug"}-${version}" + crossNameAddon;
|
||||
pname = "${crossNameAddon}${name}${if stripped then "" else "-debug"}";
|
||||
inherit version;
|
||||
|
||||
builder = ../builder.sh;
|
||||
|
||||
@@ -217,96 +162,52 @@ stdenv.mkDerivation ({
|
||||
++ (optional hostPlatform.isDarwin gnused)
|
||||
;
|
||||
|
||||
depsTargetTarget = optional (!crossStageStatic && threadsCross != null) threadsCross;
|
||||
|
||||
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"
|
||||
'';
|
||||
preConfigure = import ../common/pre-configure.nix {
|
||||
inherit (stdenv) lib;
|
||||
inherit version hostPlatform langGo;
|
||||
};
|
||||
|
||||
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" ++
|
||||
configureFlags = import ../common/configure-flags.nix {
|
||||
inherit
|
||||
stdenv
|
||||
targetPackages
|
||||
crossStageStatic libcCross
|
||||
version
|
||||
|
||||
# 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++" ]
|
||||
)
|
||||
)
|
||||
}"
|
||||
] ++
|
||||
gmp mpfr libmpc libelf isl
|
||||
|
||||
(if (enableMultilib || targetPlatform.isAvr)
|
||||
then ["--enable-multilib" "--disable-libquadmath"]
|
||||
else ["--disable-multilib"]) ++
|
||||
optional (!enableShared) "--disable-shared" ++
|
||||
(if enablePlugin
|
||||
then ["--enable-plugin"]
|
||||
else ["--disable-plugin"]) ++
|
||||
enableLTO
|
||||
enableMultilib
|
||||
enablePlugin
|
||||
enableShared
|
||||
|
||||
# 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.isx86_32) "--with-arch=${stdenv.hostPlatform.parsed.cpu.name}" ++
|
||||
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"
|
||||
]
|
||||
;
|
||||
langC
|
||||
langCC
|
||||
langFortran
|
||||
langGo
|
||||
langObjC
|
||||
langObjCpp
|
||||
;
|
||||
};
|
||||
|
||||
targetConfig = if targetPlatform != hostPlatform then targetPlatform.config else null;
|
||||
|
||||
buildFlags = optional
|
||||
(bootstrap && hostPlatform == buildPlatform)
|
||||
(targetPlatform == hostPlatform && hostPlatform == buildPlatform)
|
||||
(if profiledCompiler then "profiledbootstrap" else "bootstrap");
|
||||
|
||||
dontStrip = !stripped;
|
||||
|
||||
installTargets =
|
||||
if stripped
|
||||
then "install-strip"
|
||||
else "install";
|
||||
installTargets = optional stripped "install-strip";
|
||||
|
||||
# https://gcc.gnu.org/install/specific.html#x86-64-x-solaris210
|
||||
${if hostPlatform.system == "x86_64-solaris" then "CC" else null} = "gcc -m64";
|
||||
@@ -326,24 +227,13 @@ stdenv.mkDerivation ({
|
||||
|
||||
LIBRARY_PATH = optionals (targetPlatform == hostPlatform) (makeLibraryPath (optional (zlib != null) zlib));
|
||||
|
||||
EXTRA_TARGET_FLAGS = optionals
|
||||
(targetPlatform != hostPlatform && libcCross != null)
|
||||
([
|
||||
"-idirafter ${getDev libcCross}${libcCross.incdir or "/include"}"
|
||||
] ++ optionals (! crossStageStatic) [
|
||||
"-B${libcCross.out}${libcCross.libdir or "/lib"}"
|
||||
]);
|
||||
|
||||
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"}"
|
||||
]));
|
||||
inherit
|
||||
(import ../common/extra-target-flags.nix {
|
||||
inherit stdenv crossStageStatic libcCross threadsCross;
|
||||
})
|
||||
EXTRA_TARGET_FLAGS
|
||||
EXTRA_TARGET_LDFLAGS
|
||||
;
|
||||
|
||||
passthru = {
|
||||
inherit langC langCC langObjC langObjCpp langFortran langGo version;
|
||||
|
||||
@@ -0,0 +1,174 @@
|
||||
{ stdenv
|
||||
, targetPackages
|
||||
|
||||
, crossStageStatic, libcCross
|
||||
, version
|
||||
|
||||
, gmp, mpfr, libmpc, libelf, isl
|
||||
, cloog ? null
|
||||
|
||||
, enableLTO
|
||||
, enableMultilib
|
||||
, enablePlugin
|
||||
, enableShared
|
||||
|
||||
, langC
|
||||
, langCC
|
||||
, langFortran
|
||||
, langJava ? false, javaAwtGtk ? false, javaAntlr ? null, javaEcj ? null
|
||||
, langGo
|
||||
, langObjC
|
||||
, langObjCpp
|
||||
}:
|
||||
|
||||
assert cloog != null -> stdenv.lib.versionOlder version "5";
|
||||
assert langJava -> stdenv.lib.versionOlder version "7";
|
||||
|
||||
let
|
||||
inherit (stdenv)
|
||||
buildPlatform hostPlatform targetPlatform
|
||||
lib;
|
||||
|
||||
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 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
|
||||
] ++ lib.optionals crossMingw [
|
||||
"--with-headers=${lib.getDev libcCross}/include"
|
||||
"--with-gcc"
|
||||
"--with-gnu-as"
|
||||
"--with-gnu-ld"
|
||||
"--disable-debug"
|
||||
"--enable-sjlj-exceptions"
|
||||
"--disable-win32-registry"
|
||||
] else [
|
||||
(if crossDarwin then "--with-sysroot=${lib.getLib libcCross}/share/sysroot"
|
||||
else "--with-headers=${lib.getDev libcCross}${libcCross.incdir or "/include"}")
|
||||
"--enable-__cxa_atexit"
|
||||
"--enable-long-long"
|
||||
"--enable-threads=${if targetPlatform.isUnix then "posix"
|
||||
else if targetPlatform.isWindows then "mcf"
|
||||
else "single"}"
|
||||
"--enable-nls"
|
||||
"--disable-decimal-float" # No final libdecnumber (it may work only in 386)
|
||||
] ++ lib.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"
|
||||
] ++ lib.optionals (targetPlatform.libc == "musl") [
|
||||
# musl at least, disable: https://git.buildroot.net/buildroot/commit/?id=873d4019f7fb00f6a80592224236b3ba7d657865
|
||||
"--disable-libmpx"
|
||||
] ++ lib.optionals crossMingw [
|
||||
"--enable-sjlj-exceptions"
|
||||
"--enable-hash-synchronization"
|
||||
"--enable-libssp"
|
||||
"--disable-nls"
|
||||
"--with-dwarf2"
|
||||
# To keep ABI compatibility with upstream mingw-w64
|
||||
"--enable-fully-dynamic-string"
|
||||
] ++ lib.optional (targetPlatform.libc == "newlib") "--with-newlib"
|
||||
++ lib.optional (targetPlatform.libc == "avrlibc") "--with-avrlibc"
|
||||
);
|
||||
|
||||
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}"
|
||||
]
|
||||
++ lib.optional (libelf != null) "--with-libelf=${libelf}"
|
||||
++ lib.optional (!(crossMingw && crossStageStatic))
|
||||
"--with-native-system-header-dir=${lib.getDev stdenv.cc.libc}/include"
|
||||
|
||||
# Basic configuration
|
||||
++ [
|
||||
(lib.enableFeature enableLTO "lto")
|
||||
"--disable-libstdcxx-pch"
|
||||
"--without-included-gettext"
|
||||
"--with-system-zlib"
|
||||
"--enable-static"
|
||||
"--enable-languages=${
|
||||
lib.concatStrings (lib.intersperse ","
|
||||
( lib.optional langC "c"
|
||||
++ lib.optional langCC "c++"
|
||||
++ lib.optional langFortran "fortran"
|
||||
++ lib.optional langJava "java"
|
||||
++ lib.optional langGo "go"
|
||||
++ lib.optional langObjC "objc"
|
||||
++ lib.optional langObjCpp "obj-c++"
|
||||
++ lib.optionals crossDarwin [ "objc" "obj-c++" ]
|
||||
)
|
||||
)
|
||||
}"
|
||||
]
|
||||
|
||||
++ (if (enableMultilib || targetPlatform.isAvr)
|
||||
then ["--enable-multilib" "--disable-libquadmath"]
|
||||
else ["--disable-multilib"])
|
||||
++ lib.optional (!enableShared) "--disable-shared"
|
||||
++ [
|
||||
(lib.enableFeature enablePlugin "plugin")
|
||||
]
|
||||
|
||||
# Optional features
|
||||
++ lib.optional (isl != null) "--with-isl=${isl}"
|
||||
++ lib.optionals (cloog != null) [
|
||||
"--with-cloog=${cloog}"
|
||||
"--disable-cloog-version-check"
|
||||
"--enable-cloog-backend=isl"
|
||||
]
|
||||
|
||||
# Java options
|
||||
++ lib.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"
|
||||
]
|
||||
++ lib.optional javaAwtGtk "--enable-java-awt=gtk"
|
||||
++ lib.optional (langJava && javaAntlr != null) "--with-antlr-jar=${javaAntlr}"
|
||||
|
||||
++ (import ../common/platform-flags.nix { inherit (stdenv) lib targetPlatform; })
|
||||
++ lib.optionals (targetPlatform != hostPlatform) crossConfigureFlags
|
||||
++ lib.optional (targetPlatform != hostPlatform) "--disable-bootstrap"
|
||||
|
||||
# Platform-specific flags
|
||||
++ lib.optional (targetPlatform == hostPlatform && targetPlatform.isx86_32) "--with-arch=${stdenv.hostPlatform.parsed.cpu.name}"
|
||||
++ lib.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"
|
||||
]
|
||||
++ lib.optionals (targetPlatform == hostPlatform && targetPlatform.libc == "musl") [
|
||||
"--disable-libsanitizer"
|
||||
"--disable-symvers"
|
||||
"libat_cv_have_ifunc=no"
|
||||
"--disable-gnu-indirect-function"
|
||||
]
|
||||
;
|
||||
|
||||
in configureFlags
|
||||
@@ -0,0 +1,30 @@
|
||||
{ stdenv, crossStageStatic, libcCross, threadsCross }:
|
||||
|
||||
let
|
||||
inherit (stdenv) lib hostPlatform targetPlatform;
|
||||
in
|
||||
|
||||
{
|
||||
EXTRA_TARGET_FLAGS = let
|
||||
mkFlags = dep: lib.optionals (targetPlatform != hostPlatform && dep != null) ([
|
||||
"-idirafter ${lib.getDev dep}${dep.incdir or "/include"}"
|
||||
] ++ stdenv.lib.optionals (! crossStageStatic) [
|
||||
"-B${lib.getLib dep}${dep.libdir or "/lib"}"
|
||||
]);
|
||||
in mkFlags libcCross
|
||||
++ lib.optionals (!crossStageStatic) (mkFlags threadsCross)
|
||||
;
|
||||
|
||||
EXTRA_TARGET_LDFLAGS = let
|
||||
mkFlags = dep: lib.optionals (targetPlatform != hostPlatform && dep != null) ([
|
||||
"-Wl,-L${lib.getLib dep}${dep.libdir or "/lib"}"
|
||||
] ++ (if crossStageStatic then [
|
||||
"-B${lib.getLib dep}${dep.libdir or "/lib"}"
|
||||
] else [
|
||||
"-Wl,-rpath,${lib.getLib dep}${dep.libdir or "/lib"}"
|
||||
"-Wl,-rpath-link,${lib.getLib dep}${dep.libdir or "/lib"}"
|
||||
]));
|
||||
in mkFlags libcCross
|
||||
++ lib.optionals (!crossStageStatic) (mkFlags threadsCross)
|
||||
;
|
||||
}
|
||||
@@ -0,0 +1 @@
|
||||
"740f233da00c4fb5bcc225b2e29768824bcecc58"
|
||||
@@ -0,0 +1,12 @@
|
||||
{ lib, version, hostPlatform, langJava ? false, langGo }:
|
||||
|
||||
assert langJava -> lib.versionOlder version "7";
|
||||
|
||||
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"
|
||||
'' + lib.optionalString (lib.versionOlder version "7" && (langJava || langGo)) ''
|
||||
export lib=$out;
|
||||
''
|
||||
@@ -1,352 +0,0 @@
|
||||
{ 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
|
||||
, flex ? null
|
||||
, 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 = "7-20170409";
|
||||
|
||||
inherit (stdenv) buildPlatform hostPlatform targetPlatform;
|
||||
|
||||
patches =
|
||||
[ ]
|
||||
++ optional (targetPlatform != hostPlatform) ../libstdc++-target.patch
|
||||
++ optional noSysDirs ../no-sys-dirs.patch
|
||||
++ optional langFortran ../gfortran-driving.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}/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") [
|
||||
# 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"
|
||||
]
|
||||
++ 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/snapshots/${version}/gcc-${version}.tar.bz2";
|
||||
sha256 = "19197rw1xrpkb8h10lfgn6zj7yj52x95hdmr0x5lg8i4v3i23b67";
|
||||
};
|
||||
|
||||
inherit patches;
|
||||
|
||||
outputs = [ "out" "lib" "man" "info" ];
|
||||
setOutputFlags = false;
|
||||
NIX_NO_SELF_RPATH = true;
|
||||
|
||||
libc_dev = stdenv.cc.libc_dev;
|
||||
|
||||
hardeningDisable = [ "format" "pie" ];
|
||||
|
||||
postPatch =
|
||||
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;
|
||||
|
||||
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 flex
|
||||
targetPackages.stdenv.cc.bintools # For linking code at run-time
|
||||
] ++ (optional (isl != null) isl)
|
||||
++ (optional (zlib != null) zlib)
|
||||
# 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)
|
||||
;
|
||||
|
||||
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
|
||||
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"
|
||||
]
|
||||
;
|
||||
|
||||
targetConfig = if targetPlatform != hostPlatform then targetPlatform.config else null;
|
||||
|
||||
buildFlags = if bootstrap then
|
||||
(if profiledCompiler then "profiledbootstrap" else "bootstrap")
|
||||
else "";
|
||||
|
||||
dontStrip = !stripped;
|
||||
NIX_STRIP_DEBUG = !stripped;
|
||||
|
||||
installTargets =
|
||||
if stripped
|
||||
then "install-strip"
|
||||
else "install";
|
||||
|
||||
# https://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_FLAGS = optionals
|
||||
(targetPlatform != hostPlatform && libcCross != null)
|
||||
([
|
||||
"-idirafter ${getDev libcCross}${libcCross.incdir or "/include"}"
|
||||
] ++ optionals (! crossStageStatic) [
|
||||
"-B${libcCross.out}${libcCross.libdir or "/lib"}"
|
||||
]);
|
||||
|
||||
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;
|
||||
};
|
||||
|
||||
enableParallelBuilding = true;
|
||||
inherit enableMultilib;
|
||||
|
||||
inherit (stdenv) is64bit;
|
||||
|
||||
meta = {
|
||||
homepage = https://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; [ ];
|
||||
|
||||
platforms =
|
||||
stdenv.lib.platforms.linux ++
|
||||
stdenv.lib.platforms.freebsd ++
|
||||
stdenv.lib.platforms.illumos ++
|
||||
stdenv.lib.platforms.darwin;
|
||||
|
||||
broken = true;
|
||||
};
|
||||
}
|
||||
|
||||
// optionalAttrs (targetPlatform != hostPlatform && targetPlatform.libc == "msvcrt" && crossStageStatic) {
|
||||
makeFlags = [ "all-gcc" "all-target-libgcc" ];
|
||||
installTargets = "install-gcc install-target-libgcc";
|
||||
}
|
||||
|
||||
// optionalAttrs (enableMultilib) { dontMoveLib64 = true; }
|
||||
)
|
||||
@@ -3,9 +3,6 @@
|
||||
openssl, zlib, sqlite, libxml2, libyaml, libmysqlclient, lmdb, leveldb, postgresql,
|
||||
version, git-version, gambit, src }:
|
||||
|
||||
# TODO: distinct packages for gerbil-release and gerbil-devel
|
||||
# TODO: make static compilation work
|
||||
|
||||
stdenv.mkDerivation rec {
|
||||
pname = "gerbil";
|
||||
inherit version;
|
||||
@@ -18,7 +15,7 @@ stdenv.mkDerivation rec {
|
||||
buildInputs = [ gambit rsync bash ]
|
||||
++ buildInputs_libraries ++ buildInputs_staticLibraries;
|
||||
|
||||
NIX_CFLAGS_COMPILE = [ "-I${libmysqlclient}/include/mysql" "-L${libmysqlclient}/lib/mysql" ];
|
||||
NIX_CFLAGS_COMPILE = "-I${libmysqlclient}/include/mysql -L${libmysqlclient}/lib/mysql";
|
||||
|
||||
postPatch = ''
|
||||
echo '(define (gerbil-version-string) "v${git-version}")' > src/gerbil/runtime/gx-version.scm
|
||||
@@ -32,19 +29,23 @@ stdenv.mkDerivation rec {
|
||||
substituteInPlace "$f" --replace '"gsc"' '"${gambit}/bin/gsc"'
|
||||
done
|
||||
substituteInPlace "etc/gerbil.el" --replace '"gxc"' "\"$out/bin/gxc\""
|
||||
'';
|
||||
|
||||
cat > etc/gerbil_static_libraries.sh <<EOF
|
||||
#OPENSSL_LIBCRYPTO=${makeStaticLibraries openssl}/lib/libcrypto.a # MISSING!
|
||||
#OPENSSL_LIBSSL=${makeStaticLibraries openssl}/lib/libssl.a # MISSING!
|
||||
ZLIB=${makeStaticLibraries zlib}/lib/libz.a
|
||||
## TODO: make static compilation work.
|
||||
## For that, get all the packages below to somehow expose static libraries,
|
||||
## so we can offer users the option to statically link them into Gambit and/or Gerbil.
|
||||
## Then add the following to the postPatch script above:
|
||||
# cat > etc/gerbil_static_libraries.sh <<EOF
|
||||
# OPENSSL_LIBCRYPTO=${makeStaticLibraries openssl}/lib/libcrypto.a # MISSING!
|
||||
# OPENSSL_LIBSSL=${makeStaticLibraries openssl}/lib/libssl.a # MISSING!
|
||||
# ZLIB=${makeStaticLibraries zlib}/lib/libz.a
|
||||
# SQLITE=${makeStaticLibraries sqlite}/lib/sqlite.a # MISSING!
|
||||
# LIBXML2=${makeStaticLibraries libxml2}/lib/libxml2.a # MISSING!
|
||||
# YAML=${makeStaticLibraries libyaml}/lib/libyaml.a # MISSING!
|
||||
MYSQL=${makeStaticLibraries libmysqlclient}/lib/mariadb/libmariadb.a
|
||||
# MYSQL=${makeStaticLibraries libmysqlclient}/lib/mariadb/libmariadb.a
|
||||
# LMDB=${makeStaticLibraries lmdb}/lib/mysql/libmysqlclient_r.a # MISSING!
|
||||
LEVELDB=${makeStaticLibraries lmdb}/lib/libleveldb.a
|
||||
EOF
|
||||
'';
|
||||
# LEVELDB=${makeStaticLibraries leveldb}/lib/libleveldb.a
|
||||
# EOF
|
||||
|
||||
buildPhase = ''
|
||||
runHook preBuild
|
||||
@@ -52,6 +53,14 @@ EOF
|
||||
# Enable all optional libraries
|
||||
substituteInPlace "src/std/build-features.ss" --replace '#f' '#t'
|
||||
|
||||
# Enable autodetection of a default GERBIL_HOME
|
||||
for i in src/gerbil/boot/gx-init-exe.scm src/gerbil/boot/gx-init.scm ; do
|
||||
substituteInPlace "$i" --replace '(getenv "GERBIL_HOME" #f)' "(getenv \"GERBIL_HOME\" \"$out\")"
|
||||
done
|
||||
for i in src/gerbil/boot/gxi-init.scm src/gerbil/compiler/driver.ss src/gerbil/runtime/gx-gambc.scm src/std/build.ss src/tools/build.ss ; do
|
||||
substituteInPlace "$i" --replace '(getenv "GERBIL_HOME")' "(getenv \"GERBIL_HOME\" \"$out\")"
|
||||
done
|
||||
|
||||
# gxprof testing uses $HOME/.cache/gerbil/gxc
|
||||
export HOME=$$PWD
|
||||
|
||||
@@ -71,7 +80,7 @@ EOF
|
||||
export GERBIL_HOME=$out
|
||||
case "\$1" in -:*) GSIOPTIONS=\$1 ; shift ;; esac
|
||||
if [[ \$# = 0 ]] ; then
|
||||
exec ${gambit}/bin/gsi \$GSIOPTIONS \$GERBIL_HOME/lib/gxi-init \$GERBIL_HOME/lib/gxi-interactive - ;
|
||||
exec ${gambit}/bin/gsi \$GSIOPTIONS \$GERBIL_HOME/lib/gxi-init \$GERBIL_HOME/lib/gxi-interactive -
|
||||
else
|
||||
exec ${gambit}/bin/gsi \$GSIOPTIONS \$GERBIL_HOME/lib/gxi-init "\$@"
|
||||
fi
|
||||
@@ -85,8 +94,8 @@ EOF
|
||||
description = "Gerbil Scheme";
|
||||
homepage = "https://github.com/vyzo/gerbil";
|
||||
license = stdenv.lib.licenses.lgpl2;
|
||||
# NB regarding platforms: only actually tested on Linux, *should* work everywhere,
|
||||
# but *might* need adaptation e.g. on macOS. Please report success and/or failure to fare.
|
||||
# NB regarding platforms: regularly tested on Linux, only occasionally on macOS.
|
||||
# Please report success and/or failure to fare.
|
||||
platforms = stdenv.lib.platforms.unix;
|
||||
maintainers = with stdenv.lib.maintainers; [ fare ];
|
||||
};
|
||||
|
||||
@@ -1,14 +1,15 @@
|
||||
{ stdenv, callPackage, fetchFromGitHub, gambit-unstable }:
|
||||
{ stdenv, callPackage, fetchFromGitHub, gambit, gambit-unstable }:
|
||||
|
||||
callPackage ./build.nix {
|
||||
version = "unstable-2019-08-11";
|
||||
git-version = "0.16-DEV-132-gcb58f9a3";
|
||||
gambit = gambit-unstable;
|
||||
version = "unstable-2020-02-27";
|
||||
git-version = "0.16-DEV-493-g1ffb74db";
|
||||
#gambit = gambit-unstable;
|
||||
gambit = gambit;
|
||||
src = fetchFromGitHub {
|
||||
owner = "vyzo";
|
||||
repo = "gerbil";
|
||||
rev = "cb58f9a30630a6f3e85a55f2c1dcc654f517ffed";
|
||||
sha256 = "18jh64v1gi6z3pks9zf19f2wcjpv21cs270dnaq617kgwp53vysh";
|
||||
rev = "1ffb74db5ffd49b4bad751586cef5e619c891d41";
|
||||
sha256 = "1szmdp8lvy5gpcwn5bpa7x383m6vywl35xa7hz9a5vs1rq4w2097";
|
||||
};
|
||||
inherit stdenv;
|
||||
}
|
||||
|
||||
@@ -0,0 +1,234 @@
|
||||
{ stdenv, pkgsBuildTarget, targetPackages
|
||||
|
||||
# build-tools
|
||||
, bootPkgs
|
||||
, autoconf, automake, coreutils, fetchurl, perl, python3, m4, sphinx
|
||||
, bash
|
||||
|
||||
, libiconv ? null, ncurses
|
||||
|
||||
, # GHC can be built with system libffi or a bundled one.
|
||||
libffi ? null
|
||||
|
||||
, useLLVM ? !stdenv.targetPlatform.isx86
|
||||
, # LLVM is conceptually a run-time-only depedendency, but for
|
||||
# non-x86, we need LLVM to bootstrap later stages, so it becomes a
|
||||
# build-time dependency too.
|
||||
buildLlvmPackages, llvmPackages
|
||||
|
||||
, # If enabled, GHC will be built with the GPL-free but slower integer-simple
|
||||
# library instead of the faster but GPLed integer-gmp library.
|
||||
enableIntegerSimple ? !(stdenv.lib.any (stdenv.lib.meta.platformMatch stdenv.hostPlatform) gmp.meta.platforms), gmp
|
||||
|
||||
, # If enabled, use -fPIC when compiling static libs.
|
||||
enableRelocatedStaticLibs ? stdenv.targetPlatform != stdenv.hostPlatform
|
||||
|
||||
, # Whether to build dynamic libs for the standard library (on the target
|
||||
# platform). Static libs are always built.
|
||||
enableShared ? !stdenv.targetPlatform.isWindows && !stdenv.targetPlatform.useiOSPrebuilt
|
||||
|
||||
, # Whetherto build terminfo.
|
||||
enableTerminfo ? !stdenv.targetPlatform.isWindows
|
||||
|
||||
, # What flavour to build. An empty string indicates no
|
||||
# specific flavour and falls back to ghc default values.
|
||||
ghcFlavour ? stdenv.lib.optionalString (stdenv.targetPlatform != stdenv.hostPlatform)
|
||||
(if useLLVM then "perf-cross" else "perf-cross-ncg")
|
||||
|
||||
, # Whether to disable the large address space allocator
|
||||
# necessary fix for iOS: https://www.reddit.com/r/haskell/comments/4ttdz1/building_an_osxi386_to_iosarm64_cross_compiler/d5qvd67/
|
||||
disableLargeAddressSpace ? stdenv.targetPlatform.isDarwin && stdenv.targetPlatform.isAarch64
|
||||
}:
|
||||
|
||||
assert !enableIntegerSimple -> gmp != null;
|
||||
|
||||
let
|
||||
inherit (stdenv) buildPlatform hostPlatform targetPlatform;
|
||||
|
||||
inherit (bootPkgs) ghc;
|
||||
|
||||
# TODO(@Ericson2314) Make unconditional
|
||||
targetPrefix = stdenv.lib.optionalString
|
||||
(targetPlatform != hostPlatform)
|
||||
"${targetPlatform.config}-";
|
||||
|
||||
buildMK = ''
|
||||
BuildFlavour = ${ghcFlavour}
|
||||
ifneq \"\$(BuildFlavour)\" \"\"
|
||||
include mk/flavours/\$(BuildFlavour).mk
|
||||
endif
|
||||
DYNAMIC_GHC_PROGRAMS = ${if enableShared then "YES" else "NO"}
|
||||
INTEGER_LIBRARY = ${if enableIntegerSimple then "integer-simple" else "integer-gmp"}
|
||||
'' + stdenv.lib.optionalString (targetPlatform != hostPlatform) ''
|
||||
Stage1Only = ${if targetPlatform.system == hostPlatform.system then "NO" else "YES"}
|
||||
CrossCompilePrefix = ${targetPrefix}
|
||||
HADDOCK_DOCS = NO
|
||||
BUILD_SPHINX_HTML = NO
|
||||
BUILD_SPHINX_PDF = NO
|
||||
'' + stdenv.lib.optionalString enableRelocatedStaticLibs ''
|
||||
GhcLibHcOpts += -fPIC
|
||||
GhcRtsHcOpts += -fPIC
|
||||
'' + stdenv.lib.optionalString targetPlatform.useAndroidPrebuilt ''
|
||||
EXTRA_CC_OPTS += -std=gnu99
|
||||
'';
|
||||
|
||||
# Splicer will pull out correct variations
|
||||
libDeps = platform: stdenv.lib.optional enableTerminfo [ ncurses ]
|
||||
++ [libffi]
|
||||
++ stdenv.lib.optional (!enableIntegerSimple) gmp
|
||||
++ stdenv.lib.optional (platform.libc != "glibc" && !targetPlatform.isWindows) libiconv;
|
||||
|
||||
toolsForTarget = [
|
||||
pkgsBuildTarget.targetPackages.stdenv.cc
|
||||
] ++ stdenv.lib.optional useLLVM buildLlvmPackages.llvm;
|
||||
|
||||
targetCC = builtins.head toolsForTarget;
|
||||
|
||||
useLdGold = targetPlatform.isLinux && !(targetPlatform.useLLVM or false);
|
||||
|
||||
in
|
||||
stdenv.mkDerivation (rec {
|
||||
version = "8.10.0.20200123";
|
||||
name = "${targetPrefix}ghc-${version}";
|
||||
|
||||
src = fetchurl {
|
||||
url = "https://downloads.haskell.org/ghc/8.10.1-rc1/ghc-${version}-src.tar.xz";
|
||||
sha256 = "162s5g33s918i12qfcqdj5wanc10xg07g5lq3gpm5j7c1v0y1zrf";
|
||||
};
|
||||
|
||||
enableParallelBuilding = true;
|
||||
|
||||
outputs = [ "out" "doc" ];
|
||||
|
||||
postPatch = "patchShebangs .";
|
||||
|
||||
# GHC is a bit confused on its cross terminology.
|
||||
preConfigure = ''
|
||||
for env in $(env | grep '^TARGET_' | sed -E 's|\+?=.*||'); do
|
||||
export "''${env#TARGET_}=''${!env}"
|
||||
done
|
||||
# GHC is a bit confused on its cross terminology, as these would normally be
|
||||
# the *host* tools.
|
||||
export CC="${targetCC}/bin/${targetCC.targetPrefix}cc"
|
||||
export CXX="${targetCC}/bin/${targetCC.targetPrefix}cxx"
|
||||
# Use gold to work around https://sourceware.org/bugzilla/show_bug.cgi?id=16177
|
||||
export LD="${targetCC.bintools}/bin/${targetCC.bintools.targetPrefix}ld${stdenv.lib.optionalString useLdGold ".gold"}"
|
||||
export AS="${targetCC.bintools.bintools}/bin/${targetCC.bintools.targetPrefix}as"
|
||||
export AR="${targetCC.bintools.bintools}/bin/${targetCC.bintools.targetPrefix}ar"
|
||||
export NM="${targetCC.bintools.bintools}/bin/${targetCC.bintools.targetPrefix}nm"
|
||||
export RANLIB="${targetCC.bintools.bintools}/bin/${targetCC.bintools.targetPrefix}ranlib"
|
||||
export READELF="${targetCC.bintools.bintools}/bin/${targetCC.bintools.targetPrefix}readelf"
|
||||
export STRIP="${targetCC.bintools.bintools}/bin/${targetCC.bintools.targetPrefix}strip"
|
||||
|
||||
echo -n "${buildMK}" > mk/build.mk
|
||||
sed -i -e 's|-isysroot /Developer/SDKs/MacOSX10.5.sdk||' configure
|
||||
'' + stdenv.lib.optionalString (!stdenv.isDarwin) ''
|
||||
export NIX_LDFLAGS+=" -rpath $out/lib/ghc-${version}"
|
||||
'' + stdenv.lib.optionalString stdenv.isDarwin ''
|
||||
export NIX_LDFLAGS+=" -no_dtrace_dof"
|
||||
'' + stdenv.lib.optionalString targetPlatform.useAndroidPrebuilt ''
|
||||
sed -i -e '5i ,("armv7a-unknown-linux-androideabi", ("e-m:e-p:32:32-i64:64-v128:64:128-a:0:32-n32-S64", "cortex-a8", ""))' llvm-targets
|
||||
'' + stdenv.lib.optionalString targetPlatform.isMusl ''
|
||||
echo "patching llvm-targets for musl targets..."
|
||||
echo "Cloning these existing '*-linux-gnu*' targets:"
|
||||
grep linux-gnu llvm-targets | sed 's/^/ /'
|
||||
echo "(go go gadget sed)"
|
||||
sed -i 's,\(^.*linux-\)gnu\(.*\)$,\0\n\1musl\2,' llvm-targets
|
||||
echo "llvm-targets now contains these '*-linux-musl*' targets:"
|
||||
grep linux-musl llvm-targets | sed 's/^/ /'
|
||||
|
||||
echo "And now patching to preserve '-musleabi' as done with '-gnueabi'"
|
||||
# (aclocal.m4 is actual source, but patch configure as well since we don't re-gen)
|
||||
for x in configure aclocal.m4; do
|
||||
substituteInPlace $x \
|
||||
--replace '*-android*|*-gnueabi*)' \
|
||||
'*-android*|*-gnueabi*|*-musleabi*)'
|
||||
done
|
||||
'';
|
||||
|
||||
# TODO(@Ericson2314): Always pass "--target" and always prefix.
|
||||
configurePlatforms = [ "build" "host" ]
|
||||
++ stdenv.lib.optional (targetPlatform != hostPlatform) "target";
|
||||
# `--with` flags for libraries needed for RTS linker
|
||||
configureFlags = [
|
||||
"--datadir=$doc/share/doc/ghc"
|
||||
"--with-curses-includes=${ncurses.dev}/include" "--with-curses-libraries=${ncurses.out}/lib"
|
||||
] ++ stdenv.lib.optionals (libffi != null) ["--with-system-libffi" "--with-ffi-includes=${targetPackages.libffi.dev}/include" "--with-ffi-libraries=${targetPackages.libffi.out}/lib"
|
||||
] ++ stdenv.lib.optional (targetPlatform == hostPlatform && !enableIntegerSimple) [
|
||||
"--with-gmp-includes=${targetPackages.gmp.dev}/include" "--with-gmp-libraries=${targetPackages.gmp.out}/lib"
|
||||
] ++ stdenv.lib.optional (targetPlatform == hostPlatform && hostPlatform.libc != "glibc" && !targetPlatform.isWindows) [
|
||||
"--with-iconv-includes=${libiconv}/include" "--with-iconv-libraries=${libiconv}/lib"
|
||||
] ++ stdenv.lib.optionals (targetPlatform != hostPlatform) [
|
||||
"--enable-bootstrap-with-devel-snapshot"
|
||||
] ++ stdenv.lib.optionals useLdGold [
|
||||
"CFLAGS=-fuse-ld=gold"
|
||||
"CONF_GCC_LINKER_OPTS_STAGE1=-fuse-ld=gold"
|
||||
"CONF_GCC_LINKER_OPTS_STAGE2=-fuse-ld=gold"
|
||||
] ++ stdenv.lib.optionals (disableLargeAddressSpace) [
|
||||
"--disable-large-address-space"
|
||||
];
|
||||
|
||||
# Make sure we never relax`$PATH` and hooks support for compatability.
|
||||
strictDeps = true;
|
||||
|
||||
# Don’t add -liconv to LDFLAGS automatically so that GHC will add it itself.
|
||||
dontAddExtraLibs = true;
|
||||
|
||||
nativeBuildInputs = [
|
||||
perl autoconf automake m4 python3 sphinx
|
||||
ghc bootPkgs.alex bootPkgs.happy bootPkgs.hscolour
|
||||
];
|
||||
|
||||
# For building runtime libs
|
||||
depsBuildTarget = toolsForTarget;
|
||||
|
||||
buildInputs = [ perl bash ] ++ (libDeps hostPlatform);
|
||||
|
||||
propagatedBuildInputs = [ targetPackages.stdenv.cc ]
|
||||
++ stdenv.lib.optional useLLVM llvmPackages.llvm;
|
||||
|
||||
depsTargetTarget = map stdenv.lib.getDev (libDeps targetPlatform);
|
||||
depsTargetTargetPropagated = map (stdenv.lib.getOutput "out") (libDeps targetPlatform);
|
||||
|
||||
# required, because otherwise all symbols from HSffi.o are stripped, and
|
||||
# that in turn causes GHCi to abort
|
||||
stripDebugFlags = [ "-S" ] ++ stdenv.lib.optional (!targetPlatform.isDarwin) "--keep-file-symbols";
|
||||
|
||||
checkTarget = "test";
|
||||
|
||||
hardeningDisable = [ "format" ] ++ stdenv.lib.optional stdenv.targetPlatform.isMusl "pie";
|
||||
|
||||
postInstall = ''
|
||||
# Install the bash completion file.
|
||||
install -D -m 444 utils/completion/ghc.bash $out/share/bash-completion/completions/${targetPrefix}ghc
|
||||
|
||||
# Patch scripts to include "readelf" and "cat" in $PATH.
|
||||
for i in "$out/bin/"*; do
|
||||
test ! -h $i || continue
|
||||
egrep --quiet '^#!' <(head -n 1 $i) || continue
|
||||
sed -i -e '2i export PATH="$PATH:${stdenv.lib.makeBinPath [ targetPackages.stdenv.cc.bintools coreutils ]}"' $i
|
||||
done
|
||||
'';
|
||||
|
||||
passthru = {
|
||||
inherit bootPkgs targetPrefix;
|
||||
|
||||
inherit llvmPackages;
|
||||
inherit enableShared;
|
||||
|
||||
# Our Cabal compiler name
|
||||
haskellCompilerName = "ghc-${version}";
|
||||
};
|
||||
|
||||
meta = {
|
||||
homepage = http://haskell.org/ghc;
|
||||
description = "The Glasgow Haskell Compiler";
|
||||
maintainers = with stdenv.lib.maintainers; [ marcweber andres peti ];
|
||||
inherit (ghc.meta) license platforms;
|
||||
};
|
||||
|
||||
} // stdenv.lib.optionalAttrs targetPlatform.useAndroidPrebuilt {
|
||||
dontStrip = true;
|
||||
dontPatchELF = true;
|
||||
noAuditTmpdir = true;
|
||||
})
|
||||
@@ -1,5 +1,5 @@
|
||||
{ stdenv, substituteAll
|
||||
, fetchurl, perl, gcc, llvm_39
|
||||
, fetchurl, perl, gcc, llvm
|
||||
, ncurses5, gmp, glibc, libiconv
|
||||
}:
|
||||
|
||||
@@ -53,7 +53,7 @@ stdenv.mkDerivation rec {
|
||||
or (throw "cannot bootstrap GHC on this platform"));
|
||||
|
||||
nativeBuildInputs = [ perl ];
|
||||
buildInputs = stdenv.lib.optionals (stdenv.targetPlatform.isAarch32 || stdenv.targetPlatform.isAarch64) [ llvm_39 ];
|
||||
buildInputs = stdenv.lib.optionals (stdenv.targetPlatform.isAarch32 || stdenv.targetPlatform.isAarch64) [ llvm ];
|
||||
|
||||
# Cannot patchelf beforehand due to relative RPATHs that anticipate
|
||||
# the final install location/
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
|
||||
, libiconv ? null, ncurses
|
||||
|
||||
, useLLVM ? !stdenv.targetPlatform.isx86 || (stdenv.targetPlatform.isMusl && stdenv.hostPlatform != stdenv.targetPlatform)
|
||||
, useLLVM ? !stdenv.targetPlatform.isx86 || (stdenv.targetPlatform.isMusl && stdenv.hostPlatform != stdenv.targetPlatform) || stdenv.targetPlatform.isiOS
|
||||
, # LLVM is conceptually a run-time-only depedendency, but for
|
||||
# non-x86, we need LLVM to bootstrap later stages, so it becomes a
|
||||
# build-time dependency too.
|
||||
@@ -69,7 +69,7 @@ let
|
||||
'';
|
||||
|
||||
# Splicer will pull out correct variations
|
||||
libDeps = platform: stdenv.lib.optional enableTerminfo [ ncurses ]
|
||||
libDeps = platform: stdenv.lib.optional enableTerminfo ncurses
|
||||
++ stdenv.lib.optional (!enableIntegerSimple) gmp
|
||||
++ stdenv.lib.optional (platform.libc != "glibc" && !targetPlatform.isWindows) libiconv;
|
||||
|
||||
@@ -79,6 +79,8 @@ let
|
||||
|
||||
targetCC = builtins.head toolsForTarget;
|
||||
|
||||
useLdGold = targetPlatform.isLinux && !(targetPlatform.useLLVM or false);
|
||||
|
||||
in
|
||||
stdenv.mkDerivation (rec {
|
||||
version = "8.4.4";
|
||||
@@ -126,7 +128,7 @@ stdenv.mkDerivation (rec {
|
||||
export CC="${targetCC}/bin/${targetCC.targetPrefix}cc"
|
||||
export CXX="${targetCC}/bin/${targetCC.targetPrefix}cxx"
|
||||
# Use gold to work around https://sourceware.org/bugzilla/show_bug.cgi?id=16177
|
||||
export LD="${targetCC.bintools}/bin/${targetCC.bintools.targetPrefix}ld${stdenv.lib.optionalString targetPlatform.isLinux ".gold"}"
|
||||
export LD="${targetCC.bintools}/bin/${targetCC.bintools.targetPrefix}ld${stdenv.lib.optionalString useLdGold ".gold"}"
|
||||
export AS="${targetCC.bintools.bintools}/bin/${targetCC.bintools.targetPrefix}as"
|
||||
export AR="${targetCC.bintools.bintools}/bin/${targetCC.bintools.targetPrefix}ar"
|
||||
export NM="${targetCC.bintools.bintools}/bin/${targetCC.bintools.targetPrefix}nm"
|
||||
@@ -167,13 +169,13 @@ stdenv.mkDerivation (rec {
|
||||
configureFlags = [
|
||||
"--datadir=$doc/share/doc/ghc"
|
||||
"--with-curses-includes=${ncurses.dev}/include" "--with-curses-libraries=${ncurses.out}/lib"
|
||||
] ++ stdenv.lib.optional (targetPlatform == hostPlatform && !enableIntegerSimple) [
|
||||
] ++ stdenv.lib.optionals (targetPlatform == hostPlatform && !enableIntegerSimple) [
|
||||
"--with-gmp-includes=${targetPackages.gmp.dev}/include" "--with-gmp-libraries=${targetPackages.gmp.out}/lib"
|
||||
] ++ stdenv.lib.optional (targetPlatform == hostPlatform && hostPlatform.libc != "glibc" && !targetPlatform.isWindows) [
|
||||
] ++ stdenv.lib.optionals (targetPlatform == hostPlatform && hostPlatform.libc != "glibc" && !targetPlatform.isWindows) [
|
||||
"--with-iconv-includes=${libiconv}/include" "--with-iconv-libraries=${libiconv}/lib"
|
||||
] ++ stdenv.lib.optionals (targetPlatform != hostPlatform) [
|
||||
"--enable-bootstrap-with-devel-snapshot"
|
||||
] ++ stdenv.lib.optionals (targetPlatform.isAarch32) [
|
||||
] ++ stdenv.lib.optionals useLdGold [
|
||||
"CFLAGS=-fuse-ld=gold"
|
||||
"CONF_GCC_LINKER_OPTS_STAGE1=-fuse-ld=gold"
|
||||
"CONF_GCC_LINKER_OPTS_STAGE2=-fuse-ld=gold"
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
{ stdenv
|
||||
, fetchurl, perl, gcc, llvm_39
|
||||
, fetchurl, perl, gcc
|
||||
, ncurses5, gmp, glibc, libiconv
|
||||
}:
|
||||
|
||||
@@ -45,7 +45,6 @@ stdenv.mkDerivation rec {
|
||||
or (throw "cannot bootstrap GHC on this platform"));
|
||||
|
||||
nativeBuildInputs = [ perl ];
|
||||
buildInputs = stdenv.lib.optionals (stdenv.targetPlatform.isAarch32 || stdenv.targetPlatform.isAarch64) [ llvm_39 ];
|
||||
|
||||
# Cannot patchelf beforehand due to relative RPATHs that anticipate
|
||||
# the final install location/
|
||||
|
||||
@@ -10,7 +10,7 @@
|
||||
, # GHC can be built with system libffi or a bundled one.
|
||||
libffi ? null
|
||||
|
||||
, useLLVM ? !stdenv.targetPlatform.isx86
|
||||
, useLLVM ? !stdenv.targetPlatform.isx86 || stdenv.targetPlatform.isiOS
|
||||
, # LLVM is conceptually a run-time-only depedendency, but for
|
||||
# non-x86, we need LLVM to bootstrap later stages, so it becomes a
|
||||
# build-time dependency too.
|
||||
@@ -73,7 +73,7 @@ let
|
||||
'';
|
||||
|
||||
# Splicer will pull out correct variations
|
||||
libDeps = platform: stdenv.lib.optional enableTerminfo [ ncurses ]
|
||||
libDeps = platform: stdenv.lib.optional enableTerminfo ncurses
|
||||
++ [libffi]
|
||||
++ stdenv.lib.optional (!enableIntegerSimple) gmp
|
||||
++ stdenv.lib.optional (platform.libc != "glibc" && !targetPlatform.isWindows) libiconv;
|
||||
@@ -84,6 +84,8 @@ let
|
||||
|
||||
targetCC = builtins.head toolsForTarget;
|
||||
|
||||
useLdGold = targetPlatform.isLinux && !(targetPlatform.useLLVM or false);
|
||||
|
||||
in
|
||||
stdenv.mkDerivation (rec {
|
||||
version = "8.6.5";
|
||||
@@ -125,7 +127,7 @@ stdenv.mkDerivation (rec {
|
||||
export CC="${targetCC}/bin/${targetCC.targetPrefix}cc"
|
||||
export CXX="${targetCC}/bin/${targetCC.targetPrefix}cxx"
|
||||
# Use gold to work around https://sourceware.org/bugzilla/show_bug.cgi?id=16177
|
||||
export LD="${targetCC.bintools}/bin/${targetCC.bintools.targetPrefix}ld${stdenv.lib.optionalString targetPlatform.isLinux ".gold"}"
|
||||
export LD="${targetCC.bintools}/bin/${targetCC.bintools.targetPrefix}ld${stdenv.lib.optionalString useLdGold ".gold"}"
|
||||
export AS="${targetCC.bintools.bintools}/bin/${targetCC.bintools.targetPrefix}as"
|
||||
export AR="${targetCC.bintools.bintools}/bin/${targetCC.bintools.targetPrefix}ar"
|
||||
export NM="${targetCC.bintools.bintools}/bin/${targetCC.bintools.targetPrefix}nm"
|
||||
@@ -167,13 +169,13 @@ stdenv.mkDerivation (rec {
|
||||
"--datadir=$doc/share/doc/ghc"
|
||||
"--with-curses-includes=${ncurses.dev}/include" "--with-curses-libraries=${ncurses.out}/lib"
|
||||
] ++ stdenv.lib.optionals (libffi != null) ["--with-system-libffi" "--with-ffi-includes=${targetPackages.libffi.dev}/include" "--with-ffi-libraries=${targetPackages.libffi.out}/lib"
|
||||
] ++ stdenv.lib.optional (targetPlatform == hostPlatform && !enableIntegerSimple) [
|
||||
] ++ stdenv.lib.optionals (targetPlatform == hostPlatform && !enableIntegerSimple) [
|
||||
"--with-gmp-includes=${targetPackages.gmp.dev}/include" "--with-gmp-libraries=${targetPackages.gmp.out}/lib"
|
||||
] ++ stdenv.lib.optional (targetPlatform == hostPlatform && hostPlatform.libc != "glibc" && !targetPlatform.isWindows) [
|
||||
] ++ stdenv.lib.optionals (targetPlatform == hostPlatform && hostPlatform.libc != "glibc" && !targetPlatform.isWindows) [
|
||||
"--with-iconv-includes=${libiconv}/include" "--with-iconv-libraries=${libiconv}/lib"
|
||||
] ++ stdenv.lib.optionals (targetPlatform != hostPlatform) [
|
||||
"--enable-bootstrap-with-devel-snapshot"
|
||||
] ++ stdenv.lib.optionals (targetPlatform.isAarch32) [
|
||||
] ++ stdenv.lib.optionals useLdGold [
|
||||
"CFLAGS=-fuse-ld=gold"
|
||||
"CONF_GCC_LINKER_OPTS_STAGE1=-fuse-ld=gold"
|
||||
"CONF_GCC_LINKER_OPTS_STAGE2=-fuse-ld=gold"
|
||||
|
||||
@@ -10,7 +10,7 @@
|
||||
, # GHC can be built with system libffi or a bundled one.
|
||||
libffi ? null
|
||||
|
||||
, useLLVM ? !stdenv.targetPlatform.isx86
|
||||
, useLLVM ? !stdenv.targetPlatform.isx86 || stdenv.targetPlatform.isiOS
|
||||
, # LLVM is conceptually a run-time-only depedendency, but for
|
||||
# non-x86, we need LLVM to bootstrap later stages, so it becomes a
|
||||
# build-time dependency too.
|
||||
@@ -73,7 +73,7 @@ let
|
||||
'';
|
||||
|
||||
# Splicer will pull out correct variations
|
||||
libDeps = platform: stdenv.lib.optional enableTerminfo [ ncurses ]
|
||||
libDeps = platform: stdenv.lib.optional enableTerminfo ncurses
|
||||
++ [libffi]
|
||||
++ stdenv.lib.optional (!enableIntegerSimple) gmp
|
||||
++ stdenv.lib.optional (platform.libc != "glibc" && !targetPlatform.isWindows) libiconv;
|
||||
@@ -84,6 +84,8 @@ let
|
||||
|
||||
targetCC = builtins.head toolsForTarget;
|
||||
|
||||
useLdGold = targetPlatform.isLinux && !(targetPlatform.useLLVM or false);
|
||||
|
||||
in
|
||||
stdenv.mkDerivation (rec {
|
||||
version = "8.8.1";
|
||||
@@ -110,7 +112,7 @@ stdenv.mkDerivation (rec {
|
||||
export CC="${targetCC}/bin/${targetCC.targetPrefix}cc"
|
||||
export CXX="${targetCC}/bin/${targetCC.targetPrefix}cxx"
|
||||
# Use gold to work around https://sourceware.org/bugzilla/show_bug.cgi?id=16177
|
||||
export LD="${targetCC.bintools}/bin/${targetCC.bintools.targetPrefix}ld${stdenv.lib.optionalString targetPlatform.isLinux ".gold"}"
|
||||
export LD="${targetCC.bintools}/bin/${targetCC.bintools.targetPrefix}ld${stdenv.lib.optionalString useLdGold ".gold"}"
|
||||
export AS="${targetCC.bintools.bintools}/bin/${targetCC.bintools.targetPrefix}as"
|
||||
export AR="${targetCC.bintools.bintools}/bin/${targetCC.bintools.targetPrefix}ar"
|
||||
export NM="${targetCC.bintools.bintools}/bin/${targetCC.bintools.targetPrefix}nm"
|
||||
@@ -152,13 +154,13 @@ stdenv.mkDerivation (rec {
|
||||
"--datadir=$doc/share/doc/ghc"
|
||||
"--with-curses-includes=${ncurses.dev}/include" "--with-curses-libraries=${ncurses.out}/lib"
|
||||
] ++ stdenv.lib.optionals (libffi != null) ["--with-system-libffi" "--with-ffi-includes=${targetPackages.libffi.dev}/include" "--with-ffi-libraries=${targetPackages.libffi.out}/lib"
|
||||
] ++ stdenv.lib.optional (targetPlatform == hostPlatform && !enableIntegerSimple) [
|
||||
] ++ stdenv.lib.optionals (targetPlatform == hostPlatform && !enableIntegerSimple) [
|
||||
"--with-gmp-includes=${targetPackages.gmp.dev}/include" "--with-gmp-libraries=${targetPackages.gmp.out}/lib"
|
||||
] ++ stdenv.lib.optional (targetPlatform == hostPlatform && hostPlatform.libc != "glibc" && !targetPlatform.isWindows) [
|
||||
] ++ stdenv.lib.optionals (targetPlatform == hostPlatform && hostPlatform.libc != "glibc" && !targetPlatform.isWindows) [
|
||||
"--with-iconv-includes=${libiconv}/include" "--with-iconv-libraries=${libiconv}/lib"
|
||||
] ++ stdenv.lib.optionals (targetPlatform != hostPlatform) [
|
||||
"--enable-bootstrap-with-devel-snapshot"
|
||||
] ++ stdenv.lib.optionals (targetPlatform.isAarch32) [
|
||||
] ++ stdenv.lib.optionals useLdGold [
|
||||
"CFLAGS=-fuse-ld=gold"
|
||||
"CONF_GCC_LINKER_OPTS_STAGE1=-fuse-ld=gold"
|
||||
"CONF_GCC_LINKER_OPTS_STAGE2=-fuse-ld=gold"
|
||||
|
||||
@@ -0,0 +1,240 @@
|
||||
{ stdenv, pkgsBuildTarget, targetPackages
|
||||
|
||||
# build-tools
|
||||
, bootPkgs
|
||||
, autoconf, automake, coreutils, fetchurl, perl, python3, m4, sphinx
|
||||
, bash
|
||||
|
||||
, libiconv ? null, ncurses
|
||||
|
||||
, # GHC can be built with system libffi or a bundled one.
|
||||
libffi ? null
|
||||
|
||||
, useLLVM ? !stdenv.targetPlatform.isx86
|
||||
, # LLVM is conceptually a run-time-only depedendency, but for
|
||||
# non-x86, we need LLVM to bootstrap later stages, so it becomes a
|
||||
# build-time dependency too.
|
||||
buildLlvmPackages, llvmPackages
|
||||
|
||||
, # If enabled, GHC will be built with the GPL-free but slower integer-simple
|
||||
# library instead of the faster but GPLed integer-gmp library.
|
||||
enableIntegerSimple ? !(stdenv.lib.any (stdenv.lib.meta.platformMatch stdenv.hostPlatform) gmp.meta.platforms), gmp
|
||||
|
||||
, # If enabled, use -fPIC when compiling static libs.
|
||||
enableRelocatedStaticLibs ? stdenv.targetPlatform != stdenv.hostPlatform
|
||||
|
||||
, # Whether to build dynamic libs for the standard library (on the target
|
||||
# platform). Static libs are always built.
|
||||
enableShared ? !stdenv.targetPlatform.isWindows && !stdenv.targetPlatform.useiOSPrebuilt
|
||||
|
||||
, # Whetherto build terminfo.
|
||||
enableTerminfo ? !stdenv.targetPlatform.isWindows
|
||||
|
||||
, # What flavour to build. An empty string indicates no
|
||||
# specific flavour and falls back to ghc default values.
|
||||
ghcFlavour ? stdenv.lib.optionalString (stdenv.targetPlatform != stdenv.hostPlatform)
|
||||
(if useLLVM then "perf-cross" else "perf-cross-ncg")
|
||||
|
||||
, # Whether to disable the large address space allocator
|
||||
# necessary fix for iOS: https://www.reddit.com/r/haskell/comments/4ttdz1/building_an_osxi386_to_iosarm64_cross_compiler/d5qvd67/
|
||||
disableLargeAddressSpace ? stdenv.targetPlatform.isDarwin && stdenv.targetPlatform.isAarch64
|
||||
}:
|
||||
|
||||
assert !enableIntegerSimple -> gmp != null;
|
||||
|
||||
let
|
||||
inherit (stdenv) buildPlatform hostPlatform targetPlatform;
|
||||
|
||||
inherit (bootPkgs) ghc;
|
||||
|
||||
# TODO(@Ericson2314) Make unconditional
|
||||
targetPrefix = stdenv.lib.optionalString
|
||||
(targetPlatform != hostPlatform)
|
||||
"${targetPlatform.config}-";
|
||||
|
||||
buildMK = ''
|
||||
BuildFlavour = ${ghcFlavour}
|
||||
ifneq \"\$(BuildFlavour)\" \"\"
|
||||
include mk/flavours/\$(BuildFlavour).mk
|
||||
endif
|
||||
DYNAMIC_GHC_PROGRAMS = ${if enableShared then "YES" else "NO"}
|
||||
INTEGER_LIBRARY = ${if enableIntegerSimple then "integer-simple" else "integer-gmp"}
|
||||
'' + stdenv.lib.optionalString (targetPlatform != hostPlatform) ''
|
||||
Stage1Only = ${if targetPlatform.system == hostPlatform.system then "NO" else "YES"}
|
||||
CrossCompilePrefix = ${targetPrefix}
|
||||
HADDOCK_DOCS = NO
|
||||
BUILD_SPHINX_HTML = NO
|
||||
BUILD_SPHINX_PDF = NO
|
||||
'' + stdenv.lib.optionalString enableRelocatedStaticLibs ''
|
||||
GhcLibHcOpts += -fPIC
|
||||
GhcRtsHcOpts += -fPIC
|
||||
'' + stdenv.lib.optionalString targetPlatform.useAndroidPrebuilt ''
|
||||
EXTRA_CC_OPTS += -std=gnu99
|
||||
'';
|
||||
|
||||
# Splicer will pull out correct variations
|
||||
libDeps = platform: stdenv.lib.optional enableTerminfo [ ncurses ]
|
||||
++ [libffi]
|
||||
++ stdenv.lib.optional (!enableIntegerSimple) gmp
|
||||
++ stdenv.lib.optional (platform.libc != "glibc" && !targetPlatform.isWindows) libiconv;
|
||||
|
||||
toolsForTarget = [
|
||||
pkgsBuildTarget.targetPackages.stdenv.cc
|
||||
] ++ stdenv.lib.optional useLLVM buildLlvmPackages.llvm;
|
||||
|
||||
targetCC = builtins.head toolsForTarget;
|
||||
|
||||
useLdGold = targetPlatform.isLinux && !(targetPlatform.useLLVM or false);
|
||||
|
||||
in
|
||||
stdenv.mkDerivation (rec {
|
||||
version = "8.8.2";
|
||||
name = "${targetPrefix}ghc-${version}";
|
||||
|
||||
src = fetchurl {
|
||||
url = "https://downloads.haskell.org/ghc/8.8.2/ghc-${version}-src.tar.xz";
|
||||
sha256 = "02qa6wgjpxgakg7hv4zfdlrx9k7zxa5i02wnr6y9fsv8j16sbkh1";
|
||||
};
|
||||
|
||||
enableParallelBuilding = true;
|
||||
|
||||
outputs = [ "out" "doc" ];
|
||||
|
||||
postPatch = "patchShebangs .";
|
||||
|
||||
# GHC is a bit confused on its cross terminology.
|
||||
preConfigure = ''
|
||||
for env in $(env | grep '^TARGET_' | sed -E 's|\+?=.*||'); do
|
||||
export "''${env#TARGET_}=''${!env}"
|
||||
done
|
||||
# GHC is a bit confused on its cross terminology, as these would normally be
|
||||
# the *host* tools.
|
||||
export CC="${targetCC}/bin/${targetCC.targetPrefix}cc"
|
||||
export CXX="${targetCC}/bin/${targetCC.targetPrefix}cxx"
|
||||
# Use gold to work around https://sourceware.org/bugzilla/show_bug.cgi?id=16177
|
||||
export LD="${targetCC.bintools}/bin/${targetCC.bintools.targetPrefix}ld${stdenv.lib.optionalString useLdGold ".gold"}"
|
||||
export AS="${targetCC.bintools.bintools}/bin/${targetCC.bintools.targetPrefix}as"
|
||||
export AR="${targetCC.bintools.bintools}/bin/${targetCC.bintools.targetPrefix}ar"
|
||||
export NM="${targetCC.bintools.bintools}/bin/${targetCC.bintools.targetPrefix}nm"
|
||||
export RANLIB="${targetCC.bintools.bintools}/bin/${targetCC.bintools.targetPrefix}ranlib"
|
||||
export READELF="${targetCC.bintools.bintools}/bin/${targetCC.bintools.targetPrefix}readelf"
|
||||
export STRIP="${targetCC.bintools.bintools}/bin/${targetCC.bintools.targetPrefix}strip"
|
||||
|
||||
echo -n "${buildMK}" > mk/build.mk
|
||||
sed -i -e 's|-isysroot /Developer/SDKs/MacOSX10.5.sdk||' configure
|
||||
'' + stdenv.lib.optionalString (!stdenv.isDarwin) ''
|
||||
export NIX_LDFLAGS+=" -rpath $out/lib/ghc-${version}"
|
||||
'' + stdenv.lib.optionalString stdenv.isDarwin ''
|
||||
export NIX_LDFLAGS+=" -no_dtrace_dof"
|
||||
'' + stdenv.lib.optionalString targetPlatform.useAndroidPrebuilt ''
|
||||
sed -i -e '5i ,("armv7a-unknown-linux-androideabi", ("e-m:e-p:32:32-i64:64-v128:64:128-a:0:32-n32-S64", "cortex-a8", ""))' llvm-targets
|
||||
'' + stdenv.lib.optionalString targetPlatform.isMusl ''
|
||||
echo "patching llvm-targets for musl targets..."
|
||||
echo "Cloning these existing '*-linux-gnu*' targets:"
|
||||
grep linux-gnu llvm-targets | sed 's/^/ /'
|
||||
echo "(go go gadget sed)"
|
||||
sed -i 's,\(^.*linux-\)gnu\(.*\)$,\0\n\1musl\2,' llvm-targets
|
||||
echo "llvm-targets now contains these '*-linux-musl*' targets:"
|
||||
grep linux-musl llvm-targets | sed 's/^/ /'
|
||||
|
||||
echo "And now patching to preserve '-musleabi' as done with '-gnueabi'"
|
||||
# (aclocal.m4 is actual source, but patch configure as well since we don't re-gen)
|
||||
for x in configure aclocal.m4; do
|
||||
substituteInPlace $x \
|
||||
--replace '*-android*|*-gnueabi*)' \
|
||||
'*-android*|*-gnueabi*|*-musleabi*)'
|
||||
done
|
||||
'';
|
||||
|
||||
# TODO(@Ericson2314): Always pass "--target" and always prefix.
|
||||
configurePlatforms = [ "build" "host" ]
|
||||
++ stdenv.lib.optional (targetPlatform != hostPlatform) "target";
|
||||
|
||||
# `--with` flags for libraries needed for RTS linker
|
||||
configureFlags = [
|
||||
"--datadir=$doc/share/doc/ghc"
|
||||
"--with-curses-includes=${ncurses.dev}/include" "--with-curses-libraries=${ncurses.out}/lib"
|
||||
] ++ stdenv.lib.optionals (libffi != null) [
|
||||
"--with-system-libffi"
|
||||
"--with-ffi-includes=${targetPackages.libffi.dev}/include"
|
||||
"--with-ffi-libraries=${targetPackages.libffi.out}/lib"
|
||||
] ++ stdenv.lib.optional (targetPlatform == hostPlatform && !enableIntegerSimple) [
|
||||
"--with-gmp-includes=${targetPackages.gmp.dev}/include"
|
||||
"--with-gmp-libraries=${targetPackages.gmp.out}/lib"
|
||||
] ++ stdenv.lib.optional (targetPlatform == hostPlatform && hostPlatform.libc != "glibc" && !targetPlatform.isWindows) [
|
||||
"--with-iconv-includes=${libiconv}/include"
|
||||
"--with-iconv-libraries=${libiconv}/lib"
|
||||
] ++ stdenv.lib.optionals (targetPlatform != hostPlatform) [
|
||||
"--enable-bootstrap-with-devel-snapshot"
|
||||
] ++ stdenv.lib.optionals useLdGold [
|
||||
"CFLAGS=-fuse-ld=gold"
|
||||
"CONF_GCC_LINKER_OPTS_STAGE1=-fuse-ld=gold"
|
||||
"CONF_GCC_LINKER_OPTS_STAGE2=-fuse-ld=gold"
|
||||
] ++ stdenv.lib.optionals (disableLargeAddressSpace) [
|
||||
"--disable-large-address-space"
|
||||
];
|
||||
|
||||
# Make sure we never relax`$PATH` and hooks support for compatability.
|
||||
strictDeps = true;
|
||||
|
||||
# Don’t add -liconv to LDFLAGS automatically so that GHC will add it itself.
|
||||
dontAddExtraLibs = true;
|
||||
|
||||
nativeBuildInputs = [
|
||||
perl autoconf automake m4 python3 sphinx
|
||||
ghc bootPkgs.alex bootPkgs.happy bootPkgs.hscolour
|
||||
];
|
||||
|
||||
# For building runtime libs
|
||||
depsBuildTarget = toolsForTarget;
|
||||
|
||||
buildInputs = [ perl bash ] ++ (libDeps hostPlatform);
|
||||
|
||||
propagatedBuildInputs = [ targetPackages.stdenv.cc ]
|
||||
++ stdenv.lib.optional useLLVM llvmPackages.llvm;
|
||||
|
||||
depsTargetTarget = map stdenv.lib.getDev (libDeps targetPlatform);
|
||||
depsTargetTargetPropagated = map (stdenv.lib.getOutput "out") (libDeps targetPlatform);
|
||||
|
||||
# required, because otherwise all symbols from HSffi.o are stripped, and
|
||||
# that in turn causes GHCi to abort
|
||||
stripDebugFlags = [ "-S" ] ++ stdenv.lib.optional (!targetPlatform.isDarwin) "--keep-file-symbols";
|
||||
|
||||
checkTarget = "test";
|
||||
|
||||
hardeningDisable = [ "format" ] ++ stdenv.lib.optional stdenv.targetPlatform.isMusl "pie";
|
||||
|
||||
postInstall = ''
|
||||
# Install the bash completion file.
|
||||
install -D -m 444 utils/completion/ghc.bash $out/share/bash-completion/completions/${targetPrefix}ghc
|
||||
|
||||
# Patch scripts to include "readelf" and "cat" in $PATH.
|
||||
for i in "$out/bin/"*; do
|
||||
test ! -h $i || continue
|
||||
egrep --quiet '^#!' <(head -n 1 $i) || continue
|
||||
sed -i -e '2i export PATH="$PATH:${stdenv.lib.makeBinPath [ targetPackages.stdenv.cc.bintools coreutils ]}"' $i
|
||||
done
|
||||
'';
|
||||
|
||||
passthru = {
|
||||
inherit bootPkgs targetPrefix;
|
||||
|
||||
inherit llvmPackages;
|
||||
inherit enableShared;
|
||||
|
||||
# Our Cabal compiler name
|
||||
haskellCompilerName = "ghc-${version}";
|
||||
};
|
||||
|
||||
meta = {
|
||||
homepage = http://haskell.org/ghc;
|
||||
description = "The Glasgow Haskell Compiler";
|
||||
maintainers = with stdenv.lib.maintainers; [ marcweber andres peti ];
|
||||
inherit (ghc.meta) license platforms;
|
||||
};
|
||||
|
||||
} // stdenv.lib.optionalAttrs targetPlatform.useAndroidPrebuilt {
|
||||
dontStrip = true;
|
||||
dontPatchELF = true;
|
||||
noAuditTmpdir = true;
|
||||
})
|
||||
@@ -0,0 +1,240 @@
|
||||
{ stdenv, pkgsBuildTarget, targetPackages
|
||||
|
||||
# build-tools
|
||||
, bootPkgs
|
||||
, autoconf, automake, coreutils, fetchurl, perl, python3, m4, sphinx
|
||||
, bash
|
||||
|
||||
, libiconv ? null, ncurses
|
||||
|
||||
, # GHC can be built with system libffi or a bundled one.
|
||||
libffi ? null
|
||||
|
||||
, useLLVM ? !stdenv.targetPlatform.isx86
|
||||
, # LLVM is conceptually a run-time-only depedendency, but for
|
||||
# non-x86, we need LLVM to bootstrap later stages, so it becomes a
|
||||
# build-time dependency too.
|
||||
buildLlvmPackages, llvmPackages
|
||||
|
||||
, # If enabled, GHC will be built with the GPL-free but slower integer-simple
|
||||
# library instead of the faster but GPLed integer-gmp library.
|
||||
enableIntegerSimple ? !(stdenv.lib.any (stdenv.lib.meta.platformMatch stdenv.hostPlatform) gmp.meta.platforms), gmp
|
||||
|
||||
, # If enabled, use -fPIC when compiling static libs.
|
||||
enableRelocatedStaticLibs ? stdenv.targetPlatform != stdenv.hostPlatform
|
||||
|
||||
, # Whether to build dynamic libs for the standard library (on the target
|
||||
# platform). Static libs are always built.
|
||||
enableShared ? !stdenv.targetPlatform.isWindows && !stdenv.targetPlatform.useiOSPrebuilt
|
||||
|
||||
, # Whetherto build terminfo.
|
||||
enableTerminfo ? !stdenv.targetPlatform.isWindows
|
||||
|
||||
, # What flavour to build. An empty string indicates no
|
||||
# specific flavour and falls back to ghc default values.
|
||||
ghcFlavour ? stdenv.lib.optionalString (stdenv.targetPlatform != stdenv.hostPlatform)
|
||||
(if useLLVM then "perf-cross" else "perf-cross-ncg")
|
||||
|
||||
, # Whether to disable the large address space allocator
|
||||
# necessary fix for iOS: https://www.reddit.com/r/haskell/comments/4ttdz1/building_an_osxi386_to_iosarm64_cross_compiler/d5qvd67/
|
||||
disableLargeAddressSpace ? stdenv.targetPlatform.isDarwin && stdenv.targetPlatform.isAarch64
|
||||
}:
|
||||
|
||||
assert !enableIntegerSimple -> gmp != null;
|
||||
|
||||
let
|
||||
inherit (stdenv) buildPlatform hostPlatform targetPlatform;
|
||||
|
||||
inherit (bootPkgs) ghc;
|
||||
|
||||
# TODO(@Ericson2314) Make unconditional
|
||||
targetPrefix = stdenv.lib.optionalString
|
||||
(targetPlatform != hostPlatform)
|
||||
"${targetPlatform.config}-";
|
||||
|
||||
buildMK = ''
|
||||
BuildFlavour = ${ghcFlavour}
|
||||
ifneq \"\$(BuildFlavour)\" \"\"
|
||||
include mk/flavours/\$(BuildFlavour).mk
|
||||
endif
|
||||
DYNAMIC_GHC_PROGRAMS = ${if enableShared then "YES" else "NO"}
|
||||
INTEGER_LIBRARY = ${if enableIntegerSimple then "integer-simple" else "integer-gmp"}
|
||||
'' + stdenv.lib.optionalString (targetPlatform != hostPlatform) ''
|
||||
Stage1Only = ${if targetPlatform.system == hostPlatform.system then "NO" else "YES"}
|
||||
CrossCompilePrefix = ${targetPrefix}
|
||||
HADDOCK_DOCS = NO
|
||||
BUILD_SPHINX_HTML = NO
|
||||
BUILD_SPHINX_PDF = NO
|
||||
'' + stdenv.lib.optionalString enableRelocatedStaticLibs ''
|
||||
GhcLibHcOpts += -fPIC
|
||||
GhcRtsHcOpts += -fPIC
|
||||
'' + stdenv.lib.optionalString targetPlatform.useAndroidPrebuilt ''
|
||||
EXTRA_CC_OPTS += -std=gnu99
|
||||
'';
|
||||
|
||||
# Splicer will pull out correct variations
|
||||
libDeps = platform: stdenv.lib.optional enableTerminfo [ ncurses ]
|
||||
++ [libffi]
|
||||
++ stdenv.lib.optional (!enableIntegerSimple) gmp
|
||||
++ stdenv.lib.optional (platform.libc != "glibc" && !targetPlatform.isWindows) libiconv;
|
||||
|
||||
toolsForTarget = [
|
||||
pkgsBuildTarget.targetPackages.stdenv.cc
|
||||
] ++ stdenv.lib.optional useLLVM buildLlvmPackages.llvm;
|
||||
|
||||
targetCC = builtins.head toolsForTarget;
|
||||
|
||||
useLdGold = targetPlatform.isLinux && !(targetPlatform.useLLVM or false);
|
||||
|
||||
in
|
||||
stdenv.mkDerivation (rec {
|
||||
version = "8.8.3";
|
||||
name = "${targetPrefix}ghc-${version}";
|
||||
|
||||
src = fetchurl {
|
||||
url = "https://downloads.haskell.org/ghc/${version}/ghc-${version}-src.tar.xz";
|
||||
sha256 = "128g932i3wix6ic03v04nh5755vyjiidzri9iybwad72yfmc1p70";
|
||||
};
|
||||
|
||||
enableParallelBuilding = true;
|
||||
|
||||
outputs = [ "out" "doc" ];
|
||||
|
||||
postPatch = "patchShebangs .";
|
||||
|
||||
# GHC is a bit confused on its cross terminology.
|
||||
preConfigure = ''
|
||||
for env in $(env | grep '^TARGET_' | sed -E 's|\+?=.*||'); do
|
||||
export "''${env#TARGET_}=''${!env}"
|
||||
done
|
||||
# GHC is a bit confused on its cross terminology, as these would normally be
|
||||
# the *host* tools.
|
||||
export CC="${targetCC}/bin/${targetCC.targetPrefix}cc"
|
||||
export CXX="${targetCC}/bin/${targetCC.targetPrefix}cxx"
|
||||
# Use gold to work around https://sourceware.org/bugzilla/show_bug.cgi?id=16177
|
||||
export LD="${targetCC.bintools}/bin/${targetCC.bintools.targetPrefix}ld${stdenv.lib.optionalString useLdGold ".gold"}"
|
||||
export AS="${targetCC.bintools.bintools}/bin/${targetCC.bintools.targetPrefix}as"
|
||||
export AR="${targetCC.bintools.bintools}/bin/${targetCC.bintools.targetPrefix}ar"
|
||||
export NM="${targetCC.bintools.bintools}/bin/${targetCC.bintools.targetPrefix}nm"
|
||||
export RANLIB="${targetCC.bintools.bintools}/bin/${targetCC.bintools.targetPrefix}ranlib"
|
||||
export READELF="${targetCC.bintools.bintools}/bin/${targetCC.bintools.targetPrefix}readelf"
|
||||
export STRIP="${targetCC.bintools.bintools}/bin/${targetCC.bintools.targetPrefix}strip"
|
||||
|
||||
echo -n "${buildMK}" > mk/build.mk
|
||||
sed -i -e 's|-isysroot /Developer/SDKs/MacOSX10.5.sdk||' configure
|
||||
'' + stdenv.lib.optionalString (!stdenv.isDarwin) ''
|
||||
export NIX_LDFLAGS+=" -rpath $out/lib/ghc-${version}"
|
||||
'' + stdenv.lib.optionalString stdenv.isDarwin ''
|
||||
export NIX_LDFLAGS+=" -no_dtrace_dof"
|
||||
'' + stdenv.lib.optionalString targetPlatform.useAndroidPrebuilt ''
|
||||
sed -i -e '5i ,("armv7a-unknown-linux-androideabi", ("e-m:e-p:32:32-i64:64-v128:64:128-a:0:32-n32-S64", "cortex-a8", ""))' llvm-targets
|
||||
'' + stdenv.lib.optionalString targetPlatform.isMusl ''
|
||||
echo "patching llvm-targets for musl targets..."
|
||||
echo "Cloning these existing '*-linux-gnu*' targets:"
|
||||
grep linux-gnu llvm-targets | sed 's/^/ /'
|
||||
echo "(go go gadget sed)"
|
||||
sed -i 's,\(^.*linux-\)gnu\(.*\)$,\0\n\1musl\2,' llvm-targets
|
||||
echo "llvm-targets now contains these '*-linux-musl*' targets:"
|
||||
grep linux-musl llvm-targets | sed 's/^/ /'
|
||||
|
||||
echo "And now patching to preserve '-musleabi' as done with '-gnueabi'"
|
||||
# (aclocal.m4 is actual source, but patch configure as well since we don't re-gen)
|
||||
for x in configure aclocal.m4; do
|
||||
substituteInPlace $x \
|
||||
--replace '*-android*|*-gnueabi*)' \
|
||||
'*-android*|*-gnueabi*|*-musleabi*)'
|
||||
done
|
||||
'';
|
||||
|
||||
# TODO(@Ericson2314): Always pass "--target" and always prefix.
|
||||
configurePlatforms = [ "build" "host" ]
|
||||
++ stdenv.lib.optional (targetPlatform != hostPlatform) "target";
|
||||
|
||||
# `--with` flags for libraries needed for RTS linker
|
||||
configureFlags = [
|
||||
"--datadir=$doc/share/doc/ghc"
|
||||
"--with-curses-includes=${ncurses.dev}/include" "--with-curses-libraries=${ncurses.out}/lib"
|
||||
] ++ stdenv.lib.optionals (libffi != null) [
|
||||
"--with-system-libffi"
|
||||
"--with-ffi-includes=${targetPackages.libffi.dev}/include"
|
||||
"--with-ffi-libraries=${targetPackages.libffi.out}/lib"
|
||||
] ++ stdenv.lib.optional (targetPlatform == hostPlatform && !enableIntegerSimple) [
|
||||
"--with-gmp-includes=${targetPackages.gmp.dev}/include"
|
||||
"--with-gmp-libraries=${targetPackages.gmp.out}/lib"
|
||||
] ++ stdenv.lib.optional (targetPlatform == hostPlatform && hostPlatform.libc != "glibc" && !targetPlatform.isWindows) [
|
||||
"--with-iconv-includes=${libiconv}/include"
|
||||
"--with-iconv-libraries=${libiconv}/lib"
|
||||
] ++ stdenv.lib.optionals (targetPlatform != hostPlatform) [
|
||||
"--enable-bootstrap-with-devel-snapshot"
|
||||
] ++ stdenv.lib.optionals useLdGold [
|
||||
"CFLAGS=-fuse-ld=gold"
|
||||
"CONF_GCC_LINKER_OPTS_STAGE1=-fuse-ld=gold"
|
||||
"CONF_GCC_LINKER_OPTS_STAGE2=-fuse-ld=gold"
|
||||
] ++ stdenv.lib.optionals (disableLargeAddressSpace) [
|
||||
"--disable-large-address-space"
|
||||
];
|
||||
|
||||
# Make sure we never relax`$PATH` and hooks support for compatability.
|
||||
strictDeps = true;
|
||||
|
||||
# Don’t add -liconv to LDFLAGS automatically so that GHC will add it itself.
|
||||
dontAddExtraLibs = true;
|
||||
|
||||
nativeBuildInputs = [
|
||||
perl autoconf automake m4 python3 sphinx
|
||||
ghc bootPkgs.alex bootPkgs.happy bootPkgs.hscolour
|
||||
];
|
||||
|
||||
# For building runtime libs
|
||||
depsBuildTarget = toolsForTarget;
|
||||
|
||||
buildInputs = [ perl bash ] ++ (libDeps hostPlatform);
|
||||
|
||||
propagatedBuildInputs = [ targetPackages.stdenv.cc ]
|
||||
++ stdenv.lib.optional useLLVM llvmPackages.llvm;
|
||||
|
||||
depsTargetTarget = map stdenv.lib.getDev (libDeps targetPlatform);
|
||||
depsTargetTargetPropagated = map (stdenv.lib.getOutput "out") (libDeps targetPlatform);
|
||||
|
||||
# required, because otherwise all symbols from HSffi.o are stripped, and
|
||||
# that in turn causes GHCi to abort
|
||||
stripDebugFlags = [ "-S" ] ++ stdenv.lib.optional (!targetPlatform.isDarwin) "--keep-file-symbols";
|
||||
|
||||
checkTarget = "test";
|
||||
|
||||
hardeningDisable = [ "format" ] ++ stdenv.lib.optional stdenv.targetPlatform.isMusl "pie";
|
||||
|
||||
postInstall = ''
|
||||
# Install the bash completion file.
|
||||
install -D -m 444 utils/completion/ghc.bash $out/share/bash-completion/completions/${targetPrefix}ghc
|
||||
|
||||
# Patch scripts to include "readelf" and "cat" in $PATH.
|
||||
for i in "$out/bin/"*; do
|
||||
test ! -h $i || continue
|
||||
egrep --quiet '^#!' <(head -n 1 $i) || continue
|
||||
sed -i -e '2i export PATH="$PATH:${stdenv.lib.makeBinPath [ targetPackages.stdenv.cc.bintools coreutils ]}"' $i
|
||||
done
|
||||
'';
|
||||
|
||||
passthru = {
|
||||
inherit bootPkgs targetPrefix;
|
||||
|
||||
inherit llvmPackages;
|
||||
inherit enableShared;
|
||||
|
||||
# Our Cabal compiler name
|
||||
haskellCompilerName = "ghc-${version}";
|
||||
};
|
||||
|
||||
meta = {
|
||||
homepage = http://haskell.org/ghc;
|
||||
description = "The Glasgow Haskell Compiler";
|
||||
maintainers = with stdenv.lib.maintainers; [ marcweber andres peti ];
|
||||
inherit (ghc.meta) license platforms;
|
||||
};
|
||||
|
||||
} // stdenv.lib.optionalAttrs targetPlatform.useAndroidPrebuilt {
|
||||
dontStrip = true;
|
||||
dontPatchELF = true;
|
||||
noAuditTmpdir = true;
|
||||
})
|
||||
@@ -2,12 +2,15 @@
|
||||
|
||||
# build-tools
|
||||
, bootPkgs
|
||||
, autoconf, automake, coreutils, fetchgit, fetchpatch, perl, python3, m4, sphinx
|
||||
, autoconf, autoreconfHook, automake, coreutils, fetchgit, fetchpatch, perl, python3, m4, sphinx
|
||||
, bash
|
||||
|
||||
, libiconv ? null, ncurses
|
||||
|
||||
, useLLVM ? !stdenv.targetPlatform.isx86
|
||||
, enableDwarf ? !stdenv.targetPlatform.isDarwin &&
|
||||
!stdenv.targetPlatform.isWindows, elfutils # for DWARF support
|
||||
|
||||
, useLLVM ? !stdenv.targetPlatform.isx86 || stdenv.targetPlatform.isiOS
|
||||
, # LLVM is conceptually a run-time-only depedendency, but for
|
||||
# non-x86, we need LLVM to bootstrap later stages, so it becomes a
|
||||
# build-time dependency too.
|
||||
@@ -27,7 +30,7 @@
|
||||
, # Whetherto build terminfo.
|
||||
enableTerminfo ? !stdenv.targetPlatform.isWindows
|
||||
|
||||
, version ? "8.9.20190924"
|
||||
, version ? "8.10.20191119"
|
||||
, # What flavour to build. An empty string indicates no
|
||||
# specific flavour and falls back to ghc default values.
|
||||
ghcFlavour ? stdenv.lib.optionalString (stdenv.targetPlatform != stdenv.hostPlatform)
|
||||
@@ -71,9 +74,10 @@ let
|
||||
'';
|
||||
|
||||
# Splicer will pull out correct variations
|
||||
libDeps = platform: stdenv.lib.optional enableTerminfo [ ncurses ]
|
||||
libDeps = platform: stdenv.lib.optional enableTerminfo ncurses
|
||||
++ stdenv.lib.optional (!enableIntegerSimple) gmp
|
||||
++ stdenv.lib.optional (platform.libc != "glibc" && !targetPlatform.isWindows) libiconv;
|
||||
++ stdenv.lib.optional (platform.libc != "glibc" && !targetPlatform.isWindows) libiconv
|
||||
++ stdenv.lib.optional enableDwarf elfutils;
|
||||
|
||||
toolsForTarget = [
|
||||
pkgsBuildTarget.targetPackages.stdenv.cc
|
||||
@@ -81,6 +85,8 @@ let
|
||||
|
||||
targetCC = builtins.head toolsForTarget;
|
||||
|
||||
useLdGold = targetPlatform.isLinux && !(targetPlatform.useLLVM or false);
|
||||
|
||||
in
|
||||
stdenv.mkDerivation (rec {
|
||||
inherit version;
|
||||
@@ -89,8 +95,8 @@ stdenv.mkDerivation (rec {
|
||||
|
||||
src = fetchgit {
|
||||
url = "https://gitlab.haskell.org/ghc/ghc.git/";
|
||||
rev = "795986aaf33e2ffc233836b86a92a77366c91db2";
|
||||
sha256 = "0a111x6c53r07q5qdg6c8mnydqp0wh4mpxmw7ga4x5wlap8i0bji";
|
||||
rev = "0418c38d55c7a47967187dce2db5ea2ab1021b1e";
|
||||
sha256 = "1d8g30ii0w4xh6fh61bxbalsqqyanny99nn3p727fx7favnhgvxi";
|
||||
};
|
||||
|
||||
enableParallelBuilding = true;
|
||||
@@ -98,13 +104,6 @@ stdenv.mkDerivation (rec {
|
||||
outputs = [ "out" "doc" ];
|
||||
|
||||
patches = [
|
||||
(fetchpatch { # https://github.com/haskell/haddock/issues/900
|
||||
url = "https://patch-diff.githubusercontent.com/raw/haskell/haddock/pull/983.diff";
|
||||
name = "loadpluginsinmodules.diff";
|
||||
sha256 = "0bvvv0zsfq2581zsir97zfkggc1kkircbbajc2fz3b169ycpbha1";
|
||||
extraPrefix = "utils/haddock/";
|
||||
stripLen = 1;
|
||||
})
|
||||
];
|
||||
|
||||
postPatch = "patchShebangs .";
|
||||
@@ -120,7 +119,7 @@ stdenv.mkDerivation (rec {
|
||||
export CXX="${targetCC}/bin/${targetCC.targetPrefix}cxx"
|
||||
# Use gold to work around https://sourceware.org/bugzilla/show_bug.cgi?id=16177
|
||||
# and more generally have a faster linker.
|
||||
export LD="${targetCC.bintools}/bin/${targetCC.bintools.targetPrefix}ld${stdenv.lib.optionalString targetPlatform.isLinux ".gold"}"
|
||||
export LD="${targetCC.bintools}/bin/${targetCC.bintools.targetPrefix}ld${stdenv.lib.optionalString useLdGold ".gold"}"
|
||||
export AS="${targetCC.bintools.bintools}/bin/${targetCC.bintools.targetPrefix}as"
|
||||
export AR="${targetCC.bintools.bintools}/bin/${targetCC.bintools.targetPrefix}ar"
|
||||
export NM="${targetCC.bintools.bintools}/bin/${targetCC.bintools.targetPrefix}nm"
|
||||
@@ -164,25 +163,29 @@ stdenv.mkDerivation (rec {
|
||||
configureFlags = [
|
||||
"--datadir=$doc/share/doc/ghc"
|
||||
"--with-curses-includes=${ncurses.dev}/include" "--with-curses-libraries=${ncurses.out}/lib"
|
||||
] ++ stdenv.lib.optional (targetPlatform == hostPlatform && !enableIntegerSimple) [
|
||||
] ++ stdenv.lib.optionals (targetPlatform == hostPlatform && !enableIntegerSimple) [
|
||||
"--with-gmp-includes=${targetPackages.gmp.dev}/include" "--with-gmp-libraries=${targetPackages.gmp.out}/lib"
|
||||
] ++ stdenv.lib.optional (targetPlatform == hostPlatform && hostPlatform.libc != "glibc" && !targetPlatform.isWindows) [
|
||||
] ++ stdenv.lib.optionals (targetPlatform == hostPlatform && hostPlatform.libc != "glibc" && !targetPlatform.isWindows) [
|
||||
"--with-iconv-includes=${libiconv}/include" "--with-iconv-libraries=${libiconv}/lib"
|
||||
] ++ stdenv.lib.optionals (targetPlatform != hostPlatform) [
|
||||
"--enable-bootstrap-with-devel-snapshot"
|
||||
] ++ stdenv.lib.optionals (targetPlatform.isAarch32) [
|
||||
] ++ stdenv.lib.optionals useLdGold [
|
||||
"CFLAGS=-fuse-ld=gold"
|
||||
"CONF_GCC_LINKER_OPTS_STAGE1=-fuse-ld=gold"
|
||||
"CONF_GCC_LINKER_OPTS_STAGE2=-fuse-ld=gold"
|
||||
] ++ stdenv.lib.optionals (disableLargeAddressSpace) [
|
||||
"--disable-large-address-space"
|
||||
] ++ stdenv.lib.optionals enableDwarf [
|
||||
"--enable-dwarf-unwind"
|
||||
"--with-libdw-includes=${stdenv.lib.getDev elfutils}/include"
|
||||
"--with-libdw-libraries=${stdenv.lib.getLib elfutils}/lib"
|
||||
];
|
||||
|
||||
# Make sure we never relax`$PATH` and hooks support for compatability.
|
||||
strictDeps = true;
|
||||
|
||||
nativeBuildInputs = [
|
||||
perl autoconf automake m4 python3 sphinx
|
||||
perl autoconf autoreconfHook automake m4 python3 sphinx
|
||||
ghc bootPkgs.alex bootPkgs.happy bootPkgs.hscolour
|
||||
];
|
||||
|
||||
|
||||
@@ -16,7 +16,7 @@
|
||||
}:
|
||||
|
||||
runCommand "configured-ghcjs-src" {
|
||||
buildInputs = [
|
||||
nativeBuildInputs = [
|
||||
perl
|
||||
autoconf
|
||||
automake
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
{ stdenv
|
||||
, pkgsHostHost
|
||||
, callPackage
|
||||
, fetchgit
|
||||
, ghcjsSrcJson ? null
|
||||
@@ -14,7 +15,6 @@
|
||||
, pkgconfig
|
||||
, gcc
|
||||
, lib
|
||||
, nodePackages
|
||||
, ghcjsDepOverrides ? (_:_:{})
|
||||
, haskell
|
||||
}:
|
||||
@@ -46,7 +46,7 @@ let
|
||||
|
||||
enableShared = true;
|
||||
|
||||
socket-io = nodePackages."socket.io";
|
||||
socket-io = pkgsHostHost.nodePackages."socket.io";
|
||||
|
||||
# Relics of the old GHCJS build system
|
||||
stage1Packages = [];
|
||||
|
||||
@@ -0,0 +1,24 @@
|
||||
{ stdenv, rustPlatform, fetchFromGitHub, Security }:
|
||||
|
||||
rustPlatform.buildRustPackage rec {
|
||||
pname = "gleam";
|
||||
version = "0.6.0";
|
||||
|
||||
src = fetchFromGitHub {
|
||||
owner = "gleam-lang";
|
||||
repo = pname;
|
||||
rev = "v${version}";
|
||||
sha256 = "1fvy2j6pw1rwm0rg7555q3qg2069cx2b9lk0nsyc3jxsqp9hbn6i";
|
||||
};
|
||||
|
||||
buildInputs = stdenv.lib.optionals stdenv.isDarwin [ Security ];
|
||||
|
||||
cargoSha256 = "1vhra9v4jsy9hyhjrmxjy6rnraxz13h1b7l51xvbai5wxsxm7z8m";
|
||||
|
||||
meta = with stdenv.lib; {
|
||||
description = "A statically typed language for the Erlang VM";
|
||||
homepage = "https://gleam.run/";
|
||||
license = licenses.asl20;
|
||||
maintainers = with maintainers; [ filalex77 ];
|
||||
};
|
||||
}
|
||||
@@ -9,13 +9,13 @@
|
||||
|
||||
stdenv.mkDerivation rec {
|
||||
pname = "glslang";
|
||||
version = "7.11.3214";
|
||||
version = "8.13.3559";
|
||||
|
||||
src = fetchFromGitHub {
|
||||
owner = "KhronosGroup";
|
||||
repo = "glslang";
|
||||
rev = version;
|
||||
sha256 = "0dqjga0lcza006fhac26zp2plbq4gx8a6nsmrwkqlzji6lw1jins";
|
||||
sha256 = "0waamlh2vqh1k40m169294xdlm0iqjkx2vis4qyxfki0r0cnsmnk";
|
||||
};
|
||||
|
||||
# These get set at all-packages, keep onto them for child drvs
|
||||
|
||||
@@ -1,33 +1,24 @@
|
||||
{ lib, buildGoPackage, fetchFromGitHub }:
|
||||
{ lib, buildGoModule, fetchFromGitHub }:
|
||||
|
||||
buildGoPackage rec {
|
||||
buildGoModule rec {
|
||||
pname = "go-jsonnet";
|
||||
version = "0.13.0";
|
||||
|
||||
goPackagePath = "github.com/google/go-jsonnet";
|
||||
|
||||
# regenerate deps.nix using following steps:
|
||||
#
|
||||
# go get -u github.com/google/go-jsonnet
|
||||
# cd $GOPATH/src/github.com/google/go-jsonnet
|
||||
# git checkout <version>
|
||||
# dep init
|
||||
# dep2nix
|
||||
goDeps = ./deps.nix;
|
||||
version = "0.15.0";
|
||||
|
||||
src = fetchFromGitHub {
|
||||
rev = "v${version}";
|
||||
owner = "google";
|
||||
repo = "go-jsonnet";
|
||||
sha256 = "0x95sqhrw4pscxq0q8781wix0w881k9my5kn5nf6k0fg1d6qlgiy";
|
||||
fetchSubmodules = true;
|
||||
rev = "v${version}";
|
||||
sha256 = "0l6cwky2xl7m8nnc9abp76bhkdcf2ldbbv3r8p30xv2yr5wd1j8i";
|
||||
};
|
||||
|
||||
meta = {
|
||||
modSha256 = "1b6hz5a66hhlzpcv1badxr1b4nmk4lw0507d5jks7lqzvvwd0sxq";
|
||||
|
||||
subPackages = [ "cmd/jsonnet" ];
|
||||
|
||||
meta = with lib; {
|
||||
description = "An implementation of Jsonnet in pure Go";
|
||||
maintainers = with lib.maintainers; [ nshalman ];
|
||||
license = lib.licenses.asl20;
|
||||
homepage = https://github.com/google/go-jsonnet;
|
||||
platforms = lib.platforms.unix;
|
||||
homepage = "https://github.com/google/go-jsonnet";
|
||||
license = licenses.asl20;
|
||||
maintainers = with maintainers; [ nshalman ];
|
||||
};
|
||||
}
|
||||
|
||||
-48
@@ -1,48 +0,0 @@
|
||||
# file generated from Gopkg.lock using dep2nix (https://github.com/nixcloud/dep2nix)
|
||||
[
|
||||
{
|
||||
goPackagePath = "github.com/fatih/color";
|
||||
fetch = {
|
||||
type = "git";
|
||||
url = "https://github.com/fatih/color";
|
||||
rev = "5b77d2a35fb0ede96d138fc9a99f5c9b6aef11b4";
|
||||
sha256 = "0v8msvg38r8d1iiq2i5r4xyfx0invhc941kjrsg5gzwvagv55inv";
|
||||
};
|
||||
}
|
||||
{
|
||||
goPackagePath = "github.com/mattn/go-colorable";
|
||||
fetch = {
|
||||
type = "git";
|
||||
url = "https://github.com/mattn/go-colorable";
|
||||
rev = "167de6bfdfba052fa6b2d3664c8f5272e23c9072";
|
||||
sha256 = "1nwjmsppsjicr7anq8na6md7b1z84l9ppnlr045hhxjvbkqwalvx";
|
||||
};
|
||||
}
|
||||
{
|
||||
goPackagePath = "github.com/mattn/go-isatty";
|
||||
fetch = {
|
||||
type = "git";
|
||||
url = "https://github.com/mattn/go-isatty";
|
||||
rev = "1311e847b0cb909da63b5fecfb5370aa66236465";
|
||||
sha256 = "0rqfh1rj6f5wm8p2ky7inm8g10152p7w6n2cli17kf9gad797i8h";
|
||||
};
|
||||
}
|
||||
{
|
||||
goPackagePath = "github.com/sergi/go-diff";
|
||||
fetch = {
|
||||
type = "git";
|
||||
url = "https://github.com/sergi/go-diff";
|
||||
rev = "1744e2970ca51c86172c8190fadad617561ed6e7";
|
||||
sha256 = "0swiazj8wphs2zmk1qgq75xza6m19snif94h2m6fi8dqkwqdl7c7";
|
||||
};
|
||||
}
|
||||
{
|
||||
goPackagePath = "golang.org/x/sys";
|
||||
fetch = {
|
||||
type = "git";
|
||||
url = "https://go.googlesource.com/sys";
|
||||
rev = "4c4f7f33c9ed00de01c4c741d2177abfcfe19307";
|
||||
sha256 = "191001bxqyc3xfs46nnqmm7jdk0r73vk7a4zqngfl7zwjv9smwsq";
|
||||
};
|
||||
}
|
||||
]
|
||||
@@ -1,4 +1,4 @@
|
||||
{ stdenv, fetchurl, fetchpatch, tzdata, iana-etc, runCommand
|
||||
{ stdenv, fetchurl, tzdata, iana-etc, runCommand
|
||||
, perl, which, pkgconfig, patch, procps, pcre, cacert, Security, Foundation
|
||||
, mailcap, runtimeShell
|
||||
, buildPackages, pkgsTargetTarget
|
||||
@@ -30,11 +30,11 @@ in
|
||||
|
||||
stdenv.mkDerivation rec {
|
||||
pname = "go";
|
||||
version = "1.12.9";
|
||||
version = "1.12.17";
|
||||
|
||||
src = fetchurl {
|
||||
url = "https://dl.google.com/go/go${version}.src.tar.gz";
|
||||
sha256 = "1z32imbwmpkzgyh5c3vi7rbvzbq94xjk5qi2xm9sccj7kknmc3mb";
|
||||
sha256 = "09cbl90maxry713wd18jdqrms3ivbvcm472csnxc78rsqhc851yy";
|
||||
};
|
||||
|
||||
# perl is used for testing go vet
|
||||
@@ -96,6 +96,12 @@ stdenv.mkDerivation rec {
|
||||
# Disable cgo lookup tests not works, they depend on resolver
|
||||
rm src/net/cgo_unix_test.go
|
||||
|
||||
# Disable TestGcSys because it's flakey in our tests, but the failure is not
|
||||
# reproducible by multiple people in other environments.
|
||||
# See https://github.com/NixOS/nixpkgs/issues/68361#issuecomment-537849272 and following
|
||||
# NOTE: Try re-enabling for releases newer than 1.12.9
|
||||
sed -i '/TestGcSys/areturn' src/runtime/gc_test.go
|
||||
|
||||
'' + optionalString stdenv.isLinux ''
|
||||
sed -i 's,/usr/share/zoneinfo/,${tzdata}/share/zoneinfo/,' src/time/zoneinfo_unix.go
|
||||
'' + optionalString stdenv.isAarch32 ''
|
||||
@@ -135,13 +141,11 @@ stdenv.mkDerivation rec {
|
||||
./go-1.9-skip-flaky-20072.patch
|
||||
./skip-external-network-tests.patch
|
||||
./skip-nohup-tests.patch
|
||||
] ++ [
|
||||
# breaks under load: https://github.com/golang/go/issues/25628
|
||||
./skip-test-extra-files-on-386.patch
|
||||
(fetchpatch { # probably included in >= 1.12.10
|
||||
url = "https://github.com/golang/go/commit/aae0b5b0b.diff";
|
||||
name = "TestGcSys-too-much-memory.diff";
|
||||
sha256 = "1bl9d2pl6n99n9g65cq91sygmp1iva5rmrxbprwn4xd0ql36psa8";
|
||||
})
|
||||
(if stdenv.isAarch32
|
||||
then ./skip-test-extra-files-on-aarch32.patch
|
||||
else ./skip-test-extra-files-on-386.patch)
|
||||
];
|
||||
|
||||
postPatch = ''
|
||||
@@ -238,7 +242,7 @@ stdenv.mkDerivation rec {
|
||||
homepage = http://golang.org/;
|
||||
description = "The Go Programming language";
|
||||
license = licenses.bsd3;
|
||||
maintainers = with maintainers; [ cstrahan orivej velovix mic92 rvolosatovs ];
|
||||
maintainers = with maintainers; [ cstrahan orivej mic92 rvolosatovs Frostman ];
|
||||
platforms = platforms.linux ++ platforms.darwin;
|
||||
};
|
||||
}
|
||||
|
||||
@@ -30,11 +30,11 @@ in
|
||||
|
||||
stdenv.mkDerivation rec {
|
||||
pname = "go";
|
||||
version = "1.13.1";
|
||||
version = "1.13.8";
|
||||
|
||||
src = fetchurl {
|
||||
url = "https://dl.google.com/go/go${version}.src.tar.gz";
|
||||
sha256 = "0n4k42bbrj5g9b1kczkfsih049v43vqzaps7n69gmfa4jpk59wc1";
|
||||
sha256 = "0d7cxffk72568h46srzswrxd0bsdip7amgkf499wzn6l6d3g0fxi";
|
||||
};
|
||||
|
||||
# perl is used for testing go vet
|
||||
@@ -57,8 +57,8 @@ stdenv.mkDerivation rec {
|
||||
--replace '#!/usr/bin/env bash' '#!${runtimeShell}'
|
||||
|
||||
# Patch the mimetype database location which is missing on NixOS.
|
||||
substituteInPlace src/mime/type_unix.go \
|
||||
--replace '/etc/mime.types' '${mailcap}/etc/mime.types'
|
||||
# but also allow static binaries built with NixOS to run outside nix
|
||||
sed -i 's,\"/etc/mime.types,"${mailcap}/etc/mime.types\"\,\n\t&,' src/mime/type_unix.go
|
||||
|
||||
# Disabling the 'os/http/net' tests (they want files not available in
|
||||
# chroot builds)
|
||||
@@ -97,7 +97,10 @@ stdenv.mkDerivation rec {
|
||||
rm src/net/cgo_unix_test.go
|
||||
|
||||
'' + optionalString stdenv.isLinux ''
|
||||
sed -i 's,/usr/share/zoneinfo/,${tzdata}/share/zoneinfo/,' src/time/zoneinfo_unix.go
|
||||
# prepend the nix path to the zoneinfo files but also leave the original value for static binaries
|
||||
# that run outside a nix server
|
||||
sed -i 's,\"/usr/share/zoneinfo/,"${tzdata}/share/zoneinfo/\"\,\n\t&,' src/time/zoneinfo_unix.go
|
||||
|
||||
'' + optionalString stdenv.isAarch32 ''
|
||||
echo '#!${runtimeShell}' > misc/cgo/testplugin/test.bash
|
||||
'' + optionalString stdenv.isDarwin ''
|
||||
@@ -135,8 +138,11 @@ stdenv.mkDerivation rec {
|
||||
./go-1.9-skip-flaky-20072.patch
|
||||
./skip-external-network-tests.patch
|
||||
./skip-nohup-tests.patch
|
||||
] ++ [
|
||||
# breaks under load: https://github.com/golang/go/issues/25628
|
||||
./skip-test-extra-files-on-386.patch
|
||||
(if stdenv.isAarch32
|
||||
then ./skip-test-extra-files-on-aarch32.patch
|
||||
else ./skip-test-extra-files-on-386.patch)
|
||||
];
|
||||
|
||||
postPatch = ''
|
||||
@@ -233,7 +239,7 @@ stdenv.mkDerivation rec {
|
||||
homepage = http://golang.org/;
|
||||
description = "The Go Programming language";
|
||||
license = licenses.bsd3;
|
||||
maintainers = with maintainers; [ cstrahan orivej velovix mic92 rvolosatovs kalbasit ];
|
||||
maintainers = with maintainers; [ cstrahan orivej mic92 rvolosatovs kalbasit Frostman ];
|
||||
platforms = platforms.linux ++ platforms.darwin;
|
||||
};
|
||||
}
|
||||
|
||||
@@ -0,0 +1,245 @@
|
||||
{ stdenv, fetchurl, tzdata, iana-etc, runCommand
|
||||
, perl, which, pkgconfig, patch, procps, pcre, cacert, Security, Foundation
|
||||
, mailcap, runtimeShell
|
||||
, buildPackages, pkgsTargetTarget
|
||||
}:
|
||||
|
||||
let
|
||||
|
||||
inherit (stdenv.lib) optionals optionalString;
|
||||
|
||||
goBootstrap = runCommand "go-bootstrap" {} ''
|
||||
mkdir $out
|
||||
cp -rf ${buildPackages.go_bootstrap}/* $out/
|
||||
chmod -R u+w $out
|
||||
find $out -name "*.c" -delete
|
||||
cp -rf $out/bin/* $out/share/go/bin/
|
||||
'';
|
||||
|
||||
goarch = platform: {
|
||||
"i686" = "386";
|
||||
"x86_64" = "amd64";
|
||||
"aarch64" = "arm64";
|
||||
"arm" = "arm";
|
||||
"armv5tel" = "arm";
|
||||
"armv6l" = "arm";
|
||||
"armv7l" = "arm";
|
||||
}.${platform.parsed.cpu.name} or (throw "Unsupported system");
|
||||
|
||||
in
|
||||
|
||||
stdenv.mkDerivation rec {
|
||||
pname = "go";
|
||||
version = "1.14";
|
||||
|
||||
src = fetchurl {
|
||||
url = "https://dl.google.com/go/go${version}.src.tar.gz";
|
||||
sha256 = "12a3nzj4k4p5ica447sjfva9pvvj84a03b4xlg3mhl2nmm33wr3d";
|
||||
};
|
||||
|
||||
# perl is used for testing go vet
|
||||
nativeBuildInputs = [ perl which pkgconfig patch procps ];
|
||||
buildInputs = [ cacert pcre ]
|
||||
++ optionals stdenv.isLinux [ stdenv.cc.libc.out ]
|
||||
++ optionals (stdenv.hostPlatform.libc == "glibc") [ stdenv.cc.libc.static ];
|
||||
|
||||
|
||||
propagatedBuildInputs = optionals stdenv.isDarwin [ Security Foundation ];
|
||||
|
||||
hardeningDisable = [ "all" ];
|
||||
|
||||
prePatch = ''
|
||||
patchShebangs ./ # replace /bin/bash
|
||||
|
||||
# This source produces shell script at run time,
|
||||
# and thus it is not corrected by patchShebangs.
|
||||
substituteInPlace misc/cgo/testcarchive/carchive_test.go \
|
||||
--replace '#!/usr/bin/env bash' '#!${runtimeShell}'
|
||||
|
||||
# Patch the mimetype database location which is missing on NixOS.
|
||||
# but also allow static binaries built with NixOS to run outside nix
|
||||
sed -i 's,\"/etc/mime.types,"${mailcap}/etc/mime.types\"\,\n\t&,' src/mime/type_unix.go
|
||||
|
||||
# Disabling the 'os/http/net' tests (they want files not available in
|
||||
# chroot builds)
|
||||
rm src/net/{listen,parse}_test.go
|
||||
rm src/syscall/exec_linux_test.go
|
||||
|
||||
# !!! substituteInPlace does not seems to be effective.
|
||||
# The os test wants to read files in an existing path. Just don't let it be /usr/bin.
|
||||
sed -i 's,/usr/bin,'"`pwd`", src/os/os_test.go
|
||||
sed -i 's,/bin/pwd,'"`type -P pwd`", src/os/os_test.go
|
||||
# Disable the unix socket test
|
||||
sed -i '/TestShutdownUnix/aif true \{ return\; \}' src/net/net_test.go
|
||||
# Disable the hostname test
|
||||
sed -i '/TestHostname/aif true \{ return\; \}' src/os/os_test.go
|
||||
# ParseInLocation fails the test
|
||||
sed -i '/TestParseInSydney/aif true \{ return\; \}' src/time/format_test.go
|
||||
# Remove the api check as it never worked
|
||||
sed -i '/src\/cmd\/api\/run.go/ireturn nil' src/cmd/dist/test.go
|
||||
# Remove the coverage test as we have removed this utility
|
||||
sed -i '/TestCoverageWithCgo/aif true \{ return\; \}' src/cmd/go/go_test.go
|
||||
# Remove the timezone naming test
|
||||
sed -i '/TestLoadFixed/aif true \{ return\; \}' src/time/time_test.go
|
||||
# Remove disable setgid test
|
||||
sed -i '/TestRespectSetgidDir/aif true \{ return\; \}' src/cmd/go/internal/work/build_test.go
|
||||
# Remove cert tests that conflict with NixOS's cert resolution
|
||||
sed -i '/TestEnvVars/aif true \{ return\; \}' src/crypto/x509/root_unix_test.go
|
||||
# TestWritevError hangs sometimes
|
||||
sed -i '/TestWritevError/aif true \{ return\; \}' src/net/writev_test.go
|
||||
# TestVariousDeadlines fails sometimes
|
||||
sed -i '/TestVariousDeadlines/aif true \{ return\; \}' src/net/timeout_test.go
|
||||
|
||||
sed -i 's,/etc/protocols,${iana-etc}/etc/protocols,' src/net/lookup_unix.go
|
||||
sed -i 's,/etc/services,${iana-etc}/etc/services,' src/net/port_unix.go
|
||||
|
||||
# Disable cgo lookup tests not works, they depend on resolver
|
||||
rm src/net/cgo_unix_test.go
|
||||
|
||||
'' + optionalString stdenv.isLinux ''
|
||||
# prepend the nix path to the zoneinfo files but also leave the original value for static binaries
|
||||
# that run outside a nix server
|
||||
sed -i 's,\"/usr/share/zoneinfo/,"${tzdata}/share/zoneinfo/\"\,\n\t&,' src/time/zoneinfo_unix.go
|
||||
|
||||
'' + optionalString stdenv.isAarch32 ''
|
||||
echo '#!${runtimeShell}' > misc/cgo/testplugin/test.bash
|
||||
'' + optionalString stdenv.isDarwin ''
|
||||
substituteInPlace src/race.bash --replace \
|
||||
"sysctl machdep.cpu.extfeatures | grep -qv EM64T" true
|
||||
sed -i 's,strings.Contains(.*sysctl.*,true {,' src/cmd/dist/util.go
|
||||
sed -i 's,"/etc","'"$TMPDIR"'",' src/os/os_test.go
|
||||
sed -i 's,/_go_os_test,'"$TMPDIR"'/_go_os_test,' src/os/path_test.go
|
||||
|
||||
sed -i '/TestChdirAndGetwd/aif true \{ return\; \}' src/os/os_test.go
|
||||
sed -i '/TestCredentialNoSetGroups/aif true \{ return\; \}' src/os/exec/exec_posix_test.go
|
||||
sed -i '/TestRead0/aif true \{ return\; \}' src/os/os_test.go
|
||||
sed -i '/TestSystemRoots/aif true \{ return\; \}' src/crypto/x509/root_darwin_test.go
|
||||
|
||||
sed -i '/TestGoInstallRebuildsStalePackagesInOtherGOPATH/aif true \{ return\; \}' src/cmd/go/go_test.go
|
||||
sed -i '/TestBuildDashIInstallsDependencies/aif true \{ return\; \}' src/cmd/go/go_test.go
|
||||
|
||||
sed -i '/TestDisasmExtld/aif true \{ return\; \}' src/cmd/objdump/objdump_test.go
|
||||
|
||||
sed -i 's/unrecognized/unknown/' src/cmd/link/internal/ld/lib.go
|
||||
|
||||
# TestCurrent fails because Current is not implemented on Darwin
|
||||
sed -i 's/TestCurrent/testCurrent/g' src/os/user/user_test.go
|
||||
sed -i 's/TestLookup/testLookup/g' src/os/user/user_test.go
|
||||
|
||||
touch $TMPDIR/group $TMPDIR/hosts $TMPDIR/passwd
|
||||
'';
|
||||
|
||||
patches = [
|
||||
./remove-tools-1.11.patch
|
||||
./ssl-cert-file-1.13.patch
|
||||
./remove-test-pie-1.14.patch
|
||||
./creds-test.patch
|
||||
./go-1.9-skip-flaky-19608.patch
|
||||
./go-1.9-skip-flaky-20072.patch
|
||||
./skip-external-network-tests.patch
|
||||
./skip-nohup-tests.patch
|
||||
] ++ [
|
||||
# breaks under load: https://github.com/golang/go/issues/25628
|
||||
(if stdenv.isAarch32
|
||||
then ./skip-test-extra-files-on-aarch32-1.14.patch
|
||||
else ./skip-test-extra-files-on-386-1.14.patch)
|
||||
];
|
||||
|
||||
postPatch = ''
|
||||
find . -name '*.orig' -exec rm {} ';'
|
||||
'';
|
||||
|
||||
GOOS = stdenv.targetPlatform.parsed.kernel.name;
|
||||
GOARCH = goarch stdenv.targetPlatform;
|
||||
# GOHOSTOS/GOHOSTARCH must match the building system, not the host system.
|
||||
# Go will nevertheless build a for host system that we will copy over in
|
||||
# the install phase.
|
||||
GOHOSTOS = stdenv.buildPlatform.parsed.kernel.name;
|
||||
GOHOSTARCH = goarch stdenv.buildPlatform;
|
||||
|
||||
# {CC,CXX}_FOR_TARGET must be only set for cross compilation case as go expect those
|
||||
# to be different from CC/CXX
|
||||
CC_FOR_TARGET = if (stdenv.buildPlatform != stdenv.targetPlatform) then
|
||||
"${pkgsTargetTarget.stdenv.cc}/bin/${pkgsTargetTarget.stdenv.cc.targetPrefix}cc"
|
||||
else
|
||||
null;
|
||||
CXX_FOR_TARGET = if (stdenv.buildPlatform != stdenv.targetPlatform) then
|
||||
"${pkgsTargetTarget.stdenv.cc}/bin/${pkgsTargetTarget.stdenv.cc.targetPrefix}c++"
|
||||
else
|
||||
null;
|
||||
|
||||
GOARM = toString (stdenv.lib.intersectLists [(stdenv.hostPlatform.parsed.cpu.version or "")] ["5" "6" "7"]);
|
||||
GO386 = 387; # from Arch: don't assume sse2 on i686
|
||||
CGO_ENABLED = 1;
|
||||
# Hopefully avoids test timeouts on Hydra
|
||||
GO_TEST_TIMEOUT_SCALE = 3;
|
||||
|
||||
# Indicate that we are running on build infrastructure
|
||||
# Some tests assume things like home directories and users exists
|
||||
GO_BUILDER_NAME = "nix";
|
||||
|
||||
GOROOT_BOOTSTRAP="${goBootstrap}/share/go";
|
||||
|
||||
postConfigure = ''
|
||||
export GOCACHE=$TMPDIR/go-cache
|
||||
# this is compiled into the binary
|
||||
export GOROOT_FINAL=$out/share/go
|
||||
|
||||
export PATH=$(pwd)/bin:$PATH
|
||||
|
||||
# Independent from host/target, CC should produce code for the building system.
|
||||
export CC=${buildPackages.stdenv.cc}/bin/cc
|
||||
ulimit -a
|
||||
'';
|
||||
|
||||
postBuild = ''
|
||||
(cd src && ./make.bash)
|
||||
'';
|
||||
|
||||
doCheck = stdenv.hostPlatform == stdenv.targetPlatform && !stdenv.isDarwin;
|
||||
|
||||
checkPhase = ''
|
||||
runHook preCheck
|
||||
(cd src && HOME=$TMPDIR GOCACHE=$TMPDIR/go-cache ./run.bash --no-rebuild)
|
||||
runHook postCheck
|
||||
'';
|
||||
|
||||
preInstall = ''
|
||||
rm -r pkg/obj
|
||||
# Contains the wrong perl shebang when cross compiling,
|
||||
# since it is not used for anything we can deleted as well.
|
||||
rm src/regexp/syntax/make_perl_groups.pl
|
||||
'' + (if (stdenv.buildPlatform != stdenv.hostPlatform) then ''
|
||||
mv bin/*_*/* bin
|
||||
rmdir bin/*_*
|
||||
${optionalString (!(GOHOSTARCH == GOARCH && GOOS == GOHOSTOS)) ''
|
||||
rm -rf pkg/${GOHOSTOS}_${GOHOSTARCH} pkg/tool/${GOHOSTOS}_${GOHOSTARCH}
|
||||
''}
|
||||
'' else if (stdenv.hostPlatform != stdenv.targetPlatform) then ''
|
||||
rm -rf bin/*_*
|
||||
${optionalString (!(GOHOSTARCH == GOARCH && GOOS == GOHOSTOS)) ''
|
||||
rm -rf pkg/${GOOS}_${GOARCH} pkg/tool/${GOOS}_${GOARCH}
|
||||
''}
|
||||
'' else "");
|
||||
|
||||
installPhase = ''
|
||||
runHook preInstall
|
||||
mkdir -p $GOROOT_FINAL
|
||||
cp -a bin pkg src lib misc api doc $GOROOT_FINAL
|
||||
ln -s $GOROOT_FINAL/bin $out/bin
|
||||
runHook postInstall
|
||||
'';
|
||||
|
||||
setupHook = ./setup-hook.sh;
|
||||
|
||||
disallowedReferences = [ goBootstrap ];
|
||||
|
||||
meta = with stdenv.lib; {
|
||||
branch = "1.14";
|
||||
homepage = http://golang.org/;
|
||||
description = "The Go Programming language";
|
||||
license = licenses.bsd3;
|
||||
maintainers = with maintainers; [ cstrahan orivej mic92 rvolosatovs kalbasit Frostman ];
|
||||
platforms = platforms.linux ++ platforms.darwin;
|
||||
};
|
||||
}
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user