Merge remote-tracking branch 'origin/master' into gcc-9
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
|
||||
'';
|
||||
|
||||
|
||||
@@ -54,7 +54,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
|
||||
'';
|
||||
|
||||
|
||||
@@ -10,34 +10,34 @@
|
||||
"version": "11.0.4"
|
||||
},
|
||||
"armv6l": {
|
||||
"build": "7",
|
||||
"sha256": "3fbe418368e6d5888d0f15c4751139eb60d9785b864158a001386537fa46f67e",
|
||||
"url": "https://github.com/AdoptOpenJDK/openjdk11-binaries/releases/download/jdk-11.0.3%2B7/OpenJDK11U-jdk_arm_linux_hotspot_11.0.3_7.tar.gz",
|
||||
"version": "11.0.3"
|
||||
"build": "10",
|
||||
"sha256": "c6b1fda3f8807028cbfcc34a4ded2e8a5a6b6239d2bcc1f06673ea6b1530df94",
|
||||
"url": "https://github.com/AdoptOpenJDK/openjdk11-binaries/releases/download/jdk-11.0.5%2B10/OpenJDK11U-jdk_arm_linux_hotspot_11.0.5_10.tar.gz",
|
||||
"version": "11.0.5"
|
||||
},
|
||||
"armv7l": {
|
||||
"build": "7",
|
||||
"sha256": "3fbe418368e6d5888d0f15c4751139eb60d9785b864158a001386537fa46f67e",
|
||||
"url": "https://github.com/AdoptOpenJDK/openjdk11-binaries/releases/download/jdk-11.0.3%2B7/OpenJDK11U-jdk_arm_linux_hotspot_11.0.3_7.tar.gz",
|
||||
"version": "11.0.3"
|
||||
"build": "10",
|
||||
"sha256": "c6b1fda3f8807028cbfcc34a4ded2e8a5a6b6239d2bcc1f06673ea6b1530df94",
|
||||
"url": "https://github.com/AdoptOpenJDK/openjdk11-binaries/releases/download/jdk-11.0.5%2B10/OpenJDK11U-jdk_arm_linux_hotspot_11.0.5_10.tar.gz",
|
||||
"version": "11.0.5"
|
||||
},
|
||||
"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": "6dd0c9c8a740e6c19149e98034fba8e368fd9aa16ab417aa636854d40db1a161",
|
||||
"url": "https://github.com/AdoptOpenJDK/openjdk11-binaries/releases/download/jdk-11.0.5%2B10/OpenJDK11U-jdk_x64_linux_hotspot_11.0.5_10.tar.gz",
|
||||
"version": "11.0.5"
|
||||
}
|
||||
},
|
||||
"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": "6ead0515aecb24c6a8f5f3800a070b7d20a66c8f26cba5dad137824da590a532",
|
||||
"url": "https://github.com/AdoptOpenJDK/openjdk11-binaries/releases/download/jdk-11.0.5%2B10_openj9-0.17.0/OpenJDK11U-jdk_x64_linux_openj9_11.0.5_10_openj9-0.17.0.tar.gz",
|
||||
"version": "11.0.5"
|
||||
}
|
||||
}
|
||||
},
|
||||
@@ -52,20 +52,20 @@
|
||||
"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": "2f08c469c9a8adea1b6ee3444ba2a8242a7e99d87976a077faf037a9eb7f884b",
|
||||
"url": "https://github.com/AdoptOpenJDK/openjdk11-binaries/releases/download/jdk-11.0.5%2B10/OpenJDK11U-jre_x64_linux_hotspot_11.0.5_10.tar.gz",
|
||||
"version": "11.0.5"
|
||||
}
|
||||
},
|
||||
"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": "2b68ea68d41281238a9dbe494cec762bd97fe34cf4fb6ba44ee1ce66bcec9d38",
|
||||
"url": "https://github.com/AdoptOpenJDK/openjdk11-binaries/releases/download/jdk-11.0.5%2B10_openj9-0.17.0/OpenJDK11U-jre_x64_linux_openj9_11.0.5_10_openj9-0.17.0.tar.gz",
|
||||
"version": "11.0.5"
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -76,20 +76,20 @@
|
||||
"packageType": "jdk",
|
||||
"vmType": "hotspot",
|
||||
"x86_64": {
|
||||
"build": "11",
|
||||
"sha256": "a50b211f475b9497311c9b65594764d7b852b1653f249582bb20fc3c302846a5",
|
||||
"url": "https://github.com/AdoptOpenJDK/openjdk11-binaries/releases/download/jdk-11.0.4%2B11/OpenJDK11U-jdk_x64_mac_hotspot_11.0.4_11.tar.gz",
|
||||
"version": "11.0.4"
|
||||
"build": "10",
|
||||
"sha256": "0825d0d3177832320b697944cd8e7b2e7fe3893fafe8bfcf33ee3631aa5ca96b",
|
||||
"url": "https://github.com/AdoptOpenJDK/openjdk11-binaries/releases/download/jdk-11.0.5%2B10/OpenJDK11U-jdk_x64_mac_hotspot_11.0.5_10.tar.gz",
|
||||
"version": "11.0.5"
|
||||
}
|
||||
},
|
||||
"openj9": {
|
||||
"packageType": "jdk",
|
||||
"vmType": "openj9",
|
||||
"x86_64": {
|
||||
"build": "11",
|
||||
"sha256": "7c09678d9c2d9dd0366693c6ab27bed39c76a23e7ac69b8a25c794e99dcf3ba7",
|
||||
"url": "https://github.com/AdoptOpenJDK/openjdk11-binaries/releases/download/jdk-11.0.4%2B11_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": "97dc8234b73e233316b5dfdca75af9a0d54aa23b1309b1a68fd0a5d2fa928e05",
|
||||
"url": "https://github.com/AdoptOpenJDK/openjdk11-binaries/releases/download/jdk-11.0.5%2B10.1_openj9-0.17.0/OpenJDK11U-jdk_x64_mac_openj9_11.0.5_10_openj9-0.17.0.tar.gz",
|
||||
"version": "11.0.5"
|
||||
}
|
||||
}
|
||||
},
|
||||
@@ -98,20 +98,20 @@
|
||||
"packageType": "jre",
|
||||
"vmType": "hotspot",
|
||||
"x86_64": {
|
||||
"build": "11",
|
||||
"sha256": "1647fded28d25e562811f7bce2092eb9c21d30608843b04250c023b40604ff26",
|
||||
"url": "https://github.com/AdoptOpenJDK/openjdk11-binaries/releases/download/jdk-11.0.4%2B11/OpenJDK11U-jre_x64_mac_hotspot_11.0.4_11.tar.gz",
|
||||
"version": "11.0.4"
|
||||
"build": "10",
|
||||
"sha256": "dfd212023321ebb41bce8cced15b4668001e86ecff6bffdd4f2591ccaae41566",
|
||||
"url": "https://github.com/AdoptOpenJDK/openjdk11-binaries/releases/download/jdk-11.0.5%2B10/OpenJDK11U-jre_x64_mac_hotspot_11.0.5_10.tar.gz",
|
||||
"version": "11.0.5"
|
||||
}
|
||||
},
|
||||
"openj9": {
|
||||
"packageType": "jre",
|
||||
"vmType": "openj9",
|
||||
"x86_64": {
|
||||
"build": "11",
|
||||
"sha256": "1a8e84bae517a848aa5f25c7b04f26ab3a3bfffaa7fdf9be24e1f83325e46766",
|
||||
"url": "https://github.com/AdoptOpenJDK/openjdk11-binaries/releases/download/jdk-11.0.4%2B11_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": "ea6bd0be4562e766c035b997447c059d10d5d2e58ca464c57f9078858da1c967",
|
||||
"url": "https://github.com/AdoptOpenJDK/openjdk11-binaries/releases/download/jdk-11.0.5%2B10.1_openj9-0.17.0/OpenJDK11U-jre_x64_mac_openj9_11.0.5_10_openj9-0.17.0.tar.gz",
|
||||
"version": "11.0.5"
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -122,56 +122,56 @@
|
||||
"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"
|
||||
},
|
||||
"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": "9",
|
||||
"sha256": "7b7884f2eb2ba2d47f4c0bf3bb1a2a95b73a3a7734bd47ebf9798483a7bcc423",
|
||||
"url": "https://github.com/AdoptOpenJDK/openjdk8-binaries/releases/download/jdk8u232-b09/OpenJDK8U-jdk_x64_linux_hotspot_8u232b09.tar.gz",
|
||||
"version": "8.0.232"
|
||||
}
|
||||
},
|
||||
"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": "9",
|
||||
"sha256": "abea758c7e102f3c4a3be8757ee0ce039a70e2d498c160400dfb83c6f7004dbf",
|
||||
"url": "https://github.com/AdoptOpenJDK/openjdk8-binaries/releases/download/jdk8u232-b09_openj9-0.17.0/OpenJDK8U-jdk_x64_linux_openj9_8u232b09_openj9-0.17.0.tar.gz",
|
||||
"version": "8.0.232"
|
||||
}
|
||||
}
|
||||
},
|
||||
"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"
|
||||
},
|
||||
"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": "9",
|
||||
"sha256": "bd06b84a1fc10e0a555431bc49a84e86df45de0be93c8ee4d09d13513219843b",
|
||||
"url": "https://github.com/AdoptOpenJDK/openjdk8-binaries/releases/download/jdk8u232-b09/OpenJDK8U-jre_x64_linux_hotspot_8u232b09.tar.gz",
|
||||
"version": "8.0.232"
|
||||
}
|
||||
},
|
||||
"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": "9",
|
||||
"sha256": "30bdfdb38901d4807d96a72a33b83f7a4f40255e11a88853c1e8732acc4644a7",
|
||||
"url": "https://github.com/AdoptOpenJDK/openjdk8-binaries/releases/download/jdk8u232-b09_openj9-0.17.0/OpenJDK8U-jre_x64_linux_openj9_8u232b09_openj9-0.17.0.tar.gz",
|
||||
"version": "8.0.232"
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -182,20 +182,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": "9",
|
||||
"sha256": "c237b2c2c32c893e4ee60cdac8c4bcc34ca731a5445986c03b95cf79918e40c3",
|
||||
"url": "https://github.com/AdoptOpenJDK/openjdk8-binaries/releases/download/jdk8u232-b09/OpenJDK8U-jdk_x64_mac_hotspot_8u232b09.tar.gz",
|
||||
"version": "8.0.232"
|
||||
}
|
||||
},
|
||||
"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": "9",
|
||||
"sha256": "168079dcc20f62ac4409800c78d23a63ba7c665e58cd7ac8bde21ebbbb2b6d48",
|
||||
"url": "https://github.com/AdoptOpenJDK/openjdk8-binaries/releases/download/jdk8u232-b09.1_openj9-0.17.0/OpenJDK8U-jdk_x64_mac_openj9_8u232b09_openj9-0.17.0.tar.gz",
|
||||
"version": "8.0.232"
|
||||
}
|
||||
}
|
||||
},
|
||||
@@ -204,20 +204,20 @@
|
||||
"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": "9",
|
||||
"sha256": "5ec5f11dbc81ab65641b765e1ef2f924736c0d1cc797cb95b078598d9d863afd",
|
||||
"url": "https://github.com/AdoptOpenJDK/openjdk8-binaries/releases/download/jdk8u232-b09/OpenJDK8U-jre_x64_mac_hotspot_8u232b09.tar.gz",
|
||||
"version": "8.0.232"
|
||||
}
|
||||
},
|
||||
"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": "9",
|
||||
"sha256": "60b70aa16c8ca38b96c305003f3d9871897555d0b4039b8e1f8db9ceeab16d53",
|
||||
"url": "https://github.com/AdoptOpenJDK/openjdk8-binaries/releases/download/jdk8u232-b09.1_openj9-0.17.0/OpenJDK8U-jre_x64_mac_openj9_8u232b09_openj9-0.17.0.tar.gz",
|
||||
"version": "8.0.232"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
55
pkgs/development/compilers/bs-platform/bs-platform-62.nix
Normal file
55
pkgs/development/compilers/bs-platform/bs-platform-62.nix
Normal file
@@ -0,0 +1,55 @@
|
||||
{ stdenv, fetchFromGitHub, ninja, nodejs, python3 }:
|
||||
let
|
||||
version = "6.2.1";
|
||||
ocaml-version = "4.06.1";
|
||||
src = fetchFromGitHub {
|
||||
owner = "BuckleScript";
|
||||
repo = "bucklescript";
|
||||
rev = "${version}";
|
||||
sha256 = "0zx9nq7cik0c60n3rndqfqy3vdbj5lcrx6zcqcz2d60jjxi1z32y";
|
||||
fetchSubmodules = true;
|
||||
};
|
||||
ocaml = import ./ocaml.nix {
|
||||
bs-version = version;
|
||||
version = ocaml-version;
|
||||
inherit stdenv;
|
||||
src = "${src}/ocaml";
|
||||
};
|
||||
in
|
||||
stdenv.mkDerivation {
|
||||
inherit src version;
|
||||
pname = "bs-platform";
|
||||
BS_RELEASE_BUILD = "true";
|
||||
buildInputs = [ nodejs python3 ];
|
||||
|
||||
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 ${ninja}/bin/ninja vendor/ninja/snapshot/ninja.linux
|
||||
'';
|
||||
|
||||
configurePhase = ''
|
||||
node scripts/ninja.js config
|
||||
'';
|
||||
|
||||
buildPhase = ''
|
||||
node scripts/ninja.js build
|
||||
'';
|
||||
|
||||
installPhase = ''
|
||||
node scripts/install.js
|
||||
|
||||
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
|
||||
'';
|
||||
}
|
||||
15
pkgs/development/compilers/bs-platform/default.nix
Normal file
15
pkgs/development/compilers/bs-platform/default.nix
Normal file
@@ -0,0 +1,15 @@
|
||||
{ stdenv, fetchFromGitHub, ninja, nodejs, python3, ... }:
|
||||
let
|
||||
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 ];
|
||||
platforms = platforms.all;
|
||||
};
|
||||
in
|
||||
{
|
||||
bs-platform-621 = import ./bs-platform-62.nix {
|
||||
inherit stdenv fetchFromGitHub ninja nodejs python3;
|
||||
} // { inherit meta; };
|
||||
}
|
||||
16
pkgs/development/compilers/bs-platform/ocaml.nix
Normal file
16
pkgs/development/compilers/bs-platform/ocaml.nix
Normal file
@@ -0,0 +1,16 @@
|
||||
{ stdenv, src, version, bs-version }:
|
||||
stdenv.mkDerivation rec {
|
||||
inherit src version;
|
||||
name = "ocaml-${version}+bs-${bs-version}";
|
||||
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;
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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 @@
|
||||
{ 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
|
||||
, 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
|
||||
@@ -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_1_0_2
|
||||
] ++ 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,6 +56,8 @@ let
|
||||
inherit sha256;
|
||||
};
|
||||
|
||||
outputs = [ "out" "lib" "bin" ];
|
||||
|
||||
# we are almost able to run the full test suite now
|
||||
postPatch = ''
|
||||
substituteInPlace src/crystal/system/unix/time.cr \
|
||||
@@ -72,14 +80,9 @@ let
|
||||
--replace '`hostname`' '`${nettools}/bin/hostname`'
|
||||
'';
|
||||
|
||||
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 +94,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 +127,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,7 +159,7 @@ let
|
||||
maintainers = with maintainers; [ manveru david50407 peterhoeg ];
|
||||
platforms = builtins.attrNames archs;
|
||||
};
|
||||
}; in compiler;
|
||||
}));
|
||||
|
||||
in rec {
|
||||
binaryCrystal_0_26 = genericBinary {
|
||||
@@ -212,7 +224,22 @@ 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 = crystal_0_30;
|
||||
};
|
||||
|
||||
crystal_0_32 = generic {
|
||||
version = "255bfc5fa925b95b72e34b26ad997fb2b3f83059";
|
||||
sha256 = "1dgk36cj5lwhs1c4zp0s1c9hjk0h3vljq6zwhlnzkl1xs7cgzim1";
|
||||
doCheck = false; # 5 checks are failing now
|
||||
binary = crystal_0_31;
|
||||
extraBuildInputs = [ readline ];
|
||||
};
|
||||
|
||||
crystal = crystal_0_31;
|
||||
|
||||
crystal2nix = callPackage ./crystal2nix.nix {};
|
||||
}
|
||||
|
||||
220
pkgs/development/compilers/cudatoolkit/common.nix
Normal file
220
pkgs/development/compilers/cudatoolkit/common.nix
Normal file
@@ -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,15 @@
|
||||
{ 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
|
||||
, gcc49
|
||||
, gcc5
|
||||
, 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";
|
||||
@@ -302,5 +121,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;
|
||||
}
|
||||
|
||||
@@ -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
|
||||
};
|
||||
15
pkgs/development/compilers/ecl/libffi-3.3-abi.patch
Normal file
15
pkgs/development/compilers/ecl/libffi-3.3-abi.patch
Normal file
@@ -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
|
||||
};
|
||||
@@ -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.18";
|
||||
|
||||
src = fetchurl {
|
||||
url = "https://flatassembler.net/fasm-${version}.tgz";
|
||||
sha256 = "1jaqm7w458ny37fsw3fln17kw31rcsk8kyadci45qcbw6jspmn7k";
|
||||
sha256 = "0m88vi8ac9mlak430nyrg3nxsj0fzy3yli8kk0mqsw8rqw2pfvqb";
|
||||
};
|
||||
|
||||
installPhase = ''
|
||||
|
||||
@@ -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,98 +178,47 @@ 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;
|
||||
@@ -366,24 +261,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,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.9.4";
|
||||
let majorVersion = "4";
|
||||
version = "${majorVersion}.9.4";
|
||||
|
||||
inherit (stdenv) buildPlatform hostPlatform targetPlatform;
|
||||
|
||||
@@ -101,72 +107,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 +116,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,102 +184,47 @@ 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;
|
||||
@@ -379,24 +267,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
|
||||
@@ -45,10 +47,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 = "5.5.0";
|
||||
let majorVersion = "5";
|
||||
version = "${majorVersion}.5.0";
|
||||
|
||||
inherit (stdenv) buildPlatform hostPlatform targetPlatform;
|
||||
|
||||
@@ -61,6 +67,10 @@ let version = "5.5.0";
|
||||
++ 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";
|
||||
})
|
||||
++ 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 = "074bl5n27d1ksa31pvzj4vd8xd46r118k0w94gdv3s1vydg7mah0";
|
||||
});
|
||||
|
||||
javaEcj = fetchurl {
|
||||
@@ -88,72 +98,8 @@ let version = "5.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"
|
||||
]
|
||||
++ 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
|
||||
|
||||
@@ -161,7 +107,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;
|
||||
|
||||
@@ -247,101 +194,48 @@ 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 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;
|
||||
@@ -384,24 +278,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;
|
||||
|
||||
@@ -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,104 +202,48 @@ 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;
|
||||
@@ -391,24 +286,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;
|
||||
|
||||
@@ -17,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
|
||||
@@ -35,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;
|
||||
|
||||
@@ -59,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;
|
||||
@@ -228,91 +171,50 @@ 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
|
||||
[
|
||||
(if enableLTO then "--enable-lto" else "--disable-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;
|
||||
@@ -342,24 +244,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
|
||||
@@ -17,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
|
||||
@@ -35,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;
|
||||
|
||||
@@ -51,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;
|
||||
|
||||
@@ -219,88 +163,47 @@ 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
|
||||
[
|
||||
(if enableLTO then "--enable-lto" else "--disable-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;
|
||||
@@ -328,24 +231,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 = "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,88 +162,47 @@ 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;
|
||||
@@ -326,24 +230,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;
|
||||
|
||||
174
pkgs/development/compilers/gcc/common/configure-flags.nix
Normal file
174
pkgs/development/compilers/gcc/common/configure-flags.nix
Normal file
@@ -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.optional (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
|
||||
30
pkgs/development/compilers/gcc/common/extra-target-flags.nix
Normal file
30
pkgs/development/compilers/gcc/common/extra-target-flags.nix
Normal file
@@ -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"
|
||||
12
pkgs/development/compilers/gcc/common/pre-configure.nix
Normal file
12
pkgs/development/compilers/gcc/common/pre-configure.nix
Normal file
@@ -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,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
|
||||
@@ -35,10 +37,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-20170409";
|
||||
let majorVersion = "7";
|
||||
version = "${majorVersion}-20170409";
|
||||
|
||||
inherit (stdenv) buildPlatform hostPlatform targetPlatform;
|
||||
|
||||
@@ -46,81 +52,22 @@ let version = "7-20170409";
|
||||
[ ]
|
||||
++ optional (targetPlatform != hostPlatform) ../libstdc++-target.patch
|
||||
++ optional noSysDirs ../no-sys-dirs.patch
|
||||
++ optional langFortran ../gfortran-driving.patch;
|
||||
++ optional langFortran ../gfortran-driving.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=${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;
|
||||
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;
|
||||
|
||||
@@ -182,84 +129,48 @@ 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
|
||||
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.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"
|
||||
]
|
||||
;
|
||||
langC
|
||||
langCC
|
||||
langFortran
|
||||
langGo
|
||||
langObjC
|
||||
langObjCpp
|
||||
;
|
||||
};
|
||||
|
||||
targetConfig = if targetPlatform != hostPlatform then targetPlatform.config else null;
|
||||
|
||||
buildFlags = if bootstrap then
|
||||
(if profiledCompiler then "profiledbootstrap" else "bootstrap")
|
||||
else "";
|
||||
buildFlags = optional
|
||||
(targetPlatform == hostPlatform && hostPlatform == buildPlatform)
|
||||
(if profiledCompiler then "profiledbootstrap" else "bootstrap");
|
||||
|
||||
dontStrip = !stripped;
|
||||
NIX_STRIP_DEBUG = !stripped;
|
||||
@@ -287,24 +198,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,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-2019-11-15";
|
||||
git-version = "0.15.1-461-gee22de62";
|
||||
#gambit = gambit-unstable;
|
||||
gambit = gambit;
|
||||
src = fetchFromGitHub {
|
||||
owner = "vyzo";
|
||||
repo = "gerbil";
|
||||
rev = "cb58f9a30630a6f3e85a55f2c1dcc654f517ffed";
|
||||
sha256 = "18jh64v1gi6z3pks9zf19f2wcjpv21cs270dnaq617kgwp53vysh";
|
||||
rev = "ee22de628a656ee59c6c72bc25d7b2e25a4ece2f";
|
||||
sha256 = "1n1j596b91k9xcmv22l72nga6wv20bka2q51ik2jw2vkcw8zkc1c";
|
||||
};
|
||||
inherit stdenv;
|
||||
}
|
||||
|
||||
@@ -126,7 +126,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 (targetPlatform.isLinux && !(targetPlatform.useLLVM or false)) ".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"
|
||||
|
||||
@@ -125,7 +125,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 (targetPlatform.isLinux && !(targetPlatform.useLLVM or false)) ".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"
|
||||
|
||||
@@ -110,7 +110,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 (targetPlatform.isLinux && !(targetPlatform.useLLVM or false)) ".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"
|
||||
|
||||
@@ -2,11 +2,14 @@
|
||||
|
||||
# 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
|
||||
|
||||
, enableDwarf ? !stdenv.targetPlatform.isDarwin &&
|
||||
!stdenv.targetPlatform.isWindows, elfutils # for DWARF support
|
||||
|
||||
, 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
|
||||
@@ -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)
|
||||
@@ -73,7 +76,8 @@ let
|
||||
# Splicer will pull out correct variations
|
||||
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
|
||||
@@ -89,8 +93,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 +102,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 +117,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 (targetPlatform.isLinux && !(targetPlatform.useLLVM or false)) ".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"
|
||||
@@ -176,13 +173,17 @@ stdenv.mkDerivation (rec {
|
||||
"CONF_GCC_LINKER_OPTS_STAGE2=-fuse-ld=gold"
|
||||
] ++ stdenv.lib.optionals (disableLargeAddressSpace) [
|
||||
"--disable-large-address-space"
|
||||
] ++ stdenv.lib.optional 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
|
||||
|
||||
24
pkgs/development/compilers/gleam/default.nix
Normal file
24
pkgs/development/compilers/gleam/default.nix
Normal file
@@ -0,0 +1,24 @@
|
||||
{ stdenv, rustPlatform, fetchFromGitHub, Security }:
|
||||
|
||||
rustPlatform.buildRustPackage rec {
|
||||
pname = "gleam";
|
||||
version = "0.5.0";
|
||||
|
||||
src = fetchFromGitHub {
|
||||
owner = "lpil";
|
||||
repo = pname;
|
||||
rev = "v${version}";
|
||||
sha256 = "17h573fm5b1f71ivyipl76p0vw7injm7j3cbg6plkfizcb1j5m7f";
|
||||
};
|
||||
|
||||
buildInputs = stdenv.lib.optionals stdenv.isDarwin [ Security ];
|
||||
|
||||
cargoSha256 = "04v1gj5nmmcizyrsg6b87qsfzw2zqi57vf1zlnq8680yc54qdah9";
|
||||
|
||||
meta = with stdenv.lib; {
|
||||
description = "A statically typed language for the Erlang VM";
|
||||
homepage = "https://gleam.run/";
|
||||
license = licenses.asl20;
|
||||
maintainers = with maintainers; [ filalex77 ];
|
||||
};
|
||||
}
|
||||
@@ -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.14.0";
|
||||
|
||||
src = fetchFromGitHub {
|
||||
rev = "v${version}";
|
||||
owner = "google";
|
||||
repo = "go-jsonnet";
|
||||
sha256 = "0x95sqhrw4pscxq0q8781wix0w881k9my5kn5nf6k0fg1d6qlgiy";
|
||||
fetchSubmodules = true;
|
||||
rev = "v${version}";
|
||||
sha256 = "1q0mpydh8h0zrml605q9r259y8584kbwcr9g4sqcb1n13b4d1sgp";
|
||||
};
|
||||
|
||||
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
pkgs/development/compilers/go-jsonnet/deps.nix
generated
48
pkgs/development/compilers/go-jsonnet/deps.nix
generated
@@ -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";
|
||||
};
|
||||
}
|
||||
]
|
||||
@@ -30,11 +30,11 @@ in
|
||||
|
||||
stdenv.mkDerivation rec {
|
||||
pname = "go";
|
||||
version = "1.13.3";
|
||||
version = "1.13.5";
|
||||
|
||||
src = fetchurl {
|
||||
url = "https://dl.google.com/go/go${version}.src.tar.gz";
|
||||
sha256 = "1pz3423gw3z2zwcmk9l2c6v68w5is39gndq7502c9mbm8c226wag";
|
||||
sha256 = "1zr6lravlmyld57nnymkcr092pys4pr8qy0ans1rj3dkl3i5dlr7";
|
||||
};
|
||||
|
||||
# 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 ''
|
||||
|
||||
@@ -61,7 +61,9 @@ stdenv.mkDerivation rec {
|
||||
|
||||
sed -i 's,/etc/protocols,${iana-etc}/etc/protocols,' src/net/lookup_unix.go
|
||||
'' + lib.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
|
||||
|
||||
# Find the loader dynamically
|
||||
LOADER="$(find ${lib.getLib libc}/lib -name ld-linux\* | head -n 1)"
|
||||
|
||||
@@ -270,7 +270,7 @@ in rec {
|
||||
# Set JAVA_HOME automatically.
|
||||
mkdir -p $out/nix-support
|
||||
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
|
||||
'';
|
||||
postFixup = openjdk.postFixup or null;
|
||||
@@ -293,7 +293,7 @@ in rec {
|
||||
# gfortran readline bzip2 lzma pcre.dev curl ed ## WIP: fastr dependencies
|
||||
];
|
||||
postUnpack = ''
|
||||
cp ${stdenv.cc.cc}/include/c++/${stdenv.cc.cc.version}/stdlib.h \
|
||||
cp ${stdenv.cc.cc}/include/c++/${lib.getVersion stdenv.cc.cc}/stdlib.h \
|
||||
$sourceRoot/sulong/projects/com.oracle.truffle.llvm.libraries.bitcode/include
|
||||
cp ${truffleMake} $TMP && mv *truffle.make truffle.make
|
||||
rm $sourceRoot/truffle/src/libffi/patches/others/0001-Add-mx-bootstrap-Makefile.patch
|
||||
@@ -318,7 +318,7 @@ in rec {
|
||||
--replace 'protected String compilerCommand = "cc";' 'protected String compilerCommand = "${stdenv.cc}/bin/cc";'
|
||||
# prevent cyclical imports caused by identical <include> names
|
||||
substituteInPlace sulong/projects/com.oracle.truffle.llvm.libraries.bitcode/include/stdlib.h \
|
||||
--replace '# include <cstdlib>' '# include "${stdenv.cc.cc}/include/c++/${stdenv.cc.cc.version}/cstdlib"'
|
||||
--replace '# include <cstdlib>' '# include "${stdenv.cc.cc}/include/c++/${lib.getVersion stdenv.cc.cc}/cstdlib"'
|
||||
# dragonegg can't seem to compile on nix, so let's not require it
|
||||
substituteInPlace sulong/mx.sulong/suite.py \
|
||||
--replace '"requireDragonegg" : True,' '"requireDragonegg" : False,'
|
||||
|
||||
@@ -72,7 +72,7 @@ let
|
||||
# Set JAVA_HOME automatically.
|
||||
mkdir -p $out/nix-support
|
||||
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
|
||||
'';
|
||||
|
||||
|
||||
@@ -24,13 +24,13 @@ in
|
||||
|
||||
stdenv.mkDerivation rec {
|
||||
pname = "intel-graphics-compiler";
|
||||
version = "1.0.10";
|
||||
version = "1.0.2878";
|
||||
|
||||
src = fetchFromGitHub {
|
||||
owner = "intel";
|
||||
repo = "intel-graphics-compiler";
|
||||
rev = "igc-${version}";
|
||||
sha256 = "1yqd2zvvvxxxzb5d3v0f03n0jdivid5l2cj11dw7ff7xz7jwiv2i";
|
||||
sha256 = "0rgij1013fy2x2szfchy3z6390mjfqw3nz4zprcb5v2v6mpvcj4l";
|
||||
};
|
||||
|
||||
nativeBuildInputs = [ clang cmake bison flex llvm python ];
|
||||
|
||||
44
pkgs/development/compilers/jasmin/default.nix
Normal file
44
pkgs/development/compilers/jasmin/default.nix
Normal file
@@ -0,0 +1,44 @@
|
||||
{ stdenv
|
||||
, fetchurl
|
||||
, unzip
|
||||
, jdk
|
||||
, ant
|
||||
, makeWrapper
|
||||
, jre
|
||||
, callPackage
|
||||
}:
|
||||
|
||||
stdenv.mkDerivation rec {
|
||||
pname = "jasmin";
|
||||
version = "2.4";
|
||||
|
||||
src = fetchurl {
|
||||
url = "mirror://sourceforge/jasmin/jasmin-${version}/jasmin-${version}.zip";
|
||||
sha256 = "17a41vr96glcdrdbk88805wwvv1r6w8wg7if23yhd0n6rrl0r8ga";
|
||||
};
|
||||
|
||||
nativeBuildInputs = [ unzip jdk ant makeWrapper ];
|
||||
|
||||
buildPhase = "ant all";
|
||||
installPhase =
|
||||
''
|
||||
install -Dm644 jasmin.jar $out/share/java/jasmin.jar
|
||||
mkdir -p $out/bin
|
||||
makeWrapper ${jre}/bin/java $out/bin/jasmin \
|
||||
--add-flags "-jar $out/share/java/jasmin.jar"
|
||||
'';
|
||||
|
||||
passthru.tests = {
|
||||
minimal-module = callPackage ./test-assemble-hello-world {};
|
||||
};
|
||||
|
||||
meta = with stdenv.lib; {
|
||||
description = "An assembler for the Java Virtual Machine";
|
||||
homepage = "http://jasmin.sourceforge.net/";
|
||||
downloadPage = "https://sourceforge.net/projects/jasmin/files/latest/download";
|
||||
license = licenses.bsd3;
|
||||
maintainers = with maintainers; [ fgaz ];
|
||||
platforms = platforms.all;
|
||||
};
|
||||
}
|
||||
|
||||
@@ -0,0 +1,31 @@
|
||||
.class public HelloWorld
|
||||
.super java/lang/Object
|
||||
|
||||
;
|
||||
; standard initializer (calls java.lang.Object's initializer)
|
||||
;
|
||||
.method public <init>()V
|
||||
aload_0
|
||||
invokenonvirtual java/lang/Object/<init>()V
|
||||
return
|
||||
.end method
|
||||
|
||||
;
|
||||
; main() - prints out Hello World
|
||||
;
|
||||
.method public static main([Ljava/lang/String;)V
|
||||
.limit stack 2 ; up to two items can be pushed
|
||||
|
||||
; push System.out onto the stack
|
||||
getstatic java/lang/System/out Ljava/io/PrintStream;
|
||||
|
||||
; push a string onto the stack
|
||||
ldc "Hello World!"
|
||||
|
||||
; call the PrintStream.println() method.
|
||||
invokevirtual java/io/PrintStream/println(Ljava/lang/String;)V
|
||||
|
||||
; done
|
||||
return
|
||||
.end method
|
||||
|
||||
@@ -0,0 +1,12 @@
|
||||
{ stdenv, jasmin, jre }:
|
||||
|
||||
stdenv.mkDerivation {
|
||||
name = "jasmin-test-assemble-hello-world";
|
||||
meta.timeout = 60;
|
||||
buildCommand = ''
|
||||
${jasmin}/bin/jasmin ${./HelloWorld.j}
|
||||
${jre}/bin/java HelloWorld | grep "Hello World"
|
||||
touch $out
|
||||
'';
|
||||
}
|
||||
|
||||
@@ -1,14 +1,14 @@
|
||||
{ stdenv, fetchurl, makeWrapper, jre, unzip }:
|
||||
|
||||
let
|
||||
version = "1.3.50";
|
||||
version = "1.3.61";
|
||||
in stdenv.mkDerivation {
|
||||
inherit version;
|
||||
pname = "kotlin";
|
||||
|
||||
src = fetchurl {
|
||||
url = "https://github.com/JetBrains/kotlin/releases/download/v${version}/kotlin-compiler-${version}.zip";
|
||||
sha256 = "1v66pnk810agf26khwdv7l8jpc11x6na5fyqxs9jvxdpls8l0hk9";
|
||||
sha256 = "073vb402b03llscgr298iih5lc3y1dn1qxyid2i9hiyrsld1a09r";
|
||||
};
|
||||
|
||||
propagatedBuildInputs = [ jre ] ;
|
||||
|
||||
@@ -6,7 +6,8 @@
|
||||
let
|
||||
gcc = if stdenv.cc.isGNU then stdenv.cc.cc else stdenv.cc.cc.gcc;
|
||||
self = stdenv.mkDerivation ({
|
||||
name = "clang-${version}";
|
||||
pname = "clang";
|
||||
inherit version;
|
||||
|
||||
src = fetch "cfe" "16vnv3msnvx33dydd17k2cq0icndi1a06bg5vcxkrhjjb1rqlwv1";
|
||||
|
||||
@@ -91,7 +92,7 @@ let
|
||||
platforms = stdenv.lib.platforms.all;
|
||||
};
|
||||
} // stdenv.lib.optionalAttrs enableManpages {
|
||||
name = "clang-manpages-${version}";
|
||||
pname = "clang-manpages";
|
||||
|
||||
buildPhase = ''
|
||||
make docs-clang-man
|
||||
|
||||
@@ -24,7 +24,8 @@ let
|
||||
in
|
||||
|
||||
stdenv.mkDerivation ({
|
||||
name = "llvm-${version}";
|
||||
pname = "llvm";
|
||||
inherit version;
|
||||
|
||||
src = fetch "llvm" "0l9bf7kdwhlj0kq1hawpyxhna1062z3h7qcz2y8nfl9dz2qksy6s";
|
||||
|
||||
@@ -173,7 +174,7 @@ stdenv.mkDerivation ({
|
||||
platforms = stdenv.lib.platforms.all;
|
||||
};
|
||||
} // stdenv.lib.optionalAttrs enableManpages {
|
||||
name = "llvm-manpages-${version}";
|
||||
pname = "llvm-manpages";
|
||||
|
||||
buildPhase = ''
|
||||
make docs-llvm-man
|
||||
|
||||
@@ -6,7 +6,8 @@
|
||||
let
|
||||
gcc = if stdenv.cc.isGNU then stdenv.cc.cc else stdenv.cc.cc.gcc;
|
||||
self = stdenv.mkDerivation ({
|
||||
name = "clang-${version}";
|
||||
pname = "clang";
|
||||
inherit version;
|
||||
|
||||
src = fetch "cfe" "0018520c4qxf5hgjdqgpz2dgl3faf4gsz87fdlb8zdmx99rfk77s";
|
||||
|
||||
@@ -87,7 +88,7 @@ let
|
||||
platforms = stdenv.lib.platforms.all;
|
||||
};
|
||||
} // stdenv.lib.optionalAttrs enableManpages {
|
||||
name = "clang-manpages-${version}";
|
||||
pname = "clang-manpages";
|
||||
|
||||
buildPhase = ''
|
||||
make docs-clang-man
|
||||
|
||||
@@ -23,7 +23,8 @@ let
|
||||
in
|
||||
|
||||
stdenv.mkDerivation ({
|
||||
name = "llvm-${version}";
|
||||
pname = "llvm";
|
||||
inherit version;
|
||||
|
||||
src = fetch "llvm" "0g1bbj2n6xv4p1n6hh17vj3vpvg56wacipc81dgwga9mg2lys8nm";
|
||||
|
||||
@@ -156,7 +157,7 @@ stdenv.mkDerivation ({
|
||||
platforms = stdenv.lib.platforms.all;
|
||||
};
|
||||
} // stdenv.lib.optionalAttrs enableManpages {
|
||||
name = "llvm-manpages-${version}";
|
||||
pname = "llvm-manpages";
|
||||
|
||||
buildPhase = ''
|
||||
make docs-llvm-man
|
||||
|
||||
@@ -6,7 +6,8 @@
|
||||
let
|
||||
gcc = if stdenv.cc.isGNU then stdenv.cc.cc else stdenv.cc.cc.gcc;
|
||||
self = stdenv.mkDerivation ({
|
||||
name = "clang-${version}";
|
||||
pname = "clang";
|
||||
inherit version;
|
||||
|
||||
src = fetch "cfe" "0rxn4rh7rrnsqbdgp4gzc8ishbkryhpl1kd3mpnxzpxxhla3y93w";
|
||||
|
||||
@@ -87,7 +88,7 @@ let
|
||||
platforms = stdenv.lib.platforms.all;
|
||||
};
|
||||
} // stdenv.lib.optionalAttrs enableManpages {
|
||||
name = "clang-manpages-${version}";
|
||||
pname = "clang-manpages";
|
||||
|
||||
buildPhase = ''
|
||||
make docs-clang-man
|
||||
|
||||
@@ -26,7 +26,8 @@ let
|
||||
in
|
||||
|
||||
stdenv.mkDerivation ({
|
||||
name = "llvm-${version}";
|
||||
pname = "llvm";
|
||||
inherit version;
|
||||
|
||||
src = fetch "llvm" "1qpls3vk85lydi5b4axl0809fv932qgsqgdgrk098567z4jc7mmn";
|
||||
|
||||
@@ -154,7 +155,7 @@ stdenv.mkDerivation ({
|
||||
platforms = stdenv.lib.platforms.all;
|
||||
};
|
||||
} // stdenv.lib.optionalAttrs enableManpages {
|
||||
name = "llvm-manpages-${version}";
|
||||
pname = "llvm-manpages";
|
||||
|
||||
buildPhase = ''
|
||||
make docs-llvm-man
|
||||
|
||||
@@ -6,7 +6,8 @@
|
||||
|
||||
let
|
||||
self = stdenv.mkDerivation ({
|
||||
name = "clang-${version}";
|
||||
pname = "clang";
|
||||
inherit version;
|
||||
|
||||
src = fetch "cfe" "0vc4i87qwxnw9lci4ayws9spakg0z6w5w670snj9f8g5m9rc8zg9";
|
||||
|
||||
@@ -93,7 +94,7 @@ let
|
||||
platforms = stdenv.lib.platforms.all;
|
||||
};
|
||||
} // stdenv.lib.optionalAttrs enableManpages {
|
||||
name = "clang-manpages-${version}";
|
||||
pname = "clang-manpages";
|
||||
|
||||
buildPhase = ''
|
||||
make docs-clang-man
|
||||
|
||||
@@ -7,6 +7,10 @@ stdenv.mkDerivation {
|
||||
nativeBuildInputs = [ cmake python llvm ];
|
||||
buildInputs = stdenv.lib.optional stdenv.hostPlatform.isDarwin libcxxabi;
|
||||
|
||||
NIX_CFLAGS_COMPILE = [
|
||||
"-DSCUDO_DEFAULT_OPTIONS=DeleteSizeMismatch=0:DeallocationTypeMismatch=0"
|
||||
];
|
||||
|
||||
cmakeFlags = stdenv.lib.optionals (stdenv.hostPlatform.useLLVM or false || stdenv.isDarwin) [
|
||||
"-DCOMPILER_RT_DEFAULT_TARGET_ONLY=ON"
|
||||
"-DCMAKE_C_COMPILER_TARGET=${stdenv.hostPlatform.config}"
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
{ lib, stdenv, fetch, cmake, python, libcxxabi, fixDarwinDylibNames, version }:
|
||||
{ lib, stdenv, fetch, cmake, python, libcxxabi, fixDarwinDylibNames, version
|
||||
, enableShared ? ! stdenv.hostPlatform.isMusl }:
|
||||
|
||||
stdenv.mkDerivation {
|
||||
pname = "libc++";
|
||||
@@ -31,7 +32,8 @@ stdenv.mkDerivation {
|
||||
"-DLIBCXX_LIBCXXABI_LIB_PATH=${libcxxabi}/lib"
|
||||
"-DLIBCXX_LIBCPPABI_VERSION=2"
|
||||
"-DLIBCXX_CXX_ABI=libcxxabi"
|
||||
] ++ stdenv.lib.optional stdenv.hostPlatform.isMusl "-DLIBCXX_HAS_MUSL_LIBC=1";
|
||||
] ++ stdenv.lib.optional stdenv.hostPlatform.isMusl "-DLIBCXX_HAS_MUSL_LIBC=1"
|
||||
++ stdenv.lib.optional (!enableShared) "-DLIBCXX_ENABLE_SHARED=OFF" ;
|
||||
|
||||
enableParallelBuilding = true;
|
||||
|
||||
|
||||
@@ -1,4 +1,6 @@
|
||||
{ stdenv, cmake, fetch, libcxx, llvm, version }:
|
||||
{ stdenv, cmake, fetch, libcxx, llvm, version
|
||||
# on musl the shared objects don't build
|
||||
, enableShared ? ! stdenv.hostPlatform.isMusl }:
|
||||
|
||||
stdenv.mkDerivation {
|
||||
pname = "libc++abi";
|
||||
@@ -11,13 +13,15 @@ stdenv.mkDerivation {
|
||||
postUnpack = ''
|
||||
unpackFile ${libcxx.src}
|
||||
unpackFile ${llvm.src}
|
||||
export cmakeFlags="-DLLVM_PATH=$PWD/$(ls -d llvm-*) -DLIBCXXABI_LIBCXX_PATH=$PWD/$(ls -d libcxx-*)"
|
||||
cmakeFlagsArray=($cmakeFlagsArray -DLLVM_PATH=$PWD/$(ls -d llvm-*) -DLIBCXXABI_LIBCXX_PATH=$PWD/$(ls -d libcxx-*) )
|
||||
'' + stdenv.lib.optionalString stdenv.isDarwin ''
|
||||
export TRIPLE=x86_64-apple-darwin
|
||||
'' + stdenv.lib.optionalString stdenv.hostPlatform.isMusl ''
|
||||
patch -p1 -d $(ls -d libcxx-*) -i ${../libcxx-0001-musl-hacks.patch}
|
||||
'';
|
||||
|
||||
cmakeFlags = stdenv.lib.optional (!enableShared) "-DLIBCXXABI_ENABLE_SHARED=OFF";
|
||||
|
||||
installPhase = if stdenv.isDarwin
|
||||
then ''
|
||||
for file in lib/*.dylib; do
|
||||
@@ -34,10 +38,10 @@ stdenv.mkDerivation {
|
||||
else ''
|
||||
install -d -m 755 $out/include $out/lib
|
||||
install -m 644 lib/libc++abi.a $out/lib
|
||||
install -m 644 lib/libc++abi.so.1.0 $out/lib
|
||||
${stdenv.lib.optionalString enableShared "install -m 644 lib/libc++abi.so.1.0 $out/lib"}
|
||||
install -m 644 ../include/cxxabi.h $out/include
|
||||
ln -s libc++abi.so.1.0 $out/lib/libc++abi.so
|
||||
ln -s libc++abi.so.1.0 $out/lib/libc++abi.so.1
|
||||
${stdenv.lib.optionalString enableShared "ln -s libc++abi.so.1.0 $out/lib/libc++abi.so"}
|
||||
${stdenv.lib.optionalString enableShared "ln -s libc++abi.so.1.0 $out/lib/libc++abi.so.1"}
|
||||
'';
|
||||
|
||||
meta = {
|
||||
|
||||
@@ -30,7 +30,8 @@ let
|
||||
imap (i: _: concatStringsSep "." (take i parts)) parts;
|
||||
|
||||
in stdenv.mkDerivation ({
|
||||
name = "llvm-${version}";
|
||||
pname = "llvm";
|
||||
inherit version;
|
||||
|
||||
src = fetch "llvm" "0r1p5didv4rkgxyvbkyz671xddg6i3dxvbpsi1xxipkla0l9pk0v";
|
||||
polly_src = fetch "polly" "16qkns4ab4x0azrvhy4j7cncbyb2rrbdrqj87zphvqxm5pvm8m1h";
|
||||
@@ -94,6 +95,9 @@ in stdenv.mkDerivation ({
|
||||
rm test/tools/llvm-dwarfdump/X86/debug_addr_dwarf4.s
|
||||
rm test/tools/llvm-dwarfdump/X86/debug_addr_unsupported_version.s
|
||||
rm test/tools/llvm-dwarfdump/X86/debug_addr_version_mismatch.s
|
||||
'' + optionalString (stdenv.hostPlatform.system == "armv6l-linux") ''
|
||||
# Seems to require certain floating point hardware (NEON?)
|
||||
rm test/ExecutionEngine/frem.ll
|
||||
'' + ''
|
||||
patchShebangs test/BugPoint/compile-custom.ll.py
|
||||
'';
|
||||
@@ -172,7 +176,7 @@ in stdenv.mkDerivation ({
|
||||
platforms = stdenv.lib.platforms.all;
|
||||
};
|
||||
} // stdenv.lib.optionalAttrs enableManpages {
|
||||
name = "llvm-manpages-${version}";
|
||||
pname = "llvm-manpages";
|
||||
|
||||
buildPhase = ''
|
||||
make docs-llvm-man
|
||||
|
||||
@@ -6,7 +6,8 @@
|
||||
|
||||
let
|
||||
self = stdenv.mkDerivation ({
|
||||
name = "clang-${version}";
|
||||
pname = "clang";
|
||||
inherit version;
|
||||
|
||||
src = fetch "cfe" "0ihnbdl058gvl2wdy45p5am55bq8ifx8m9mhcsgj9ax8yxlzvvvh";
|
||||
|
||||
@@ -105,7 +106,7 @@ let
|
||||
platforms = stdenv.lib.platforms.all;
|
||||
};
|
||||
} // stdenv.lib.optionalAttrs enableManpages {
|
||||
name = "clang-manpages-${version}";
|
||||
pname = "clang-manpages";
|
||||
|
||||
buildPhase = ''
|
||||
make docs-clang-man
|
||||
|
||||
@@ -7,6 +7,10 @@ stdenv.mkDerivation {
|
||||
nativeBuildInputs = [ cmake python llvm ];
|
||||
buildInputs = stdenv.lib.optional stdenv.hostPlatform.isDarwin libcxxabi;
|
||||
|
||||
NIX_CFLAGS_COMPILE = [
|
||||
"-DSCUDO_DEFAULT_OPTIONS=DeleteSizeMismatch=0:DeallocationTypeMismatch=0"
|
||||
];
|
||||
|
||||
cmakeFlags = stdenv.lib.optionals (stdenv.hostPlatform.useLLVM or false) [
|
||||
"-DCOMPILER_RT_DEFAULT_TARGET_ONLY=ON"
|
||||
"-DCMAKE_C_COMPILER_TARGET=${stdenv.hostPlatform.config}"
|
||||
|
||||
@@ -28,7 +28,8 @@ let
|
||||
concatStringsSep "." (take 1 (splitVersion release_version));
|
||||
|
||||
in stdenv.mkDerivation ({
|
||||
name = "llvm-${version}";
|
||||
pname = "llvm";
|
||||
inherit version;
|
||||
|
||||
src = fetch "llvm" "1rvm5gqp5v8hfn17kqws3zhk94w4kxndal12bqa0y57p09nply24";
|
||||
polly_src = fetch "polly" "1lfjdz3ilj5xmjxvicd8f5ykybks67ry2pdb777352r3mzlgg8g8";
|
||||
@@ -150,7 +151,7 @@ in stdenv.mkDerivation ({
|
||||
platforms = stdenv.lib.platforms.all;
|
||||
};
|
||||
} // stdenv.lib.optionalAttrs enableManpages {
|
||||
name = "llvm-manpages-${version}";
|
||||
pname = "llvm-manpages";
|
||||
|
||||
buildPhase = ''
|
||||
make docs-llvm-man
|
||||
|
||||
@@ -7,6 +7,10 @@ stdenv.mkDerivation rec {
|
||||
nativeBuildInputs = [ cmake python llvm ];
|
||||
buildInputs = stdenv.lib.optional stdenv.hostPlatform.isDarwin libcxxabi;
|
||||
|
||||
NIX_CFLAGS_COMPILE = [
|
||||
"-DSCUDO_DEFAULT_OPTIONS=DeleteSizeMismatch=0:DeallocationTypeMismatch=0"
|
||||
];
|
||||
|
||||
cmakeFlags = stdenv.lib.optionals (stdenv.hostPlatform.useLLVM or false) [
|
||||
"-DCOMPILER_RT_DEFAULT_TARGET_ONLY=ON"
|
||||
"-DCMAKE_C_COMPILER_TARGET=${stdenv.hostPlatform.config}"
|
||||
|
||||
@@ -75,6 +75,15 @@ in stdenv.mkDerivation (rec {
|
||||
rm unittests/Support/DynamicLibrary/DynamicLibraryTest.cpp
|
||||
# valgrind unhappy with musl or glibc, but fails w/musl only
|
||||
rm test/CodeGen/AArch64/wineh4.mir
|
||||
'' + optionalString stdenv.hostPlatform.isAarch32 ''
|
||||
# skip failing X86 test cases on 32-bit ARM
|
||||
rm test/DebugInfo/X86/convert-debugloc.ll
|
||||
rm test/DebugInfo/X86/convert-inlined.ll
|
||||
rm test/DebugInfo/X86/convert-linked.ll
|
||||
rm test/tools/dsymutil/X86/op-convert.test
|
||||
'' + optionalString (stdenv.hostPlatform.system == "armv6l-linux") ''
|
||||
# Seems to require certain floating point hardware (NEON?)
|
||||
rm test/ExecutionEngine/frem.ll
|
||||
'' + ''
|
||||
patchShebangs test/BugPoint/compile-custom.ll.py
|
||||
|
||||
|
||||
@@ -1,15 +1,15 @@
|
||||
{ stdenv, fetchFromGitHub, coreutils, autoreconfHook, smlnj }:
|
||||
|
||||
let
|
||||
rev= "4528ccacdfd53d36f5959c005b27cd7ab6175b83";
|
||||
rev = "7376cb20ba5285a6b076a73c821e4743809c1d9d";
|
||||
in stdenv.mkDerivation {
|
||||
pname = "manticore";
|
||||
version = "2019.09.20";
|
||||
version = "2019.12.03";
|
||||
|
||||
src = fetchFromGitHub {
|
||||
owner = "ManticoreProject";
|
||||
repo = "manticore";
|
||||
sha256 = "1xz7msiq5x2c56zjxydbxlj6r001mm5zszcda6f6v5qfmmd1bakz";
|
||||
sha256 = "17h3ar7d6145dyrm006r3gd5frk3v4apjk383n78dh4vlniv1ay2";
|
||||
inherit rev;
|
||||
};
|
||||
|
||||
|
||||
@@ -2,13 +2,13 @@
|
||||
|
||||
stdenv.mkDerivation rec {
|
||||
pname = "mruby";
|
||||
version = "2.0.1";
|
||||
version = "2.1.0";
|
||||
|
||||
src = fetchFromGitHub {
|
||||
owner = "mruby";
|
||||
repo = "mruby";
|
||||
rev = version;
|
||||
sha256 = "1zm2d5kj9fnfx8ifj8ysrrr838ipwmvz35byzjhprakrg64911p9";
|
||||
sha256 = "1y072c7dh9jf8xwy7kia6cb4dkpspq4zf24ssn7zm5f46p4waxni";
|
||||
};
|
||||
|
||||
nativeBuildInputs = [ ruby bison ];
|
||||
|
||||
@@ -5,11 +5,11 @@
|
||||
|
||||
stdenv.mkDerivation rec {
|
||||
pname = "nim";
|
||||
version = "1.0.2";
|
||||
version = "1.0.4";
|
||||
|
||||
src = fetchurl {
|
||||
url = "https://nim-lang.org/download/${pname}-${version}.tar.xz";
|
||||
sha256 = "1rjinrs119c8i6wzz5fzjfml7n7kbd5hb9642g4rr8qxkq4sx83k";
|
||||
sha256 = "1q5fx9g40bk4ajghi856w5l34fmrl7avq5j6p0dr2xa4l52ib149";
|
||||
};
|
||||
|
||||
enableParallelBuilding = true;
|
||||
|
||||
@@ -12,16 +12,18 @@ in
|
||||
|
||||
{ stdenv, fetchurl, ncurses, buildEnv
|
||||
, libX11, xorgproto, useX11 ? safeX11 stdenv
|
||||
, aflSupport ? false
|
||||
, flambdaSupport ? false
|
||||
}:
|
||||
|
||||
assert useX11 -> !stdenv.isAarch32 && !stdenv.isMips;
|
||||
assert aflSupport -> stdenv.lib.versionAtLeast version "4.05";
|
||||
assert flambdaSupport -> stdenv.lib.versionAtLeast version "4.03";
|
||||
|
||||
let
|
||||
useNativeCompilers = !stdenv.isMips;
|
||||
inherit (stdenv.lib) optional optionals optionalString;
|
||||
name = "ocaml${optionalString flambdaSupport "+flambda"}-${version}";
|
||||
name = "ocaml${optionalString aflSupport "+afl"}${optionalString flambdaSupport "+flambda"}-${version}";
|
||||
in
|
||||
|
||||
let
|
||||
@@ -41,11 +43,16 @@ stdenv.mkDerivation (args // {
|
||||
};
|
||||
|
||||
prefixKey = "-prefix ";
|
||||
configureFlags = optionals useX11 (
|
||||
if stdenv.lib.versionAtLeast version "4.08"
|
||||
then [ "--x-libraries=${x11lib}" "--x-includes=${x11inc}"]
|
||||
else [ "-x11lib" x11lib "-x11include" x11inc ])
|
||||
++ optional flambdaSupport "-flambda"
|
||||
configureFlags =
|
||||
let flags = new: old:
|
||||
if stdenv.lib.versionAtLeast version "4.08"
|
||||
then new else old
|
||||
; in
|
||||
optionals useX11 (flags
|
||||
[ "--x-libraries=${x11lib}" "--x-includes=${x11inc}"]
|
||||
[ "-x11lib" x11lib "-x11include" x11inc ])
|
||||
++ optional aflSupport (flags "--with-afl" "-afl-instrument")
|
||||
++ optional flambdaSupport (flags "--enable-flambda" "-flambda")
|
||||
;
|
||||
|
||||
buildFlags = "world" + optionalString useNativeCompilers " bootstrap world.opt";
|
||||
|
||||
@@ -106,7 +106,7 @@ let
|
||||
# Set JAVA_HOME automatically.
|
||||
mkdir -p $out/nix-support
|
||||
cat <<EOF > $out/nix-support/setup-hook
|
||||
if [ -z "\$JAVA_HOME" ]; then export JAVA_HOME=$out/lib/openjdk; fi
|
||||
if [ -z "\''${JAVA_HOME-}" ]; then export JAVA_HOME=$out/lib/openjdk; fi
|
||||
EOF
|
||||
'';
|
||||
|
||||
|
||||
@@ -193,6 +193,11 @@ let
|
||||
mkdir $out/lib/openjdk/jre
|
||||
lndir $jre/lib/openjdk/jre $out/lib/openjdk/jre
|
||||
|
||||
# Make sure cmm/*.pf are not symlinks:
|
||||
# https://youtrack.jetbrains.com/issue/IDEA-147272
|
||||
rm -rf $out/lib/openjdk/jre/lib/cmm
|
||||
ln -s {$jre,$out}/lib/openjdk/jre/lib/cmm
|
||||
|
||||
# Setup fallback fonts
|
||||
${lib.optionalString (!headless) ''
|
||||
mkdir -p $jre/lib/openjdk/jre/lib/fonts
|
||||
@@ -231,7 +236,7 @@ let
|
||||
# Set JAVA_HOME automatically.
|
||||
mkdir -p $out/nix-support
|
||||
cat <<EOF > $out/nix-support/setup-hook
|
||||
if [ -z "\$JAVA_HOME" ]; then export JAVA_HOME=$out/lib/openjdk; fi
|
||||
if [ -z "\''${JAVA_HOME-}" ]; then export JAVA_HOME=$out/lib/openjdk; fi
|
||||
EOF
|
||||
'';
|
||||
|
||||
|
||||
@@ -44,7 +44,7 @@ let
|
||||
|
||||
# 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
|
||||
'';
|
||||
|
||||
|
||||
@@ -44,7 +44,7 @@ let
|
||||
|
||||
# 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
|
||||
'';
|
||||
|
||||
|
||||
@@ -44,7 +44,7 @@ let
|
||||
|
||||
# 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
|
||||
'';
|
||||
|
||||
|
||||
@@ -114,7 +114,7 @@ let
|
||||
# Set JAVA_HOME automatically.
|
||||
mkdir -p $out/nix-support
|
||||
cat <<EOF > $out/nix-support/setup-hook
|
||||
if [ -z "\$JAVA_HOME" ]; then export JAVA_HOME=$out/lib/openjdk; fi
|
||||
if [ -z "\''${JAVA_HOME-}" ]; then export JAVA_HOME=$out/lib/openjdk; fi
|
||||
EOF
|
||||
'';
|
||||
|
||||
|
||||
@@ -156,7 +156,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
|
||||
'';
|
||||
|
||||
@@ -201,4 +201,4 @@ let result = stdenv.mkDerivation rec {
|
||||
platforms = [ "i686-linux" "x86_64-linux" "armv7l-linux" "aarch64-linux" ]; # some inherit jre.meta.platforms
|
||||
};
|
||||
|
||||
}; in stdenv.lib.trivial.warn "Public updates for Oracle Java SE 8 released after January 2019 will not be available for business, commercial or production use without a commercial license. See https://java.com/en/download/release_notice.jsp for more information." result
|
||||
}; in result
|
||||
|
||||
@@ -26,6 +26,6 @@ stdenv.mkDerivation rec {
|
||||
# under the 3-clause BSD license. The rest is 2-clause BSD license.
|
||||
license = with licenses; [ bsd3 bsd2 ];
|
||||
platforms = platforms.unix;
|
||||
maintainers = [ maintainers.fuuzetsu ];
|
||||
maintainers = [ ];
|
||||
};
|
||||
}
|
||||
|
||||
@@ -8,13 +8,13 @@ in clangStdenv.mkDerivation rec {
|
||||
# In theory this could use GCC + Clang rather than just Clang,
|
||||
# but https://github.com/NixOS/nixpkgs/issues/29877 stops this
|
||||
name = "openshadinglanguage-${version}";
|
||||
version = "1.10.7";
|
||||
version = "1.10.8";
|
||||
|
||||
src = fetchFromGitHub {
|
||||
owner = "imageworks";
|
||||
repo = "OpenShadingLanguage";
|
||||
rev = "Release-1.10.7";
|
||||
sha256 = "15grach34grp8x65sq8xzs2s6nfzjhn4blpfnaicw46jdi4c2w59";
|
||||
rev = "Release-1.10.8";
|
||||
sha256 = "1vfdbs1yprr22nx64ff89jcqabfw0md8drifpbzqn2v6ipc8gz6a";
|
||||
};
|
||||
|
||||
cmakeFlags = [ "-DUSE_BOOST_WAVE=ON" "-DENABLERTTI=ON" ];
|
||||
|
||||
@@ -28,7 +28,7 @@ stdenv.mkDerivation {
|
||||
license = stdenv.lib.licenses.lgpl21;
|
||||
platforms = with stdenv.lib.platforms; linux;
|
||||
maintainers = [ #Add your name here!
|
||||
stdenv.lib.maintainers.z77z
|
||||
stdenv.lib.maintainers.maggesi
|
||||
];
|
||||
};
|
||||
}
|
||||
|
||||
@@ -33,6 +33,6 @@ stdenv.mkDerivation rec {
|
||||
homepage = https://www.polyml.org/;
|
||||
license = licenses.lgpl21;
|
||||
platforms = with platforms; (linux ++ darwin);
|
||||
maintainers = with maintainers; [ z77z yurrriq ];
|
||||
maintainers = with maintainers; [ maggesi yurrriq ];
|
||||
};
|
||||
}
|
||||
|
||||
@@ -33,6 +33,6 @@ stdenv.mkDerivation rec {
|
||||
homepage = https://www.polyml.org/;
|
||||
license = licenses.lgpl21;
|
||||
platforms = with platforms; (linux ++ darwin);
|
||||
maintainers = with maintainers; [ z77z yurrriq ];
|
||||
maintainers = with maintainers; [ maggesi yurrriq ];
|
||||
};
|
||||
}
|
||||
|
||||
@@ -1,18 +1,18 @@
|
||||
{ stdenv, fetchFromGitHub, llvm, makeWrapper, pcre2, coreutils, which, libressl,
|
||||
{ stdenv, fetchFromGitHub, llvm, makeWrapper, pcre2, coreutils, which, libressl, libxml2,
|
||||
cc ? stdenv.cc, lto ? !stdenv.isDarwin }:
|
||||
|
||||
stdenv.mkDerivation ( rec {
|
||||
pname = "ponyc";
|
||||
version = "0.32.0";
|
||||
version = "0.33.0";
|
||||
|
||||
src = fetchFromGitHub {
|
||||
owner = "ponylang";
|
||||
repo = pname;
|
||||
rev = version;
|
||||
sha256 = "07ai5lr0zdrcdmfjxsypp33fpj8lnak7y5177s7qd19163z0ia20";
|
||||
sha256 = "0a0sw902nrayg0s1zrkhfpvrmdqw19nif67hsv0ijrckcq37bjcz";
|
||||
};
|
||||
|
||||
buildInputs = [ llvm makeWrapper which ];
|
||||
buildInputs = [ llvm makeWrapper which libxml2 ];
|
||||
propagatedBuildInputs = [ cc ];
|
||||
|
||||
# Disable problematic networking tests
|
||||
|
||||
@@ -2,13 +2,13 @@
|
||||
|
||||
stdenv.mkDerivation rec {
|
||||
pname = "pony-stable";
|
||||
version = "0.2.1";
|
||||
version = "0.2.2";
|
||||
|
||||
src = fetchFromGitHub {
|
||||
owner = "ponylang";
|
||||
repo = "pony-stable";
|
||||
rev = version;
|
||||
sha256 = "1wiinw35bp3zpq9kx61x2zvid7ln00jrw052ah8801s0d9dbwrdr";
|
||||
sha256 = "0nzvsqvl315brp3yb4j5kl82xnkmib4jk416jjc7yrz4k3jgr278";
|
||||
};
|
||||
|
||||
buildInputs = [ ponyc ];
|
||||
|
||||
@@ -18,19 +18,19 @@ let
|
||||
|
||||
in stdenv.mkDerivation rec {
|
||||
pname = "purescript";
|
||||
version = "0.13.3";
|
||||
version = "0.13.5";
|
||||
|
||||
src =
|
||||
if stdenv.isDarwin
|
||||
then
|
||||
fetchurl {
|
||||
url = "https://github.com/${pname}/${pname}/releases/download/v${version}/macos.tar.gz";
|
||||
sha256 = "04ylhqadj7wnclhiar9il6fkrxmh9qkz6fpas7z3b37w4qg0gshl";
|
||||
sha256 = "19bb50m0cd738r353blgy21d842b3yj58xfbplk7bz59jawj9lym";
|
||||
}
|
||||
else
|
||||
fetchurl {
|
||||
url = "https://github.com/${pname}/${pname}/releases/download/v${version}/linux64.tar.gz";
|
||||
sha256 = "1xcn694qfql87pdjh09hhvfvpakzxb2hagss61vh9msqq3s96l3z";
|
||||
sha256 = "016wvwypgb4859f0n1lqsqv9a8cca2y8g7d6ffvzx6rncd115gxi";
|
||||
};
|
||||
|
||||
|
||||
|
||||
33
pkgs/development/compilers/rasm/default.nix
Normal file
33
pkgs/development/compilers/rasm/default.nix
Normal file
@@ -0,0 +1,33 @@
|
||||
{ stdenv, fetchurl, unzip }:
|
||||
|
||||
stdenv.mkDerivation rec {
|
||||
pname = "rasm";
|
||||
version = "0.117";
|
||||
|
||||
src = fetchurl {
|
||||
url = "www.roudoudou.com/export/cpc/rasm/${pname}_v0117_src.zip";
|
||||
sha256 = "1hwily4cfays59qm7qd1ax48i7cpbxhs5l9mfpyn7m2lxsfqrl3z";
|
||||
};
|
||||
|
||||
sourceRoot = ".";
|
||||
|
||||
nativeBuildInputs = [ unzip ];
|
||||
|
||||
buildPhase = ''
|
||||
# according to official documentation
|
||||
cc rasm_v*.c -O2 -lm -lrt -march=native -o rasm
|
||||
'';
|
||||
|
||||
installPhase = ''
|
||||
install -Dt $out/bin rasm
|
||||
'';
|
||||
|
||||
meta = with stdenv.lib; {
|
||||
homepage = "http://www.roudoudou.com/rasm/";
|
||||
description = "Z80 assembler";
|
||||
# use -n option to display all licenses
|
||||
license = licenses.mit; # expat version
|
||||
maintainers = [ maintainers.genesis ];
|
||||
platforms = platforms.linux;
|
||||
};
|
||||
}
|
||||
@@ -5,13 +5,13 @@
|
||||
|
||||
stdenv.mkDerivation rec {
|
||||
name = "ocaml${ocaml.version}-reason-${version}";
|
||||
version = "3.5.0";
|
||||
version = "3.5.1";
|
||||
|
||||
src = fetchFromGitHub {
|
||||
owner = "facebook";
|
||||
repo = "reason";
|
||||
rev = "ea207004e021efef5a92ecd011d9d5b9b16bbded";
|
||||
sha256 = "0cdjy7sw15rlk63prrwy8lavqrz8fqwsgwr19ihvj99x332r98kk";
|
||||
rev = "aea245a43eb44034d2fccac7028b640a437af239";
|
||||
sha256 = "0ff7rjxbsg9zkq6sxlm9bkx7yk8x2cvras7z8436msczgd1wmmyf";
|
||||
};
|
||||
|
||||
nativeBuildInputs = [ makeWrapper ];
|
||||
@@ -27,8 +27,8 @@ stdenv.mkDerivation rec {
|
||||
postInstall = ''
|
||||
wrapProgram $out/bin/rtop \
|
||||
--prefix PATH : "${utop}/bin" \
|
||||
--set CAML_LD_LIBRARY_PATH ${ocaml_lwt}/lib/ocaml/${ocaml.version}/site-lib:$CAML_LD_LIBRARY_PATH \
|
||||
--set OCAMLPATH $out/lib/ocaml/${ocaml.version}/site-lib:$OCAMLPATH
|
||||
--prefix CAML_LD_LIBRARY_PATH : "${ocaml_lwt}/lib/ocaml/${ocaml.version}/site-lib" \
|
||||
--prefix OCAMLPATH : "$out/lib/ocaml/${ocaml.version}/site-lib"
|
||||
'';
|
||||
|
||||
meta = with stdenv.lib; {
|
||||
|
||||
@@ -6,12 +6,12 @@
|
||||
|
||||
stdenv.mkDerivation rec {
|
||||
pname = "rgbds";
|
||||
version = "0.3.8";
|
||||
version = "0.3.9";
|
||||
src = fetchFromGitHub {
|
||||
owner = "rednex";
|
||||
repo = "rgbds";
|
||||
rev = "v${version}";
|
||||
sha256 = "0db37z886026svhj6qnc3wk56sndbnz1vi41gn2k3bl6ppbnjlpk";
|
||||
sha256 = "0pzd9ig3ahpgq7jbj82grllxx1v01d620insr2m8h0c6jj25n5hv";
|
||||
};
|
||||
nativeBuildInputs = [ bison flex pkg-config libpng ];
|
||||
installFlags = "PREFIX=\${out}";
|
||||
|
||||
21
pkgs/development/compilers/rust/1_38_0.nix
Normal file
21
pkgs/development/compilers/rust/1_38_0.nix
Normal file
@@ -0,0 +1,21 @@
|
||||
import ./default.nix {
|
||||
rustcVersion = "1.38.0";
|
||||
rustcSha256 = "101dlpsfkq67p0hbwx4acqq6n90dj4bbprndizpgh1kigk566hk4";
|
||||
|
||||
# Note: the version MUST be one version prior to the version we're
|
||||
# building
|
||||
bootstrapVersion = "1.37.0";
|
||||
|
||||
# fetch hashes by running `print-hashes.sh 1.37.0`
|
||||
bootstrapHashes = {
|
||||
i686-unknown-linux-gnu = "74510e0e52a55e65a9f716673c2cda4d2bd427e2453541c6993c77c3ec04acf9";
|
||||
x86_64-unknown-linux-gnu = "cb573229bfd32928177c3835fdeb62d52da64806b844bc1095c6225b0665a1cb";
|
||||
arm-unknown-linux-gnueabihf = "272739fbb23cf6c2040c1813af9c8c7f386cac37d9de638f22a1816eb96bc0ae";
|
||||
armv7-unknown-linux-gnueabihf = "5b87b877f0ed20c6a09ce26e7a15d8c61b26b62484b97e78a51099d0efefec98";
|
||||
aarch64-unknown-linux-gnu = "263ef98fa3a6b2911b56f89c06615cdebf6ef676eb9b2493ad1539602f79b6ba";
|
||||
i686-apple-darwin = "e45d0c4d882fc6c404ffa6fe790294f4ea96384a2b48804adbf723f3635477a8";
|
||||
x86_64-apple-darwin = "b2310c97ffb964f253c4088c8d29865f876a49da2a45305493af5b5c7a3ca73d";
|
||||
};
|
||||
|
||||
selectRustPackage = pkgs: pkgs.rust_1_38_0;
|
||||
}
|
||||
29
pkgs/development/compilers/rust/1_39_0.nix
Normal file
29
pkgs/development/compilers/rust/1_39_0.nix
Normal file
@@ -0,0 +1,29 @@
|
||||
# New rust versions should first go to staging.
|
||||
# Things to check after updating:
|
||||
# 1. Rustc should produce rust binaries on x86_64-linux, aarch64-linux and x86_64-darwin:
|
||||
# i.e. nix-shell -p fd or @GrahamcOfBorg build fd on github
|
||||
# This testing can be also done by other volunteers as part of the pull
|
||||
# request review, in case platforms cannot be covered.
|
||||
# 2. The LLVM version used for building should match with rust upstream.
|
||||
# 3. Firefox and Thunderbird should still build on x86_64-linux.
|
||||
import ./default.nix {
|
||||
rustcVersion = "1.39.0";
|
||||
rustcSha256 = "0mwkc1bnil2cfyf6nglpvbn2y0zfbv44zfhsd5qg4c9rm6vgd8dl";
|
||||
|
||||
# Note: the version MUST be one version prior to the version we're
|
||||
# building
|
||||
bootstrapVersion = "1.38.0";
|
||||
|
||||
# fetch hashes by running `print-hashes.sh 1.38.0`
|
||||
bootstrapHashes = {
|
||||
i686-unknown-linux-gnu = "41aed8a350e24a0cac1444ed99b3dd24a90bc581dd88cb420c6e547d6b5f57af";
|
||||
x86_64-unknown-linux-gnu = "adda26b3f0609dbfbdc2019da4a20101879b9db2134fae322a4e863a069ec221";
|
||||
arm-unknown-linux-gnueabihf = "0603a3d3d16ae8f3b3b117eb699e8f3ef7532a6f6d3c29d13e7d4614fc3c9e7a";
|
||||
armv7-unknown-linux-gnueabihf = "8b1bf1680a61a643d6b5c7a3b1a1ce88448652756395e20ba5846739cbd085c4";
|
||||
aarch64-unknown-linux-gnu = "06afd6d525326cea95c3aa658aaa8542eab26f44235565bb16913ac9d12b7bda";
|
||||
i686-apple-darwin = "cdbf2807774bed350a3af6f41d7f7dd7ceff28777cde310c3ba90033188eb2f8";
|
||||
x86_64-apple-darwin = "bd301b78ddcd5d4553962b115e1dca5436dd3755ed323f86f4485769286a8a5a";
|
||||
};
|
||||
|
||||
selectRustPackage = pkgs: pkgs.rust_1_39_0;
|
||||
}
|
||||
@@ -1,38 +1,11 @@
|
||||
{ stdenv, fetchurl, callPackage }:
|
||||
{ stdenv, fetchurl, rust, callPackage, version, hashes }:
|
||||
|
||||
let
|
||||
# Note: the version MUST be one version prior to the version we're
|
||||
# building
|
||||
version = "1.37.0";
|
||||
|
||||
# fetch hashes by running `print-hashes.sh 1.37.0`
|
||||
hashes = {
|
||||
i686-unknown-linux-gnu = "74510e0e52a55e65a9f716673c2cda4d2bd427e2453541c6993c77c3ec04acf9";
|
||||
x86_64-unknown-linux-gnu = "cb573229bfd32928177c3835fdeb62d52da64806b844bc1095c6225b0665a1cb";
|
||||
armv7-unknown-linux-gnueabihf = "5b87b877f0ed20c6a09ce26e7a15d8c61b26b62484b97e78a51099d0efefec98";
|
||||
aarch64-unknown-linux-gnu = "263ef98fa3a6b2911b56f89c06615cdebf6ef676eb9b2493ad1539602f79b6ba";
|
||||
i686-apple-darwin = "e45d0c4d882fc6c404ffa6fe790294f4ea96384a2b48804adbf723f3635477a8";
|
||||
x86_64-apple-darwin = "b2310c97ffb964f253c4088c8d29865f876a49da2a45305493af5b5c7a3ca73d";
|
||||
};
|
||||
|
||||
platform =
|
||||
if stdenv.hostPlatform.system == "i686-linux"
|
||||
then "i686-unknown-linux-gnu"
|
||||
else if stdenv.hostPlatform.system == "x86_64-linux"
|
||||
then "x86_64-unknown-linux-gnu"
|
||||
else if stdenv.hostPlatform.system == "armv7l-linux"
|
||||
then "armv7-unknown-linux-gnueabihf"
|
||||
else if stdenv.hostPlatform.system == "aarch64-linux"
|
||||
then "aarch64-unknown-linux-gnu"
|
||||
else if stdenv.hostPlatform.system == "i686-darwin"
|
||||
then "i686-apple-darwin"
|
||||
else if stdenv.hostPlatform.system == "x86_64-darwin"
|
||||
then "x86_64-apple-darwin"
|
||||
else throw "missing bootstrap url for platform ${stdenv.hostPlatform.system}";
|
||||
platform = rust.toRustTarget stdenv.hostPlatform;
|
||||
|
||||
src = fetchurl {
|
||||
url = "https://static.rust-lang.org/dist/rust-${version}-${platform}.tar.gz";
|
||||
sha256 = hashes.${platform};
|
||||
sha256 = hashes.${platform} or (throw "missing bootstrap url for platform ${platform}");
|
||||
};
|
||||
|
||||
in callPackage ./binary.nix
|
||||
|
||||
@@ -1,3 +1,9 @@
|
||||
{ rustcVersion
|
||||
, rustcSha256
|
||||
, bootstrapVersion
|
||||
, bootstrapHashes
|
||||
, selectRustPackage
|
||||
}:
|
||||
{ stdenv, lib
|
||||
, buildPackages
|
||||
, newScope, callPackage
|
||||
@@ -5,17 +11,25 @@
|
||||
, llvmPackages_5
|
||||
, pkgsBuildTarget, pkgsBuildBuild
|
||||
}: rec {
|
||||
makeRustPlatform = { rustc, cargo, ... }: {
|
||||
toRustTarget = platform: with platform.parsed; let
|
||||
cpu_ = {
|
||||
"armv7a" = "armv7";
|
||||
"armv7l" = "armv7";
|
||||
"armv6l" = "arm";
|
||||
}.${cpu.name} or cpu.name;
|
||||
in "${cpu_}-${vendor.name}-${kernel.name}${lib.optionalString (abi.name != "unknown") "-${abi.name}"}";
|
||||
|
||||
makeRustPlatform = { rustc, cargo, ... }: rec {
|
||||
rust = {
|
||||
inherit rustc cargo;
|
||||
};
|
||||
|
||||
buildRustPackage = callPackage ../../../build-support/rust {
|
||||
inherit rustc cargo;
|
||||
fetchcargo = buildPackages.callPackage ../../../build-support/rust/fetchcargo.nix {
|
||||
inherit cargo;
|
||||
};
|
||||
|
||||
fetchcargo = buildPackages.callPackage ../../../build-support/rust/fetchcargo.nix {
|
||||
inherit cargo;
|
||||
};
|
||||
buildRustPackage = callPackage ../../../build-support/rust {
|
||||
inherit rustc cargo fetchcargo;
|
||||
};
|
||||
|
||||
rustcSrc = callPackage ./rust-src.nix {
|
||||
@@ -36,21 +50,27 @@
|
||||
# cycles / purify builds). In this way, nixpkgs would be in control of all
|
||||
# bootstrapping.
|
||||
packages = {
|
||||
prebuilt = callPackage ./bootstrap.nix {};
|
||||
prebuilt = callPackage ./bootstrap.nix {
|
||||
version = bootstrapVersion;
|
||||
hashes = bootstrapHashes;
|
||||
};
|
||||
stable = lib.makeScope newScope (self: let
|
||||
# Like `buildRustPackages`, but may also contain prebuilt binaries to
|
||||
# break cycle. Just like `bootstrapTools` for nixpkgs as a whole,
|
||||
# nothing in the final package set should refer to this.
|
||||
bootstrapRustPackages = self.buildRustPackages.overrideScope' (_: _:
|
||||
lib.optionalAttrs (stdenv.buildPlatform == stdenv.hostPlatform)
|
||||
buildPackages.rust.packages.prebuilt);
|
||||
(selectRustPackage buildPackages).packages.prebuilt);
|
||||
bootRustPlatform = makeRustPlatform bootstrapRustPackages;
|
||||
in {
|
||||
# Packages suitable for build-time, e.g. `build.rs`-type stuff.
|
||||
buildRustPackages = buildPackages.rust.packages.stable;
|
||||
buildRustPackages = (selectRustPackage buildPackages).packages.stable;
|
||||
# Analogous to stdenv
|
||||
rustPlatform = makeRustPlatform self.buildRustPackages;
|
||||
rustc = self.callPackage ./rustc.nix ({
|
||||
version = rustcVersion;
|
||||
sha256 = rustcSha256;
|
||||
|
||||
# Use boot package set to break cycle
|
||||
rustPlatform = bootRustPlatform;
|
||||
} // lib.optionalAttrs (stdenv.cc.isClang && stdenv.hostPlatform == stdenv.buildPlatform) {
|
||||
|
||||
@@ -10,6 +10,7 @@ set -euo pipefail
|
||||
PLATFORMS=(
|
||||
i686-unknown-linux-gnu
|
||||
x86_64-unknown-linux-gnu
|
||||
arm-unknown-linux-gnueabihf
|
||||
armv7-unknown-linux-gnueabihf
|
||||
aarch64-unknown-linux-gnu
|
||||
i686-apple-darwin
|
||||
|
||||
@@ -1,28 +1,30 @@
|
||||
{ stdenv, removeReferencesTo, pkgsBuildBuild, pkgsBuildHost, pkgsBuildTarget
|
||||
, fetchurl, file, python2
|
||||
, llvm_7, darwin, git, cmake, rustPlatform
|
||||
, llvm_9, darwin, git, cmake, rust, rustPlatform
|
||||
, pkgconfig, openssl
|
||||
, which, libffi
|
||||
, withBundledLLVM ? false
|
||||
, version
|
||||
, sha256
|
||||
}:
|
||||
|
||||
let
|
||||
inherit (stdenv.lib) optional optionalString;
|
||||
inherit (darwin.apple_sdk.frameworks) Security;
|
||||
|
||||
llvmSharedForBuild = pkgsBuildBuild.llvm_7.override { enableSharedLibraries = true; };
|
||||
llvmSharedForHost = pkgsBuildHost.llvm_7.override { enableSharedLibraries = true; };
|
||||
llvmSharedForTarget = pkgsBuildTarget.llvm_7.override { enableSharedLibraries = true; };
|
||||
llvmSharedForBuild = pkgsBuildBuild.llvm_9.override { enableSharedLibraries = true; };
|
||||
llvmSharedForHost = pkgsBuildHost.llvm_9.override { enableSharedLibraries = true; };
|
||||
llvmSharedForTarget = pkgsBuildTarget.llvm_9.override { enableSharedLibraries = true; };
|
||||
|
||||
# For use at runtime
|
||||
llvmShared = llvm_7.override { enableSharedLibraries = true; };
|
||||
llvmShared = llvm_9.override { enableSharedLibraries = true; };
|
||||
in stdenv.mkDerivation rec {
|
||||
pname = "rustc";
|
||||
version = "1.38.0";
|
||||
inherit version;
|
||||
|
||||
src = fetchurl {
|
||||
url = "https://static.rust-lang.org/dist/rustc-${version}-src.tar.gz";
|
||||
sha256 = "101dlpsfkq67p0hbwx4acqq6n90dj4bbprndizpgh1kigk566hk4";
|
||||
inherit sha256;
|
||||
};
|
||||
|
||||
__darwinAllowLocalNetworking = true;
|
||||
@@ -51,9 +53,9 @@ in stdenv.mkDerivation rec {
|
||||
# We need rust to build rust. If we don't provide it, configure will try to download it.
|
||||
# Reference: https://github.com/rust-lang/rust/blob/master/src/bootstrap/configure.py
|
||||
configureFlags = let
|
||||
setBuild = "--set=target.${stdenv.buildPlatform.config}";
|
||||
setHost = "--set=target.${stdenv.hostPlatform.config}";
|
||||
setTarget = "--set=target.${stdenv.targetPlatform.config}";
|
||||
setBuild = "--set=target.${rust.toRustTarget stdenv.buildPlatform}";
|
||||
setHost = "--set=target.${rust.toRustTarget stdenv.hostPlatform}";
|
||||
setTarget = "--set=target.${rust.toRustTarget stdenv.targetPlatform}";
|
||||
ccForBuild = "${pkgsBuildBuild.targetPackages.stdenv.cc}/bin/${pkgsBuildBuild.targetPackages.stdenv.cc.targetPrefix}cc";
|
||||
cxxForBuild = "${pkgsBuildBuild.targetPackages.stdenv.cc}/bin/${pkgsBuildBuild.targetPackages.stdenv.cc.targetPrefix}c++";
|
||||
ccForHost = "${pkgsBuildHost.targetPackages.stdenv.cc}/bin/${pkgsBuildHost.targetPackages.stdenv.cc.targetPrefix}cc";
|
||||
@@ -66,9 +68,9 @@ in stdenv.mkDerivation rec {
|
||||
"--set=build.cargo=${rustPlatform.rust.cargo}/bin/cargo"
|
||||
"--enable-rpath"
|
||||
"--enable-vendor"
|
||||
"--build=${stdenv.buildPlatform.config}"
|
||||
"--host=${stdenv.hostPlatform.config}"
|
||||
"--target=${stdenv.targetPlatform.config}"
|
||||
"--build=${rust.toRustTarget stdenv.buildPlatform}"
|
||||
"--host=${rust.toRustTarget stdenv.hostPlatform}"
|
||||
"--target=${rust.toRustTarget stdenv.targetPlatform}"
|
||||
|
||||
"${setBuild}.cc=${ccForBuild}"
|
||||
"${setHost}.cc=${ccForHost}"
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user