Merge staging-next into staging

This commit is contained in:
Frederik Rietdijk
2020-10-13 19:35:37 +02:00
210 changed files with 11913 additions and 8961 deletions

View File

@@ -3,11 +3,11 @@
, withContrib ? true }:
let
versionPkg = "0.3.13" ;
versionPkg = "0.4.1" ;
contrib = fetchurl {
url = "mirror://sourceforge/ats2-lang/ATS2-Postiats-contrib-${versionPkg}.tgz";
sha256 = "5f64172b2df08c8563b01febc32b582b2d7b59c0c514bd2beb727e69bb8e24ee";
sha256 = "184m4hz2xszhcfc6w9fw9qibhmcvgjmikwfwkb345xypr59jm93d";
};
postInstallContrib = stdenv.lib.optionalString withContrib
@@ -31,7 +31,7 @@ stdenv.mkDerivation rec {
src = fetchurl {
url = "mirror://sourceforge/ats2-lang/ATS2-Postiats-gmp-${version}.tgz";
sha256 = "0056ff5bfa55c9b9831dce004e7b1b9e7a98d56a9d8ae49d827f9fd0ef823c23";
sha256 = "0c4nqp6yzmpj0mcpg7ibmwyqi8hjw3sza8myvy4nzq3fa6wldy5l";
};
buildInputs = [ gmp ];

View File

@@ -24,6 +24,7 @@ let
mkdir "$rsrc"
ln -s "${cc}/lib/clang/${release_version}/include" "$rsrc"
ln -s "${targetLlvmLibraries.compiler-rt.out}/lib" "$rsrc/lib"
ln -s "${targetLlvmLibraries.compiler-rt.out}/share" "$rsrc/share"
echo "-resource-dir=$rsrc" >> $out/nix-support/cc-cflags
'' + stdenv.lib.optionalString (stdenv.targetPlatform.isLinux && !(stdenv.targetPlatform.useLLVM or false)) ''
echo "--gcc-toolchain=${gccForLibs}" >> $out/nix-support/cc-cflags

View File

@@ -24,6 +24,7 @@ let
mkdir "$rsrc"
ln -s "${cc}/lib/clang/${release_version}/include" "$rsrc"
ln -s "${targetLlvmLibraries.compiler-rt.out}/lib" "$rsrc/lib"
ln -s "${targetLlvmLibraries.compiler-rt.out}/share" "$rsrc/share"
echo "-resource-dir=$rsrc" >> $out/nix-support/cc-cflags
'' + stdenv.lib.optionalString (stdenv.targetPlatform.isLinux && tools.clang-unwrapped ? gcc && !(stdenv.targetPlatform.useLLVM or false)) ''
echo "--gcc-toolchain=${tools.clang-unwrapped.gcc}" >> $out/nix-support/cc-cflags

View File

@@ -0,0 +1,73 @@
{ stdenv, lib, fetchzip, fetchpatch, gcc }:
stdenv.mkDerivation rec {
pname = "miranda";
version = "2.066";
# The build generates object files (`.x`) from module files (`.m`).
# To be able to invalidate object file, it contains the `mtime`
# of the corresponding module file at the time of the build.
# When a file is installed to Nix store its `mtime` is set to `1`,
# so the `mtime` field in the object file would no longer match
# and Miranda would try to regenerate it at the runtime,
# even though it is up to date.
# Using `fetchzip` will make all the source files have `mtime=1`
# from the start so this mismatch cannot occur.
src = fetchzip {
url = "https://www.cs.kent.ac.uk/people/staff/dat/miranda/src/mira-${builtins.replaceStrings [ "." ] [ "" ] version}-src.tgz";
sha256 = "KE/FTL9YW9l7VBAgkFZlqgSM1Bt/BXT6GkkONtyKJjQ=";
};
patches = [
# Allow passing `PREFIX` to makeFlags.
# Sent upstream on 2020-10-10.
(fetchpatch {
name = "fix-makefile-variables.patch";
url = "https://github.com/jtojnar/miranda/commit/be62d2150725a4c314aa7e3e1e75a165c90be65d.patch";
sha256 = "0r8nnr7iyzp1a3w3n6y1xi0ralqhm1ifp75yhyj3h1g229vk51a6";
})
# Create the installation directories.
# Sent upstream on 2020-10-10.
(fetchpatch {
name = "add-mkdirs-makefile.patch";
url = "https://github.com/jtojnar/miranda/commit/048754606625975d5358e946549c41ae7b5d3428.patch";
sha256 = "1n8xv679i7s789km2dxxrs2pphyyi7vr7rhafqvmkcdmhmxk9h2a";
})
# Use correct installation path for finding the library.
# Sent upstream on 2020-10-10.
(fetchpatch {
name = "c-path-fixes.patch";
url = "https://github.com/jtojnar/miranda/commit/aea0a118a802a0da6029b781f7cfd388224263cf.patch";
sha256 = "1z3giv8fzc35a23ga9ahz9d1fbvya67kavnb8h4rv2icbzr5j5gd";
})
# Make build reproducible.
# Sent upstream on 2020-10-10.
(fetchpatch {
name = "deterministic-build.patch";
url = "https://github.com/jtojnar/miranda/commit/daf8abb8f30ec1cca21698e3fc355578b9f7c571.patch";
sha256 = "TC/YrHrMzdlwicJ3oJ/TjwhkufmV3ypemgyqhMmVut4=";
})
];
makeFlags = [
"CC=cc"
"CFLAGS=-O2"
"PREFIX=${placeholder "out"}"
];
enableParallelBuilding = true;
postPatch = ''
patchShebangs quotehostinfo
'';
meta = with stdenv.lib; {
description = "Compiler for Miranda -- a pure, non-strict, polymorphic, higher order functional programming language";
homepage = "https://www.cs.kent.ac.uk/people/staff/dat/miranda/";
license = licenses.bsd2;
maintainers = with maintainers; [ siraben ];
};
}

View File

@@ -13,12 +13,23 @@
, llvmPackages
, pkgsBuildTarget, pkgsBuildBuild
}: rec {
# https://doc.rust-lang.org/reference/conditional-compilation.html#target_arch
toTargetArch = platform:
if platform.isAarch32 then "arm"
else platform.parsed.cpu.name;
# https://doc.rust-lang.org/reference/conditional-compilation.html#target_os
toTargetOs = platform:
if platform.isDarwin then "macos"
else platform.parsed.kernel.name;
# Target triple. Rust has slightly different naming conventions than we use.
toRustTarget = platform: with platform.parsed; let
cpu_ = {
cpu_ = platform.rustc.arch or {
"armv7a" = "armv7";
"armv7l" = "armv7";
"armv6l" = "arm";
}.${cpu.name} or platform.rustc.arch or cpu.name;
}.${cpu.name} or cpu.name;
in platform.rustc.config
or "${cpu_}-${vendor.name}-${kernel.name}${lib.optionalString (abi.name != "unknown") "-${abi.name}"}";

View File

@@ -39,5 +39,7 @@ llvmPackages.stdenv.mkDerivation rec {
license = licenses.mit;
platforms = platforms.unix;
maintainers = [ maintainers.andrewrk ];
# See https://github.com/NixOS/nixpkgs/issues/86299
broken = stdenv.isDarwin;
};
}