3
0
Fork 0
forked from mirrors/nixpkgs

pkgs/development/compilers: stdenv.lib -> lib

This commit is contained in:
Ben Siraphob 2021-01-22 18:25:31 +07:00
parent bbaff89ceb
commit acc5f7b18a
320 changed files with 1660 additions and 1657 deletions

View file

@ -1,4 +1,4 @@
{ stdenv, fetchurl }: { lib, stdenv, fetchurl }:
stdenv.mkDerivation rec { stdenv.mkDerivation rec {
pname = "4th"; pname = "4th";
@ -30,7 +30,7 @@ stdenv.mkDerivation rec {
"MANDIR=${placeholder "out"}/share/man" "MANDIR=${placeholder "out"}/share/man"
]; ];
meta = with stdenv.lib; { meta = with lib; {
description = "A portable Forth compiler"; description = "A portable Forth compiler";
homepage = "https://thebeez.home.xs4all.nl/4tH/index.html"; homepage = "https://thebeez.home.xs4all.nl/4tH/index.html";
license = licenses.lgpl3; license = licenses.lgpl3;

View file

@ -1,4 +1,4 @@
{stdenv, fetchurl, ant, jre, jdk}: {lib, stdenv, fetchurl, ant, jre, jdk}:
stdenv.mkDerivation rec { stdenv.mkDerivation rec {
pname = "abcl"; pname = "abcl";
version = "1.8.0"; version = "1.8.0";
@ -31,9 +31,9 @@ stdenv.mkDerivation rec {
meta = { meta = {
inherit version; inherit version;
description = "A JVM-based Common Lisp implementation"; description = "A JVM-based Common Lisp implementation";
license = stdenv.lib.licenses.gpl3 ; license = lib.licenses.gpl3 ;
maintainers = [stdenv.lib.maintainers.raskin]; maintainers = [lib.maintainers.raskin];
platforms = stdenv.lib.platforms.linux; platforms = lib.platforms.linux;
homepage = "https://common-lisp.net/project/armedbear/"; homepage = "https://common-lisp.net/project/armedbear/";
}; };
} }

View file

@ -1,4 +1,4 @@
{ stdenv, fetchsvn }: { lib, stdenv, fetchsvn }:
stdenv.mkDerivation rec { stdenv.mkDerivation rec {
pname = "acme"; pname = "acme";
@ -19,7 +19,7 @@ stdenv.mkDerivation rec {
--replace "= gcc" "?= gcc" --replace "= gcc" "?= gcc"
''; '';
meta = with stdenv.lib; { meta = with lib; {
description = "A multi-platform cross assembler for 6502/6510/65816 CPUs"; description = "A multi-platform cross assembler for 6502/6510/65816 CPUs";
homepage = "https://sourceforge.net/projects/acme-crossass/"; homepage = "https://sourceforge.net/projects/acme-crossass/";
license = licenses.gpl2Plus; license = licenses.gpl2Plus;

View file

@ -1,7 +1,7 @@
sourcePerArch: sourcePerArch:
{ swingSupport ? true # not used for now { swingSupport ? true # not used for now
, stdenv , lib, stdenv
, fetchurl , fetchurl
}: }:
@ -43,11 +43,11 @@ let cpuName = stdenv.hostPlatform.parsed.cpu.name;
passthru.home = result; passthru.home = result;
meta = with stdenv.lib; { meta = with lib; {
license = licenses.gpl2Classpath; license = licenses.gpl2Classpath;
description = "AdoptOpenJDK, prebuilt OpenJDK binary"; description = "AdoptOpenJDK, prebuilt OpenJDK binary";
platforms = [ "x86_64-darwin" ]; # some inherit jre.meta.platforms platforms = [ "x86_64-darwin" ]; # some inherit jre.meta.platforms
maintainers = with stdenv.lib.maintainers; [ taku0 ]; maintainers = with lib.maintainers; [ taku0 ];
}; };
}; in result }; in result

View file

@ -69,7 +69,7 @@ let result = stdenv.mkDerivation rec {
passthru.home = result; passthru.home = result;
meta = with stdenv.lib; { meta = with lib; {
license = licenses.gpl2Classpath; license = licenses.gpl2Classpath;
description = "AdoptOpenJDK, prebuilt OpenJDK binary"; description = "AdoptOpenJDK, prebuilt OpenJDK binary";
platforms = lib.mapAttrsToList (arch: _: arch + "-linux") sourcePerArch; # some inherit jre.meta.platforms platforms = lib.mapAttrsToList (arch: _: arch + "-linux") sourcePerArch; # some inherit jre.meta.platforms

View file

@ -1,4 +1,4 @@
{ stdenv, fetchFromGitHub, cargo, rustc, autoreconfHook, jdk, glib, xulrunner, zip, pkg-config, npapi_sdk, bash, bc }: { lib, stdenv, fetchFromGitHub, cargo, rustc, autoreconfHook, jdk, glib, xulrunner, zip, pkg-config, npapi_sdk, bash, bc }:
stdenv.mkDerivation rec { stdenv.mkDerivation rec {
pname = "adoptopenjdk-icedtea-web"; pname = "adoptopenjdk-icedtea-web";
@ -58,6 +58,6 @@ stdenv.mkDerivation rec {
based on the NetX project. based on the NetX project.
''; '';
homepage = "https://github.com/adoptopenjdk/icedtea-web"; homepage = "https://github.com/adoptopenjdk/icedtea-web";
platforms = stdenv.lib.platforms.linux; platforms = lib.platforms.linux;
}; };
} }

View file

@ -1,4 +1,4 @@
{ fetchgit, stdenv, gmp, which, flex, bison, makeWrapper { fetchgit, lib, stdenv, gmp, which, flex, bison, makeWrapper
, autoconf, automake, libtool, jdk, perl }: , autoconf, automake, libtool, jdk, perl }:
stdenv.mkDerivation { stdenv.mkDerivation {
@ -32,7 +32,7 @@ stdenv.mkDerivation {
broken = true; broken = true;
homepage = "http://www.aldor.org/"; homepage = "http://www.aldor.org/";
description = "Programming language with an expressive type system"; description = "Programming language with an expressive type system";
license = stdenv.lib.licenses.asl20; license = lib.licenses.asl20;
longDescription = '' longDescription = ''
Aldor is a programming language with an expressive type system well-suited Aldor is a programming language with an expressive type system well-suited
@ -47,6 +47,6 @@ stdenv.mkDerivation {
and powerful properties of functional, object-oriented and aspect-oriented styles. and powerful properties of functional, object-oriented and aspect-oriented styles.
''; '';
platforms = stdenv.lib.platforms.linux; platforms = lib.platforms.linux;
}; };
} }

View file

@ -1,4 +1,4 @@
{stdenv, gcc, glibc, fetchurl, fetchgit, libtool, autoconf, automake, file, gnumake, which, zsh, m4, pkg-config, perl, gnome2, gtk2, pango, sqlite, libxml2, zlib, gmp, smlnj }: {lib, stdenv, gcc, glibc, fetchurl, fetchgit, libtool, autoconf, automake, file, gnumake, which, zsh, m4, pkg-config, perl, gnome2, gtk2, pango, sqlite, libxml2, zlib, gmp, smlnj }:
stdenv.mkDerivation { stdenv.mkDerivation {
name = "aliceml-1.4-7d44dc8e"; name = "aliceml-1.4-7d44dc8e";
@ -50,8 +50,8 @@ stdenv.mkDerivation {
programming. programming.
''; '';
homepage = "https://www.ps.uni-saarland.de/alice/"; homepage = "https://www.ps.uni-saarland.de/alice/";
license = stdenv.lib.licenses.mit; license = lib.licenses.mit;
maintainers = [ stdenv.lib.maintainers.doublec ]; maintainers = [ lib.maintainers.doublec ];
broken = true; broken = true;
}; };
} }

View file

@ -1,4 +1,4 @@
{ stdenv, fetchurl, makeWrapper, jre }: { lib, stdenv, fetchurl, makeWrapper, jre }:
let let
playerglobal_ver = "27.0"; playerglobal_ver = "27.0";
@ -47,7 +47,7 @@ in stdenv.mkDerivation rec {
fixupPhase = ":"; fixupPhase = ":";
meta = with stdenv.lib; { meta = with lib; {
description = "Flex SDK for Adobe Flash / ActionScript"; description = "Flex SDK for Adobe Flash / ActionScript";
homepage = "https://flex.apache.org/"; homepage = "https://flex.apache.org/";
license = with licenses; [ asl20 ]; license = with licenses; [ asl20 ];

View file

@ -1,4 +1,4 @@
{ stdenv, fetchFromGitHub, icestorm }: { lib, stdenv, fetchFromGitHub, icestorm }:
with builtins; with builtins;
@ -37,8 +37,8 @@ stdenv.mkDerivation rec {
the IceStorm [2] icepack command. the IceStorm [2] icepack command.
''; '';
homepage = "https://github.com/cseed/arachne-pnr"; homepage = "https://github.com/cseed/arachne-pnr";
license = stdenv.lib.licenses.mit; license = lib.licenses.mit;
maintainers = with stdenv.lib.maintainers; [ shell thoughtpolice ]; maintainers = with lib.maintainers; [ shell thoughtpolice ];
platforms = stdenv.lib.platforms.linux; platforms = lib.platforms.linux;
}; };
} }

View file

@ -1,4 +1,4 @@
{ stdenv, fetchurl, perl }: { lib, stdenv, fetchurl, perl }:
stdenv.mkDerivation rec { stdenv.mkDerivation rec {
pname = "asn1c"; pname = "asn1c";
@ -23,7 +23,7 @@ stdenv.mkDerivation rec {
doCheck = true; doCheck = true;
meta = with stdenv.lib; { meta = with lib; {
homepage = "http://lionet.info/asn1c/compiler.html"; homepage = "http://lionet.info/asn1c/compiler.html";
description = "Open Source ASN.1 Compiler"; description = "Open Source ASN.1 Compiler";
license = licenses.bsd2; license = licenses.bsd2;

View file

@ -1,4 +1,4 @@
{stdenv, fetchurl, jre}: {lib, stdenv, fetchurl, jre}:
stdenv.mkDerivation rec { stdenv.mkDerivation rec {
pname = "aspectj"; pname = "aspectj";
@ -18,7 +18,7 @@ stdenv.mkDerivation rec {
meta = { meta = {
homepage = "http://www.eclipse.org/aspectj/"; homepage = "http://www.eclipse.org/aspectj/";
description = "A seamless aspect-oriented extension to the Java programming language"; description = "A seamless aspect-oriented extension to the Java programming language";
platforms = stdenv.lib.platforms.unix; platforms = lib.platforms.unix;
license = stdenv.lib.licenses.epl10; license = lib.licenses.epl10;
}; };
} }

View file

@ -1,4 +1,4 @@
{ stdenv, fetchurl, gmp }: { lib, stdenv, fetchurl, gmp }:
stdenv.mkDerivation rec { stdenv.mkDerivation rec {
pname = "ats"; pname = "ats";
@ -16,10 +16,10 @@ stdenv.mkDerivation rec {
meta = { meta = {
description = "Functional programming language with dependent types"; description = "Functional programming language with dependent types";
homepage = "http://www.ats-lang.org"; homepage = "http://www.ats-lang.org";
license = stdenv.lib.licenses.gpl3Plus; license = lib.licenses.gpl3Plus;
# TODO: it looks like ATS requires gcc specifically. Someone with more knowledge # TODO: it looks like ATS requires gcc specifically. Someone with more knowledge
# will need to experiment. # will need to experiment.
platforms = stdenv.lib.platforms.linux; platforms = lib.platforms.linux;
maintainers = [ stdenv.lib.maintainers.thoughtpolice ]; maintainers = [ lib.maintainers.thoughtpolice ];
}; };
} }

View file

@ -1,4 +1,4 @@
{ stdenv, fetchurl, gmp { lib, stdenv, fetchurl, gmp
, withEmacsSupport ? true , withEmacsSupport ? true
, withContrib ? true }: , withContrib ? true }:
@ -10,14 +10,14 @@ let
sha256 = "184m4hz2xszhcfc6w9fw9qibhmcvgjmikwfwkb345xypr59jm93d"; sha256 = "184m4hz2xszhcfc6w9fw9qibhmcvgjmikwfwkb345xypr59jm93d";
}; };
postInstallContrib = stdenv.lib.optionalString withContrib postInstallContrib = lib.optionalString withContrib
'' ''
local contribDir=$out/lib/ats2-postiats-*/ ; local contribDir=$out/lib/ats2-postiats-*/ ;
mkdir -p $contribDir ; mkdir -p $contribDir ;
tar -xzf "${contrib}" --strip-components 1 -C $contribDir ; tar -xzf "${contrib}" --strip-components 1 -C $contribDir ;
''; '';
postInstallEmacs = stdenv.lib.optionalString withEmacsSupport postInstallEmacs = lib.optionalString withEmacsSupport
'' ''
local siteLispDir=$out/share/emacs/site-lisp/ats2 ; local siteLispDir=$out/share/emacs/site-lisp/ats2 ;
mkdir -p $siteLispDir ; mkdir -p $siteLispDir ;
@ -36,7 +36,7 @@ stdenv.mkDerivation rec {
buildInputs = [ gmp ]; buildInputs = [ gmp ];
setupHook = with stdenv.lib; setupHook = with lib;
let let
hookFiles = hookFiles =
[ ./setup-hook.sh ] [ ./setup-hook.sh ]
@ -47,7 +47,7 @@ stdenv.mkDerivation rec {
postInstall = postInstallContrib + postInstallEmacs; postInstall = postInstallContrib + postInstallEmacs;
meta = with stdenv.lib; { meta = with lib; {
description = "Functional programming language with dependent types"; description = "Functional programming language with dependent types";
homepage = "http://www.ats-lang.org"; homepage = "http://www.ats-lang.org";
license = licenses.gpl3Plus; license = licenses.gpl3Plus;

View file

@ -1,4 +1,4 @@
{ stdenv, fetchFromGitHub, zlib, jdk, CoreServices, Foundation }: { lib, stdenv, fetchFromGitHub, zlib, jdk, CoreServices, Foundation }:
stdenv.mkDerivation rec { stdenv.mkDerivation rec {
pname = "avian"; pname = "avian";
@ -12,7 +12,7 @@ stdenv.mkDerivation rec {
}; };
buildInputs = [ zlib jdk ] buildInputs = [ zlib jdk ]
++ stdenv.lib.optionals stdenv.isDarwin [ CoreServices Foundation ]; ++ lib.optionals stdenv.isDarwin [ CoreServices Foundation ];
NIX_CFLAGS_COMPILE = "-Wno-error"; NIX_CFLAGS_COMPILE = "-Wno-error";
@ -36,8 +36,8 @@ stdenv.mkDerivation rec {
building self-contained applications. building self-contained applications.
''; '';
homepage = "https://readytalk.github.io/avian/"; homepage = "https://readytalk.github.io/avian/";
license = stdenv.lib.licenses.isc; license = lib.licenses.isc;
platforms = stdenv.lib.platforms.all; platforms = lib.platforms.all;
maintainers = [ stdenv.lib.maintainers.earldouglas ]; maintainers = [ lib.maintainers.earldouglas ];
}; };
} }

View file

@ -1,4 +1,4 @@
{ stdenv, fetchurl, autoconf, automake }: { lib, stdenv, fetchurl, autoconf, automake }:
stdenv.mkDerivation rec { stdenv.mkDerivation rec {
name = "avra-1.3.0"; name = "avra-1.3.0";
@ -19,7 +19,7 @@ stdenv.mkDerivation rec {
automake -a automake -a
''; '';
meta = with stdenv.lib; { meta = with lib; {
description = "Assembler for the Atmel AVR microcontroller family"; description = "Assembler for the Atmel AVR microcontroller family";
homepage = "http://avra.sourceforge.net/"; homepage = "http://avra.sourceforge.net/";
license = licenses.gpl2Plus; license = licenses.gpl2Plus;

View file

@ -1,4 +1,4 @@
{ fetchurl, stdenv, autoconf, automake, libtool, gmp { fetchurl, lib, stdenv, autoconf, automake, libtool, gmp
, darwin , darwin
}: }:
@ -13,7 +13,7 @@ stdenv.mkDerivation rec {
nativeBuildInputs = [ autoconf automake libtool ]; nativeBuildInputs = [ autoconf automake libtool ];
buildInputs = stdenv.lib.optional stdenv.isDarwin buildInputs = lib.optional stdenv.isDarwin
darwin.apple_sdk.frameworks.ApplicationServices darwin.apple_sdk.frameworks.ApplicationServices
; ;
@ -21,7 +21,7 @@ stdenv.mkDerivation rec {
preConfigure = preConfigure =
# For libuv on darwin # For libuv on darwin
stdenv.lib.optionalString stdenv.isDarwin '' lib.optionalString stdenv.isDarwin ''
export LIBTOOLIZE=libtoolize export LIBTOOLIZE=libtoolize
'' + '' +
# Help libgc's configure. # Help libgc's configure.
@ -50,9 +50,9 @@ stdenv.mkDerivation rec {
meta = { meta = {
description = "Efficient Scheme compiler"; description = "Efficient Scheme compiler";
homepage = "http://www-sop.inria.fr/indes/fp/Bigloo/"; homepage = "http://www-sop.inria.fr/indes/fp/Bigloo/";
license = stdenv.lib.licenses.gpl2Plus; license = lib.licenses.gpl2Plus;
platforms = stdenv.lib.platforms.unix; platforms = lib.platforms.unix;
maintainers = with stdenv.lib.maintainers; [ thoughtpolice ]; maintainers = with lib.maintainers; [ thoughtpolice ];
longDescription = '' longDescription = ''
Bigloo is a Scheme implementation devoted to one goal: enabling Bigloo is a Scheme implementation devoted to one goal: enabling

View file

@ -1,4 +1,4 @@
{ stdenv, cmake, python3, fetchFromGitHub, fetchpatch, emscripten }: { lib, stdenv, cmake, python3, fetchFromGitHub, fetchpatch, emscripten }:
stdenv.mkDerivation rec { stdenv.mkDerivation rec {
pname = "binaryen"; pname = "binaryen";
@ -21,7 +21,7 @@ stdenv.mkDerivation rec {
nativeBuildInputs = [ cmake python3 ]; nativeBuildInputs = [ cmake python3 ];
meta = with stdenv.lib; { meta = with lib; {
homepage = "https://github.com/WebAssembly/binaryen"; homepage = "https://github.com/WebAssembly/binaryen";
description = "Compiler infrastructure and toolchain library for WebAssembly, in C++"; description = "Compiler infrastructure and toolchain library for WebAssembly, in C++";
platforms = platforms.all; platforms = platforms.all;

View file

@ -1,4 +1,4 @@
{ stdenv { lib, stdenv
, fetchFromGitHub , fetchFromGitHub
, fetchpatch , fetchpatch
, autoconf , autoconf
@ -97,10 +97,10 @@ in stdenv.mkDerivation rec {
meta = { meta = {
description = "Toolchain for the Bluespec Hardware Definition Language"; description = "Toolchain for the Bluespec Hardware Definition Language";
homepage = "https://github.com/B-Lang-org/bsc"; homepage = "https://github.com/B-Lang-org/bsc";
license = stdenv.lib.licenses.bsd3; license = lib.licenses.bsd3;
platforms = [ "x86_64-linux" ]; platforms = [ "x86_64-linux" ];
# darwin fails at https://github.com/B-Lang-org/bsc/pull/35#issuecomment-583731562 # darwin fails at https://github.com/B-Lang-org/bsc/pull/35#issuecomment-583731562
# aarch64 fails, as GHC fails with "ghc: could not execute: opt" # aarch64 fails, as GHC fails with "ghc: could not execute: opt"
maintainers = with stdenv.lib.maintainers; [ jcumming thoughtpolice ]; maintainers = with lib.maintainers; [ jcumming thoughtpolice ];
}; };
} }

View file

@ -1,12 +1,12 @@
# This file is based on https://github.com/turboMaCk/bs-platform.nix/blob/master/build-bs-platform.nix # This file is based on https://github.com/turboMaCk/bs-platform.nix/blob/master/build-bs-platform.nix
# to make potential future updates simpler # to make potential future updates simpler
{ stdenv, fetchFromGitHub, ninja, runCommand, nodejs, python3, { lib, stdenv, fetchFromGitHub, ninja, runCommand, nodejs, python3,
ocaml-version, version, src, ocaml-version, version, src,
patches ? [], patches ? [],
ocaml ? (import ./ocaml.nix { ocaml ? (import ./ocaml.nix {
version = ocaml-version; version = ocaml-version;
inherit stdenv; inherit lib stdenv;
src = "${src}/ocaml"; src = "${src}/ocaml";
}), }),
custom-ninja ? (ninja.overrideAttrs (attrs: { custom-ninja ? (ninja.overrideAttrs (attrs: {

View file

@ -1,9 +1,9 @@
{ stdenv, runCommand, fetchFromGitHub, ninja, nodejs, python3, ... }: { lib, stdenv, runCommand, fetchFromGitHub, ninja, nodejs, python3, ... }:
let let
build-bs-platform = import ./build-bs-platform.nix; build-bs-platform = import ./build-bs-platform.nix;
in in
(build-bs-platform rec { (build-bs-platform rec {
inherit stdenv runCommand fetchFromGitHub ninja nodejs python3; inherit lib stdenv runCommand fetchFromGitHub ninja nodejs python3;
version = "8.2.0"; version = "8.2.0";
ocaml-version = "4.06.1"; ocaml-version = "4.06.1";
@ -17,7 +17,7 @@ in
fetchSubmodules = true; fetchSubmodules = true;
}; };
}).overrideAttrs (attrs: { }).overrideAttrs (attrs: {
meta = with stdenv.lib; { meta = with lib; {
description = "A JavaScript backend for OCaml focused on smooth integration and clean generated code"; description = "A JavaScript backend for OCaml focused on smooth integration and clean generated code";
homepage = "https://bucklescript.github.io"; homepage = "https://bucklescript.github.io";
license = licenses.lgpl3; license = licenses.lgpl3;

View file

@ -1,4 +1,4 @@
{ stdenv, src, version }: { lib, stdenv, src, version }:
stdenv.mkDerivation rec { stdenv.mkDerivation rec {
inherit src version; inherit src version;
name = "ocaml-${version}+bs"; name = "ocaml-${version}+bs";
@ -9,7 +9,7 @@ stdenv.mkDerivation rec {
make -j9 world.opt make -j9 world.opt
''; '';
meta = with stdenv.lib; { meta = with lib; {
branch = "4.06"; branch = "4.06";
platforms = platforms.all; platforms = platforms.all;
}; };

View file

@ -1,4 +1,4 @@
{ stdenv, fetchurl, perl, coreutils }: { lib, stdenv, fetchurl, perl, coreutils }:
stdenv.mkDerivation rec { stdenv.mkDerivation rec {
name = "berkeley_upc-2.22.0"; name = "berkeley_upc-2.22.0";
@ -18,7 +18,7 @@ stdenv.mkDerivation rec {
nativeBuildInputs = [ coreutils ]; nativeBuildInputs = [ coreutils ];
buildInputs = [ perl ]; buildInputs = [ perl ];
meta = with stdenv.lib; { meta = with lib; {
description = "A compiler for the Berkely Unified Parallel C language"; description = "A compiler for the Berkely Unified Parallel C language";
longDescription = '' longDescription = ''
Unified Parallel C (UPC) is an extension of the C programming language Unified Parallel C (UPC) is an extension of the C programming language

View file

@ -1,4 +1,4 @@
{ stdenv, fetchFromGitHub, gcc }: { lib, stdenv, fetchFromGitHub, gcc }:
stdenv.mkDerivation rec { stdenv.mkDerivation rec {
pname = "cakelisp"; pname = "cakelisp";
@ -18,7 +18,7 @@ stdenv.mkDerivation rec {
--replace '"/usr/bin/g++"' '"${gcc}/bin/g++"' --replace '"/usr/bin/g++"' '"${gcc}/bin/g++"'
substituteInPlace src/ModuleManager.cpp \ substituteInPlace src/ModuleManager.cpp \
--replace '"/usr/bin/g++"' '"${gcc}/bin/g++"' --replace '"/usr/bin/g++"' '"${gcc}/bin/g++"'
'' + stdenv.lib.optionalString stdenv.isDarwin '' '' + lib.optionalString stdenv.isDarwin ''
substituteInPlace Build.sh --replace '--export-dynamic' '-export_dynamic' substituteInPlace Build.sh --replace '--export-dynamic' '-export_dynamic'
substituteInPlace runtime/HotReloading.cake --replace '--export-dynamic' '-export_dynamic' substituteInPlace runtime/HotReloading.cake --replace '--export-dynamic' '-export_dynamic'
substituteInPlace Bootstrap.cake --replace '--export-dynamic' '-export_dynamic' substituteInPlace Bootstrap.cake --replace '--export-dynamic' '-export_dynamic'
@ -32,7 +32,7 @@ stdenv.mkDerivation rec {
install -Dm755 bin/cakelisp -t $out/bin install -Dm755 bin/cakelisp -t $out/bin
''; '';
meta = with stdenv.lib; { meta = with lib; {
description = "A performance-oriented Lisp-like language"; description = "A performance-oriented Lisp-like language";
homepage = "https://github.com/makuto/cakelisp"; homepage = "https://github.com/makuto/cakelisp";
license = licenses.gpl3Plus; license = licenses.gpl3Plus;

View file

@ -1,4 +1,4 @@
{ stdenv, fetchFromGitHub, makeWrapper, clang, haskellPackages }: { lib, stdenv, fetchFromGitHub, makeWrapper, clang, haskellPackages }:
haskellPackages.mkDerivation rec { haskellPackages.mkDerivation rec {
@ -39,10 +39,10 @@ haskellPackages.mkDerivation rec {
description = "A statically typed lisp, without a GC, for real-time applications"; description = "A statically typed lisp, without a GC, for real-time applications";
homepage = "https://github.com/carp-lang/Carp"; homepage = "https://github.com/carp-lang/Carp";
license = stdenv.lib.licenses.asl20; license = lib.licenses.asl20;
maintainers = with stdenv.lib.maintainers; [ jluttine ]; maintainers = with lib.maintainers; [ jluttine ];
# Windows not (yet) supported. # Windows not (yet) supported.
platforms = with stdenv.lib.platforms; unix ++ darwin; platforms = with lib.platforms; unix ++ darwin;
} }

View file

@ -1,4 +1,4 @@
{ stdenv { lib, stdenv
, fetchFromGitHub , fetchFromGitHub
}: }:
@ -15,7 +15,7 @@ stdenv.mkDerivation rec {
makeFlags = [ "PREFIX=${placeholder "out"}"]; makeFlags = [ "PREFIX=${placeholder "out"}"];
meta = with stdenv.lib; { meta = with lib; {
homepage = "https://cc65.github.io/"; homepage = "https://cc65.github.io/";
description = "C compiler for processors of 6502 family"; description = "C compiler for processors of 6502 family";
longDescription = '' longDescription = ''

View file

@ -1,4 +1,4 @@
{ stdenv, fetchurl, runCommand, bootstrap_cmds, coreutils, glibc, m4, runtimeShell }: { lib, stdenv, fetchurl, runCommand, bootstrap_cmds, coreutils, glibc, m4, runtimeShell }:
let let
options = rec { options = rec {
@ -101,7 +101,7 @@ stdenv.mkDerivation rec {
hardeningDisable = [ "format" ]; hardeningDisable = [ "format" ];
meta = with stdenv.lib; { meta = with lib; {
description = "Clozure Common Lisp"; description = "Clozure Common Lisp";
homepage = "https://ccl.clozure.com/"; homepage = "https://ccl.clozure.com/";
maintainers = with maintainers; [ raskin muflax tohl ]; maintainers = with maintainers; [ raskin muflax tohl ];

View file

@ -1,4 +1,4 @@
{ stdenv, fetchFromGitHub { lib, stdenv, fetchFromGitHub
, coreutils, cctools , coreutils, cctools
, ncurses, libiconv, libX11, libuuid , ncurses, libiconv, libX11, libuuid
}: }:
@ -15,12 +15,12 @@ stdenv.mkDerivation rec {
fetchSubmodules = true; fetchSubmodules = true;
}; };
nativeBuildInputs = [ coreutils ] ++ stdenv.lib.optional stdenv.isDarwin cctools; nativeBuildInputs = [ coreutils ] ++ lib.optional stdenv.isDarwin cctools;
buildInputs = [ ncurses libiconv libX11 libuuid ]; buildInputs = [ ncurses libiconv libX11 libuuid ];
enableParallelBuilding = true; enableParallelBuilding = true;
NIX_CFLAGS_COMPILE = stdenv.lib.optionalString stdenv.cc.isGNU "-Wno-error=format-truncation"; NIX_CFLAGS_COMPILE = lib.optionalString stdenv.cc.isGNU "-Wno-error=format-truncation";
/* /*
** We patch out a very annoying 'feature' in ./configure, which ** We patch out a very annoying 'feature' in ./configure, which
@ -70,9 +70,9 @@ stdenv.mkDerivation rec {
meta = { meta = {
description = "A powerful and incredibly fast R6RS Scheme compiler"; description = "A powerful and incredibly fast R6RS Scheme compiler";
homepage = "https://cisco.github.io/ChezScheme/"; homepage = "https://cisco.github.io/ChezScheme/";
license = stdenv.lib.licenses.asl20; license = lib.licenses.asl20;
maintainers = with stdenv.lib.maintainers; [ thoughtpolice ]; maintainers = with lib.maintainers; [ thoughtpolice ];
platforms = stdenv.lib.platforms.unix; platforms = lib.platforms.unix;
badPlatforms = [ "aarch64-linux" ]; badPlatforms = [ "aarch64-linux" ];
}; };
} }

View file

@ -1,4 +1,4 @@
{ stdenv, fetchurl, makeWrapper, darwin, bootstrap-chicken ? null }: { lib, stdenv, fetchurl, makeWrapper, darwin, bootstrap-chicken ? null }:
let let
version = "4.13.0"; version = "4.13.0";
@ -8,7 +8,6 @@ let
else if (isFreeBSD || isOpenBSD) then "bsd" else if (isFreeBSD || isOpenBSD) then "bsd"
else if isSunOS then "solaris" else if isSunOS then "solaris"
else "linux"; # Should be a sane default else "linux"; # Should be a sane default
lib = stdenv.lib;
in in
stdenv.mkDerivation { stdenv.mkDerivation {
pname = "chicken"; pname = "chicken";
@ -70,9 +69,9 @@ stdenv.mkDerivation {
meta = { meta = {
homepage = "http://www.call-cc.org/"; homepage = "http://www.call-cc.org/";
license = stdenv.lib.licenses.bsd3; license = lib.licenses.bsd3;
maintainers = with stdenv.lib.maintainers; [ corngood ]; maintainers = with lib.maintainers; [ corngood ];
platforms = stdenv.lib.platforms.linux ++ stdenv.lib.platforms.darwin; # Maybe other Unix platforms = lib.platforms.linux ++ lib.platforms.darwin; # Maybe other Unix
description = "A portable compiler for the Scheme programming language"; description = "A portable compiler for the Scheme programming language";
longDescription = '' longDescription = ''
CHICKEN is a compiler for the Scheme programming language. CHICKEN is a compiler for the Scheme programming language.

View file

@ -20,8 +20,8 @@ eggDerivation {
meta = { meta = {
description = "Generate nix-expression from CHICKEN scheme eggs"; description = "Generate nix-expression from CHICKEN scheme eggs";
homepage = "https://github.com/the-kenny/egg2nix"; homepage = "https://github.com/the-kenny/egg2nix";
license = stdenv.lib.licenses.bsd3; license = lib.licenses.bsd3;
platforms = stdenv.lib.platforms.unix; platforms = lib.platforms.unix;
maintainers = with stdenv.lib.maintainers; [ corngood ]; maintainers = with lib.maintainers; [ corngood ];
}; };
} }

View file

@ -1,4 +1,4 @@
{ stdenv, chicken, makeWrapper }: { lib, stdenv, chicken, makeWrapper }:
{ name, src { name, src
, buildInputs ? [] , buildInputs ? []
, chickenInstallFlags ? [] , chickenInstallFlags ? []
@ -8,7 +8,7 @@
let let
libPath = "${chicken}/var/lib/chicken/${toString chicken.binaryVersion}/"; libPath = "${chicken}/var/lib/chicken/${toString chicken.binaryVersion}/";
overrides = import ./overrides.nix; overrides = import ./overrides.nix;
baseName = stdenv.lib.getName name; baseName = lib.getName name;
override = if builtins.hasAttr baseName overrides override = if builtins.hasAttr baseName overrides
then then
builtins.getAttr baseName overrides builtins.getAttr baseName overrides
@ -20,7 +20,7 @@ stdenv.mkDerivation ({
propagatedBuildInputs = buildInputs; propagatedBuildInputs = buildInputs;
buildInputs = [ makeWrapper chicken ]; buildInputs = [ makeWrapper chicken ];
CSC_OPTIONS = stdenv.lib.concatStringsSep " " cscOptions; CSC_OPTIONS = lib.concatStringsSep " " cscOptions;
CHICKEN_REPOSITORY = libPath; CHICKEN_REPOSITORY = libPath;
CHICKEN_INSTALL_PREFIX = "$out"; CHICKEN_INSTALL_PREFIX = "$out";
@ -28,7 +28,7 @@ stdenv.mkDerivation ({
installPhase = '' installPhase = ''
runHook preInstall runHook preInstall
chicken-install -p $out ${stdenv.lib.concatStringsSep " " chickenInstallFlags} chicken-install -p $out ${lib.concatStringsSep " " chickenInstallFlags}
for f in $out/bin/* for f in $out/bin/*
do do

View file

@ -1,4 +1,4 @@
{ stdenv, fetchurl, makeWrapper, darwin, bootstrap-chicken ? null }: { lib, stdenv, fetchurl, makeWrapper, darwin, bootstrap-chicken ? null }:
let let
version = "5.2.0"; version = "5.2.0";
@ -8,7 +8,6 @@ let
else if (isFreeBSD || isOpenBSD) then "bsd" else if (isFreeBSD || isOpenBSD) then "bsd"
else if isSunOS then "solaris" else if isSunOS then "solaris"
else "linux"; # Should be a sane default else "linux"; # Should be a sane default
lib = stdenv.lib;
in in
stdenv.mkDerivation { stdenv.mkDerivation {
pname = "chicken"; pname = "chicken";
@ -51,9 +50,9 @@ stdenv.mkDerivation {
meta = { meta = {
homepage = "http://www.call-cc.org/"; homepage = "http://www.call-cc.org/";
license = stdenv.lib.licenses.bsd3; license = lib.licenses.bsd3;
maintainers = with stdenv.lib.maintainers; [ corngood ]; maintainers = with lib.maintainers; [ corngood ];
platforms = stdenv.lib.platforms.linux ++ stdenv.lib.platforms.darwin; # Maybe other Unix platforms = lib.platforms.linux ++ lib.platforms.darwin; # Maybe other Unix
description = "A portable compiler for the Scheme programming language"; description = "A portable compiler for the Scheme programming language";
longDescription = '' longDescription = ''
CHICKEN is a compiler for the Scheme programming language. CHICKEN is a compiler for the Scheme programming language.

View file

@ -1,4 +1,4 @@
{ stdenv, eggDerivation, fetchFromGitHub, chickenEggs }: { lib, stdenv, eggDerivation, fetchFromGitHub, chickenEggs }:
# Note: This mostly reimplements the default.nix already contained in # Note: This mostly reimplements the default.nix already contained in
# the tarball. Is there a nicer way than duplicating code? # the tarball. Is there a nicer way than duplicating code?
@ -22,8 +22,8 @@ eggDerivation {
meta = { meta = {
description = "Generate nix-expression from CHICKEN scheme eggs"; description = "Generate nix-expression from CHICKEN scheme eggs";
homepage = "https://github.com/the-kenny/egg2nix"; homepage = "https://github.com/the-kenny/egg2nix";
license = stdenv.lib.licenses.bsd3; license = lib.licenses.bsd3;
platforms = stdenv.lib.platforms.unix; platforms = lib.platforms.unix;
maintainers = with stdenv.lib.maintainers; [ corngood ]; maintainers = with lib.maintainers; [ corngood ];
}; };
} }

View file

@ -1,4 +1,4 @@
{ stdenv, chicken, makeWrapper }: { lib, stdenv, chicken, makeWrapper }:
{ name, src { name, src
, buildInputs ? [] , buildInputs ? []
, chickenInstallFlags ? [] , chickenInstallFlags ? []
@ -7,7 +7,7 @@
let let
overrides = import ./overrides.nix; overrides = import ./overrides.nix;
baseName = stdenv.lib.getName name; baseName = lib.getName name;
override = if builtins.hasAttr baseName overrides override = if builtins.hasAttr baseName overrides
then then
builtins.getAttr baseName overrides builtins.getAttr baseName overrides
@ -19,14 +19,14 @@ stdenv.mkDerivation ({
propagatedBuildInputs = buildInputs; propagatedBuildInputs = buildInputs;
buildInputs = [ makeWrapper chicken ]; buildInputs = [ makeWrapper chicken ];
CSC_OPTIONS = stdenv.lib.concatStringsSep " " cscOptions; CSC_OPTIONS = lib.concatStringsSep " " cscOptions;
installPhase = '' installPhase = ''
runHook preInstall runHook preInstall
export CHICKEN_INSTALL_PREFIX=$out export CHICKEN_INSTALL_PREFIX=$out
export CHICKEN_INSTALL_REPOSITORY=$out/lib/chicken/${toString chicken.binaryVersion} export CHICKEN_INSTALL_REPOSITORY=$out/lib/chicken/${toString chicken.binaryVersion}
chicken-install ${stdenv.lib.concatStringsSep " " chickenInstallFlags} chicken-install ${lib.concatStringsSep " " chickenInstallFlags}
for f in $out/bin/* for f in $out/bin/*
do do

View file

@ -1,4 +1,4 @@
{ stdenv, fetchFromGitHub }: { lib, stdenv, fetchFromGitHub }:
stdenv.mkDerivation rec { stdenv.mkDerivation rec {
pname = "ciao"; pname = "ciao";
@ -22,7 +22,7 @@ stdenv.mkDerivation rec {
./ciao-boot.sh install ./ciao-boot.sh install
''; '';
meta = with stdenv.lib; { meta = with lib; {
homepage = "https://ciao-lang.org/"; homepage = "https://ciao-lang.org/";
description = "A general purpose, multi-paradigm programming language in the Prolog family"; description = "A general purpose, multi-paradigm programming language in the Prolog family";
license = licenses.lgpl21; license = licenses.lgpl21;

View file

@ -1,4 +1,4 @@
{ stdenv, fetchFromGitHub, fetchFromGitLab { lib, stdenv, fetchFromGitHub, fetchFromGitLab
, llvmPackages , llvmPackages
, cmake, boehmgc, gmp, zlib, ncurses, boost, libelf , cmake, boehmgc, gmp, zlib, ncurses, boost, libelf
, python, git, sbcl , python, git, sbcl
@ -72,14 +72,14 @@ stdenv.mkDerivation rec {
buildInputs = with llvmPackages; buildInputs = with llvmPackages;
( (
builtins.map (x: stdenv.lib.overrideDerivation x builtins.map (x: lib.overrideDerivation x
(x: {NIX_CFLAGS_COMPILE= (x.NIX_CFLAGS_COMPILE or "") + " -frtti"; })) (x: {NIX_CFLAGS_COMPILE= (x.NIX_CFLAGS_COMPILE or "") + " -frtti"; }))
[ llvm clang clang-unwrapped clang ]) ++ [ llvm clang clang-unwrapped clang ]) ++
[ [
gmp zlib ncurses gmp zlib ncurses
boost boehmgc libelf boost boehmgc libelf
(boost.override {enableStatic = true; enableShared = false;}) (boost.override {enableStatic = true; enableShared = false;})
(stdenv.lib.overrideDerivation boehmgc (lib.overrideDerivation boehmgc
(x: {configureFlags = (x.configureFlags or []) ++ ["--enable-static"];})) (x: {configureFlags = (x.configureFlags or []) ++ ["--enable-static"];}))
]; ];
@ -120,9 +120,9 @@ stdenv.mkDerivation rec {
meta = { meta = {
inherit version; inherit version;
description = "A Common Lisp implementation based on LLVM with C++ integration"; description = "A Common Lisp implementation based on LLVM with C++ integration";
license = stdenv.lib.licenses.lgpl21Plus ; license = lib.licenses.lgpl21Plus ;
maintainers = [stdenv.lib.maintainers.raskin]; maintainers = [lib.maintainers.raskin];
platforms = stdenv.lib.platforms.linux; platforms = lib.platforms.linux;
# Large, long to build, a private build of clang is needed, a prerelease. # Large, long to build, a private build of clang is needed, a prerelease.
hydraPlatforms = []; hydraPlatforms = [];
homepage = "https://github.com/drmeister/clasp"; homepage = "https://github.com/drmeister/clasp";

View file

@ -1,4 +1,4 @@
{ stdenv, fetchurl }: { lib, stdenv, fetchurl }:
stdenv.mkDerivation { stdenv.mkDerivation {
name = "clean-3.0"; name = "clean-3.0";
@ -45,8 +45,8 @@ stdenv.mkDerivation {
''; '';
homepage = "http://wiki.clean.cs.ru.nl/Clean"; homepage = "http://wiki.clean.cs.ru.nl/Clean";
license = stdenv.lib.licenses.lgpl21; license = lib.licenses.lgpl21;
maintainers = [ stdenv.lib.maintainers.kkallio ]; maintainers = [ lib.maintainers.kkallio ];
platforms = [ "i686-linux" "x86_64-linux" ]; platforms = [ "i686-linux" "x86_64-linux" ];
}; };
} }

View file

@ -1,4 +1,4 @@
{ stdenv, fetchurl, jre, makeWrapper }: { lib, stdenv, fetchurl, jre, makeWrapper }:
stdenv.mkDerivation rec { stdenv.mkDerivation rec {
pname = "closure-compiler"; pname = "closure-compiler";
@ -21,7 +21,7 @@ stdenv.mkDerivation rec {
--add-flags "-jar $out/share/java/closure-compiler-v${version}.jar" --add-flags "-jar $out/share/java/closure-compiler-v${version}.jar"
''; '';
meta = with stdenv.lib; { meta = with lib; {
description = "A tool for making JavaScript download and run faster"; description = "A tool for making JavaScript download and run faster";
homepage = "https://developers.google.com/closure/compiler/"; homepage = "https://developers.google.com/closure/compiler/";
license = licenses.asl20; license = licenses.asl20;

View file

@ -1,4 +1,4 @@
{ stdenv, fetchurl, python, runtimeShell }: { lib, stdenv, fetchurl, python, runtimeShell }:
stdenv.mkDerivation { stdenv.mkDerivation {
name = "cmdstan-2.17.1"; name = "cmdstan-2.17.1";
@ -36,7 +36,7 @@ stdenv.mkDerivation {
likelihood estimation with Optimization (L-BFGS). likelihood estimation with Optimization (L-BFGS).
''; '';
homepage = "https://mc-stan.org/interfaces/cmdstan.html"; homepage = "https://mc-stan.org/interfaces/cmdstan.html";
license = stdenv.lib.licenses.bsd3; license = lib.licenses.bsd3;
platforms = stdenv.lib.platforms.all; platforms = lib.platforms.all;
}; };
} }

View file

@ -1,4 +1,4 @@
{stdenv, fetchurl}: {lib, stdenv, fetchurl}:
let let
inherit (stdenv.hostPlatform) system; inherit (stdenv.hostPlatform) system;
@ -36,9 +36,9 @@ stdenv.mkDerivation {
which runs on most major Unix platforms. It mainly conforms to the which runs on most major Unix platforms. It mainly conforms to the
ANSI Common Lisp standard. ANSI Common Lisp standard.
''; '';
license = stdenv.lib.licenses.free; # public domain license = lib.licenses.free; # public domain
homepage = "http://www.cons.org/cmucl/"; homepage = "http://www.cons.org/cmucl/";
maintainers = [stdenv.lib.maintainers.tohl]; maintainers = [lib.maintainers.tohl];
platforms = stdenv.lib.platforms.linux; platforms = lib.platforms.linux;
}; };
} }

View file

@ -1,4 +1,4 @@
{ stdenv, fetchurl, makeWrapper, gcc, asciidoc, autoreconfHook }: { lib, stdenv, fetchurl, makeWrapper, gcc, asciidoc, autoreconfHook }:
stdenv.mkDerivation rec { stdenv.mkDerivation rec {
pname = "colm"; pname = "colm";
@ -20,7 +20,7 @@ stdenv.mkDerivation rec {
--prefix PATH ":" ${gcc}/bin --prefix PATH ":" ${gcc}/bin
''; '';
meta = with stdenv.lib; { meta = with lib; {
description = "A programming language for the analysis and transformation of computer languages"; description = "A programming language for the analysis and transformation of computer languages";
homepage = "http://www.colm.net/open-source/colm"; homepage = "http://www.colm.net/open-source/colm";
license = licenses.gpl2; license = licenses.gpl2;

View file

@ -1,4 +1,4 @@
{ stdenv, fetchFromGitHub, fetchpatch, makeWrapper { lib, stdenv, fetchFromGitHub, fetchpatch, makeWrapper
, coqPackages, ocamlPackages, coq2html , coqPackages, ocamlPackages, coq2html
, tools ? stdenv.cc , tools ? stdenv.cc
, version ? "3.8" , version ? "3.8"
@ -8,7 +8,7 @@ let
ocaml-pkgs = with ocamlPackages; [ ocaml findlib menhir ]; ocaml-pkgs = with ocamlPackages; [ ocaml findlib menhir ];
ccomp-platform = if stdenv.isDarwin then "x86_64-macosx" else "x86_64-linux"; ccomp-platform = if stdenv.isDarwin then "x86_64-macosx" else "x86_64-linux";
inherit (coqPackages) coq flocq; inherit (coqPackages) coq flocq;
inherit (stdenv.lib) optional optionalString; inherit (lib) optional optionalString;
in in
let param = { let param = {
@ -83,7 +83,7 @@ stdenv.mkDerivation rec {
outputs = [ "out" "lib" "doc" "man" ]; outputs = [ "out" "lib" "doc" "man" ];
meta = with stdenv.lib; { meta = with lib; {
description = "Formally verified C compiler"; description = "Formally verified C compiler";
homepage = "https://compcert.org"; homepage = "https://compcert.org";
license = licenses.inria-compcert; license = licenses.inria-compcert;

View file

@ -1,4 +1,4 @@
{ stdenv { lib, stdenv
, fetchzip , fetchzip
, pkg-config , pkg-config
, autoPatchelfHook , autoPatchelfHook
@ -38,7 +38,7 @@ stdenv.mkDerivation rec {
isClang = true; isClang = true;
}; };
meta = with stdenv.lib; { meta = with lib; {
description = description =
"Accelerate Complex C++ Applications on Heterogeneous Compute Systems using Open Standards"; "Accelerate Complex C++ Applications on Heterogeneous Compute Systems using Open Standards";
homepage = "https://www.codeplay.com/products/computesuite/computecpp"; homepage = "https://www.codeplay.com/products/computesuite/computecpp";

View file

@ -1,4 +1,4 @@
{ stdenv { lib, stdenv
, fetchurl , fetchurl
, libffi , libffi
}: }:
@ -23,7 +23,7 @@ stdenv.mkDerivation rec {
installPhase = '' installPhase = ''
make BACKEND=elf64 install prefix=$out make BACKEND=elf64 install prefix=$out
''; '';
meta = with stdenv.lib; { meta = with lib; {
description = "Simple imperative language, statically typed with type inference and genericity"; description = "Simple imperative language, statically typed with type inference and genericity";
homepage = "https://tibleiz.net/copper/"; homepage = "https://tibleiz.net/copper/";
license = licenses.bsd2; license = licenses.bsd2;

View file

@ -1,4 +1,4 @@
{ config, stdenv { config, lib, stdenv
, fetchFromGitHub , fetchFromGitHub
, fetchpatch , fetchpatch
, which , which
@ -90,7 +90,7 @@ stdenv.mkDerivation rec {
runHook postInstall runHook postInstall
''; '';
meta = with stdenv.lib; { meta = with lib; {
homepage = "https://github.com/dotnet/core/"; homepage = "https://github.com/dotnet/core/";
description = ".NET is a general purpose development platform"; description = ".NET is a general purpose development platform";
platforms = [ "x86_64-linux" ]; platforms = [ "x86_64-linux" ];

View file

@ -63,7 +63,7 @@ let
commonBuildInputs = extraBuildInputs: [ commonBuildInputs = extraBuildInputs: [
boehmgc libatomic_ops pcre libevent libyaml zlib libxml2 openssl boehmgc libatomic_ops pcre libevent libyaml zlib libxml2 openssl
] ++ extraBuildInputs ] ++ extraBuildInputs
++ stdenv.lib.optionals stdenv.isDarwin [ libiconv ]; ++ lib.optionals stdenv.isDarwin [ libiconv ];
generic = ( generic = (
{ version { version

View file

@ -61,7 +61,7 @@ stdenv.mkDerivation rec {
gtk2 glib fontconfig freetype unixODBC alsaLib gtk2 glib fontconfig freetype unixODBC alsaLib
]; ];
rpath = "${stdenv.lib.makeLibraryPath runtimeDependencies}:${stdenv.cc.cc.lib}/lib64"; rpath = "${lib.makeLibraryPath runtimeDependencies}:${stdenv.cc.cc.lib}/lib64";
unpackPhase = '' unpackPhase = ''
sh $src --keep --noexec sh $src --keep --noexec
@ -232,7 +232,7 @@ stdenv.mkDerivation rec {
majorVersion = lib.versions.majorMinor version; majorVersion = lib.versions.majorMinor version;
}; };
meta = with stdenv.lib; { meta = with lib; {
description = "A compiler for NVIDIA GPUs, math libraries, and tools"; description = "A compiler for NVIDIA GPUs, math libraries, and tools";
homepage = "https://developer.nvidia.com/cuda-toolkit"; homepage = "https://developer.nvidia.com/cuda-toolkit";
platforms = [ "x86_64-linux" ]; platforms = [ "x86_64-linux" ];

View file

@ -1,4 +1,4 @@
{ stdenv { lib, stdenv
, fetchFromGitHub , fetchFromGitHub
, cmake , cmake
, pkg-config , pkg-config
@ -27,7 +27,7 @@ stdenv.mkDerivation {
checkTarget = "tests"; checkTarget = "tests";
meta = with stdenv.lib; { meta = with lib; {
description = "Lisp-flavoured C"; description = "Lisp-flavoured C";
longDescription = '' longDescription = ''
Dale is a system (no GC) programming language that uses Dale is a system (no GC) programming language that uses

View file

@ -1,4 +1,4 @@
{ stdenv, fetchFromGitHub }: { lib, stdenv, fetchFromGitHub }:
stdenv.mkDerivation rec { stdenv.mkDerivation rec {
pname = "dasm"; pname = "dasm";
@ -24,7 +24,7 @@ stdenv.mkDerivation rec {
checkTarget = "test"; checkTarget = "test";
doCheck = true; doCheck = true;
meta = with stdenv.lib; { meta = with lib; {
description = "Assembler for 6502 and other 8-bit microprocessors"; description = "Assembler for 6502 and other 8-bit microprocessors";
homepage = "https://dasm-assembler.github.io"; homepage = "https://dasm-assembler.github.io";
license = licenses.gpl2; license = licenses.gpl2;

View file

@ -1,4 +1,4 @@
{ stdenv, fetchurl }: { lib, stdenv, fetchurl }:
stdenv.mkDerivation rec { stdenv.mkDerivation rec {
pname = "dev86"; pname = "dev86";
@ -16,6 +16,6 @@ stdenv.mkDerivation rec {
meta = { meta = {
description = "Linux 8086 development environment"; description = "Linux 8086 development environment";
homepage = "http://v3.sk/~lkundrak/dev86/"; homepage = "http://v3.sk/~lkundrak/dev86/";
platforms = stdenv.lib.platforms.linux; platforms = lib.platforms.linux;
}; };
} }

View file

@ -16,7 +16,7 @@ let
name = "dmd.conf"; name = "dmd.conf";
text = (lib.generators.toINI {} { text = (lib.generators.toINI {} {
Environment = { Environment = {
DFLAGS = ''-I@out@/include/dmd -L-L@out@/lib -fPIC ${stdenv.lib.optionalString (!targetPackages.stdenv.cc.isClang) "-L--export-dynamic"}''; DFLAGS = ''-I@out@/include/dmd -L-L@out@/lib -fPIC ${lib.optionalString (!targetPackages.stdenv.cc.isClang) "-L--export-dynamic"}'';
}; };
}); });
}; };
@ -77,16 +77,16 @@ stdenv.mkDerivation rec {
postPatch = '' postPatch = ''
substituteInPlace dmd/test/dshell/test6952.d --replace "/usr/bin/env bash" "${bash}/bin/bash" substituteInPlace dmd/test/dshell/test6952.d --replace "/usr/bin/env bash" "${bash}/bin/bash"
'' ''
+ stdenv.lib.optionalString stdenv.hostPlatform.isLinux '' + lib.optionalString stdenv.hostPlatform.isLinux ''
substituteInPlace phobos/std/socket.d --replace "assert(ih.addrList[0] == 0x7F_00_00_01);" "" substituteInPlace phobos/std/socket.d --replace "assert(ih.addrList[0] == 0x7F_00_00_01);" ""
'' ''
+ stdenv.lib.optionalString stdenv.hostPlatform.isDarwin '' + lib.optionalString stdenv.hostPlatform.isDarwin ''
substituteInPlace phobos/std/socket.d --replace "foreach (name; names)" "names = []; foreach (name; names)" substituteInPlace phobos/std/socket.d --replace "foreach (name; names)" "names = []; foreach (name; names)"
''; '';
nativeBuildInputs = [ makeWrapper unzip which gdb git ] nativeBuildInputs = [ makeWrapper unzip which gdb git ]
++ stdenv.lib.optional stdenv.hostPlatform.isDarwin (with darwin.apple_sdk.frameworks; [ ++ lib.optional stdenv.hostPlatform.isDarwin (with darwin.apple_sdk.frameworks; [
Foundation Foundation
]); ]);
@ -163,7 +163,7 @@ stdenv.mkDerivation rec {
substitute ${dmdConfFile} "$out/bin/dmd.conf" --subst-var out substitute ${dmdConfFile} "$out/bin/dmd.conf" --subst-var out
''; '';
meta = with stdenv.lib; { meta = with lib; {
description = "Official reference compiler for the D language"; description = "Official reference compiler for the D language";
homepage = "http://dlang.org/"; homepage = "http://dlang.org/";
# Everything is now Boost licensed, even the backend. # Everything is now Boost licensed, even the backend.

View file

@ -4,7 +4,7 @@
}: }:
assert builtins.elem type [ "aspnetcore" "netcore" "sdk"]; assert builtins.elem type [ "aspnetcore" "netcore" "sdk"];
{ stdenv { lib, stdenv
, fetchurl , fetchurl
, libunwind , libunwind
, openssl , openssl
@ -41,7 +41,7 @@ let
in stdenv.mkDerivation rec { in stdenv.mkDerivation rec {
inherit pname version; inherit pname version;
rpath = stdenv.lib.makeLibraryPath [ rpath = lib.makeLibraryPath [
curl curl
icu icu
libunwind libunwind
@ -70,7 +70,7 @@ in stdenv.mkDerivation rec {
runHook postInstall runHook postInstall
''; '';
postFixup = stdenv.lib.optionalString stdenv.isLinux '' postFixup = lib.optionalString stdenv.isLinux ''
patchelf --set-interpreter "${stdenv.cc.bintools.dynamicLinker}" $out/dotnet patchelf --set-interpreter "${stdenv.cc.bintools.dynamicLinker}" $out/dotnet
patchelf --set-rpath "${rpath}" $out/dotnet patchelf --set-rpath "${rpath}" $out/dotnet
find $out -type f -name "*.so" -exec patchelf --set-rpath '$ORIGIN:${rpath}' {} \; find $out -type f -name "*.so" -exec patchelf --set-rpath '$ORIGIN:${rpath}' {} \;
@ -82,7 +82,7 @@ in stdenv.mkDerivation rec {
$out/bin/dotnet --info $out/bin/dotnet --info
''; '';
meta = with stdenv.lib; { meta = with lib; {
homepage = "https://dotnet.github.io/"; homepage = "https://dotnet.github.io/";
description = builtins.getAttr type descriptions; description = builtins.getAttr type descriptions;
platforms = [ "x86_64-linux" "aarch64-linux" "x86_64-darwin" ]; platforms = [ "x86_64-linux" "aarch64-linux" "x86_64-darwin" ];

View file

@ -1,4 +1,4 @@
{ stdenv, fetchurl, fetchpatch { lib, stdenv, fetchurl, fetchpatch
, libtool, autoconf, automake , libtool, autoconf, automake
, gmp, mpfr, libffi, makeWrapper , gmp, mpfr, libffi, makeWrapper
, noUnicode ? false , noUnicode ? false
@ -23,7 +23,7 @@ let
]; ];
propagatedBuildInputs = [ propagatedBuildInputs = [
libffi gmp mpfr gcc libffi gmp mpfr gcc
] ++ stdenv.lib.optionals useBoehmgc [ ] ++ lib.optionals useBoehmgc [
# replaces ecl's own gc which other packages can depend on, thus propagated # replaces ecl's own gc which other packages can depend on, thus propagated
boehmgc boehmgc
]; ];
@ -42,7 +42,7 @@ stdenv.mkDerivation {
"--with-libffi-prefix=${libffi.dev}" "--with-libffi-prefix=${libffi.dev}"
] ]
++ ++
(stdenv.lib.optional (! noUnicode) (lib.optional (! noUnicode)
"--enable-unicode") "--enable-unicode")
; ;
@ -77,8 +77,8 @@ stdenv.mkDerivation {
meta = { meta = {
inherit (s) version; inherit (s) version;
description = "Lisp implementation aiming to be small, fast and easy to embed"; description = "Lisp implementation aiming to be small, fast and easy to embed";
license = stdenv.lib.licenses.mit ; license = lib.licenses.mit ;
maintainers = [stdenv.lib.maintainers.raskin]; maintainers = [lib.maintainers.raskin];
platforms = stdenv.lib.platforms.unix; platforms = lib.platforms.unix;
}; };
} }

View file

@ -1,4 +1,4 @@
{stdenv, fetchurl {lib, stdenv, fetchurl
, libtool, autoconf, automake , libtool, autoconf, automake
, texinfo , texinfo
, gmp, mpfr, libffi, makeWrapper , gmp, mpfr, libffi, makeWrapper
@ -22,7 +22,7 @@ let
propagatedBuildInputs = [ propagatedBuildInputs = [
libffi gmp mpfr gcc libffi gmp mpfr gcc
# replaces ecl's own gc which other packages can depend on, thus propagated # replaces ecl's own gc which other packages can depend on, thus propagated
] ++ stdenv.lib.optionals useBoehmgc [ ] ++ lib.optionals useBoehmgc [
# replaces ecl's own gc which other packages can depend on, thus propagated # replaces ecl's own gc which other packages can depend on, thus propagated
boehmgc boehmgc
]; ];
@ -76,7 +76,7 @@ stdenv.mkDerivation {
"--with-libffi-prefix=${libffi.dev}" "--with-libffi-prefix=${libffi.dev}"
] ]
++ ++
(stdenv.lib.optional (! noUnicode) (lib.optional (! noUnicode)
"--enable-unicode") "--enable-unicode")
; ;
@ -94,8 +94,8 @@ stdenv.mkDerivation {
inherit (s) version; inherit (s) version;
description = "Lisp implementation aiming to be small, fast and easy to embed"; description = "Lisp implementation aiming to be small, fast and easy to embed";
homepage = "https://common-lisp.net/project/ecl/"; homepage = "https://common-lisp.net/project/ecl/";
license = stdenv.lib.licenses.mit ; license = lib.licenses.mit ;
maintainers = [stdenv.lib.maintainers.raskin]; maintainers = [lib.maintainers.raskin];
platforms = stdenv.lib.platforms.linux; platforms = lib.platforms.linux;
}; };
} }

View file

@ -1,4 +1,4 @@
{ stdenv { lib, stdenv
, fetchurl , fetchurl
, symlinkJoin , symlinkJoin
, makeWrapper , makeWrapper
@ -84,8 +84,8 @@ stdenv.mkDerivation rec {
arbitrary special cases. Output is the C subset of C++. arbitrary special cases. Output is the C subset of C++.
''; '';
homepage = "http://eli-project.sourceforge.net/"; homepage = "http://eli-project.sourceforge.net/";
license = stdenv.lib.licenses.gpl2; license = lib.licenses.gpl2;
maintainers = with stdenv.lib.maintainers; [ timokau ]; maintainers = with lib.maintainers; [ timokau ];
platforms = stdenv.lib.platforms.linux; platforms = lib.platforms.linux;
}; };
} }

View file

@ -118,7 +118,7 @@ let
elm-test = patchBinwrap [elmi-to-json] elm-test = patchBinwrap [elmi-to-json]
nodePkgs.elm-test // { nodePkgs.elm-test // {
meta = with stdenv.lib; { meta = with lib; {
description = "Runs elm-test suites from Node.js"; description = "Runs elm-test suites from Node.js";
homepage = "https://github.com/rtfeldman/node-test-runner"; homepage = "https://github.com/rtfeldman/node-test-runner";
license = licenses.bsd3; license = licenses.bsd3;
@ -128,7 +128,7 @@ let
elm-verify-examples = patchBinwrap [elmi-to-json] elm-verify-examples = patchBinwrap [elmi-to-json]
nodePkgs.elm-verify-examples // { nodePkgs.elm-verify-examples // {
meta = with stdenv.lib; { meta = with lib; {
description = "Verify examples in your docs"; description = "Verify examples in your docs";
homepage = "https://github.com/stoeffel/elm-verify-examples"; homepage = "https://github.com/stoeffel/elm-verify-examples";
license = licenses.bsd3; license = licenses.bsd3;
@ -153,7 +153,7 @@ let
mkdir -p unpacked_bin mkdir -p unpacked_bin
ln -sf ${elm-instrument}/bin/elm-instrument unpacked_bin/elm-instrument ln -sf ${elm-instrument}/bin/elm-instrument unpacked_bin/elm-instrument
''; '';
meta = with stdenv.lib; { meta = with lib; {
description = "Work in progress - Code coverage tooling for Elm"; description = "Work in progress - Code coverage tooling for Elm";
homepage = "https://github.com/zwilias/elm-coverage"; homepage = "https://github.com/zwilias/elm-coverage";
license = licenses.bsd3; license = licenses.bsd3;
@ -163,7 +163,7 @@ let
create-elm-app = patchNpmElm (patchBinwrap [elmi-to-json] create-elm-app = patchNpmElm (patchBinwrap [elmi-to-json]
nodePkgs.create-elm-app) // { nodePkgs.create-elm-app) // {
meta = with stdenv.lib; { meta = with lib; {
description = "Create Elm apps with no build configuration"; description = "Create Elm apps with no build configuration";
homepage = "https://github.com/halfzebra/create-elm-app"; homepage = "https://github.com/halfzebra/create-elm-app";
license = licenses.mit; license = licenses.mit;
@ -173,7 +173,7 @@ let
elm-review = patchBinwrap [elmRustPackages.elm-json] elm-review = patchBinwrap [elmRustPackages.elm-json]
nodePkgs.elm-review // { nodePkgs.elm-review // {
meta = with stdenv.lib; { meta = with lib; {
description = "Analyzes Elm projects, to help find mistakes before your users find them"; description = "Analyzes Elm projects, to help find mistakes before your users find them";
homepage = "https://package.elm-lang.org/packages/jfmengels/elm-review/${nodePkgs.elm-review.version}"; homepage = "https://package.elm-lang.org/packages/jfmengels/elm-review/${nodePkgs.elm-review.version}";
license = licenses.bsd3; license = licenses.bsd3;
@ -182,7 +182,7 @@ let
}; };
elm-language-server = nodePkgs."@elm-tooling/elm-language-server" // { elm-language-server = nodePkgs."@elm-tooling/elm-language-server" // {
meta = with stdenv.lib; { meta = with lib; {
description = "Language server implementation for Elm"; description = "Language server implementation for Elm";
homepage = "https://github.com/elm-tooling/elm-language-server"; homepage = "https://github.com/elm-tooling/elm-language-server";
license = licenses.mit; license = licenses.mit;
@ -191,7 +191,7 @@ let
}; };
elm-optimize-level-2 = nodePkgs."elm-optimize-level-2" // { elm-optimize-level-2 = nodePkgs."elm-optimize-level-2" // {
meta = with stdenv.lib; { meta = with lib; {
description = "A second level of optimization for the Javascript that the Elm Compiler produces"; description = "A second level of optimization for the Javascript that the Elm Compiler produces";
homepage = "https://github.com/mdgriffith/elm-optimize-level-2"; homepage = "https://github.com/mdgriffith/elm-optimize-level-2";
license = licenses.bsd3; license = licenses.bsd3;

View file

@ -1,7 +1,7 @@
{ mkDerivation, fetchgit, ansi-terminal, ansi-wl-pprint, array, base, binary { mkDerivation, fetchgit, ansi-terminal, ansi-wl-pprint, array, base, binary
, bytestring, cmark, containers, directory, filepath, free, HUnit , bytestring, cmark, containers, directory, filepath, free, HUnit
, indents, json, mtl, optparse-applicative, parsec, process , indents, json, mtl, optparse-applicative, parsec, process
, QuickCheck, quickcheck-io, split, stdenv, tasty, tasty-golden , QuickCheck, quickcheck-io, split, lib, stdenv, tasty, tasty-golden
, tasty-hunit, tasty-quickcheck, text , tasty-hunit, tasty-quickcheck, text
}: }:
mkDerivation { mkDerivation {
@ -36,5 +36,5 @@ mkDerivation {
doHaddock = false; doHaddock = false;
homepage = "https://elm-lang.org"; homepage = "https://elm-lang.org";
description = "A source code formatter for Elm"; description = "A source code formatter for Elm";
license = stdenv.lib.licenses.bsd3; license = lib.licenses.bsd3;
} }

View file

@ -2,7 +2,7 @@
, bytestring, Cabal, cmark, containers, directory, elm-format , bytestring, Cabal, cmark, containers, directory, elm-format
, fetchgit, filepath, free, HUnit, indents, json, mtl , fetchgit, filepath, free, HUnit, indents, json, mtl
, optparse-applicative, parsec, process, QuickCheck, quickcheck-io , optparse-applicative, parsec, process, QuickCheck, quickcheck-io
, split, stdenv, tasty, tasty-golden, tasty-hunit, tasty-quickcheck , split, lib, stdenv, tasty, tasty-golden, tasty-hunit, tasty-quickcheck
, text , text
}: }:
mkDerivation { mkDerivation {
@ -30,5 +30,5 @@ mkDerivation {
]; ];
homepage = "https://elm-lang.org"; homepage = "https://elm-lang.org";
description = "Instrumentation library for Elm"; description = "Instrumentation library for Elm";
license = stdenv.lib.licenses.bsd3; license = lib.licenses.bsd3;
} }

View file

@ -3,7 +3,7 @@
, file-embed, filelock, filepath, ghc-prim, haskeline, HTTP , file-embed, filelock, filepath, ghc-prim, haskeline, HTTP
, http-client, http-client-tls, http-types, language-glsl, mtl , http-client, http-client-tls, http-types, language-glsl, mtl
, network, parsec, process, raw-strings-qq, scientific, SHA , network, parsec, process, raw-strings-qq, scientific, SHA
, snap-core, snap-server, stdenv, template-haskell, time , snap-core, snap-server, lib, stdenv, template-haskell, time
, unordered-containers, utf8-string, vector, zip-archive , unordered-containers, utf8-string, vector, zip-archive
}: }:
mkDerivation { mkDerivation {
@ -27,5 +27,5 @@ mkDerivation {
]; ];
homepage = "https://elm-lang.org"; homepage = "https://elm-lang.org";
description = "The `elm` command line interface"; description = "The `elm` command line interface";
license = stdenv.lib.licenses.bsd3; license = lib.licenses.bsd3;
} }

View file

@ -1,6 +1,6 @@
{ mkDerivation, aeson, base, binary, bytestring, containers { mkDerivation, aeson, base, binary, bytestring, containers
, directory, fetchgit, filepath, ghc-prim, hpack , directory, fetchgit, filepath, ghc-prim, hpack
, optparse-applicative, stdenv, text, unliftio , optparse-applicative, lib, stdenv, text, unliftio
, unordered-containers , unordered-containers
}: }:
mkDerivation { mkDerivation {
@ -23,5 +23,5 @@ mkDerivation {
testHaskellDepends = [ base ]; testHaskellDepends = [ base ];
prePatch = "hpack"; prePatch = "hpack";
homepage = "https://github.com/stoeffel/elmi-to-json#readme"; homepage = "https://github.com/stoeffel/elmi-to-json#readme";
license = stdenv.lib.licenses.bsd3; license = lib.licenses.bsd3;
} }

View file

@ -1,4 +1,4 @@
{ mkDerivation, base, concatenative, mtl, parsec, stdenv }: { mkDerivation, base, concatenative, mtl, parsec, lib, stdenv }:
mkDerivation { mkDerivation {
pname = "indents"; pname = "indents";
version = "0.3.3"; version = "0.3.3";
@ -7,5 +7,5 @@ mkDerivation {
doCheck = false; doCheck = false;
homepage = "http://patch-tag.com/r/salazar/indents"; homepage = "http://patch-tag.com/r/salazar/indents";
description = "indentation sensitive parser-combinators for parsec"; description = "indentation sensitive parser-combinators for parsec";
license = stdenv.lib.licenses.bsd3; license = lib.licenses.bsd3;
} }

View file

@ -1,4 +1,4 @@
{ stdenv, fetchFromGitHub, python3, nodejs, closurecompiler { lib, stdenv, fetchFromGitHub, python3, nodejs, closurecompiler
, jre, binaryen , jre, binaryen
, llvmPackages_11 , llvmPackages_11
, symlinkJoin, makeWrapper , symlinkJoin, makeWrapper
@ -101,7 +101,7 @@ stdenv.mkDerivation rec {
popd popd
''; '';
meta = with stdenv.lib; { meta = with lib; {
homepage = "https://github.com/emscripten-core/emscripten"; homepage = "https://github.com/emscripten-core/emscripten";
description = "An LLVM-to-JavaScript Compiler"; description = "An LLVM-to-JavaScript Compiler";
platforms = platforms.all; platforms = platforms.all;

View file

@ -1,4 +1,4 @@
{ stdenv, fetchgit, qt4, ecl, xorgserver, xkbcomp, xkeyboard_config }: { lib, stdenv, fetchgit, qt4, ecl, xorgserver, xkbcomp, xkeyboard_config }:
stdenv.mkDerivation rec { stdenv.mkDerivation rec {
version = src.rev; version = src.rev;
@ -44,7 +44,7 @@ stdenv.mkDerivation rec {
ln -s $out/lib/eql/build-dir/libeql*.so* $out/lib ln -s $out/lib/eql/build-dir/libeql*.so* $out/lib
''; '';
meta = with stdenv.lib; { meta = with lib; {
description = "Embedded Qt Lisp (ECL+Qt)"; description = "Embedded Qt Lisp (ECL+Qt)";
maintainers = with maintainers; [ raskin ]; maintainers = with maintainers; [ raskin ];
platforms = platforms.linux; platforms = platforms.linux;

View file

@ -1,4 +1,4 @@
{ stdenv, fetchurl, glib, git, { lib, stdenv, fetchurl, glib, git,
rlwrap, curl, pkg-config, perl, makeWrapper, tzdata, ncurses, rlwrap, curl, pkg-config, perl, makeWrapper, tzdata, ncurses,
pango, cairo, gtk2, gdk-pixbuf, gtkglext, pango, cairo, gtk2, gdk-pixbuf, gtkglext,
mesa, xorg, openssl, unzip }: mesa, xorg, openssl, unzip }:
@ -47,7 +47,7 @@ stdenv.mkDerivation rec {
# out of known libraries. The side effect is that find-lib # out of known libraries. The side effect is that find-lib
# will work only on the known libraries. There does not seem # will work only on the known libraries. There does not seem
# to be a generic solution here. # to be a generic solution here.
find $(echo ${stdenv.lib.makeLibraryPath (with xorg; [ find $(echo ${lib.makeLibraryPath (with xorg; [
glib libX11 pango cairo gtk2 gdk-pixbuf gtkglext glib libX11 pango cairo gtk2 gdk-pixbuf gtkglext
mesa libXmu libXt libICE libSM ])} | sed -e 's#:# #g') -name \*.so.\* > $TMPDIR/so.lst mesa libXmu libXt libICE libSM ])} | sed -e 's#:# #g') -name \*.so.\* > $TMPDIR/so.lst
@ -68,7 +68,7 @@ stdenv.mkDerivation rec {
cp ./factor $out/bin cp ./factor $out/bin
wrapProgram $out/bin/factor --prefix LD_LIBRARY_PATH : \ wrapProgram $out/bin/factor --prefix LD_LIBRARY_PATH : \
"${stdenv.lib.makeLibraryPath (with xorg; [ glib "${lib.makeLibraryPath (with xorg; [ glib
libX11 pango cairo gtk2 gdk-pixbuf gtkglext libX11 pango cairo gtk2 gdk-pixbuf gtkglext
mesa libXmu libXt libICE libSM openssl])}" mesa libXmu libXt libICE libSM openssl])}"
@ -93,7 +93,7 @@ stdenv.mkDerivation rec {
cp misc/fuel/*.el $out/share/emacs/site-lisp/ cp misc/fuel/*.el $out/share/emacs/site-lisp/
''; '';
meta = with stdenv.lib; { meta = with lib; {
homepage = "https://factorcode.org"; homepage = "https://factorcode.org";
license = licenses.bsd2; license = licenses.bsd2;
description = "A concatenative, stack-based programming language"; description = "A concatenative, stack-based programming language";

View file

@ -1,4 +1,4 @@
{ stdenv { lib, stdenv
, fetchzip , fetchzip
}: }:
@ -48,7 +48,7 @@ stdenv.mkDerivation rec {
cp docs/*.txt $doc/share/doc/fasmg cp docs/*.txt $doc/share/doc/fasmg
''; '';
meta = with stdenv.lib; { meta = with lib; {
description = "x86(-64) macro assembler to binary, MZ, PE, COFF, and ELF"; description = "x86(-64) macro assembler to binary, MZ, PE, COFF, and ELF";
homepage = "https://flatassembler.net"; homepage = "https://flatassembler.net";
license = licenses.bsd3; license = licenses.bsd3;

View file

@ -1,4 +1,4 @@
{ stdenv, fetchzip, unzip, bison, flex, gperf, zlib }: { lib, stdenv, fetchzip, unzip, bison, flex, gperf, zlib }:
stdenv.mkDerivation rec { stdenv.mkDerivation rec {
pname = "flasm"; pname = "flasm";
@ -20,7 +20,7 @@ stdenv.mkDerivation rec {
install -Dm755 flasm -t $out/bin install -Dm755 flasm -t $out/bin
''; '';
meta = with stdenv.lib; { meta = with lib; {
description = "Assembler and disassembler for Flash (SWF) bytecode"; description = "Assembler and disassembler for Flash (SWF) bytecode";
homepage = "http://flasm.sourceforge.net/"; homepage = "http://flasm.sourceforge.net/";
license = licenses.bsd2; license = licenses.bsd2;

View file

@ -13,7 +13,7 @@
, coreutils , coreutils
, git , git
, runCommand , runCommand
, stdenv , lib, stdenv
, fetchurl , fetchurl
, alsaLib , alsaLib
, dbus , dbus
@ -137,7 +137,7 @@ runCommand drvName
preferLocalBuild = true; preferLocalBuild = true;
allowSubstitutes = false; allowSubstitutes = false;
passthru = { unwrapped = flutter; }; passthru = { unwrapped = flutter; };
meta = with stdenv.lib; { meta = with lib; {
description = "Flutter is Google's SDK for building mobile, web and desktop with Dart"; description = "Flutter is Google's SDK for building mobile, web and desktop with Dart";
longDescription = '' longDescription = ''
Flutter is Googles UI toolkit for building beautiful, Flutter is Googles UI toolkit for building beautiful,

View file

@ -1,4 +1,4 @@
{ stdenv, fetchurl, gawk }: { lib, stdenv, fetchurl, gawk }:
let startFPC = import ./binary.nix { inherit stdenv fetchurl; }; in let startFPC = import ./binary.nix { inherit stdenv fetchurl; }; in
@ -40,7 +40,7 @@ stdenv.mkDerivation rec {
bootstrap = startFPC; bootstrap = startFPC;
}; };
meta = with stdenv.lib; { meta = with lib; {
description = "Free Pascal Compiler from a source distribution"; description = "Free Pascal Compiler from a source distribution";
homepage = "https://www.freepascal.org"; homepage = "https://www.freepascal.org";
maintainers = [ maintainers.raskin ]; maintainers = [ maintainers.raskin ];

View file

@ -97,7 +97,7 @@ stdenv.mkDerivation rec {
--prefix PATH ':' "${lib.makeBinPath [ fpc gdb gnumake binutils ]}" --prefix PATH ':' "${lib.makeBinPath [ fpc gdb gnumake binutils ]}"
''; '';
meta = with stdenv.lib; { meta = with lib; {
description = "Graphical IDE for the FreePascal language"; description = "Graphical IDE for the FreePascal language";
homepage = "https://www.lazarus.freepascal.org"; homepage = "https://www.lazarus.freepascal.org";
license = licenses.gpl2Plus ; license = licenses.gpl2Plus ;

View file

@ -1,6 +1,6 @@
# Temporarily avoid dependency on dotnetbuildhelpers to avoid rebuilding many times while working on it # Temporarily avoid dependency on dotnetbuildhelpers to avoid rebuilding many times while working on it
{ stdenv, fetchurl, mono, pkg-config, dotnetbuildhelpers, autoconf, automake, which }: { lib, stdenv, fetchurl, mono, pkg-config, dotnetbuildhelpers, autoconf, automake, which }:
stdenv.mkDerivation rec { stdenv.mkDerivation rec {
pname = "fsharp"; pname = "fsharp";
@ -41,8 +41,8 @@ stdenv.mkDerivation rec {
meta = { meta = {
description = "A functional CLI language"; description = "A functional CLI language";
homepage = "https://fsharp.org/"; homepage = "https://fsharp.org/";
license = stdenv.lib.licenses.asl20; license = lib.licenses.asl20;
maintainers = with stdenv.lib.maintainers; [ thoughtpolice raskin ]; maintainers = with lib.maintainers; [ thoughtpolice raskin ];
platforms = with stdenv.lib.platforms; unix; platforms = with lib.platforms; unix;
}; };
} }

View file

@ -1,6 +1,6 @@
# Temporaririly avoid dependency on dotnetbuildhelpers to avoid rebuilding many times while working on it # Temporaririly avoid dependency on dotnetbuildhelpers to avoid rebuilding many times while working on it
{ stdenv, fetchurl, pkg-config, autoconf, automake, which, mono, msbuild, dotnetbuildhelpers, dotnetPackages }: { lib, stdenv, fetchurl, pkg-config, autoconf, automake, which, mono, msbuild, dotnetbuildhelpers, dotnetPackages }:
stdenv.mkDerivation rec { stdenv.mkDerivation rec {
pname = "fsharp"; pname = "fsharp";
@ -119,8 +119,8 @@ EOF
meta = { meta = {
description = "A functional CLI language"; description = "A functional CLI language";
homepage = "https://fsharp.org/"; homepage = "https://fsharp.org/";
license = stdenv.lib.licenses.asl20; license = lib.licenses.asl20;
maintainers = with stdenv.lib.maintainers; [ thoughtpolice raskin ]; maintainers = with lib.maintainers; [ thoughtpolice raskin ];
platforms = with stdenv.lib.platforms; unix; platforms = with lib.platforms; unix;
}; };
} }

View file

@ -1,4 +1,4 @@
{ stdenv, fetchFromGitHub, z3, ocamlPackages, makeWrapper, installShellFiles }: { lib, stdenv, fetchFromGitHub, z3, ocamlPackages, makeWrapper, installShellFiles }:
stdenv.mkDerivation rec { stdenv.mkDerivation rec {
pname = "fstar"; pname = "fstar";
@ -38,7 +38,7 @@ stdenv.mkDerivation rec {
installShellCompletion --zsh --name _fstar.exe .completion/zsh/__fstar.exe installShellCompletion --zsh --name _fstar.exe .completion/zsh/__fstar.exe
''; '';
meta = with stdenv.lib; { meta = with lib; {
description = "ML-like functional programming language aimed at program verification"; description = "ML-like functional programming language aimed at program verification";
homepage = "https://www.fstar-lang.org"; homepage = "https://www.fstar-lang.org";
license = licenses.asl20; license = licenses.asl20;

View file

@ -1,5 +1,5 @@
{ stdenv, fetchzip, fpc , lang ? "en" } : { lib, stdenv, fetchzip, fpc , lang ? "en" } :
assert stdenv.lib.assertOneOf "lang" lang ["cn" "de" "en" "fr" "tr"]; assert lib.assertOneOf "lang" lang ["cn" "de" "en" "fr" "tr"];
stdenv.mkDerivation rec { stdenv.mkDerivation rec {
pname = "gavrasm"; pname = "gavrasm";
version = "4.5"; version = "4.5";
@ -29,7 +29,7 @@ stdenv.mkDerivation rec {
cp LiesMich.Txt $out/doc cp LiesMich.Txt $out/doc
''; '';
meta = with stdenv.lib; { meta = with lib; {
homepage = "http://www.avr-asm-tutorial.net/gavrasm"; homepage = "http://www.avr-asm-tutorial.net/gavrasm";
description = "AVR Assembler for ATMEL AVR-Processors"; description = "AVR Assembler for ATMEL AVR-Processors";
license = licenses.unfree; license = licenses.unfree;

View file

@ -1,4 +1,4 @@
{ stdenv { lib, stdenv
, fetchurl , fetchurl
, ncurses5 , ncurses5
, python27 , python27
@ -39,11 +39,11 @@ stdenv.mkDerivation rec {
find $out -type f | while read f; do find $out -type f | while read f; do
patchelf "$f" > /dev/null 2>&1 || continue patchelf "$f" > /dev/null 2>&1 || continue
patchelf --set-interpreter $(cat ${stdenv.cc}/nix-support/dynamic-linker) "$f" || true patchelf --set-interpreter $(cat ${stdenv.cc}/nix-support/dynamic-linker) "$f" || true
patchelf --set-rpath ${stdenv.lib.makeLibraryPath [ "$out" stdenv.cc.cc ncurses5 python27 ]} "$f" || true patchelf --set-rpath ${lib.makeLibraryPath [ "$out" stdenv.cc.cc ncurses5 python27 ]} "$f" || true
done done
''; '';
meta = with stdenv.lib; { meta = with lib; {
description = "Pre-built GNU toolchain from ARM Cortex-M & Cortex-R processors"; description = "Pre-built GNU toolchain from ARM Cortex-M & Cortex-R processors";
homepage = "https://developer.arm.com/open-source/gnu-toolchain/gnu-rm"; homepage = "https://developer.arm.com/open-source/gnu-toolchain/gnu-rm";
license = with licenses; [ bsd2 gpl2 gpl3 lgpl21 lgpl3 mit ]; license = with licenses; [ bsd2 gpl2 gpl3 lgpl21 lgpl3 mit ];

View file

@ -1,4 +1,4 @@
{ stdenv { lib, stdenv
, fetchurl , fetchurl
, ncurses5 , ncurses5
, python27 , python27
@ -37,11 +37,11 @@ stdenv.mkDerivation rec {
find $out -type f | while read f; do find $out -type f | while read f; do
patchelf "$f" > /dev/null 2>&1 || continue patchelf "$f" > /dev/null 2>&1 || continue
patchelf --set-interpreter $(cat ${stdenv.cc}/nix-support/dynamic-linker) "$f" || true patchelf --set-interpreter $(cat ${stdenv.cc}/nix-support/dynamic-linker) "$f" || true
patchelf --set-rpath ${stdenv.lib.makeLibraryPath [ "$out" stdenv.cc.cc ncurses5 python27 ]} "$f" || true patchelf --set-rpath ${lib.makeLibraryPath [ "$out" stdenv.cc.cc ncurses5 python27 ]} "$f" || true
done done
''; '';
meta = with stdenv.lib; { meta = with lib; {
description = "Pre-built GNU toolchain from ARM Cortex-M & Cortex-R processors"; description = "Pre-built GNU toolchain from ARM Cortex-M & Cortex-R processors";
homepage = "https://developer.arm.com/open-source/gnu-toolchain/gnu-rm"; homepage = "https://developer.arm.com/open-source/gnu-toolchain/gnu-rm";
license = with licenses; [ bsd2 gpl2 gpl3 lgpl21 lgpl3 mit ]; license = with licenses; [ bsd2 gpl2 gpl3 lgpl21 lgpl3 mit ];

View file

@ -1,4 +1,4 @@
{ stdenv { lib, stdenv
, fetchurl , fetchurl
, ncurses5 , ncurses5
, python27 , python27
@ -37,11 +37,11 @@ stdenv.mkDerivation rec {
find $out -type f | while read f; do find $out -type f | while read f; do
patchelf "$f" > /dev/null 2>&1 || continue patchelf "$f" > /dev/null 2>&1 || continue
patchelf --set-interpreter $(cat ${stdenv.cc}/nix-support/dynamic-linker) "$f" || true patchelf --set-interpreter $(cat ${stdenv.cc}/nix-support/dynamic-linker) "$f" || true
patchelf --set-rpath ${stdenv.lib.makeLibraryPath [ "$out" stdenv.cc.cc ncurses5 python27 ]} "$f" || true patchelf --set-rpath ${lib.makeLibraryPath [ "$out" stdenv.cc.cc ncurses5 python27 ]} "$f" || true
done done
''; '';
meta = with stdenv.lib; { meta = with lib; {
description = "Pre-built GNU toolchain from ARM Cortex-M & Cortex-R processors"; description = "Pre-built GNU toolchain from ARM Cortex-M & Cortex-R processors";
homepage = "https://developer.arm.com/open-source/gnu-toolchain/gnu-rm"; homepage = "https://developer.arm.com/open-source/gnu-toolchain/gnu-rm";
license = with licenses; [ bsd2 gpl2 gpl3 lgpl21 lgpl3 mit ]; license = with licenses; [ bsd2 gpl2 gpl3 lgpl21 lgpl3 mit ];

View file

@ -1,4 +1,4 @@
{ stdenv { lib, stdenv
, fetchurl , fetchurl
, ncurses5 , ncurses5
, python27 , python27
@ -37,11 +37,11 @@ stdenv.mkDerivation rec {
find $out -type f | while read f; do find $out -type f | while read f; do
patchelf "$f" > /dev/null 2>&1 || continue patchelf "$f" > /dev/null 2>&1 || continue
patchelf --set-interpreter $(cat ${stdenv.cc}/nix-support/dynamic-linker) "$f" || true patchelf --set-interpreter $(cat ${stdenv.cc}/nix-support/dynamic-linker) "$f" || true
patchelf --set-rpath ${stdenv.lib.makeLibraryPath [ "$out" stdenv.cc.cc ncurses5 python27 ]} "$f" || true patchelf --set-rpath ${lib.makeLibraryPath [ "$out" stdenv.cc.cc ncurses5 python27 ]} "$f" || true
done done
''; '';
meta = with stdenv.lib; { meta = with lib; {
description = "Pre-built GNU toolchain from ARM Cortex-M & Cortex-R processors"; description = "Pre-built GNU toolchain from ARM Cortex-M & Cortex-R processors";
homepage = "https://developer.arm.com/open-source/gnu-toolchain/gnu-rm"; homepage = "https://developer.arm.com/open-source/gnu-toolchain/gnu-rm";
license = with licenses; [ bsd2 gpl2 gpl3 lgpl21 lgpl3 mit ]; license = with licenses; [ bsd2 gpl2 gpl3 lgpl21 lgpl3 mit ];

View file

@ -1,4 +1,4 @@
{ stdenv { lib, stdenv
, fetchurl , fetchurl
, ncurses5 , ncurses5
, python27 , python27
@ -39,11 +39,11 @@ stdenv.mkDerivation rec {
find $out -type f | while read f; do find $out -type f | while read f; do
patchelf "$f" > /dev/null 2>&1 || continue patchelf "$f" > /dev/null 2>&1 || continue
patchelf --set-interpreter $(cat ${stdenv.cc}/nix-support/dynamic-linker) "$f" || true patchelf --set-interpreter $(cat ${stdenv.cc}/nix-support/dynamic-linker) "$f" || true
patchelf --set-rpath ${stdenv.lib.makeLibraryPath [ "$out" stdenv.cc.cc ncurses5 python27 ]} "$f" || true patchelf --set-rpath ${lib.makeLibraryPath [ "$out" stdenv.cc.cc ncurses5 python27 ]} "$f" || true
done done
''; '';
meta = with stdenv.lib; { meta = with lib; {
description = "Pre-built GNU toolchain from ARM Cortex-M & Cortex-R processors"; description = "Pre-built GNU toolchain from ARM Cortex-M & Cortex-R processors";
homepage = "https://developer.arm.com/open-source/gnu-toolchain/gnu-rm"; homepage = "https://developer.arm.com/open-source/gnu-toolchain/gnu-rm";
license = with licenses; [ bsd2 gpl2 gpl3 lgpl21 lgpl3 mit ]; license = with licenses; [ bsd2 gpl2 gpl3 lgpl21 lgpl3 mit ];

View file

@ -1,4 +1,4 @@
{ stdenv, targetPackages, fetchurl, fetchpatch, noSysDirs { lib, stdenv, targetPackages, fetchurl, fetchpatch, noSysDirs
, langC ? true, langCC ? true, langFortran ? false , langC ? true, langCC ? true, langFortran ? false
, langAda ? false , langAda ? false
, langObjC ? stdenv.targetPlatform.isDarwin , langObjC ? stdenv.targetPlatform.isDarwin
@ -48,7 +48,7 @@ assert langAda -> gnatboot != null;
# threadsCross is just for MinGW # threadsCross is just for MinGW
assert threadsCross != null -> stdenv.targetPlatform.isWindows; assert threadsCross != null -> stdenv.targetPlatform.isWindows;
with stdenv.lib; with lib;
with builtins; with builtins;
let majorVersion = "10"; let majorVersion = "10";
@ -90,7 +90,7 @@ stdenv.mkDerivation ({
inherit patches; inherit patches;
outputs = [ "out" "man" "info" ] ++ stdenv.lib.optional (!langJit) "lib"; outputs = [ "out" "man" "info" ] ++ lib.optional (!langJit) "lib";
setOutputFlags = false; setOutputFlags = false;
NIX_NO_SELF_RPATH = true; NIX_NO_SELF_RPATH = true;
@ -100,7 +100,7 @@ stdenv.mkDerivation ({
# This should kill all the stdinc frameworks that gcc and friends like to # This should kill all the stdinc frameworks that gcc and friends like to
# insert into default search paths. # insert into default search paths.
prePatch = stdenv.lib.optionalString hostPlatform.isDarwin '' prePatch = lib.optionalString hostPlatform.isDarwin ''
substituteInPlace gcc/config/darwin-c.c \ substituteInPlace gcc/config/darwin-c.c \
--replace 'if (stdinc)' 'if (0)' --replace 'if (stdinc)' 'if (0)'
@ -134,13 +134,13 @@ stdenv.mkDerivation ({
-e 's|define[[:blank:]]*MUSL_DYNAMIC_LINKER\([0-9]*\)[[:blank:]]"\([^\"]\+\)"$|define MUSL_DYNAMIC_LINKER\1 "${libc.out}\2"|g' -e 's|define[[:blank:]]*MUSL_DYNAMIC_LINKER\([0-9]*\)[[:blank:]]"\([^\"]\+\)"$|define MUSL_DYNAMIC_LINKER\1 "${libc.out}\2"|g'
done done
'' ''
+ stdenv.lib.optionalString (targetPlatform.libc == "musl") + lib.optionalString (targetPlatform.libc == "musl")
'' ''
sed -i gcc/config/linux.h -e '1i#undef LOCAL_INCLUDE_DIR' sed -i gcc/config/linux.h -e '1i#undef LOCAL_INCLUDE_DIR'
'' ''
) )
else "") else "")
+ stdenv.lib.optionalString targetPlatform.isAvr '' + lib.optionalString targetPlatform.isAvr ''
makeFlagsArray+=( makeFlagsArray+=(
'LIMITS_H_TEST=false' 'LIMITS_H_TEST=false'
) )
@ -177,20 +177,21 @@ stdenv.mkDerivation ({
depsTargetTarget = optional (!crossStageStatic && threadsCross != null) threadsCross; depsTargetTarget = optional (!crossStageStatic && threadsCross != null) threadsCross;
NIX_LDFLAGS = stdenv.lib.optionalString hostPlatform.isSunOS "-lm -ldl"; NIX_LDFLAGS = lib.optionalString hostPlatform.isSunOS "-lm -ldl";
preConfigure = import ../common/pre-configure.nix { preConfigure = import ../common/pre-configure.nix {
inherit (stdenv) lib; inherit lib;
inherit version hostPlatform gnatboot langAda langGo; inherit version hostPlatform gnatboot langAda langGo;
}; };
dontDisableStatic = true; dontDisableStatic = true;
# TODO(@Ericson2314): Always pass "--target" and always prefix. # TODO(@Ericson2314): Always pass "--target" and always prefix.
configurePlatforms = [ "build" "host" ] ++ stdenv.lib.optional (targetPlatform != hostPlatform) "target"; configurePlatforms = [ "build" "host" ] ++ lib.optional (targetPlatform != hostPlatform) "target";
configureFlags = import ../common/configure-flags.nix { configureFlags = import ../common/configure-flags.nix {
inherit inherit
lib
stdenv stdenv
targetPackages targetPackages
crossStageStatic libcCross crossStageStatic libcCross
@ -262,7 +263,7 @@ stdenv.mkDerivation ({
meta = { meta = {
homepage = "https://gcc.gnu.org/"; homepage = "https://gcc.gnu.org/";
license = stdenv.lib.licenses.gpl3Plus; # runtime support libraries are typically LGPLv3+ license = lib.licenses.gpl3Plus; # runtime support libraries are typically LGPLv3+
description = "GNU Compiler Collection, version ${version}" description = "GNU Compiler Collection, version ${version}"
+ (if stripped then "" else " (with debugging info)"); + (if stripped then "" else " (with debugging info)");
@ -275,13 +276,13 @@ stdenv.mkDerivation ({
compiler used in the GNU system including the GNU/Linux variant. compiler used in the GNU system including the GNU/Linux variant.
''; '';
maintainers = with stdenv.lib.maintainers; [ synthetica ]; maintainers = with lib.maintainers; [ synthetica ];
platforms = platforms =
stdenv.lib.platforms.linux ++ lib.platforms.linux ++
stdenv.lib.platforms.freebsd ++ lib.platforms.freebsd ++
stdenv.lib.platforms.illumos ++ lib.platforms.illumos ++
stdenv.lib.platforms.darwin; lib.platforms.darwin;
}; };
} }

View file

@ -1,4 +1,4 @@
{ stdenv, targetPackages, fetchurl, fetchpatch, noSysDirs { lib, stdenv, targetPackages, fetchurl, fetchpatch, noSysDirs
, langC ? true, langCC ? true, langFortran ? false , langC ? true, langCC ? true, langFortran ? false
, langObjC ? stdenv.targetPlatform.isDarwin , langObjC ? stdenv.targetPlatform.isDarwin
, langObjCpp ? stdenv.targetPlatform.isDarwin , langObjCpp ? stdenv.targetPlatform.isDarwin
@ -58,7 +58,7 @@ assert langGo -> langCC;
# threadsCross is just for MinGW # threadsCross is just for MinGW
assert threadsCross != null -> stdenv.targetPlatform.isWindows; assert threadsCross != null -> stdenv.targetPlatform.isWindows;
with stdenv.lib; with lib;
with builtins; with builtins;
let majorVersion = "4"; let majorVersion = "4";
@ -190,17 +190,18 @@ stdenv.mkDerivation ({
depsTargetTarget = optional (!crossStageStatic && threadsCross != null) threadsCross; depsTargetTarget = optional (!crossStageStatic && threadsCross != null) threadsCross;
preConfigure = import ../common/pre-configure.nix { preConfigure = import ../common/pre-configure.nix {
inherit (stdenv) lib; inherit lib;
inherit version hostPlatform langJava langGo; inherit version hostPlatform langJava langGo;
}; };
dontDisableStatic = true; dontDisableStatic = true;
# TODO(@Ericson2314): Always pass "--target" and always prefix. # TODO(@Ericson2314): Always pass "--target" and always prefix.
configurePlatforms = [ "build" "host" ] ++ stdenv.lib.optional (targetPlatform != hostPlatform) "target"; configurePlatforms = [ "build" "host" ] ++ lib.optional (targetPlatform != hostPlatform) "target";
configureFlags = import ../common/configure-flags.nix { configureFlags = import ../common/configure-flags.nix {
inherit inherit
lib
stdenv stdenv
targetPackages targetPackages
crossStageStatic libcCross crossStageStatic libcCross
@ -289,7 +290,7 @@ stdenv.mkDerivation ({
meta = { meta = {
homepage = "https://gcc.gnu.org/"; homepage = "https://gcc.gnu.org/";
license = stdenv.lib.licenses.gpl3Plus; # runtime support libraries are typically LGPLv3+ license = lib.licenses.gpl3Plus; # runtime support libraries are typically LGPLv3+
description = "GNU Compiler Collection, version ${version}" description = "GNU Compiler Collection, version ${version}"
+ (if stripped then "" else " (with debugging info)"); + (if stripped then "" else " (with debugging info)");
@ -302,13 +303,13 @@ stdenv.mkDerivation ({
compiler used in the GNU system including the GNU/Linux variant. compiler used in the GNU system including the GNU/Linux variant.
''; '';
maintainers = with stdenv.lib.maintainers; [ peti veprbl ]; maintainers = with lib.maintainers; [ peti veprbl ];
platforms = platforms =
stdenv.lib.platforms.linux ++ lib.platforms.linux ++
stdenv.lib.platforms.freebsd ++ lib.platforms.freebsd ++
stdenv.lib.platforms.illumos ++ lib.platforms.illumos ++
stdenv.lib.platforms.darwin; lib.platforms.darwin;
badPlatforms = [ "x86_64-darwin" ]; badPlatforms = [ "x86_64-darwin" ];
}; };
} }

View file

@ -1,4 +1,4 @@
{ stdenv, targetPackages, fetchurl, fetchpatch, noSysDirs { lib, stdenv, targetPackages, fetchurl, fetchpatch, noSysDirs
, langC ? true, langCC ? true, langFortran ? false , langC ? true, langCC ? true, langFortran ? false
, langObjC ? stdenv.targetPlatform.isDarwin , langObjC ? stdenv.targetPlatform.isDarwin
, langObjCpp ? stdenv.targetPlatform.isDarwin , langObjCpp ? stdenv.targetPlatform.isDarwin
@ -58,7 +58,7 @@ assert langGo -> langCC;
# threadsCross is just for MinGW # threadsCross is just for MinGW
assert threadsCross != null -> stdenv.targetPlatform.isWindows; assert threadsCross != null -> stdenv.targetPlatform.isWindows;
with stdenv.lib; with lib;
with builtins; with builtins;
let majorVersion = "4"; let majorVersion = "4";
@ -203,17 +203,18 @@ stdenv.mkDerivation ({
depsTargetTarget = optional (!crossStageStatic && threadsCross != null) threadsCross; depsTargetTarget = optional (!crossStageStatic && threadsCross != null) threadsCross;
preConfigure = import ../common/pre-configure.nix { preConfigure = import ../common/pre-configure.nix {
inherit (stdenv) lib; inherit lib;
inherit version hostPlatform langJava langGo; inherit version hostPlatform langJava langGo;
}; };
dontDisableStatic = true; dontDisableStatic = true;
# TODO(@Ericson2314): Always pass "--target" and always prefix. # TODO(@Ericson2314): Always pass "--target" and always prefix.
configurePlatforms = [ "build" "host" ] ++ stdenv.lib.optional (targetPlatform != hostPlatform) "target"; configurePlatforms = [ "build" "host" ] ++ lib.optional (targetPlatform != hostPlatform) "target";
configureFlags = import ../common/configure-flags.nix { configureFlags = import ../common/configure-flags.nix {
inherit inherit
lib
stdenv stdenv
targetPackages targetPackages
crossStageStatic libcCross crossStageStatic libcCross
@ -301,7 +302,7 @@ stdenv.mkDerivation ({
meta = { meta = {
homepage = "https://gcc.gnu.org/"; homepage = "https://gcc.gnu.org/";
license = stdenv.lib.licenses.gpl3Plus; # runtime support libraries are typically LGPLv3+ license = lib.licenses.gpl3Plus; # runtime support libraries are typically LGPLv3+
description = "GNU Compiler Collection, version ${version}" description = "GNU Compiler Collection, version ${version}"
+ (if stripped then "" else " (with debugging info)"); + (if stripped then "" else " (with debugging info)");
@ -314,13 +315,13 @@ stdenv.mkDerivation ({
compiler used in the GNU system including the GNU/Linux variant. compiler used in the GNU system including the GNU/Linux variant.
''; '';
maintainers = with stdenv.lib.maintainers; [ peti veprbl ]; maintainers = with lib.maintainers; [ peti veprbl ];
platforms = platforms =
stdenv.lib.platforms.linux ++ lib.platforms.linux ++
stdenv.lib.platforms.freebsd ++ lib.platforms.freebsd ++
stdenv.lib.platforms.illumos ++ lib.platforms.illumos ++
stdenv.lib.platforms.darwin; lib.platforms.darwin;
badPlatforms = [ "x86_64-darwin" ]; badPlatforms = [ "x86_64-darwin" ];
}; };
} }

View file

@ -1,4 +1,4 @@
{ stdenv, targetPackages, fetchurl, fetchpatch, fetchFromGitHub, noSysDirs { lib, stdenv, targetPackages, fetchurl, fetchpatch, fetchFromGitHub, noSysDirs
, langC ? true, langCC ? true, langFortran ? false , langC ? true, langCC ? true, langFortran ? false
, langAda ? false , langAda ? false
, langObjC ? stdenv.targetPlatform.isDarwin , langObjC ? stdenv.targetPlatform.isDarwin
@ -61,7 +61,7 @@ assert langAda -> gnatboot != null;
# threadsCross is just for MinGW # threadsCross is just for MinGW
assert threadsCross != null -> stdenv.targetPlatform.isWindows; assert threadsCross != null -> stdenv.targetPlatform.isWindows;
with stdenv.lib; with lib;
with builtins; with builtins;
let majorVersion = "6"; let majorVersion = "6";
@ -148,7 +148,7 @@ stdenv.mkDerivation ({
prePatch = prePatch =
# This should kill all the stdinc frameworks that gcc and friends like to # This should kill all the stdinc frameworks that gcc and friends like to
# insert into default search paths. # insert into default search paths.
stdenv.lib.optionalString hostPlatform.isDarwin '' lib.optionalString hostPlatform.isDarwin ''
substituteInPlace gcc/config/darwin-c.c \ substituteInPlace gcc/config/darwin-c.c \
--replace 'if (stdinc)' 'if (0)' --replace 'if (stdinc)' 'if (0)'
@ -177,7 +177,7 @@ stdenv.mkDerivation ({
-e 's|define[[:blank:]]*MUSL_DYNAMIC_LINKER\([0-9]*\)[[:blank:]]"\([^\"]\+\)"$|define MUSL_DYNAMIC_LINKER\1 "${libc.out}\2"|g' -e 's|define[[:blank:]]*MUSL_DYNAMIC_LINKER\([0-9]*\)[[:blank:]]"\([^\"]\+\)"$|define MUSL_DYNAMIC_LINKER\1 "${libc.out}\2"|g'
done done
'' ''
+ stdenv.lib.optionalString (targetPlatform.libc == "musl") + lib.optionalString (targetPlatform.libc == "musl")
'' ''
sed -i gcc/config/linux.h -e '1i#undef LOCAL_INCLUDE_DIR' sed -i gcc/config/linux.h -e '1i#undef LOCAL_INCLUDE_DIR'
'' ''
@ -219,20 +219,21 @@ stdenv.mkDerivation ({
depsTargetTarget = optional (!crossStageStatic && threadsCross != null) threadsCross; depsTargetTarget = optional (!crossStageStatic && threadsCross != null) threadsCross;
NIX_LDFLAGS = stdenv.lib.optionalString hostPlatform.isSunOS "-lm -ldl"; NIX_LDFLAGS = lib.optionalString hostPlatform.isSunOS "-lm -ldl";
preConfigure = import ../common/pre-configure.nix { preConfigure = import ../common/pre-configure.nix {
inherit (stdenv) lib; inherit lib;
inherit version hostPlatform gnatboot langJava langAda langGo; inherit version hostPlatform gnatboot langJava langAda langGo;
}; };
dontDisableStatic = true; dontDisableStatic = true;
# TODO(@Ericson2314): Always pass "--target" and always prefix. # TODO(@Ericson2314): Always pass "--target" and always prefix.
configurePlatforms = [ "build" "host" ] ++ stdenv.lib.optional (targetPlatform != hostPlatform) "target"; configurePlatforms = [ "build" "host" ] ++ lib.optional (targetPlatform != hostPlatform) "target";
configureFlags = import ../common/configure-flags.nix { configureFlags = import ../common/configure-flags.nix {
inherit inherit
lib
stdenv stdenv
targetPackages targetPackages
crossStageStatic libcCross crossStageStatic libcCross
@ -320,7 +321,7 @@ stdenv.mkDerivation ({
meta = { meta = {
homepage = "https://gcc.gnu.org/"; homepage = "https://gcc.gnu.org/";
license = stdenv.lib.licenses.gpl3Plus; # runtime support libraries are typically LGPLv3+ license = lib.licenses.gpl3Plus; # runtime support libraries are typically LGPLv3+
description = "GNU Compiler Collection, version ${version}" description = "GNU Compiler Collection, version ${version}"
+ (if stripped then "" else " (with debugging info)"); + (if stripped then "" else " (with debugging info)");
@ -333,13 +334,13 @@ stdenv.mkDerivation ({
compiler used in the GNU system including the GNU/Linux variant. compiler used in the GNU system including the GNU/Linux variant.
''; '';
maintainers = with stdenv.lib.maintainers; [ peti ]; maintainers = with lib.maintainers; [ peti ];
platforms = platforms =
stdenv.lib.platforms.linux ++ lib.platforms.linux ++
stdenv.lib.platforms.freebsd ++ lib.platforms.freebsd ++
stdenv.lib.platforms.illumos ++ lib.platforms.illumos ++
stdenv.lib.platforms.darwin; lib.platforms.darwin;
}; };
} }

View file

@ -1,4 +1,4 @@
{ stdenv, targetPackages, fetchurl, fetchpatch, noSysDirs { lib, stdenv, targetPackages, fetchurl, fetchpatch, noSysDirs
, langC ? true, langCC ? true, langFortran ? false , langC ? true, langCC ? true, langFortran ? false
, langObjC ? stdenv.targetPlatform.isDarwin , langObjC ? stdenv.targetPlatform.isDarwin
, langObjCpp ? stdenv.targetPlatform.isDarwin , langObjCpp ? stdenv.targetPlatform.isDarwin
@ -45,7 +45,7 @@ assert langGo -> langCC;
# threadsCross is just for MinGW # threadsCross is just for MinGW
assert threadsCross != null -> stdenv.targetPlatform.isWindows; assert threadsCross != null -> stdenv.targetPlatform.isWindows;
with stdenv.lib; with lib;
with builtins; with builtins;
let majorVersion = "7"; let majorVersion = "7";
@ -97,7 +97,7 @@ stdenv.mkDerivation ({
inherit patches; inherit patches;
outputs = [ "out" "man" "info" ] ++ stdenv.lib.optional (!langJit) "lib"; outputs = [ "out" "man" "info" ] ++ lib.optional (!langJit) "lib";
setOutputFlags = false; setOutputFlags = false;
NIX_NO_SELF_RPATH = true; NIX_NO_SELF_RPATH = true;
@ -107,7 +107,7 @@ stdenv.mkDerivation ({
# This should kill all the stdinc frameworks that gcc and friends like to # This should kill all the stdinc frameworks that gcc and friends like to
# insert into default search paths. # insert into default search paths.
prePatch = stdenv.lib.optionalString hostPlatform.isDarwin '' prePatch = lib.optionalString hostPlatform.isDarwin ''
substituteInPlace gcc/config/darwin-c.c \ substituteInPlace gcc/config/darwin-c.c \
--replace 'if (stdinc)' 'if (0)' --replace 'if (stdinc)' 'if (0)'
@ -141,13 +141,13 @@ stdenv.mkDerivation ({
-e 's|define[[:blank:]]*MUSL_DYNAMIC_LINKER\([0-9]*\)[[:blank:]]"\([^\"]\+\)"$|define MUSL_DYNAMIC_LINKER\1 "${libc.out}\2"|g' -e 's|define[[:blank:]]*MUSL_DYNAMIC_LINKER\([0-9]*\)[[:blank:]]"\([^\"]\+\)"$|define MUSL_DYNAMIC_LINKER\1 "${libc.out}\2"|g'
done done
'' ''
+ stdenv.lib.optionalString (targetPlatform.libc == "musl") + lib.optionalString (targetPlatform.libc == "musl")
'' ''
sed -i gcc/config/linux.h -e '1i#undef LOCAL_INCLUDE_DIR' sed -i gcc/config/linux.h -e '1i#undef LOCAL_INCLUDE_DIR'
'' ''
) )
else "") else "")
+ stdenv.lib.optionalString targetPlatform.isAvr '' + lib.optionalString targetPlatform.isAvr ''
makeFlagsArray+=( makeFlagsArray+=(
'LIMITS_H_TEST=false' 'LIMITS_H_TEST=false'
) )
@ -183,21 +183,22 @@ stdenv.mkDerivation ({
depsTargetTarget = optional (!crossStageStatic && threadsCross != null) threadsCross; depsTargetTarget = optional (!crossStageStatic && threadsCross != null) threadsCross;
NIX_CFLAGS_COMPILE = stdenv.lib.optionalString (stdenv.cc.isClang && langFortran) "-Wno-unused-command-line-argument"; NIX_CFLAGS_COMPILE = lib.optionalString (stdenv.cc.isClang && langFortran) "-Wno-unused-command-line-argument";
NIX_LDFLAGS = stdenv.lib.optionalString hostPlatform.isSunOS "-lm -ldl"; NIX_LDFLAGS = lib.optionalString hostPlatform.isSunOS "-lm -ldl";
preConfigure = import ../common/pre-configure.nix { preConfigure = import ../common/pre-configure.nix {
inherit (stdenv) lib; inherit lib;
inherit version hostPlatform langGo; inherit version hostPlatform langGo;
}; };
dontDisableStatic = true; dontDisableStatic = true;
# TODO(@Ericson2314): Always pass "--target" and always prefix. # TODO(@Ericson2314): Always pass "--target" and always prefix.
configurePlatforms = [ "build" "host" ] ++ stdenv.lib.optional (targetPlatform != hostPlatform) "target"; configurePlatforms = [ "build" "host" ] ++ lib.optional (targetPlatform != hostPlatform) "target";
configureFlags = import ../common/configure-flags.nix { configureFlags = import ../common/configure-flags.nix {
inherit inherit
lib
stdenv stdenv
targetPackages targetPackages
crossStageStatic libcCross crossStageStatic libcCross
@ -272,7 +273,7 @@ stdenv.mkDerivation ({
meta = { meta = {
homepage = "https://gcc.gnu.org/"; homepage = "https://gcc.gnu.org/";
license = stdenv.lib.licenses.gpl3Plus; # runtime support libraries are typically LGPLv3+ license = lib.licenses.gpl3Plus; # runtime support libraries are typically LGPLv3+
description = "GNU Compiler Collection, version ${version}" description = "GNU Compiler Collection, version ${version}"
+ (if stripped then "" else " (with debugging info)"); + (if stripped then "" else " (with debugging info)");
@ -285,13 +286,13 @@ stdenv.mkDerivation ({
compiler used in the GNU system including the GNU/Linux variant. compiler used in the GNU system including the GNU/Linux variant.
''; '';
maintainers = with stdenv.lib.maintainers; [ ]; maintainers = with lib.maintainers; [ ];
platforms = platforms =
stdenv.lib.platforms.linux ++ lib.platforms.linux ++
stdenv.lib.platforms.freebsd ++ lib.platforms.freebsd ++
stdenv.lib.platforms.illumos ++ lib.platforms.illumos ++
stdenv.lib.platforms.darwin; lib.platforms.darwin;
}; };
} }

View file

@ -1,4 +1,4 @@
{ stdenv, targetPackages, fetchurl, fetchpatch, noSysDirs { lib, stdenv, targetPackages, fetchurl, fetchpatch, noSysDirs
, langC ? true, langCC ? true, langFortran ? false , langC ? true, langCC ? true, langFortran ? false
, langObjC ? stdenv.targetPlatform.isDarwin , langObjC ? stdenv.targetPlatform.isDarwin
, langObjCpp ? stdenv.targetPlatform.isDarwin , langObjCpp ? stdenv.targetPlatform.isDarwin
@ -45,7 +45,7 @@ assert langGo -> langCC;
# threadsCross is just for MinGW # threadsCross is just for MinGW
assert threadsCross != null -> stdenv.targetPlatform.isWindows; assert threadsCross != null -> stdenv.targetPlatform.isWindows;
with stdenv.lib; with lib;
with builtins; with builtins;
let majorVersion = "8"; let majorVersion = "8";
@ -87,7 +87,7 @@ stdenv.mkDerivation ({
inherit patches; inherit patches;
outputs = [ "out" "man" "info" ] ++ stdenv.lib.optional (!langJit) "lib"; outputs = [ "out" "man" "info" ] ++ lib.optional (!langJit) "lib";
setOutputFlags = false; setOutputFlags = false;
NIX_NO_SELF_RPATH = true; NIX_NO_SELF_RPATH = true;
@ -97,7 +97,7 @@ stdenv.mkDerivation ({
# This should kill all the stdinc frameworks that gcc and friends like to # This should kill all the stdinc frameworks that gcc and friends like to
# insert into default search paths. # insert into default search paths.
prePatch = stdenv.lib.optionalString hostPlatform.isDarwin '' prePatch = lib.optionalString hostPlatform.isDarwin ''
substituteInPlace gcc/config/darwin-c.c \ substituteInPlace gcc/config/darwin-c.c \
--replace 'if (stdinc)' 'if (0)' --replace 'if (stdinc)' 'if (0)'
@ -131,13 +131,13 @@ stdenv.mkDerivation ({
-e 's|define[[:blank:]]*MUSL_DYNAMIC_LINKER\([0-9]*\)[[:blank:]]"\([^\"]\+\)"$|define MUSL_DYNAMIC_LINKER\1 "${libc.out}\2"|g' -e 's|define[[:blank:]]*MUSL_DYNAMIC_LINKER\([0-9]*\)[[:blank:]]"\([^\"]\+\)"$|define MUSL_DYNAMIC_LINKER\1 "${libc.out}\2"|g'
done done
'' ''
+ stdenv.lib.optionalString (targetPlatform.libc == "musl") + lib.optionalString (targetPlatform.libc == "musl")
'' ''
sed -i gcc/config/linux.h -e '1i#undef LOCAL_INCLUDE_DIR' sed -i gcc/config/linux.h -e '1i#undef LOCAL_INCLUDE_DIR'
'' ''
) )
else "") else "")
+ stdenv.lib.optionalString targetPlatform.isAvr '' + lib.optionalString targetPlatform.isAvr ''
makeFlagsArray+=( makeFlagsArray+=(
'LIMITS_H_TEST=false' 'LIMITS_H_TEST=false'
) )
@ -173,20 +173,21 @@ stdenv.mkDerivation ({
depsTargetTarget = optional (!crossStageStatic && threadsCross != null) threadsCross; depsTargetTarget = optional (!crossStageStatic && threadsCross != null) threadsCross;
NIX_LDFLAGS = stdenv.lib.optionalString hostPlatform.isSunOS "-lm -ldl"; NIX_LDFLAGS = lib.optionalString hostPlatform.isSunOS "-lm -ldl";
preConfigure = import ../common/pre-configure.nix { preConfigure = import ../common/pre-configure.nix {
inherit (stdenv) lib; inherit lib;
inherit version hostPlatform langGo; inherit version hostPlatform langGo;
}; };
dontDisableStatic = true; dontDisableStatic = true;
# TODO(@Ericson2314): Always pass "--target" and always prefix. # TODO(@Ericson2314): Always pass "--target" and always prefix.
configurePlatforms = [ "build" "host" ] ++ stdenv.lib.optional (targetPlatform != hostPlatform) "target"; configurePlatforms = [ "build" "host" ] ++ lib.optional (targetPlatform != hostPlatform) "target";
configureFlags = import ../common/configure-flags.nix { configureFlags = import ../common/configure-flags.nix {
inherit inherit
lib
stdenv stdenv
targetPackages targetPackages
crossStageStatic libcCross crossStageStatic libcCross
@ -257,7 +258,7 @@ stdenv.mkDerivation ({
meta = { meta = {
homepage = "https://gcc.gnu.org/"; homepage = "https://gcc.gnu.org/";
license = stdenv.lib.licenses.gpl3Plus; # runtime support libraries are typically LGPLv3+ license = lib.licenses.gpl3Plus; # runtime support libraries are typically LGPLv3+
description = "GNU Compiler Collection, version ${version}" description = "GNU Compiler Collection, version ${version}"
+ (if stripped then "" else " (with debugging info)"); + (if stripped then "" else " (with debugging info)");
@ -270,13 +271,13 @@ stdenv.mkDerivation ({
compiler used in the GNU system including the GNU/Linux variant. compiler used in the GNU system including the GNU/Linux variant.
''; '';
maintainers = with stdenv.lib.maintainers; [ synthetica ]; maintainers = with lib.maintainers; [ synthetica ];
platforms = platforms =
stdenv.lib.platforms.linux ++ lib.platforms.linux ++
stdenv.lib.platforms.freebsd ++ lib.platforms.freebsd ++
stdenv.lib.platforms.illumos ++ lib.platforms.illumos ++
stdenv.lib.platforms.darwin; lib.platforms.darwin;
}; };
} }

View file

@ -1,4 +1,4 @@
{ stdenv, targetPackages, fetchurl, fetchpatch, noSysDirs { lib, stdenv, targetPackages, fetchurl, fetchpatch, noSysDirs
, langC ? true, langCC ? true, langFortran ? false , langC ? true, langCC ? true, langFortran ? false
, langAda ? false , langAda ? false
, langObjC ? stdenv.targetPlatform.isDarwin , langObjC ? stdenv.targetPlatform.isDarwin
@ -54,7 +54,7 @@ assert langAda -> gnatboot != null;
# threadsCross is just for MinGW # threadsCross is just for MinGW
assert threadsCross != null -> stdenv.targetPlatform.isWindows; assert threadsCross != null -> stdenv.targetPlatform.isWindows;
with stdenv.lib; with lib;
with builtins; with builtins;
let majorVersion = "9"; let majorVersion = "9";
@ -103,7 +103,7 @@ stdenv.mkDerivation ({
inherit patches; inherit patches;
outputs = [ "out" "man" "info" ] ++ stdenv.lib.optional (!langJit) "lib"; outputs = [ "out" "man" "info" ] ++ lib.optional (!langJit) "lib";
setOutputFlags = false; setOutputFlags = false;
NIX_NO_SELF_RPATH = true; NIX_NO_SELF_RPATH = true;
@ -113,7 +113,7 @@ stdenv.mkDerivation ({
# This should kill all the stdinc frameworks that gcc and friends like to # This should kill all the stdinc frameworks that gcc and friends like to
# insert into default search paths. # insert into default search paths.
prePatch = stdenv.lib.optionalString hostPlatform.isDarwin '' prePatch = lib.optionalString hostPlatform.isDarwin ''
substituteInPlace gcc/config/darwin-c.c \ substituteInPlace gcc/config/darwin-c.c \
--replace 'if (stdinc)' 'if (0)' --replace 'if (stdinc)' 'if (0)'
@ -147,13 +147,13 @@ stdenv.mkDerivation ({
-e 's|define[[:blank:]]*MUSL_DYNAMIC_LINKER\([0-9]*\)[[:blank:]]"\([^\"]\+\)"$|define MUSL_DYNAMIC_LINKER\1 "${libc.out}\2"|g' -e 's|define[[:blank:]]*MUSL_DYNAMIC_LINKER\([0-9]*\)[[:blank:]]"\([^\"]\+\)"$|define MUSL_DYNAMIC_LINKER\1 "${libc.out}\2"|g'
done done
'' ''
+ stdenv.lib.optionalString (targetPlatform.libc == "musl") + lib.optionalString (targetPlatform.libc == "musl")
'' ''
sed -i gcc/config/linux.h -e '1i#undef LOCAL_INCLUDE_DIR' sed -i gcc/config/linux.h -e '1i#undef LOCAL_INCLUDE_DIR'
'' ''
) )
else "") else "")
+ stdenv.lib.optionalString targetPlatform.isAvr '' + lib.optionalString targetPlatform.isAvr ''
makeFlagsArray+=( makeFlagsArray+=(
'LIMITS_H_TEST=false' 'LIMITS_H_TEST=false'
) )
@ -190,20 +190,21 @@ stdenv.mkDerivation ({
depsTargetTarget = optional (!crossStageStatic && threadsCross != null) threadsCross; depsTargetTarget = optional (!crossStageStatic && threadsCross != null) threadsCross;
NIX_LDFLAGS = stdenv.lib.optionalString hostPlatform.isSunOS "-lm -ldl"; NIX_LDFLAGS = lib.optionalString hostPlatform.isSunOS "-lm -ldl";
preConfigure = import ../common/pre-configure.nix { preConfigure = import ../common/pre-configure.nix {
inherit (stdenv) lib; inherit lib;
inherit version hostPlatform gnatboot langAda langGo langJit; inherit version hostPlatform gnatboot langAda langGo langJit;
}; };
dontDisableStatic = true; dontDisableStatic = true;
# TODO(@Ericson2314): Always pass "--target" and always prefix. # TODO(@Ericson2314): Always pass "--target" and always prefix.
configurePlatforms = [ "build" "host" ] ++ stdenv.lib.optional (targetPlatform != hostPlatform) "target"; configurePlatforms = [ "build" "host" ] ++ lib.optional (targetPlatform != hostPlatform) "target";
configureFlags = import ../common/configure-flags.nix { configureFlags = import ../common/configure-flags.nix {
inherit inherit
lib
stdenv stdenv
targetPackages targetPackages
crossStageStatic libcCross crossStageStatic libcCross
@ -276,7 +277,7 @@ stdenv.mkDerivation ({
meta = { meta = {
homepage = "https://gcc.gnu.org/"; homepage = "https://gcc.gnu.org/";
license = stdenv.lib.licenses.gpl3Plus; # runtime support libraries are typically LGPLv3+ license = lib.licenses.gpl3Plus; # runtime support libraries are typically LGPLv3+
description = "GNU Compiler Collection, version ${version}" description = "GNU Compiler Collection, version ${version}"
+ (if stripped then "" else " (with debugging info)"); + (if stripped then "" else " (with debugging info)");
@ -289,13 +290,13 @@ stdenv.mkDerivation ({
compiler used in the GNU system including the GNU/Linux variant. compiler used in the GNU system including the GNU/Linux variant.
''; '';
maintainers = with stdenv.lib.maintainers; [ synthetica ]; maintainers = with lib.maintainers; [ synthetica ];
platforms = platforms =
stdenv.lib.platforms.linux ++ lib.platforms.linux ++
stdenv.lib.platforms.freebsd ++ lib.platforms.freebsd ++
stdenv.lib.platforms.illumos ++ lib.platforms.illumos ++
stdenv.lib.platforms.darwin; lib.platforms.darwin;
}; };
} }

View file

@ -1,4 +1,4 @@
{ stdenv { lib, stdenv
, targetPackages , targetPackages
, crossStageStatic, libcCross , crossStageStatic, libcCross
@ -24,8 +24,8 @@
, langJit , langJit
}: }:
assert cloog != null -> stdenv.lib.versionOlder version "5"; assert cloog != null -> lib.versionOlder version "5";
assert langJava -> stdenv.lib.versionOlder version "7"; assert langJava -> lib.versionOlder version "7";
# Note [Windows Exception Handling] # Note [Windows Exception Handling]
# sjlj (short jump long jump) exception handling makes no sense on x86_64, # sjlj (short jump long jump) exception handling makes no sense on x86_64,
@ -171,7 +171,7 @@ let
++ lib.optional javaAwtGtk "--enable-java-awt=gtk" ++ lib.optional javaAwtGtk "--enable-java-awt=gtk"
++ lib.optional (langJava && javaAntlr != null) "--with-antlr-jar=${javaAntlr}" ++ lib.optional (langJava && javaAntlr != null) "--with-antlr-jar=${javaAntlr}"
++ (import ../common/platform-flags.nix { inherit (stdenv) lib targetPlatform; }) ++ (import ../common/platform-flags.nix { inherit (stdenv) targetPlatform; inherit lib; })
++ lib.optionals (targetPlatform != hostPlatform) crossConfigureFlags ++ lib.optionals (targetPlatform != hostPlatform) crossConfigureFlags
++ lib.optional (targetPlatform != hostPlatform) "--disable-bootstrap" ++ lib.optional (targetPlatform != hostPlatform) "--disable-bootstrap"

View file

@ -11,7 +11,7 @@ in
EXTRA_FLAGS_FOR_TARGET = let EXTRA_FLAGS_FOR_TARGET = let
mkFlags = dep: langD: lib.optionals (targetPlatform != hostPlatform && dep != null && !langD) ([ mkFlags = dep: langD: lib.optionals (targetPlatform != hostPlatform && dep != null && !langD) ([
"-O2 -idirafter ${lib.getDev dep}${dep.incdir or "/include"}" "-O2 -idirafter ${lib.getDev dep}${dep.incdir or "/include"}"
] ++ stdenv.lib.optionals (! crossStageStatic) [ ] ++ lib.optionals (! crossStageStatic) [
"-B${lib.getLib dep}${dep.libdir or "/lib"}" "-B${lib.getLib dep}${dep.libdir or "/lib"}"
]); ]);
in mkFlags libcCross langD in mkFlags libcCross langD

View file

@ -1,4 +1,4 @@
{ stdenv, fetchgit, mpfr, m4, binutils, emacs, zlib, which { lib, stdenv, fetchgit, mpfr, m4, binutils, emacs, zlib, which
, texinfo, libX11, xorgproto, libXi, gmp, readline, strace , texinfo, libX11, xorgproto, libXi, gmp, readline, strace
, libXext, libXt, libXaw, libXmu } : , libXext, libXt, libXaw, libXmu } :
@ -45,7 +45,7 @@ stdenv.mkDerivation {
meta = { meta = {
description = "GNU Common Lisp compiler working via GCC"; description = "GNU Common Lisp compiler working via GCC";
maintainers = [ stdenv.lib.maintainers.raskin ]; maintainers = [ lib.maintainers.raskin ];
platforms = stdenv.lib.platforms.linux; platforms = lib.platforms.linux;
}; };
} }

View file

@ -1,4 +1,4 @@
{ stdenv, fetchurl, mpfr, m4, binutils, emacs, zlib, which { lib, stdenv, fetchurl, mpfr, m4, binutils, emacs, zlib, which
, texinfo, libX11, xorgproto, libXi, gmp , texinfo, libX11, xorgproto, libXi, gmp
, libXext, libXt, libXaw, libXmu } : , libXext, libXt, libXaw, libXmu } :
@ -42,7 +42,7 @@ stdenv.mkDerivation rec {
NIX_CFLAGS_COMPILE = "-fgnu89-inline"; NIX_CFLAGS_COMPILE = "-fgnu89-inline";
meta = with stdenv.lib; { meta = with lib; {
description = "GNU Common Lisp compiler working via GCC"; description = "GNU Common Lisp compiler working via GCC";
maintainers = [ maintainers.raskin ]; maintainers = [ maintainers.raskin ];
license = licenses.gpl2; license = licenses.gpl2;

View file

@ -1,4 +1,4 @@
{ stdenv, fetchurl, m4 }: { lib, stdenv, fetchurl, m4 }:
let let
version = "0.7.3"; version = "0.7.3";
@ -13,7 +13,7 @@ stdenv.mkDerivation {
buildInputs = [ m4 ]; buildInputs = [ m4 ];
configureFlags = stdenv.lib.optional stdenv.isDarwin [ "--build=x86_64-apple-darwin" ]; configureFlags = lib.optional stdenv.isDarwin [ "--build=x86_64-apple-darwin" ];
postInstall = '' postInstall = ''
mkdir -p $out/share/emacs/site-lisp mkdir -p $out/share/emacs/site-lisp
@ -23,7 +23,7 @@ stdenv.mkDerivation {
meta = { meta = {
description = "The Forth implementation of the GNU project"; description = "The Forth implementation of the GNU project";
homepage = "https://www.gnu.org/software/gforth/"; homepage = "https://www.gnu.org/software/gforth/";
license = stdenv.lib.licenses.gpl3; license = lib.licenses.gpl3;
platforms = stdenv.lib.platforms.all; platforms = lib.platforms.all;
}; };
} }

View file

@ -1,4 +1,4 @@
{ stdenv, pkgsBuildTarget, targetPackages { lib, stdenv, pkgsBuildTarget, targetPackages
# build-tools # build-tools
, bootPkgs , bootPkgs
@ -18,7 +18,7 @@
, # If enabled, GHC will be built with the GPL-free but slower integer-simple , # If enabled, GHC will be built with the GPL-free but slower integer-simple
# library instead of the faster but GPLed integer-gmp library. # library instead of the faster but GPLed integer-gmp library.
enableIntegerSimple ? !(stdenv.lib.any (stdenv.lib.meta.platformMatch stdenv.hostPlatform) gmp.meta.platforms), gmp enableIntegerSimple ? !(lib.any (lib.meta.platformMatch stdenv.hostPlatform) gmp.meta.platforms), gmp
, # If enabled, use -fPIC when compiling static libs. , # If enabled, use -fPIC when compiling static libs.
enableRelocatedStaticLibs ? stdenv.targetPlatform != stdenv.hostPlatform enableRelocatedStaticLibs ? stdenv.targetPlatform != stdenv.hostPlatform
@ -35,7 +35,7 @@
, # What flavour to build. An empty string indicates no , # What flavour to build. An empty string indicates no
# specific flavour and falls back to ghc default values. # specific flavour and falls back to ghc default values.
ghcFlavour ? stdenv.lib.optionalString (stdenv.targetPlatform != stdenv.hostPlatform) ghcFlavour ? lib.optionalString (stdenv.targetPlatform != stdenv.hostPlatform)
(if useLLVM then "perf-cross" else "perf-cross-ncg") (if useLLVM then "perf-cross" else "perf-cross-ncg")
, # Whether to disable the large address space allocator , # Whether to disable the large address space allocator
@ -51,7 +51,7 @@ let
inherit (bootPkgs) ghc; inherit (bootPkgs) ghc;
# TODO(@Ericson2314) Make unconditional # TODO(@Ericson2314) Make unconditional
targetPrefix = stdenv.lib.optionalString targetPrefix = lib.optionalString
(targetPlatform != hostPlatform) (targetPlatform != hostPlatform)
"${targetPlatform.config}-"; "${targetPlatform.config}-";
@ -69,32 +69,32 @@ let
# to actually link to our new Libc. The iOS simulator is a special # to actually link to our new Libc. The iOS simulator is a special
# exception because we cant actually run simulators binaries # exception because we cant actually run simulators binaries
# ourselves. # ourselves.
+ stdenv.lib.optionalString (targetPlatform != hostPlatform) '' + lib.optionalString (targetPlatform != hostPlatform) ''
Stage1Only = ${if (targetPlatform.system == hostPlatform.system && !targetPlatform.isiOS) then "NO" else "YES"} Stage1Only = ${if (targetPlatform.system == hostPlatform.system && !targetPlatform.isiOS) then "NO" else "YES"}
CrossCompilePrefix = ${targetPrefix} CrossCompilePrefix = ${targetPrefix}
HADDOCK_DOCS = NO HADDOCK_DOCS = NO
BUILD_SPHINX_HTML = NO BUILD_SPHINX_HTML = NO
BUILD_SPHINX_PDF = NO BUILD_SPHINX_PDF = NO
'' + stdenv.lib.optionalString dontStrip '' '' + lib.optionalString dontStrip ''
STRIP_CMD = : STRIP_CMD = :
'' + stdenv.lib.optionalString (!enableProfiledLibs) '' '' + lib.optionalString (!enableProfiledLibs) ''
GhcLibWays = "v dyn" GhcLibWays = "v dyn"
'' + stdenv.lib.optionalString enableRelocatedStaticLibs '' '' + lib.optionalString enableRelocatedStaticLibs ''
GhcLibHcOpts += -fPIC GhcLibHcOpts += -fPIC
GhcRtsHcOpts += -fPIC GhcRtsHcOpts += -fPIC
'' + stdenv.lib.optionalString targetPlatform.useAndroidPrebuilt '' '' + lib.optionalString targetPlatform.useAndroidPrebuilt ''
EXTRA_CC_OPTS += -std=gnu99 EXTRA_CC_OPTS += -std=gnu99
''; '';
# Splicer will pull out correct variations # Splicer will pull out correct variations
libDeps = platform: stdenv.lib.optional enableTerminfo ncurses libDeps = platform: lib.optional enableTerminfo ncurses
++ [libffi] ++ [libffi]
++ stdenv.lib.optional (!enableIntegerSimple) gmp ++ lib.optional (!enableIntegerSimple) gmp
++ stdenv.lib.optional (platform.libc != "glibc" && !targetPlatform.isWindows) libiconv; ++ lib.optional (platform.libc != "glibc" && !targetPlatform.isWindows) libiconv;
toolsForTarget = [ toolsForTarget = [
pkgsBuildTarget.targetPackages.stdenv.cc pkgsBuildTarget.targetPackages.stdenv.cc
] ++ stdenv.lib.optional useLLVM buildLlvmPackages.llvm; ] ++ lib.optional useLLVM buildLlvmPackages.llvm;
targetCC = builtins.head toolsForTarget; targetCC = builtins.head toolsForTarget;
@ -128,7 +128,7 @@ stdenv.mkDerivation (rec {
export CC="${targetCC}/bin/${targetCC.targetPrefix}cc" export CC="${targetCC}/bin/${targetCC.targetPrefix}cc"
export CXX="${targetCC}/bin/${targetCC.targetPrefix}cxx" export CXX="${targetCC}/bin/${targetCC.targetPrefix}cxx"
# Use gold to work around https://sourceware.org/bugzilla/show_bug.cgi?id=16177 # Use gold to work around https://sourceware.org/bugzilla/show_bug.cgi?id=16177
export LD="${targetCC.bintools}/bin/${targetCC.bintools.targetPrefix}ld${stdenv.lib.optionalString useLdGold ".gold"}" export LD="${targetCC.bintools}/bin/${targetCC.bintools.targetPrefix}ld${lib.optionalString useLdGold ".gold"}"
export AS="${targetCC.bintools.bintools}/bin/${targetCC.bintools.targetPrefix}as" export AS="${targetCC.bintools.bintools}/bin/${targetCC.bintools.targetPrefix}as"
export AR="${targetCC.bintools.bintools}/bin/${targetCC.bintools.targetPrefix}ar" export AR="${targetCC.bintools.bintools}/bin/${targetCC.bintools.targetPrefix}ar"
export NM="${targetCC.bintools.bintools}/bin/${targetCC.bintools.targetPrefix}nm" export NM="${targetCC.bintools.bintools}/bin/${targetCC.bintools.targetPrefix}nm"
@ -138,13 +138,13 @@ stdenv.mkDerivation (rec {
echo -n "${buildMK dontStrip}" > mk/build.mk echo -n "${buildMK dontStrip}" > mk/build.mk
sed -i -e 's|-isysroot /Developer/SDKs/MacOSX10.5.sdk||' configure sed -i -e 's|-isysroot /Developer/SDKs/MacOSX10.5.sdk||' configure
'' + stdenv.lib.optionalString (!stdenv.isDarwin) '' '' + lib.optionalString (!stdenv.isDarwin) ''
export NIX_LDFLAGS+=" -rpath $out/lib/ghc-${version}" export NIX_LDFLAGS+=" -rpath $out/lib/ghc-${version}"
'' + stdenv.lib.optionalString stdenv.isDarwin '' '' + lib.optionalString stdenv.isDarwin ''
export NIX_LDFLAGS+=" -no_dtrace_dof" export NIX_LDFLAGS+=" -no_dtrace_dof"
'' + stdenv.lib.optionalString targetPlatform.useAndroidPrebuilt '' '' + lib.optionalString targetPlatform.useAndroidPrebuilt ''
sed -i -e '5i ,("armv7a-unknown-linux-androideabi", ("e-m:e-p:32:32-i64:64-v128:64:128-a:0:32-n32-S64", "cortex-a8", ""))' llvm-targets sed -i -e '5i ,("armv7a-unknown-linux-androideabi", ("e-m:e-p:32:32-i64:64-v128:64:128-a:0:32-n32-S64", "cortex-a8", ""))' llvm-targets
'' + stdenv.lib.optionalString targetPlatform.isMusl '' '' + lib.optionalString targetPlatform.isMusl ''
echo "patching llvm-targets for musl targets..." echo "patching llvm-targets for musl targets..."
echo "Cloning these existing '*-linux-gnu*' targets:" echo "Cloning these existing '*-linux-gnu*' targets:"
grep linux-gnu llvm-targets | sed 's/^/ /' grep linux-gnu llvm-targets | sed 's/^/ /'
@ -164,29 +164,29 @@ stdenv.mkDerivation (rec {
# TODO(@Ericson2314): Always pass "--target" and always prefix. # TODO(@Ericson2314): Always pass "--target" and always prefix.
configurePlatforms = [ "build" "host" ] configurePlatforms = [ "build" "host" ]
++ stdenv.lib.optional (targetPlatform != hostPlatform) "target"; ++ lib.optional (targetPlatform != hostPlatform) "target";
# `--with` flags for libraries needed for RTS linker # `--with` flags for libraries needed for RTS linker
configureFlags = [ configureFlags = [
"--datadir=$doc/share/doc/ghc" "--datadir=$doc/share/doc/ghc"
"--with-curses-includes=${ncurses.dev}/include" "--with-curses-libraries=${ncurses.out}/lib" "--with-curses-includes=${ncurses.dev}/include" "--with-curses-libraries=${ncurses.out}/lib"
] ++ stdenv.lib.optionals (libffi != null) [ ] ++ lib.optionals (libffi != null) [
"--with-system-libffi" "--with-system-libffi"
"--with-ffi-includes=${targetPackages.libffi.dev}/include" "--with-ffi-includes=${targetPackages.libffi.dev}/include"
"--with-ffi-libraries=${targetPackages.libffi.out}/lib" "--with-ffi-libraries=${targetPackages.libffi.out}/lib"
] ++ stdenv.lib.optionals (targetPlatform == hostPlatform && !enableIntegerSimple) [ ] ++ lib.optionals (targetPlatform == hostPlatform && !enableIntegerSimple) [
"--with-gmp-includes=${targetPackages.gmp.dev}/include" "--with-gmp-includes=${targetPackages.gmp.dev}/include"
"--with-gmp-libraries=${targetPackages.gmp.out}/lib" "--with-gmp-libraries=${targetPackages.gmp.out}/lib"
] ++ stdenv.lib.optionals (targetPlatform == hostPlatform && hostPlatform.libc != "glibc" && !targetPlatform.isWindows) [ ] ++ lib.optionals (targetPlatform == hostPlatform && hostPlatform.libc != "glibc" && !targetPlatform.isWindows) [
"--with-iconv-includes=${libiconv}/include" "--with-iconv-includes=${libiconv}/include"
"--with-iconv-libraries=${libiconv}/lib" "--with-iconv-libraries=${libiconv}/lib"
] ++ stdenv.lib.optionals (targetPlatform != hostPlatform) [ ] ++ lib.optionals (targetPlatform != hostPlatform) [
"--enable-bootstrap-with-devel-snapshot" "--enable-bootstrap-with-devel-snapshot"
] ++ stdenv.lib.optionals useLdGold [ ] ++ lib.optionals useLdGold [
"CFLAGS=-fuse-ld=gold" "CFLAGS=-fuse-ld=gold"
"CONF_GCC_LINKER_OPTS_STAGE1=-fuse-ld=gold" "CONF_GCC_LINKER_OPTS_STAGE1=-fuse-ld=gold"
"CONF_GCC_LINKER_OPTS_STAGE2=-fuse-ld=gold" "CONF_GCC_LINKER_OPTS_STAGE2=-fuse-ld=gold"
] ++ stdenv.lib.optionals (disableLargeAddressSpace) [ ] ++ lib.optionals (disableLargeAddressSpace) [
"--disable-large-address-space" "--disable-large-address-space"
]; ];
@ -207,18 +207,18 @@ stdenv.mkDerivation (rec {
buildInputs = [ perl bash ] ++ (libDeps hostPlatform); buildInputs = [ perl bash ] ++ (libDeps hostPlatform);
propagatedBuildInputs = [ targetPackages.stdenv.cc ] propagatedBuildInputs = [ targetPackages.stdenv.cc ]
++ stdenv.lib.optional useLLVM llvmPackages.llvm; ++ lib.optional useLLVM llvmPackages.llvm;
depsTargetTarget = map stdenv.lib.getDev (libDeps targetPlatform); depsTargetTarget = map lib.getDev (libDeps targetPlatform);
depsTargetTargetPropagated = map (stdenv.lib.getOutput "out") (libDeps targetPlatform); depsTargetTargetPropagated = map (lib.getOutput "out") (libDeps targetPlatform);
# required, because otherwise all symbols from HSffi.o are stripped, and # required, because otherwise all symbols from HSffi.o are stripped, and
# that in turn causes GHCi to abort # that in turn causes GHCi to abort
stripDebugFlags = [ "-S" ] ++ stdenv.lib.optional (!targetPlatform.isDarwin) "--keep-file-symbols"; stripDebugFlags = [ "-S" ] ++ lib.optional (!targetPlatform.isDarwin) "--keep-file-symbols";
checkTarget = "test"; checkTarget = "test";
hardeningDisable = [ "format" ] ++ stdenv.lib.optional stdenv.targetPlatform.isMusl "pie"; hardeningDisable = [ "format" ] ++ lib.optional stdenv.targetPlatform.isMusl "pie";
postInstall = '' postInstall = ''
# Install the bash completion file. # Install the bash completion file.
@ -228,7 +228,7 @@ stdenv.mkDerivation (rec {
for i in "$out/bin/"*; do for i in "$out/bin/"*; do
test ! -h $i || continue test ! -h $i || continue
egrep --quiet '^#!' <(head -n 1 $i) || continue egrep --quiet '^#!' <(head -n 1 $i) || continue
sed -i -e '2i export PATH="$PATH:${stdenv.lib.makeBinPath [ targetPackages.stdenv.cc.bintools coreutils ]}"' $i sed -i -e '2i export PATH="$PATH:${lib.makeBinPath [ targetPackages.stdenv.cc.bintools coreutils ]}"' $i
done done
''; '';
@ -245,14 +245,14 @@ stdenv.mkDerivation (rec {
meta = { meta = {
homepage = "http://haskell.org/ghc"; homepage = "http://haskell.org/ghc";
description = "The Glasgow Haskell Compiler"; description = "The Glasgow Haskell Compiler";
maintainers = with stdenv.lib.maintainers; [ marcweber andres peti ]; maintainers = with lib.maintainers; [ marcweber andres peti ];
timeout = 24 * 3600; timeout = 24 * 3600;
inherit (ghc.meta) license platforms; inherit (ghc.meta) license platforms;
}; };
dontStrip = (targetPlatform.useAndroidPrebuilt || targetPlatform.isWasm); dontStrip = (targetPlatform.useAndroidPrebuilt || targetPlatform.isWasm);
} // stdenv.lib.optionalAttrs targetPlatform.useAndroidPrebuilt{ } // lib.optionalAttrs targetPlatform.useAndroidPrebuilt{
dontPatchELF = true; dontPatchELF = true;
noAuditTmpdir = true; noAuditTmpdir = true;
}) })

View file

@ -1,4 +1,4 @@
{ stdenv { lib, stdenv
, fetchurl, perl, gcc , fetchurl, perl, gcc
, ncurses6, gmp, glibc, libiconv, numactl , ncurses6, gmp, glibc, libiconv, numactl
, llvmPackages , llvmPackages
@ -16,12 +16,12 @@ assert stdenv.targetPlatform == stdenv.hostPlatform;
let let
useLLVM = !stdenv.targetPlatform.isx86; useLLVM = !stdenv.targetPlatform.isx86;
libPath = stdenv.lib.makeLibraryPath ([ libPath = lib.makeLibraryPath ([
ncurses6 gmp ncurses6 gmp
] ++ stdenv.lib.optional (stdenv.hostPlatform.isDarwin) libiconv ] ++ lib.optional (stdenv.hostPlatform.isDarwin) libiconv
++ stdenv.lib.optional (stdenv.hostPlatform.isAarch64) numactl); ++ lib.optional (stdenv.hostPlatform.isAarch64) numactl);
libEnvVar = stdenv.lib.optionalString stdenv.hostPlatform.isDarwin "DY" libEnvVar = lib.optionalString stdenv.hostPlatform.isDarwin "DY"
+ "LD_LIBRARY_PATH"; + "LD_LIBRARY_PATH";
glibcDynLinker = assert stdenv.isLinux; glibcDynLinker = assert stdenv.isLinux;
@ -29,7 +29,7 @@ let
# Could be stdenv.cc.bintools.dynamicLinker, keeping as-is to avoid rebuild. # Could be stdenv.cc.bintools.dynamicLinker, keeping as-is to avoid rebuild.
''"$(cat $NIX_CC/nix-support/dynamic-linker)"'' ''"$(cat $NIX_CC/nix-support/dynamic-linker)"''
else else
"${stdenv.lib.getLib glibc}/lib/ld-linux*"; "${lib.getLib glibc}/lib/ld-linux*";
in in
@ -64,7 +64,7 @@ stdenv.mkDerivation rec {
or (throw "cannot bootstrap GHC on this platform")); or (throw "cannot bootstrap GHC on this platform"));
nativeBuildInputs = [ perl ]; nativeBuildInputs = [ perl ];
propagatedBuildInputs = stdenv.lib.optionals useLLVM [ llvmPackages.llvm ]; propagatedBuildInputs = lib.optionals useLLVM [ llvmPackages.llvm ];
# Cannot patchelf beforehand due to relative RPATHs that anticipate # Cannot patchelf beforehand due to relative RPATHs that anticipate
# the final install location/ # the final install location/
@ -73,7 +73,7 @@ stdenv.mkDerivation rec {
postUnpack = postUnpack =
# GHC has dtrace probes, which causes ld to try to open /usr/lib/libdtrace.dylib # GHC has dtrace probes, which causes ld to try to open /usr/lib/libdtrace.dylib
# during linking # during linking
stdenv.lib.optionalString stdenv.isDarwin '' lib.optionalString stdenv.isDarwin ''
export NIX_LDFLAGS+=" -no_dtrace_dof" export NIX_LDFLAGS+=" -no_dtrace_dof"
# not enough room in the object files for the full path to libiconv :( # not enough room in the object files for the full path to libiconv :(
for exe in $(find . -type f -executable); do for exe in $(find . -type f -executable); do
@ -92,20 +92,20 @@ stdenv.mkDerivation rec {
'' ''
find . -name integer-gmp.buildinfo \ find . -name integer-gmp.buildinfo \
-exec sed -i "s@extra-lib-dirs: @extra-lib-dirs: ${gmp.out}/lib@" {} \; -exec sed -i "s@extra-lib-dirs: @extra-lib-dirs: ${gmp.out}/lib@" {} \;
'' + stdenv.lib.optionalString stdenv.isDarwin '' '' + lib.optionalString stdenv.isDarwin ''
find . -name base.buildinfo \ find . -name base.buildinfo \
-exec sed -i "s@extra-lib-dirs: @extra-lib-dirs: ${libiconv}/lib@" {} \; -exec sed -i "s@extra-lib-dirs: @extra-lib-dirs: ${libiconv}/lib@" {} \;
'' + '' +
# aarch64 does HAVE_NUMA so -lnuma requires it in library-dirs in rts/package.conf.in # aarch64 does HAVE_NUMA so -lnuma requires it in library-dirs in rts/package.conf.in
# FFI_LIB_DIR is a good indication of places it must be needed. # FFI_LIB_DIR is a good indication of places it must be needed.
stdenv.lib.optionalString stdenv.hostPlatform.isAarch64 '' lib.optionalString stdenv.hostPlatform.isAarch64 ''
find . -name package.conf.in \ find . -name package.conf.in \
-exec sed -i "s@FFI_LIB_DIR@FFI_LIB_DIR ${numactl.out}/lib@g" {} \; -exec sed -i "s@FFI_LIB_DIR@FFI_LIB_DIR ${numactl.out}/lib@g" {} \;
'' + '' +
# Rename needed libraries and binaries, fix interpreter # Rename needed libraries and binaries, fix interpreter
stdenv.lib.optionalString stdenv.isLinux '' lib.optionalString stdenv.isLinux ''
find . -type f -perm -0100 -exec patchelf \ find . -type f -perm -0100 -exec patchelf \
--replace-needed libncurses${stdenv.lib.optionalString stdenv.is64bit "w"}.so.6 libncurses.so \ --replace-needed libncurses${lib.optionalString stdenv.is64bit "w"}.so.6 libncurses.so \
--interpreter ${glibcDynLinker} {} \; --interpreter ${glibcDynLinker} {} \;
sed -i "s|/usr/bin/perl|perl\x00 |" ghc-${version}/ghc/stage2/build/tmp/ghc-stage2 sed -i "s|/usr/bin/perl|perl\x00 |" ghc-${version}/ghc/stage2/build/tmp/ghc-stage2
@ -117,21 +117,21 @@ stdenv.mkDerivation rec {
# (`__strdup` is defined to be an alias of `strdup` anyway[1]). # (`__strdup` is defined to be an alias of `strdup` anyway[1]).
# [1] http://refspecs.linuxbase.org/LSB_4.0.0/LSB-Core-generic/LSB-Core-generic/baselib---strdup-1.html # [1] http://refspecs.linuxbase.org/LSB_4.0.0/LSB-Core-generic/LSB-Core-generic/baselib---strdup-1.html
# Use objcopy magic to make the change: # Use objcopy magic to make the change:
stdenv.lib.optionalString stdenv.hostPlatform.isMusl '' lib.optionalString stdenv.hostPlatform.isMusl ''
find ./ghc-${version}/rts -name "libHSrts*.a" -exec ''${OBJCOPY:-objcopy} --redefine-sym __strdup=strdup {} \; find ./ghc-${version}/rts -name "libHSrts*.a" -exec ''${OBJCOPY:-objcopy} --redefine-sym __strdup=strdup {} \;
''; '';
# fix for `configure: error: Your linker is affected by binutils #16177` # fix for `configure: error: Your linker is affected by binutils #16177`
preConfigure = stdenv.lib.optionalString preConfigure = lib.optionalString
stdenv.targetPlatform.isAarch32 stdenv.targetPlatform.isAarch32
"LD=ld.gold"; "LD=ld.gold";
configurePlatforms = [ ]; configurePlatforms = [ ];
configureFlags = [ configureFlags = [
"--with-gmp-libraries=${stdenv.lib.getLib gmp}/lib" "--with-gmp-libraries=${lib.getLib gmp}/lib"
"--with-gmp-includes=${stdenv.lib.getDev gmp}/include" "--with-gmp-includes=${lib.getDev gmp}/include"
] ++ stdenv.lib.optional stdenv.isDarwin "--with-gcc=${./gcc-clang-wrapper.sh}" ] ++ lib.optional stdenv.isDarwin "--with-gcc=${./gcc-clang-wrapper.sh}"
++ stdenv.lib.optional stdenv.hostPlatform.isMusl "--disable-ld-override"; ++ lib.optional stdenv.hostPlatform.isMusl "--disable-ld-override";
# No building is necessary, but calling make without flags ironically # No building is necessary, but calling make without flags ironically
# calls install-strip ... # calls install-strip ...
@ -139,7 +139,7 @@ stdenv.mkDerivation rec {
# On Linux, use patchelf to modify the executables so that they can # On Linux, use patchelf to modify the executables so that they can
# find editline/gmp. # find editline/gmp.
postFixup = stdenv.lib.optionalString stdenv.isLinux postFixup = lib.optionalString stdenv.isLinux
(if stdenv.hostPlatform.isAarch64 then (if stdenv.hostPlatform.isAarch64 then
# Keep rpath as small as possible on aarch64 for patchelf#244. All Elfs # Keep rpath as small as possible on aarch64 for patchelf#244. All Elfs
# are 2 directories deep from $out/lib, so pooling symlinks there makes # are 2 directories deep from $out/lib, so pooling symlinks there makes
@ -167,7 +167,7 @@ stdenv.mkDerivation rec {
patchelf --set-rpath "${libPath}:$(patchelf --print-rpath $p)" $p patchelf --set-rpath "${libPath}:$(patchelf --print-rpath $p)" $p
fi fi
done done
'') + stdenv.lib.optionalString stdenv.isDarwin '' '') + lib.optionalString stdenv.isDarwin ''
# not enough room in the object files for the full path to libiconv :( # not enough room in the object files for the full path to libiconv :(
for exe in $(find "$out" -type f -executable); do for exe in $(find "$out" -type f -executable); do
isScript $exe && continue isScript $exe && continue
@ -179,7 +179,7 @@ stdenv.mkDerivation rec {
substituteInPlace $file --replace /usr/bin/ranlib "$(type -P ranlib)" substituteInPlace $file --replace /usr/bin/ranlib "$(type -P ranlib)"
done done
'' + '' +
stdenv.lib.optionalString minimal '' lib.optionalString minimal ''
# Remove profiling files # Remove profiling files
find $out -type f -name '*.p_o' -delete find $out -type f -name '*.p_o' -delete
find $out -type f -name '*.p_hi' -delete find $out -type f -name '*.p_hi' -delete
@ -215,8 +215,8 @@ stdenv.mkDerivation rec {
meta = { meta = {
homepage = "http://haskell.org/ghc"; homepage = "http://haskell.org/ghc";
description = "The Glasgow Haskell Compiler"; description = "The Glasgow Haskell Compiler";
license = stdenv.lib.licenses.bsd3; license = lib.licenses.bsd3;
platforms = ["x86_64-linux" "armv7l-linux" "aarch64-linux" "i686-linux" "x86_64-darwin"]; platforms = ["x86_64-linux" "armv7l-linux" "aarch64-linux" "i686-linux" "x86_64-darwin"];
maintainers = with stdenv.lib.maintainers; [ lostnet ]; maintainers = with lib.maintainers; [ lostnet ];
}; };
} }

View file

@ -1,4 +1,4 @@
{ stdenv, pkgsBuildTarget, targetPackages { lib, stdenv, pkgsBuildTarget, targetPackages
# build-tools # build-tools
, bootPkgs , bootPkgs
@ -18,7 +18,7 @@
, # If enabled, GHC will be built with the GPL-free but slower integer-simple , # If enabled, GHC will be built with the GPL-free but slower integer-simple
# library instead of the faster but GPLed integer-gmp library. # library instead of the faster but GPLed integer-gmp library.
enableIntegerSimple ? !(stdenv.lib.any (stdenv.lib.meta.platformMatch stdenv.hostPlatform) gmp.meta.platforms), gmp enableIntegerSimple ? !(lib.any (lib.meta.platformMatch stdenv.hostPlatform) gmp.meta.platforms), gmp
, # If enabled, use -fPIC when compiling static libs. , # If enabled, use -fPIC when compiling static libs.
enableRelocatedStaticLibs ? stdenv.targetPlatform != stdenv.hostPlatform enableRelocatedStaticLibs ? stdenv.targetPlatform != stdenv.hostPlatform
@ -35,7 +35,7 @@
, # What flavour to build. An empty string indicates no , # What flavour to build. An empty string indicates no
# specific flavour and falls back to ghc default values. # specific flavour and falls back to ghc default values.
ghcFlavour ? stdenv.lib.optionalString (stdenv.targetPlatform != stdenv.hostPlatform) ghcFlavour ? lib.optionalString (stdenv.targetPlatform != stdenv.hostPlatform)
(if useLLVM then "perf-cross" else "perf-cross-ncg") (if useLLVM then "perf-cross" else "perf-cross-ncg")
, # Whether to disable the large address space allocator , # Whether to disable the large address space allocator
@ -51,7 +51,7 @@ let
inherit (bootPkgs) ghc; inherit (bootPkgs) ghc;
# TODO(@Ericson2314) Make unconditional # TODO(@Ericson2314) Make unconditional
targetPrefix = stdenv.lib.optionalString targetPrefix = lib.optionalString
(targetPlatform != hostPlatform) (targetPlatform != hostPlatform)
"${targetPlatform.config}-"; "${targetPlatform.config}-";
@ -62,30 +62,30 @@ let
endif endif
DYNAMIC_GHC_PROGRAMS = ${if enableShared then "YES" else "NO"} DYNAMIC_GHC_PROGRAMS = ${if enableShared then "YES" else "NO"}
INTEGER_LIBRARY = ${if enableIntegerSimple then "integer-simple" else "integer-gmp"} INTEGER_LIBRARY = ${if enableIntegerSimple then "integer-simple" else "integer-gmp"}
'' + stdenv.lib.optionalString (targetPlatform != hostPlatform) '' '' + lib.optionalString (targetPlatform != hostPlatform) ''
Stage1Only = ${if targetPlatform.system == hostPlatform.system then "NO" else "YES"} Stage1Only = ${if targetPlatform.system == hostPlatform.system then "NO" else "YES"}
CrossCompilePrefix = ${targetPrefix} CrossCompilePrefix = ${targetPrefix}
HADDOCK_DOCS = NO HADDOCK_DOCS = NO
BUILD_SPHINX_HTML = NO BUILD_SPHINX_HTML = NO
BUILD_SPHINX_PDF = NO BUILD_SPHINX_PDF = NO
'' + stdenv.lib.optionalString (!enableProfiledLibs) '' '' + lib.optionalString (!enableProfiledLibs) ''
GhcLibWays = "v dyn" GhcLibWays = "v dyn"
'' + stdenv.lib.optionalString enableRelocatedStaticLibs '' '' + lib.optionalString enableRelocatedStaticLibs ''
GhcLibHcOpts += -fPIC GhcLibHcOpts += -fPIC
GhcRtsHcOpts += -fPIC GhcRtsHcOpts += -fPIC
'' + stdenv.lib.optionalString targetPlatform.useAndroidPrebuilt '' '' + lib.optionalString targetPlatform.useAndroidPrebuilt ''
EXTRA_CC_OPTS += -std=gnu99 EXTRA_CC_OPTS += -std=gnu99
''; '';
# Splicer will pull out correct variations # Splicer will pull out correct variations
libDeps = platform: stdenv.lib.optional enableTerminfo ncurses libDeps = platform: lib.optional enableTerminfo ncurses
++ [libffi] ++ [libffi]
++ stdenv.lib.optional (!enableIntegerSimple) gmp ++ lib.optional (!enableIntegerSimple) gmp
++ stdenv.lib.optional (platform.libc != "glibc" && !targetPlatform.isWindows) libiconv; ++ lib.optional (platform.libc != "glibc" && !targetPlatform.isWindows) libiconv;
toolsForTarget = [ toolsForTarget = [
pkgsBuildTarget.targetPackages.stdenv.cc pkgsBuildTarget.targetPackages.stdenv.cc
] ++ stdenv.lib.optional useLLVM buildLlvmPackages.llvm; ] ++ lib.optional useLLVM buildLlvmPackages.llvm;
targetCC = builtins.head toolsForTarget; targetCC = builtins.head toolsForTarget;
@ -110,7 +110,7 @@ stdenv.mkDerivation (rec {
# https://gitlab.haskell.org/ghc/ghc/-/issues/18549 # https://gitlab.haskell.org/ghc/ghc/-/issues/18549
patches = [ patches = [
./issue-18549.patch ./issue-18549.patch
] ++ stdenv.lib.optionals stdenv.isDarwin [ ] ++ lib.optionals stdenv.isDarwin [
# Make Block.h compile with c++ compilers. Remove with the next release # Make Block.h compile with c++ compilers. Remove with the next release
(fetchpatch { (fetchpatch {
url = "https://gitlab.haskell.org/ghc/ghc/-/commit/97d0b0a367e4c6a52a17c3299439ac7de129da24.patch"; url = "https://gitlab.haskell.org/ghc/ghc/-/commit/97d0b0a367e4c6a52a17c3299439ac7de129da24.patch";
@ -130,7 +130,7 @@ stdenv.mkDerivation (rec {
export CC="${targetCC}/bin/${targetCC.targetPrefix}cc" export CC="${targetCC}/bin/${targetCC.targetPrefix}cc"
export CXX="${targetCC}/bin/${targetCC.targetPrefix}cxx" export CXX="${targetCC}/bin/${targetCC.targetPrefix}cxx"
# Use gold to work around https://sourceware.org/bugzilla/show_bug.cgi?id=16177 # Use gold to work around https://sourceware.org/bugzilla/show_bug.cgi?id=16177
export LD="${targetCC.bintools}/bin/${targetCC.bintools.targetPrefix}ld${stdenv.lib.optionalString useLdGold ".gold"}" export LD="${targetCC.bintools}/bin/${targetCC.bintools.targetPrefix}ld${lib.optionalString useLdGold ".gold"}"
export AS="${targetCC.bintools.bintools}/bin/${targetCC.bintools.targetPrefix}as" export AS="${targetCC.bintools.bintools}/bin/${targetCC.bintools.targetPrefix}as"
export AR="${targetCC.bintools.bintools}/bin/${targetCC.bintools.targetPrefix}ar" export AR="${targetCC.bintools.bintools}/bin/${targetCC.bintools.targetPrefix}ar"
export NM="${targetCC.bintools.bintools}/bin/${targetCC.bintools.targetPrefix}nm" export NM="${targetCC.bintools.bintools}/bin/${targetCC.bintools.targetPrefix}nm"
@ -140,13 +140,13 @@ stdenv.mkDerivation (rec {
echo -n "${buildMK}" > mk/build.mk echo -n "${buildMK}" > mk/build.mk
sed -i -e 's|-isysroot /Developer/SDKs/MacOSX10.5.sdk||' configure sed -i -e 's|-isysroot /Developer/SDKs/MacOSX10.5.sdk||' configure
'' + stdenv.lib.optionalString (!stdenv.isDarwin) '' '' + lib.optionalString (!stdenv.isDarwin) ''
export NIX_LDFLAGS+=" -rpath $out/lib/ghc-${version}" export NIX_LDFLAGS+=" -rpath $out/lib/ghc-${version}"
'' + stdenv.lib.optionalString stdenv.isDarwin '' '' + lib.optionalString stdenv.isDarwin ''
export NIX_LDFLAGS+=" -no_dtrace_dof" export NIX_LDFLAGS+=" -no_dtrace_dof"
'' + stdenv.lib.optionalString targetPlatform.useAndroidPrebuilt '' '' + lib.optionalString targetPlatform.useAndroidPrebuilt ''
sed -i -e '5i ,("armv7a-unknown-linux-androideabi", ("e-m:e-p:32:32-i64:64-v128:64:128-a:0:32-n32-S64", "cortex-a8", ""))' llvm-targets sed -i -e '5i ,("armv7a-unknown-linux-androideabi", ("e-m:e-p:32:32-i64:64-v128:64:128-a:0:32-n32-S64", "cortex-a8", ""))' llvm-targets
'' + stdenv.lib.optionalString targetPlatform.isMusl '' '' + lib.optionalString targetPlatform.isMusl ''
echo "patching llvm-targets for musl targets..." echo "patching llvm-targets for musl targets..."
echo "Cloning these existing '*-linux-gnu*' targets:" echo "Cloning these existing '*-linux-gnu*' targets:"
grep linux-gnu llvm-targets | sed 's/^/ /' grep linux-gnu llvm-targets | sed 's/^/ /'
@ -166,29 +166,29 @@ stdenv.mkDerivation (rec {
# TODO(@Ericson2314): Always pass "--target" and always prefix. # TODO(@Ericson2314): Always pass "--target" and always prefix.
configurePlatforms = [ "build" "host" ] configurePlatforms = [ "build" "host" ]
++ stdenv.lib.optional (targetPlatform != hostPlatform) "target"; ++ lib.optional (targetPlatform != hostPlatform) "target";
# `--with` flags for libraries needed for RTS linker # `--with` flags for libraries needed for RTS linker
configureFlags = [ configureFlags = [
"--datadir=$doc/share/doc/ghc" "--datadir=$doc/share/doc/ghc"
"--with-curses-includes=${ncurses.dev}/include" "--with-curses-libraries=${ncurses.out}/lib" "--with-curses-includes=${ncurses.dev}/include" "--with-curses-libraries=${ncurses.out}/lib"
] ++ stdenv.lib.optionals (libffi != null) [ ] ++ lib.optionals (libffi != null) [
"--with-system-libffi" "--with-system-libffi"
"--with-ffi-includes=${targetPackages.libffi.dev}/include" "--with-ffi-includes=${targetPackages.libffi.dev}/include"
"--with-ffi-libraries=${targetPackages.libffi.out}/lib" "--with-ffi-libraries=${targetPackages.libffi.out}/lib"
] ++ stdenv.lib.optionals (targetPlatform == hostPlatform && !enableIntegerSimple) [ ] ++ lib.optionals (targetPlatform == hostPlatform && !enableIntegerSimple) [
"--with-gmp-includes=${targetPackages.gmp.dev}/include" "--with-gmp-includes=${targetPackages.gmp.dev}/include"
"--with-gmp-libraries=${targetPackages.gmp.out}/lib" "--with-gmp-libraries=${targetPackages.gmp.out}/lib"
] ++ stdenv.lib.optionals (targetPlatform == hostPlatform && hostPlatform.libc != "glibc" && !targetPlatform.isWindows) [ ] ++ lib.optionals (targetPlatform == hostPlatform && hostPlatform.libc != "glibc" && !targetPlatform.isWindows) [
"--with-iconv-includes=${libiconv}/include" "--with-iconv-includes=${libiconv}/include"
"--with-iconv-libraries=${libiconv}/lib" "--with-iconv-libraries=${libiconv}/lib"
] ++ stdenv.lib.optionals (targetPlatform != hostPlatform) [ ] ++ lib.optionals (targetPlatform != hostPlatform) [
"--enable-bootstrap-with-devel-snapshot" "--enable-bootstrap-with-devel-snapshot"
] ++ stdenv.lib.optionals useLdGold [ ] ++ lib.optionals useLdGold [
"CFLAGS=-fuse-ld=gold" "CFLAGS=-fuse-ld=gold"
"CONF_GCC_LINKER_OPTS_STAGE1=-fuse-ld=gold" "CONF_GCC_LINKER_OPTS_STAGE1=-fuse-ld=gold"
"CONF_GCC_LINKER_OPTS_STAGE2=-fuse-ld=gold" "CONF_GCC_LINKER_OPTS_STAGE2=-fuse-ld=gold"
] ++ stdenv.lib.optionals (disableLargeAddressSpace) [ ] ++ lib.optionals (disableLargeAddressSpace) [
"--disable-large-address-space" "--disable-large-address-space"
]; ];
@ -209,18 +209,18 @@ stdenv.mkDerivation (rec {
buildInputs = [ perl bash ] ++ (libDeps hostPlatform); buildInputs = [ perl bash ] ++ (libDeps hostPlatform);
propagatedBuildInputs = [ targetPackages.stdenv.cc ] propagatedBuildInputs = [ targetPackages.stdenv.cc ]
++ stdenv.lib.optional useLLVM llvmPackages.llvm; ++ lib.optional useLLVM llvmPackages.llvm;
depsTargetTarget = map stdenv.lib.getDev (libDeps targetPlatform); depsTargetTarget = map lib.getDev (libDeps targetPlatform);
depsTargetTargetPropagated = map (stdenv.lib.getOutput "out") (libDeps targetPlatform); depsTargetTargetPropagated = map (lib.getOutput "out") (libDeps targetPlatform);
# required, because otherwise all symbols from HSffi.o are stripped, and # required, because otherwise all symbols from HSffi.o are stripped, and
# that in turn causes GHCi to abort # that in turn causes GHCi to abort
stripDebugFlags = [ "-S" ] ++ stdenv.lib.optional (!targetPlatform.isDarwin) "--keep-file-symbols"; stripDebugFlags = [ "-S" ] ++ lib.optional (!targetPlatform.isDarwin) "--keep-file-symbols";
checkTarget = "test"; checkTarget = "test";
hardeningDisable = [ "format" ] ++ stdenv.lib.optional stdenv.targetPlatform.isMusl "pie"; hardeningDisable = [ "format" ] ++ lib.optional stdenv.targetPlatform.isMusl "pie";
postInstall = '' postInstall = ''
# Install the bash completion file. # Install the bash completion file.
@ -230,7 +230,7 @@ stdenv.mkDerivation (rec {
for i in "$out/bin/"*; do for i in "$out/bin/"*; do
test ! -h $i || continue test ! -h $i || continue
egrep --quiet '^#!' <(head -n 1 $i) || continue egrep --quiet '^#!' <(head -n 1 $i) || continue
sed -i -e '2i export PATH="$PATH:${stdenv.lib.makeBinPath [ targetPackages.stdenv.cc.bintools coreutils ]}"' $i sed -i -e '2i export PATH="$PATH:${lib.makeBinPath [ targetPackages.stdenv.cc.bintools coreutils ]}"' $i
done done
''; '';
@ -247,12 +247,12 @@ stdenv.mkDerivation (rec {
meta = { meta = {
homepage = "http://haskell.org/ghc"; homepage = "http://haskell.org/ghc";
description = "The Glasgow Haskell Compiler"; description = "The Glasgow Haskell Compiler";
maintainers = with stdenv.lib.maintainers; [ marcweber andres peti ]; maintainers = with lib.maintainers; [ marcweber andres peti ];
timeout = 24 * 3600; timeout = 24 * 3600;
inherit (ghc.meta) license platforms; inherit (ghc.meta) license platforms;
}; };
} // stdenv.lib.optionalAttrs targetPlatform.useAndroidPrebuilt { } // lib.optionalAttrs targetPlatform.useAndroidPrebuilt {
dontStrip = true; dontStrip = true;
dontPatchELF = true; dontPatchELF = true;
noAuditTmpdir = true; noAuditTmpdir = true;

View file

@ -1,4 +1,4 @@
{ stdenv, pkgsBuildTarget, targetPackages { lib, stdenv, pkgsBuildTarget, targetPackages
# build-tools # build-tools
, bootPkgs , bootPkgs
@ -18,7 +18,7 @@
, # If enabled, GHC will be built with the GPL-free but slower integer-simple , # If enabled, GHC will be built with the GPL-free but slower integer-simple
# library instead of the faster but GPLed integer-gmp library. # library instead of the faster but GPLed integer-gmp library.
enableIntegerSimple ? !(stdenv.lib.any (stdenv.lib.meta.platformMatch stdenv.hostPlatform) gmp.meta.platforms), gmp enableIntegerSimple ? !(lib.any (lib.meta.platformMatch stdenv.hostPlatform) gmp.meta.platforms), gmp
, # If enabled, use -fPIC when compiling static libs. , # If enabled, use -fPIC when compiling static libs.
enableRelocatedStaticLibs ? stdenv.targetPlatform != stdenv.hostPlatform enableRelocatedStaticLibs ? stdenv.targetPlatform != stdenv.hostPlatform
@ -35,7 +35,7 @@
, # What flavour to build. An empty string indicates no , # What flavour to build. An empty string indicates no
# specific flavour and falls back to ghc default values. # specific flavour and falls back to ghc default values.
ghcFlavour ? stdenv.lib.optionalString (stdenv.targetPlatform != stdenv.hostPlatform) ghcFlavour ? lib.optionalString (stdenv.targetPlatform != stdenv.hostPlatform)
(if useLLVM then "perf-cross" else "perf-cross-ncg") (if useLLVM then "perf-cross" else "perf-cross-ncg")
, # Whether to disable the large address space allocator , # Whether to disable the large address space allocator
@ -51,7 +51,7 @@ let
inherit (bootPkgs) ghc; inherit (bootPkgs) ghc;
# TODO(@Ericson2314) Make unconditional # TODO(@Ericson2314) Make unconditional
targetPrefix = stdenv.lib.optionalString targetPrefix = lib.optionalString
(targetPlatform != hostPlatform) (targetPlatform != hostPlatform)
"${targetPlatform.config}-"; "${targetPlatform.config}-";
@ -62,30 +62,30 @@ let
endif endif
DYNAMIC_GHC_PROGRAMS = ${if enableShared then "YES" else "NO"} DYNAMIC_GHC_PROGRAMS = ${if enableShared then "YES" else "NO"}
INTEGER_LIBRARY = ${if enableIntegerSimple then "integer-simple" else "integer-gmp"} INTEGER_LIBRARY = ${if enableIntegerSimple then "integer-simple" else "integer-gmp"}
'' + stdenv.lib.optionalString (targetPlatform != hostPlatform) '' '' + lib.optionalString (targetPlatform != hostPlatform) ''
Stage1Only = ${if targetPlatform.system == hostPlatform.system then "NO" else "YES"} Stage1Only = ${if targetPlatform.system == hostPlatform.system then "NO" else "YES"}
CrossCompilePrefix = ${targetPrefix} CrossCompilePrefix = ${targetPrefix}
HADDOCK_DOCS = NO HADDOCK_DOCS = NO
BUILD_SPHINX_HTML = NO BUILD_SPHINX_HTML = NO
BUILD_SPHINX_PDF = NO BUILD_SPHINX_PDF = NO
'' + stdenv.lib.optionalString (!enableProfiledLibs) '' '' + lib.optionalString (!enableProfiledLibs) ''
GhcLibWays = "v dyn" GhcLibWays = "v dyn"
'' + stdenv.lib.optionalString enableRelocatedStaticLibs '' '' + lib.optionalString enableRelocatedStaticLibs ''
GhcLibHcOpts += -fPIC GhcLibHcOpts += -fPIC
GhcRtsHcOpts += -fPIC GhcRtsHcOpts += -fPIC
'' + stdenv.lib.optionalString targetPlatform.useAndroidPrebuilt '' '' + lib.optionalString targetPlatform.useAndroidPrebuilt ''
EXTRA_CC_OPTS += -std=gnu99 EXTRA_CC_OPTS += -std=gnu99
''; '';
# Splicer will pull out correct variations # Splicer will pull out correct variations
libDeps = platform: stdenv.lib.optional enableTerminfo ncurses libDeps = platform: lib.optional enableTerminfo ncurses
++ [libffi] ++ [libffi]
++ stdenv.lib.optional (!enableIntegerSimple) gmp ++ lib.optional (!enableIntegerSimple) gmp
++ stdenv.lib.optional (platform.libc != "glibc" && !targetPlatform.isWindows) libiconv; ++ lib.optional (platform.libc != "glibc" && !targetPlatform.isWindows) libiconv;
toolsForTarget = [ toolsForTarget = [
pkgsBuildTarget.targetPackages.stdenv.cc pkgsBuildTarget.targetPackages.stdenv.cc
] ++ stdenv.lib.optional useLLVM buildLlvmPackages.llvm; ] ++ lib.optional useLLVM buildLlvmPackages.llvm;
targetCC = builtins.head toolsForTarget; targetCC = builtins.head toolsForTarget;
@ -107,7 +107,7 @@ stdenv.mkDerivation (rec {
outputs = [ "out" "doc" ]; outputs = [ "out" "doc" ];
patches = stdenv.lib.optionals stdenv.isDarwin [ patches = lib.optionals stdenv.isDarwin [
# Make Block.h compile with c++ compilers. Remove with the next release # Make Block.h compile with c++ compilers. Remove with the next release
(fetchpatch { (fetchpatch {
url = "https://gitlab.haskell.org/ghc/ghc/-/commit/97d0b0a367e4c6a52a17c3299439ac7de129da24.patch"; url = "https://gitlab.haskell.org/ghc/ghc/-/commit/97d0b0a367e4c6a52a17c3299439ac7de129da24.patch";
@ -127,7 +127,7 @@ stdenv.mkDerivation (rec {
export CC="${targetCC}/bin/${targetCC.targetPrefix}cc" export CC="${targetCC}/bin/${targetCC.targetPrefix}cc"
export CXX="${targetCC}/bin/${targetCC.targetPrefix}cxx" export CXX="${targetCC}/bin/${targetCC.targetPrefix}cxx"
# Use gold to work around https://sourceware.org/bugzilla/show_bug.cgi?id=16177 # Use gold to work around https://sourceware.org/bugzilla/show_bug.cgi?id=16177
export LD="${targetCC.bintools}/bin/${targetCC.bintools.targetPrefix}ld${stdenv.lib.optionalString useLdGold ".gold"}" export LD="${targetCC.bintools}/bin/${targetCC.bintools.targetPrefix}ld${lib.optionalString useLdGold ".gold"}"
export AS="${targetCC.bintools.bintools}/bin/${targetCC.bintools.targetPrefix}as" export AS="${targetCC.bintools.bintools}/bin/${targetCC.bintools.targetPrefix}as"
export AR="${targetCC.bintools.bintools}/bin/${targetCC.bintools.targetPrefix}ar" export AR="${targetCC.bintools.bintools}/bin/${targetCC.bintools.targetPrefix}ar"
export NM="${targetCC.bintools.bintools}/bin/${targetCC.bintools.targetPrefix}nm" export NM="${targetCC.bintools.bintools}/bin/${targetCC.bintools.targetPrefix}nm"
@ -137,13 +137,13 @@ stdenv.mkDerivation (rec {
echo -n "${buildMK}" > mk/build.mk echo -n "${buildMK}" > mk/build.mk
sed -i -e 's|-isysroot /Developer/SDKs/MacOSX10.5.sdk||' configure sed -i -e 's|-isysroot /Developer/SDKs/MacOSX10.5.sdk||' configure
'' + stdenv.lib.optionalString (!stdenv.isDarwin) '' '' + lib.optionalString (!stdenv.isDarwin) ''
export NIX_LDFLAGS+=" -rpath $out/lib/ghc-${version}" export NIX_LDFLAGS+=" -rpath $out/lib/ghc-${version}"
'' + stdenv.lib.optionalString stdenv.isDarwin '' '' + lib.optionalString stdenv.isDarwin ''
export NIX_LDFLAGS+=" -no_dtrace_dof" export NIX_LDFLAGS+=" -no_dtrace_dof"
'' + stdenv.lib.optionalString targetPlatform.useAndroidPrebuilt '' '' + lib.optionalString targetPlatform.useAndroidPrebuilt ''
sed -i -e '5i ,("armv7a-unknown-linux-androideabi", ("e-m:e-p:32:32-i64:64-v128:64:128-a:0:32-n32-S64", "cortex-a8", ""))' llvm-targets sed -i -e '5i ,("armv7a-unknown-linux-androideabi", ("e-m:e-p:32:32-i64:64-v128:64:128-a:0:32-n32-S64", "cortex-a8", ""))' llvm-targets
'' + stdenv.lib.optionalString targetPlatform.isMusl '' '' + lib.optionalString targetPlatform.isMusl ''
echo "patching llvm-targets for musl targets..." echo "patching llvm-targets for musl targets..."
echo "Cloning these existing '*-linux-gnu*' targets:" echo "Cloning these existing '*-linux-gnu*' targets:"
grep linux-gnu llvm-targets | sed 's/^/ /' grep linux-gnu llvm-targets | sed 's/^/ /'
@ -163,29 +163,29 @@ stdenv.mkDerivation (rec {
# TODO(@Ericson2314): Always pass "--target" and always prefix. # TODO(@Ericson2314): Always pass "--target" and always prefix.
configurePlatforms = [ "build" "host" ] configurePlatforms = [ "build" "host" ]
++ stdenv.lib.optional (targetPlatform != hostPlatform) "target"; ++ lib.optional (targetPlatform != hostPlatform) "target";
# `--with` flags for libraries needed for RTS linker # `--with` flags for libraries needed for RTS linker
configureFlags = [ configureFlags = [
"--datadir=$doc/share/doc/ghc" "--datadir=$doc/share/doc/ghc"
"--with-curses-includes=${ncurses.dev}/include" "--with-curses-libraries=${ncurses.out}/lib" "--with-curses-includes=${ncurses.dev}/include" "--with-curses-libraries=${ncurses.out}/lib"
] ++ stdenv.lib.optionals (libffi != null) [ ] ++ lib.optionals (libffi != null) [
"--with-system-libffi" "--with-system-libffi"
"--with-ffi-includes=${targetPackages.libffi.dev}/include" "--with-ffi-includes=${targetPackages.libffi.dev}/include"
"--with-ffi-libraries=${targetPackages.libffi.out}/lib" "--with-ffi-libraries=${targetPackages.libffi.out}/lib"
] ++ stdenv.lib.optionals (targetPlatform == hostPlatform && !enableIntegerSimple) [ ] ++ lib.optionals (targetPlatform == hostPlatform && !enableIntegerSimple) [
"--with-gmp-includes=${targetPackages.gmp.dev}/include" "--with-gmp-includes=${targetPackages.gmp.dev}/include"
"--with-gmp-libraries=${targetPackages.gmp.out}/lib" "--with-gmp-libraries=${targetPackages.gmp.out}/lib"
] ++ stdenv.lib.optionals (targetPlatform == hostPlatform && hostPlatform.libc != "glibc" && !targetPlatform.isWindows) [ ] ++ lib.optionals (targetPlatform == hostPlatform && hostPlatform.libc != "glibc" && !targetPlatform.isWindows) [
"--with-iconv-includes=${libiconv}/include" "--with-iconv-includes=${libiconv}/include"
"--with-iconv-libraries=${libiconv}/lib" "--with-iconv-libraries=${libiconv}/lib"
] ++ stdenv.lib.optionals (targetPlatform != hostPlatform) [ ] ++ lib.optionals (targetPlatform != hostPlatform) [
"--enable-bootstrap-with-devel-snapshot" "--enable-bootstrap-with-devel-snapshot"
] ++ stdenv.lib.optionals useLdGold [ ] ++ lib.optionals useLdGold [
"CFLAGS=-fuse-ld=gold" "CFLAGS=-fuse-ld=gold"
"CONF_GCC_LINKER_OPTS_STAGE1=-fuse-ld=gold" "CONF_GCC_LINKER_OPTS_STAGE1=-fuse-ld=gold"
"CONF_GCC_LINKER_OPTS_STAGE2=-fuse-ld=gold" "CONF_GCC_LINKER_OPTS_STAGE2=-fuse-ld=gold"
] ++ stdenv.lib.optionals (disableLargeAddressSpace) [ ] ++ lib.optionals (disableLargeAddressSpace) [
"--disable-large-address-space" "--disable-large-address-space"
]; ];
@ -206,18 +206,18 @@ stdenv.mkDerivation (rec {
buildInputs = [ perl bash ] ++ (libDeps hostPlatform); buildInputs = [ perl bash ] ++ (libDeps hostPlatform);
propagatedBuildInputs = [ targetPackages.stdenv.cc ] propagatedBuildInputs = [ targetPackages.stdenv.cc ]
++ stdenv.lib.optional useLLVM llvmPackages.llvm; ++ lib.optional useLLVM llvmPackages.llvm;
depsTargetTarget = map stdenv.lib.getDev (libDeps targetPlatform); depsTargetTarget = map lib.getDev (libDeps targetPlatform);
depsTargetTargetPropagated = map (stdenv.lib.getOutput "out") (libDeps targetPlatform); depsTargetTargetPropagated = map (lib.getOutput "out") (libDeps targetPlatform);
# required, because otherwise all symbols from HSffi.o are stripped, and # required, because otherwise all symbols from HSffi.o are stripped, and
# that in turn causes GHCi to abort # that in turn causes GHCi to abort
stripDebugFlags = [ "-S" ] ++ stdenv.lib.optional (!targetPlatform.isDarwin) "--keep-file-symbols"; stripDebugFlags = [ "-S" ] ++ lib.optional (!targetPlatform.isDarwin) "--keep-file-symbols";
checkTarget = "test"; checkTarget = "test";
hardeningDisable = [ "format" ] ++ stdenv.lib.optional stdenv.targetPlatform.isMusl "pie"; hardeningDisable = [ "format" ] ++ lib.optional stdenv.targetPlatform.isMusl "pie";
postInstall = '' postInstall = ''
# Install the bash completion file. # Install the bash completion file.
@ -227,7 +227,7 @@ stdenv.mkDerivation (rec {
for i in "$out/bin/"*; do for i in "$out/bin/"*; do
test ! -h $i || continue test ! -h $i || continue
egrep --quiet '^#!' <(head -n 1 $i) || continue egrep --quiet '^#!' <(head -n 1 $i) || continue
sed -i -e '2i export PATH="$PATH:${stdenv.lib.makeBinPath [ targetPackages.stdenv.cc.bintools coreutils ]}"' $i sed -i -e '2i export PATH="$PATH:${lib.makeBinPath [ targetPackages.stdenv.cc.bintools coreutils ]}"' $i
done done
''; '';
@ -244,12 +244,12 @@ stdenv.mkDerivation (rec {
meta = { meta = {
homepage = "http://haskell.org/ghc"; homepage = "http://haskell.org/ghc";
description = "The Glasgow Haskell Compiler"; description = "The Glasgow Haskell Compiler";
maintainers = with stdenv.lib.maintainers; [ marcweber andres peti ]; maintainers = with lib.maintainers; [ marcweber andres peti ];
timeout = 24 * 3600; timeout = 24 * 3600;
inherit (ghc.meta) license platforms; inherit (ghc.meta) license platforms;
}; };
} // stdenv.lib.optionalAttrs targetPlatform.useAndroidPrebuilt { } // lib.optionalAttrs targetPlatform.useAndroidPrebuilt {
dontStrip = true; dontStrip = true;
dontPatchELF = true; dontPatchELF = true;
noAuditTmpdir = true; noAuditTmpdir = true;

View file

@ -1,4 +1,4 @@
{ stdenv, substituteAll { lib, stdenv, substituteAll
, fetchurl, perl, gcc, llvm , fetchurl, perl, gcc, llvm
, ncurses5, gmp, glibc, libiconv , ncurses5, gmp, glibc, libiconv
, llvmPackages , llvmPackages
@ -10,11 +10,11 @@ assert stdenv.targetPlatform == stdenv.hostPlatform;
let let
useLLVM = !stdenv.targetPlatform.isx86; useLLVM = !stdenv.targetPlatform.isx86;
libPath = stdenv.lib.makeLibraryPath ([ libPath = lib.makeLibraryPath ([
ncurses5 gmp ncurses5 gmp
] ++ stdenv.lib.optional (stdenv.hostPlatform.isDarwin) libiconv); ] ++ lib.optional (stdenv.hostPlatform.isDarwin) libiconv);
libEnvVar = stdenv.lib.optionalString stdenv.hostPlatform.isDarwin "DY" libEnvVar = lib.optionalString stdenv.hostPlatform.isDarwin "DY"
+ "LD_LIBRARY_PATH"; + "LD_LIBRARY_PATH";
glibcDynLinker = assert stdenv.isLinux; glibcDynLinker = assert stdenv.isLinux;
@ -22,7 +22,7 @@ let
# Could be stdenv.cc.bintools.dynamicLinker, keeping as-is to avoid rebuild. # Could be stdenv.cc.bintools.dynamicLinker, keeping as-is to avoid rebuild.
''"$(cat $NIX_CC/nix-support/dynamic-linker)"'' ''"$(cat $NIX_CC/nix-support/dynamic-linker)"''
else else
"${stdenv.lib.getLib glibc}/lib/ld-linux*"; "${lib.getLib glibc}/lib/ld-linux*";
in in
@ -56,7 +56,7 @@ stdenv.mkDerivation rec {
or (throw "cannot bootstrap GHC on this platform")); or (throw "cannot bootstrap GHC on this platform"));
nativeBuildInputs = [ perl ]; nativeBuildInputs = [ perl ];
propagatedBuildInputs = stdenv.lib.optionals useLLVM [ llvmPackages.llvm ]; propagatedBuildInputs = lib.optionals useLLVM [ llvmPackages.llvm ];
# Cannot patchelf beforehand due to relative RPATHs that anticipate # Cannot patchelf beforehand due to relative RPATHs that anticipate
# the final install location/ # the final install location/
@ -65,7 +65,7 @@ stdenv.mkDerivation rec {
postUnpack = postUnpack =
# GHC has dtrace probes, which causes ld to try to open /usr/lib/libdtrace.dylib # GHC has dtrace probes, which causes ld to try to open /usr/lib/libdtrace.dylib
# during linking # during linking
stdenv.lib.optionalString stdenv.isDarwin '' lib.optionalString stdenv.isDarwin ''
export NIX_LDFLAGS+=" -no_dtrace_dof" export NIX_LDFLAGS+=" -no_dtrace_dof"
# not enough room in the object files for the full path to libiconv :( # not enough room in the object files for the full path to libiconv :(
for exe in $(find . -type f -executable); do for exe in $(find . -type f -executable); do
@ -97,14 +97,14 @@ stdenv.mkDerivation rec {
'' ''
find . -name integer-gmp.buildinfo \ find . -name integer-gmp.buildinfo \
-exec sed -i "s@extra-lib-dirs: @extra-lib-dirs: ${gmp.out}/lib@" {} \; -exec sed -i "s@extra-lib-dirs: @extra-lib-dirs: ${gmp.out}/lib@" {} \;
'' + stdenv.lib.optionalString stdenv.isDarwin '' '' + lib.optionalString stdenv.isDarwin ''
find . -name base.buildinfo \ find . -name base.buildinfo \
-exec sed -i "s@extra-lib-dirs: @extra-lib-dirs: ${libiconv}/lib@" {} \; -exec sed -i "s@extra-lib-dirs: @extra-lib-dirs: ${libiconv}/lib@" {} \;
'' + '' +
# Rename needed libraries and binaries, fix interpreter # Rename needed libraries and binaries, fix interpreter
stdenv.lib.optionalString stdenv.isLinux '' lib.optionalString stdenv.isLinux ''
find . -type f -perm -0100 -exec patchelf \ find . -type f -perm -0100 -exec patchelf \
--replace-needed libncurses${stdenv.lib.optionalString stdenv.is64bit "w"}.so.5 libncurses.so \ --replace-needed libncurses${lib.optionalString stdenv.is64bit "w"}.so.5 libncurses.so \
--replace-needed libtinfo.so libtinfo.so.5 \ --replace-needed libtinfo.so libtinfo.so.5 \
--interpreter ${glibcDynLinker} {} \; --interpreter ${glibcDynLinker} {} \;
@ -117,7 +117,7 @@ stdenv.mkDerivation rec {
# (`__strdup` is defined to be an alias of `strdup` anyway[1]). # (`__strdup` is defined to be an alias of `strdup` anyway[1]).
# [1] http://refspecs.linuxbase.org/LSB_4.0.0/LSB-Core-generic/LSB-Core-generic/baselib---strdup-1.html # [1] http://refspecs.linuxbase.org/LSB_4.0.0/LSB-Core-generic/LSB-Core-generic/baselib---strdup-1.html
# Use objcopy magic to make the change: # Use objcopy magic to make the change:
stdenv.lib.optionalString stdenv.hostPlatform.isMusl '' lib.optionalString stdenv.hostPlatform.isMusl ''
find ./ghc-${version}/rts -name "libHSrts*.a" -exec ''${OBJCOPY:-objcopy} --redefine-sym __strdup=strdup {} \; find ./ghc-${version}/rts -name "libHSrts*.a" -exec ''${OBJCOPY:-objcopy} --redefine-sym __strdup=strdup {} \;
''; '';
@ -130,10 +130,10 @@ stdenv.mkDerivation rec {
src = ./gcc-clang-wrapper.sh; src = ./gcc-clang-wrapper.sh;
}; };
in in
[ "--with-gmp-libraries=${stdenv.lib.getLib gmp}/lib" [ "--with-gmp-libraries=${lib.getLib gmp}/lib"
"--with-gmp-includes=${stdenv.lib.getDev gmp}/include" "--with-gmp-includes=${lib.getDev gmp}/include"
] ++ stdenv.lib.optional stdenv.isDarwin "--with-gcc=${gcc-clang-wrapper}" ] ++ lib.optional stdenv.isDarwin "--with-gcc=${gcc-clang-wrapper}"
++ stdenv.lib.optional stdenv.hostPlatform.isMusl "--disable-ld-override"; ++ lib.optional stdenv.hostPlatform.isMusl "--disable-ld-override";
# Stripping combined with patchelf breaks the executables (they die # Stripping combined with patchelf breaks the executables (they die
# with a segfault or the kernel even refuses the execve). (NIXPKGS-85) # with a segfault or the kernel even refuses the execve). (NIXPKGS-85)
@ -145,14 +145,14 @@ stdenv.mkDerivation rec {
# On Linux, use patchelf to modify the executables so that they can # On Linux, use patchelf to modify the executables so that they can
# find editline/gmp. # find editline/gmp.
preFixup = stdenv.lib.optionalString stdenv.isLinux '' preFixup = lib.optionalString stdenv.isLinux ''
for p in $(find "$out" -type f -executable); do for p in $(find "$out" -type f -executable); do
if isELF "$p"; then if isELF "$p"; then
echo "Patchelfing $p" echo "Patchelfing $p"
patchelf --set-rpath "${libPath}:$(patchelf --print-rpath $p)" $p patchelf --set-rpath "${libPath}:$(patchelf --print-rpath $p)" $p
fi fi
done done
'' + stdenv.lib.optionalString stdenv.isDarwin '' '' + lib.optionalString stdenv.isDarwin ''
# not enough room in the object files for the full path to libiconv :( # not enough room in the object files for the full path to libiconv :(
for exe in $(find "$out" -type f -executable); do for exe in $(find "$out" -type f -executable); do
isScript $exe && continue isScript $exe && continue
@ -186,6 +186,6 @@ stdenv.mkDerivation rec {
enableShared = true; enableShared = true;
}; };
meta.license = stdenv.lib.licenses.bsd3; meta.license = lib.licenses.bsd3;
meta.platforms = ["x86_64-linux" "i686-linux" "x86_64-darwin" "armv7l-linux" "aarch64-linux"]; meta.platforms = ["x86_64-linux" "i686-linux" "x86_64-darwin" "armv7l-linux" "aarch64-linux"];
} }

View file

@ -1,4 +1,4 @@
{ stdenv { lib, stdenv
, fetchurl, perl, gcc , fetchurl, perl, gcc
, ncurses5, ncurses6, gmp, glibc, libiconv , ncurses5, ncurses6, gmp, glibc, libiconv
, llvmPackages , llvmPackages
@ -14,11 +14,11 @@ let
ourNcurses = if useNcurses6 then ncurses6 else ncurses5; ourNcurses = if useNcurses6 then ncurses6 else ncurses5;
libPath = stdenv.lib.makeLibraryPath ([ libPath = lib.makeLibraryPath ([
ourNcurses gmp ourNcurses gmp
] ++ stdenv.lib.optional (stdenv.hostPlatform.isDarwin) libiconv); ] ++ lib.optional (stdenv.hostPlatform.isDarwin) libiconv);
libEnvVar = stdenv.lib.optionalString stdenv.hostPlatform.isDarwin "DY" libEnvVar = lib.optionalString stdenv.hostPlatform.isDarwin "DY"
+ "LD_LIBRARY_PATH"; + "LD_LIBRARY_PATH";
glibcDynLinker = assert stdenv.isLinux; glibcDynLinker = assert stdenv.isLinux;
@ -26,7 +26,7 @@ let
# Could be stdenv.cc.bintools.dynamicLinker, keeping as-is to avoid rebuild. # Could be stdenv.cc.bintools.dynamicLinker, keeping as-is to avoid rebuild.
''"$(cat $NIX_CC/nix-support/dynamic-linker)"'' ''"$(cat $NIX_CC/nix-support/dynamic-linker)"''
else else
"${stdenv.lib.getLib glibc}/lib/ld-linux*"; "${lib.getLib glibc}/lib/ld-linux*";
in in
@ -61,7 +61,7 @@ stdenv.mkDerivation rec {
or (throw "cannot bootstrap GHC on this platform")); or (throw "cannot bootstrap GHC on this platform"));
nativeBuildInputs = [ perl ]; nativeBuildInputs = [ perl ];
propagatedBuildInputs = stdenv.lib.optionals useLLVM [ llvmPackages.llvm ]; propagatedBuildInputs = lib.optionals useLLVM [ llvmPackages.llvm ];
# Cannot patchelf beforehand due to relative RPATHs that anticipate # Cannot patchelf beforehand due to relative RPATHs that anticipate
# the final install location/ # the final install location/
@ -70,7 +70,7 @@ stdenv.mkDerivation rec {
postUnpack = postUnpack =
# GHC has dtrace probes, which causes ld to try to open /usr/lib/libdtrace.dylib # GHC has dtrace probes, which causes ld to try to open /usr/lib/libdtrace.dylib
# during linking # during linking
stdenv.lib.optionalString stdenv.isDarwin '' lib.optionalString stdenv.isDarwin ''
export NIX_LDFLAGS+=" -no_dtrace_dof" export NIX_LDFLAGS+=" -no_dtrace_dof"
# not enough room in the object files for the full path to libiconv :( # not enough room in the object files for the full path to libiconv :(
for exe in $(find . -type f -executable); do for exe in $(find . -type f -executable); do
@ -90,17 +90,17 @@ stdenv.mkDerivation rec {
'' ''
find . -name integer-gmp.buildinfo \ find . -name integer-gmp.buildinfo \
-exec sed -i "s@extra-lib-dirs: @extra-lib-dirs: ${gmp.out}/lib@" {} \; -exec sed -i "s@extra-lib-dirs: @extra-lib-dirs: ${gmp.out}/lib@" {} \;
'' + stdenv.lib.optionalString stdenv.isDarwin '' '' + lib.optionalString stdenv.isDarwin ''
find . -name base.buildinfo \ find . -name base.buildinfo \
-exec sed -i "s@extra-lib-dirs: @extra-lib-dirs: ${libiconv}/lib@" {} \; -exec sed -i "s@extra-lib-dirs: @extra-lib-dirs: ${libiconv}/lib@" {} \;
'' + '' +
# Rename needed libraries and binaries, fix interpreter # Rename needed libraries and binaries, fix interpreter
stdenv.lib.optionalString stdenv.isLinux '' lib.optionalString stdenv.isLinux ''
find . -type f -perm -0100 \ find . -type f -perm -0100 \
-exec patchelf \ -exec patchelf \
--replace-needed libncurses${stdenv.lib.optionalString stdenv.is64bit "w"}.so.5 libncurses.so \ --replace-needed libncurses${lib.optionalString stdenv.is64bit "w"}.so.5 libncurses.so \
${ # This isn't required for x86_64-linux where we use ncurses6 ${ # This isn't required for x86_64-linux where we use ncurses6
stdenv.lib.optionalString (!useNcurses6) "--replace-needed libtinfo.so libtinfo.so.5" lib.optionalString (!useNcurses6) "--replace-needed libtinfo.so libtinfo.so.5"
} \ } \
--interpreter ${glibcDynLinker} {} \; --interpreter ${glibcDynLinker} {} \;
@ -113,16 +113,16 @@ stdenv.mkDerivation rec {
# (`__strdup` is defined to be an alias of `strdup` anyway[1]). # (`__strdup` is defined to be an alias of `strdup` anyway[1]).
# [1] http://refspecs.linuxbase.org/LSB_4.0.0/LSB-Core-generic/LSB-Core-generic/baselib---strdup-1.html # [1] http://refspecs.linuxbase.org/LSB_4.0.0/LSB-Core-generic/LSB-Core-generic/baselib---strdup-1.html
# Use objcopy magic to make the change: # Use objcopy magic to make the change:
stdenv.lib.optionalString stdenv.hostPlatform.isMusl '' lib.optionalString stdenv.hostPlatform.isMusl ''
find ./ghc-${version}/rts -name "libHSrts*.a" -exec ''${OBJCOPY:-objcopy} --redefine-sym __strdup=strdup {} \; find ./ghc-${version}/rts -name "libHSrts*.a" -exec ''${OBJCOPY:-objcopy} --redefine-sym __strdup=strdup {} \;
''; '';
configurePlatforms = [ ]; configurePlatforms = [ ];
configureFlags = [ configureFlags = [
"--with-gmp-libraries=${stdenv.lib.getLib gmp}/lib" "--with-gmp-libraries=${lib.getLib gmp}/lib"
"--with-gmp-includes=${stdenv.lib.getDev gmp}/include" "--with-gmp-includes=${lib.getDev gmp}/include"
] ++ stdenv.lib.optional stdenv.isDarwin "--with-gcc=${./gcc-clang-wrapper.sh}" ] ++ lib.optional stdenv.isDarwin "--with-gcc=${./gcc-clang-wrapper.sh}"
++ stdenv.lib.optional stdenv.hostPlatform.isMusl "--disable-ld-override"; ++ lib.optional stdenv.hostPlatform.isMusl "--disable-ld-override";
# No building is necessary, but calling make without flags ironically # No building is necessary, but calling make without flags ironically
# calls install-strip ... # calls install-strip ...
@ -130,14 +130,14 @@ stdenv.mkDerivation rec {
# On Linux, use patchelf to modify the executables so that they can # On Linux, use patchelf to modify the executables so that they can
# find editline/gmp. # find editline/gmp.
postFixup = stdenv.lib.optionalString stdenv.isLinux '' postFixup = lib.optionalString stdenv.isLinux ''
for p in $(find "$out" -type f -executable); do for p in $(find "$out" -type f -executable); do
if isELF "$p"; then if isELF "$p"; then
echo "Patchelfing $p" echo "Patchelfing $p"
patchelf --set-rpath "${libPath}:$(patchelf --print-rpath $p)" $p patchelf --set-rpath "${libPath}:$(patchelf --print-rpath $p)" $p
fi fi
done done
'' + stdenv.lib.optionalString stdenv.isDarwin '' '' + lib.optionalString stdenv.isDarwin ''
# not enough room in the object files for the full path to libiconv :( # not enough room in the object files for the full path to libiconv :(
for exe in $(find "$out" -type f -executable); do for exe in $(find "$out" -type f -executable); do
isScript $exe && continue isScript $exe && continue
@ -171,6 +171,6 @@ stdenv.mkDerivation rec {
enableShared = true; enableShared = true;
}; };
meta.license = stdenv.lib.licenses.bsd3; meta.license = lib.licenses.bsd3;
meta.platforms = ["x86_64-linux" "aarch64-linux" "i686-linux" "x86_64-darwin"]; meta.platforms = ["x86_64-linux" "aarch64-linux" "i686-linux" "x86_64-darwin"];
} }

View file

@ -1,4 +1,4 @@
{ stdenv, pkgsBuildTarget, targetPackages { lib, stdenv, pkgsBuildTarget, targetPackages
# build-tools # build-tools
, bootPkgs , bootPkgs
@ -18,7 +18,7 @@
, # If enabled, GHC will be built with the GPL-free but slower integer-simple , # If enabled, GHC will be built with the GPL-free but slower integer-simple
# library instead of the faster but GPLed integer-gmp library. # library instead of the faster but GPLed integer-gmp library.
enableIntegerSimple ? !(stdenv.lib.any (stdenv.lib.meta.platformMatch stdenv.hostPlatform) gmp.meta.platforms), gmp enableIntegerSimple ? !(lib.any (lib.meta.platformMatch stdenv.hostPlatform) gmp.meta.platforms), gmp
, # If enabled, use -fPIC when compiling static libs. , # If enabled, use -fPIC when compiling static libs.
enableRelocatedStaticLibs ? stdenv.targetPlatform != stdenv.hostPlatform enableRelocatedStaticLibs ? stdenv.targetPlatform != stdenv.hostPlatform
@ -32,7 +32,7 @@
, # What flavour to build. An empty string indicates no , # What flavour to build. An empty string indicates no
# specific flavour and falls back to ghc default values. # specific flavour and falls back to ghc default values.
ghcFlavour ? stdenv.lib.optionalString (stdenv.targetPlatform != stdenv.hostPlatform) ghcFlavour ? lib.optionalString (stdenv.targetPlatform != stdenv.hostPlatform)
(if useLLVM then "perf-cross" else "perf-cross-ncg") (if useLLVM then "perf-cross" else "perf-cross-ncg")
, # Whether to disable the large address space allocator , # Whether to disable the large address space allocator
@ -48,7 +48,7 @@ let
inherit (bootPkgs) ghc; inherit (bootPkgs) ghc;
# TODO(@Ericson2314) Make unconditional # TODO(@Ericson2314) Make unconditional
targetPrefix = stdenv.lib.optionalString targetPrefix = lib.optionalString
(targetPlatform != hostPlatform) (targetPlatform != hostPlatform)
"${targetPlatform.config}-"; "${targetPlatform.config}-";
@ -66,28 +66,28 @@ let
# to actually link to our new Libc. The iOS simulator is a special # to actually link to our new Libc. The iOS simulator is a special
# exception because we cant actually run simulators binaries # exception because we cant actually run simulators binaries
# ourselves. # ourselves.
+ stdenv.lib.optionalString (targetPlatform != hostPlatform) '' + lib.optionalString (targetPlatform != hostPlatform) ''
Stage1Only = ${if (targetPlatform.system == hostPlatform.system && !targetPlatform.isiOS) then "NO" else "YES"} Stage1Only = ${if (targetPlatform.system == hostPlatform.system && !targetPlatform.isiOS) then "NO" else "YES"}
CrossCompilePrefix = ${targetPrefix} CrossCompilePrefix = ${targetPrefix}
HADDOCK_DOCS = NO HADDOCK_DOCS = NO
BUILD_SPHINX_HTML = NO BUILD_SPHINX_HTML = NO
BUILD_SPHINX_PDF = NO BUILD_SPHINX_PDF = NO
'' + stdenv.lib.optionalString enableRelocatedStaticLibs '' '' + lib.optionalString enableRelocatedStaticLibs ''
GhcLibHcOpts += -fPIC GhcLibHcOpts += -fPIC
GhcRtsHcOpts += -fPIC GhcRtsHcOpts += -fPIC
'' + stdenv.lib.optionalString targetPlatform.useAndroidPrebuilt '' '' + lib.optionalString targetPlatform.useAndroidPrebuilt ''
EXTRA_CC_OPTS += -std=gnu99 EXTRA_CC_OPTS += -std=gnu99
''; '';
# Splicer will pull out correct variations # Splicer will pull out correct variations
libDeps = platform: stdenv.lib.optional enableTerminfo ncurses libDeps = platform: lib.optional enableTerminfo ncurses
++ [libffi] ++ [libffi]
++ stdenv.lib.optional (!enableIntegerSimple) gmp ++ lib.optional (!enableIntegerSimple) gmp
++ stdenv.lib.optional (platform.libc != "glibc" && !targetPlatform.isWindows) libiconv; ++ lib.optional (platform.libc != "glibc" && !targetPlatform.isWindows) libiconv;
toolsForTarget = [ toolsForTarget = [
pkgsBuildTarget.targetPackages.stdenv.cc pkgsBuildTarget.targetPackages.stdenv.cc
] ++ stdenv.lib.optional useLLVM buildLlvmPackages.llvm; ] ++ lib.optional useLLVM buildLlvmPackages.llvm;
targetCC = builtins.head toolsForTarget; targetCC = builtins.head toolsForTarget;
@ -136,7 +136,7 @@ stdenv.mkDerivation (rec {
export CC="${targetCC}/bin/${targetCC.targetPrefix}cc" export CC="${targetCC}/bin/${targetCC.targetPrefix}cc"
export CXX="${targetCC}/bin/${targetCC.targetPrefix}cxx" export CXX="${targetCC}/bin/${targetCC.targetPrefix}cxx"
# Use gold to work around https://sourceware.org/bugzilla/show_bug.cgi?id=16177 # Use gold to work around https://sourceware.org/bugzilla/show_bug.cgi?id=16177
export LD="${targetCC.bintools}/bin/${targetCC.bintools.targetPrefix}ld${stdenv.lib.optionalString useLdGold ".gold"}" export LD="${targetCC.bintools}/bin/${targetCC.bintools.targetPrefix}ld${lib.optionalString useLdGold ".gold"}"
export AS="${targetCC.bintools.bintools}/bin/${targetCC.bintools.targetPrefix}as" export AS="${targetCC.bintools.bintools}/bin/${targetCC.bintools.targetPrefix}as"
export AR="${targetCC.bintools.bintools}/bin/${targetCC.bintools.targetPrefix}ar" export AR="${targetCC.bintools.bintools}/bin/${targetCC.bintools.targetPrefix}ar"
export NM="${targetCC.bintools.bintools}/bin/${targetCC.bintools.targetPrefix}nm" export NM="${targetCC.bintools.bintools}/bin/${targetCC.bintools.targetPrefix}nm"
@ -146,13 +146,13 @@ stdenv.mkDerivation (rec {
echo -n "${buildMK}" > mk/build.mk echo -n "${buildMK}" > mk/build.mk
sed -i -e 's|-isysroot /Developer/SDKs/MacOSX10.5.sdk||' configure sed -i -e 's|-isysroot /Developer/SDKs/MacOSX10.5.sdk||' configure
'' + stdenv.lib.optionalString (!stdenv.isDarwin) '' '' + lib.optionalString (!stdenv.isDarwin) ''
export NIX_LDFLAGS+=" -rpath $out/lib/ghc-${version}" export NIX_LDFLAGS+=" -rpath $out/lib/ghc-${version}"
'' + stdenv.lib.optionalString stdenv.isDarwin '' '' + lib.optionalString stdenv.isDarwin ''
export NIX_LDFLAGS+=" -no_dtrace_dof" export NIX_LDFLAGS+=" -no_dtrace_dof"
'' + stdenv.lib.optionalString targetPlatform.useAndroidPrebuilt '' '' + lib.optionalString targetPlatform.useAndroidPrebuilt ''
sed -i -e '5i ,("armv7a-unknown-linux-androideabi", ("e-m:e-p:32:32-i64:64-v128:64:128-a:0:32-n32-S64", "cortex-a8", ""))' llvm-targets sed -i -e '5i ,("armv7a-unknown-linux-androideabi", ("e-m:e-p:32:32-i64:64-v128:64:128-a:0:32-n32-S64", "cortex-a8", ""))' llvm-targets
'' + stdenv.lib.optionalString targetPlatform.isMusl '' '' + lib.optionalString targetPlatform.isMusl ''
echo "patching llvm-targets for musl targets..." echo "patching llvm-targets for musl targets..."
echo "Cloning these existing '*-linux-gnu*' targets:" echo "Cloning these existing '*-linux-gnu*' targets:"
grep linux-gnu llvm-targets | sed 's/^/ /' grep linux-gnu llvm-targets | sed 's/^/ /'
@ -172,23 +172,23 @@ stdenv.mkDerivation (rec {
# TODO(@Ericson2314): Always pass "--target" and always prefix. # TODO(@Ericson2314): Always pass "--target" and always prefix.
configurePlatforms = [ "build" "host" ] configurePlatforms = [ "build" "host" ]
++ stdenv.lib.optional (targetPlatform != hostPlatform) "target"; ++ lib.optional (targetPlatform != hostPlatform) "target";
# `--with` flags for libraries needed for RTS linker # `--with` flags for libraries needed for RTS linker
configureFlags = [ configureFlags = [
"--datadir=$doc/share/doc/ghc" "--datadir=$doc/share/doc/ghc"
"--with-curses-includes=${ncurses.dev}/include" "--with-curses-libraries=${ncurses.out}/lib" "--with-curses-includes=${ncurses.dev}/include" "--with-curses-libraries=${ncurses.out}/lib"
] ++ stdenv.lib.optionals (libffi != null) ["--with-system-libffi" "--with-ffi-includes=${targetPackages.libffi.dev}/include" "--with-ffi-libraries=${targetPackages.libffi.out}/lib" ] ++ lib.optionals (libffi != null) ["--with-system-libffi" "--with-ffi-includes=${targetPackages.libffi.dev}/include" "--with-ffi-libraries=${targetPackages.libffi.out}/lib"
] ++ stdenv.lib.optionals (targetPlatform == hostPlatform && !enableIntegerSimple) [ ] ++ lib.optionals (targetPlatform == hostPlatform && !enableIntegerSimple) [
"--with-gmp-includes=${targetPackages.gmp.dev}/include" "--with-gmp-libraries=${targetPackages.gmp.out}/lib" "--with-gmp-includes=${targetPackages.gmp.dev}/include" "--with-gmp-libraries=${targetPackages.gmp.out}/lib"
] ++ stdenv.lib.optionals (targetPlatform == hostPlatform && hostPlatform.libc != "glibc" && !targetPlatform.isWindows) [ ] ++ lib.optionals (targetPlatform == hostPlatform && hostPlatform.libc != "glibc" && !targetPlatform.isWindows) [
"--with-iconv-includes=${libiconv}/include" "--with-iconv-libraries=${libiconv}/lib" "--with-iconv-includes=${libiconv}/include" "--with-iconv-libraries=${libiconv}/lib"
] ++ stdenv.lib.optionals (targetPlatform != hostPlatform) [ ] ++ lib.optionals (targetPlatform != hostPlatform) [
"--enable-bootstrap-with-devel-snapshot" "--enable-bootstrap-with-devel-snapshot"
] ++ stdenv.lib.optionals useLdGold [ ] ++ lib.optionals useLdGold [
"CFLAGS=-fuse-ld=gold" "CFLAGS=-fuse-ld=gold"
"CONF_GCC_LINKER_OPTS_STAGE1=-fuse-ld=gold" "CONF_GCC_LINKER_OPTS_STAGE1=-fuse-ld=gold"
"CONF_GCC_LINKER_OPTS_STAGE2=-fuse-ld=gold" "CONF_GCC_LINKER_OPTS_STAGE2=-fuse-ld=gold"
] ++ stdenv.lib.optionals (disableLargeAddressSpace) [ ] ++ lib.optionals (disableLargeAddressSpace) [
"--disable-large-address-space" "--disable-large-address-space"
]; ];
@ -209,14 +209,14 @@ stdenv.mkDerivation (rec {
buildInputs = [ perl bash ] ++ (libDeps hostPlatform); buildInputs = [ perl bash ] ++ (libDeps hostPlatform);
propagatedBuildInputs = [ targetPackages.stdenv.cc ] propagatedBuildInputs = [ targetPackages.stdenv.cc ]
++ stdenv.lib.optional useLLVM llvmPackages.llvm; ++ lib.optional useLLVM llvmPackages.llvm;
depsTargetTarget = map stdenv.lib.getDev (libDeps targetPlatform); depsTargetTarget = map lib.getDev (libDeps targetPlatform);
depsTargetTargetPropagated = map (stdenv.lib.getOutput "out") (libDeps targetPlatform); depsTargetTargetPropagated = map (lib.getOutput "out") (libDeps targetPlatform);
# required, because otherwise all symbols from HSffi.o are stripped, and # required, because otherwise all symbols from HSffi.o are stripped, and
# that in turn causes GHCi to abort # that in turn causes GHCi to abort
stripDebugFlags = [ "-S" ] ++ stdenv.lib.optional (!targetPlatform.isDarwin) "--keep-file-symbols"; stripDebugFlags = [ "-S" ] ++ lib.optional (!targetPlatform.isDarwin) "--keep-file-symbols";
# See #63511 - the only unstripped file is the debug rts which isn't meant to # See #63511 - the only unstripped file is the debug rts which isn't meant to
# be stripped. # be stripped.
@ -224,7 +224,7 @@ stdenv.mkDerivation (rec {
checkTarget = "test"; checkTarget = "test";
hardeningDisable = [ "format" ] ++ stdenv.lib.optional stdenv.targetPlatform.isMusl "pie"; hardeningDisable = [ "format" ] ++ lib.optional stdenv.targetPlatform.isMusl "pie";
postInstall = '' postInstall = ''
# Install the bash completion file. # Install the bash completion file.
@ -234,11 +234,11 @@ stdenv.mkDerivation (rec {
for i in "$out/bin/"*; do for i in "$out/bin/"*; do
test ! -h $i || continue test ! -h $i || continue
egrep --quiet '^#!' <(head -n 1 $i) || continue egrep --quiet '^#!' <(head -n 1 $i) || continue
sed -i -e '2i export PATH="$PATH:${stdenv.lib.makeBinPath [ targetPackages.stdenv.cc.bintools coreutils ]}"' $i sed -i -e '2i export PATH="$PATH:${lib.makeBinPath [ targetPackages.stdenv.cc.bintools coreutils ]}"' $i
done done
'' ''
# Temporary work-around for https://github.com/NixOS/nixpkgs/issues/66277 # Temporary work-around for https://github.com/NixOS/nixpkgs/issues/66277
+ stdenv.lib.optionalString hostPlatform.isAarch64 '' + lib.optionalString hostPlatform.isAarch64 ''
rm -rf "$doc/share/doc/ghc/html/libraries" rm -rf "$doc/share/doc/ghc/html/libraries"
''; '';
@ -255,12 +255,12 @@ stdenv.mkDerivation (rec {
meta = { meta = {
homepage = "http://haskell.org/ghc"; homepage = "http://haskell.org/ghc";
description = "The Glasgow Haskell Compiler"; description = "The Glasgow Haskell Compiler";
maintainers = with stdenv.lib.maintainers; [ marcweber andres peti ]; maintainers = with lib.maintainers; [ marcweber andres peti ];
timeout = 24 * 3600; timeout = 24 * 3600;
inherit (ghc.meta) license platforms; inherit (ghc.meta) license platforms;
}; };
} // stdenv.lib.optionalAttrs targetPlatform.useAndroidPrebuilt { } // lib.optionalAttrs targetPlatform.useAndroidPrebuilt {
dontStrip = true; dontStrip = true;
dontPatchELF = true; dontPatchELF = true;
noAuditTmpdir = true; noAuditTmpdir = true;

View file

@ -1,4 +1,4 @@
{ stdenv, pkgsBuildTarget, targetPackages { lib, stdenv, pkgsBuildTarget, targetPackages
# build-tools # build-tools
, bootPkgs , bootPkgs
@ -18,7 +18,7 @@
, # If enabled, GHC will be built with the GPL-free but slower integer-simple , # If enabled, GHC will be built with the GPL-free but slower integer-simple
# library instead of the faster but GPLed integer-gmp library. # library instead of the faster but GPLed integer-gmp library.
enableIntegerSimple ? !(stdenv.lib.any (stdenv.lib.meta.platformMatch stdenv.hostPlatform) gmp.meta.platforms), gmp enableIntegerSimple ? !(lib.any (lib.meta.platformMatch stdenv.hostPlatform) gmp.meta.platforms), gmp
, # If enabled, use -fPIC when compiling static libs. , # If enabled, use -fPIC when compiling static libs.
enableRelocatedStaticLibs ? stdenv.targetPlatform != stdenv.hostPlatform enableRelocatedStaticLibs ? stdenv.targetPlatform != stdenv.hostPlatform
@ -32,7 +32,7 @@
, # What flavour to build. An empty string indicates no , # What flavour to build. An empty string indicates no
# specific flavour and falls back to ghc default values. # specific flavour and falls back to ghc default values.
ghcFlavour ? stdenv.lib.optionalString (stdenv.targetPlatform != stdenv.hostPlatform) ghcFlavour ? lib.optionalString (stdenv.targetPlatform != stdenv.hostPlatform)
(if useLLVM then "perf-cross" else "perf-cross-ncg") (if useLLVM then "perf-cross" else "perf-cross-ncg")
, # Whether to disable the large address space allocator , # Whether to disable the large address space allocator
@ -48,7 +48,7 @@ let
inherit (bootPkgs) ghc; inherit (bootPkgs) ghc;
# TODO(@Ericson2314) Make unconditional # TODO(@Ericson2314) Make unconditional
targetPrefix = stdenv.lib.optionalString targetPrefix = lib.optionalString
(targetPlatform != hostPlatform) (targetPlatform != hostPlatform)
"${targetPlatform.config}-"; "${targetPlatform.config}-";
@ -66,30 +66,30 @@ let
# to actually link to our new Libc. The iOS simulator is a special # to actually link to our new Libc. The iOS simulator is a special
# exception because we cant actually run simulators binaries # exception because we cant actually run simulators binaries
# ourselves. # ourselves.
+ stdenv.lib.optionalString (targetPlatform != hostPlatform) '' + lib.optionalString (targetPlatform != hostPlatform) ''
Stage1Only = ${if (targetPlatform.system == hostPlatform.system && !targetPlatform.isiOS) then "NO" else "YES"} Stage1Only = ${if (targetPlatform.system == hostPlatform.system && !targetPlatform.isiOS) then "NO" else "YES"}
CrossCompilePrefix = ${targetPrefix} CrossCompilePrefix = ${targetPrefix}
HADDOCK_DOCS = NO HADDOCK_DOCS = NO
BUILD_SPHINX_HTML = NO BUILD_SPHINX_HTML = NO
BUILD_SPHINX_PDF = NO BUILD_SPHINX_PDF = NO
'' + stdenv.lib.optionalString dontStrip '' '' + lib.optionalString dontStrip ''
STRIP_CMD = : STRIP_CMD = :
'' + stdenv.lib.optionalString enableRelocatedStaticLibs '' '' + lib.optionalString enableRelocatedStaticLibs ''
GhcLibHcOpts += -fPIC GhcLibHcOpts += -fPIC
GhcRtsHcOpts += -fPIC GhcRtsHcOpts += -fPIC
'' + stdenv.lib.optionalString targetPlatform.useAndroidPrebuilt '' '' + lib.optionalString targetPlatform.useAndroidPrebuilt ''
EXTRA_CC_OPTS += -std=gnu99 EXTRA_CC_OPTS += -std=gnu99
''; '';
# Splicer will pull out correct variations # Splicer will pull out correct variations
libDeps = platform: stdenv.lib.optional enableTerminfo ncurses libDeps = platform: lib.optional enableTerminfo ncurses
++ [libffi] ++ [libffi]
++ stdenv.lib.optional (!enableIntegerSimple) gmp ++ lib.optional (!enableIntegerSimple) gmp
++ stdenv.lib.optional (platform.libc != "glibc" && !targetPlatform.isWindows) libiconv; ++ lib.optional (platform.libc != "glibc" && !targetPlatform.isWindows) libiconv;
toolsForTarget = [ toolsForTarget = [
pkgsBuildTarget.targetPackages.stdenv.cc pkgsBuildTarget.targetPackages.stdenv.cc
] ++ stdenv.lib.optional useLLVM buildLlvmPackages.llvm; ] ++ lib.optional useLLVM buildLlvmPackages.llvm;
targetCC = builtins.head toolsForTarget; targetCC = builtins.head toolsForTarget;
@ -123,7 +123,7 @@ stdenv.mkDerivation (rec {
export CC="${targetCC}/bin/${targetCC.targetPrefix}cc" export CC="${targetCC}/bin/${targetCC.targetPrefix}cc"
export CXX="${targetCC}/bin/${targetCC.targetPrefix}cxx" export CXX="${targetCC}/bin/${targetCC.targetPrefix}cxx"
# Use gold to work around https://sourceware.org/bugzilla/show_bug.cgi?id=16177 # Use gold to work around https://sourceware.org/bugzilla/show_bug.cgi?id=16177
export LD="${targetCC.bintools}/bin/${targetCC.bintools.targetPrefix}ld${stdenv.lib.optionalString useLdGold ".gold"}" export LD="${targetCC.bintools}/bin/${targetCC.bintools.targetPrefix}ld${lib.optionalString useLdGold ".gold"}"
export AS="${targetCC.bintools.bintools}/bin/${targetCC.bintools.targetPrefix}as" export AS="${targetCC.bintools.bintools}/bin/${targetCC.bintools.targetPrefix}as"
export AR="${targetCC.bintools.bintools}/bin/${targetCC.bintools.targetPrefix}ar" export AR="${targetCC.bintools.bintools}/bin/${targetCC.bintools.targetPrefix}ar"
export NM="${targetCC.bintools.bintools}/bin/${targetCC.bintools.targetPrefix}nm" export NM="${targetCC.bintools.bintools}/bin/${targetCC.bintools.targetPrefix}nm"
@ -133,13 +133,13 @@ stdenv.mkDerivation (rec {
echo -n "${buildMK dontStrip}" > mk/build.mk echo -n "${buildMK dontStrip}" > mk/build.mk
sed -i -e 's|-isysroot /Developer/SDKs/MacOSX10.5.sdk||' configure sed -i -e 's|-isysroot /Developer/SDKs/MacOSX10.5.sdk||' configure
'' + stdenv.lib.optionalString (!stdenv.isDarwin) '' '' + lib.optionalString (!stdenv.isDarwin) ''
export NIX_LDFLAGS+=" -rpath $out/lib/ghc-${version}" export NIX_LDFLAGS+=" -rpath $out/lib/ghc-${version}"
'' + stdenv.lib.optionalString stdenv.isDarwin '' '' + lib.optionalString stdenv.isDarwin ''
export NIX_LDFLAGS+=" -no_dtrace_dof" export NIX_LDFLAGS+=" -no_dtrace_dof"
'' + stdenv.lib.optionalString targetPlatform.useAndroidPrebuilt '' '' + lib.optionalString targetPlatform.useAndroidPrebuilt ''
sed -i -e '5i ,("armv7a-unknown-linux-androideabi", ("e-m:e-p:32:32-i64:64-v128:64:128-a:0:32-n32-S64", "cortex-a8", ""))' llvm-targets sed -i -e '5i ,("armv7a-unknown-linux-androideabi", ("e-m:e-p:32:32-i64:64-v128:64:128-a:0:32-n32-S64", "cortex-a8", ""))' llvm-targets
'' + stdenv.lib.optionalString targetPlatform.isMusl '' '' + lib.optionalString targetPlatform.isMusl ''
echo "patching llvm-targets for musl targets..." echo "patching llvm-targets for musl targets..."
echo "Cloning these existing '*-linux-gnu*' targets:" echo "Cloning these existing '*-linux-gnu*' targets:"
grep linux-gnu llvm-targets | sed 's/^/ /' grep linux-gnu llvm-targets | sed 's/^/ /'
@ -159,29 +159,29 @@ stdenv.mkDerivation (rec {
# TODO(@Ericson2314): Always pass "--target" and always prefix. # TODO(@Ericson2314): Always pass "--target" and always prefix.
configurePlatforms = [ "build" "host" ] configurePlatforms = [ "build" "host" ]
++ stdenv.lib.optional (targetPlatform != hostPlatform) "target"; ++ lib.optional (targetPlatform != hostPlatform) "target";
# `--with` flags for libraries needed for RTS linker # `--with` flags for libraries needed for RTS linker
configureFlags = [ configureFlags = [
"--datadir=$doc/share/doc/ghc" "--datadir=$doc/share/doc/ghc"
"--with-curses-includes=${ncurses.dev}/include" "--with-curses-libraries=${ncurses.out}/lib" "--with-curses-includes=${ncurses.dev}/include" "--with-curses-libraries=${ncurses.out}/lib"
] ++ stdenv.lib.optionals (libffi != null) [ ] ++ lib.optionals (libffi != null) [
"--with-system-libffi" "--with-system-libffi"
"--with-ffi-includes=${targetPackages.libffi.dev}/include" "--with-ffi-includes=${targetPackages.libffi.dev}/include"
"--with-ffi-libraries=${targetPackages.libffi.out}/lib" "--with-ffi-libraries=${targetPackages.libffi.out}/lib"
] ++ stdenv.lib.optionals (targetPlatform == hostPlatform && !enableIntegerSimple) [ ] ++ lib.optionals (targetPlatform == hostPlatform && !enableIntegerSimple) [
"--with-gmp-includes=${targetPackages.gmp.dev}/include" "--with-gmp-includes=${targetPackages.gmp.dev}/include"
"--with-gmp-libraries=${targetPackages.gmp.out}/lib" "--with-gmp-libraries=${targetPackages.gmp.out}/lib"
] ++ stdenv.lib.optionals (targetPlatform == hostPlatform && hostPlatform.libc != "glibc" && !targetPlatform.isWindows) [ ] ++ lib.optionals (targetPlatform == hostPlatform && hostPlatform.libc != "glibc" && !targetPlatform.isWindows) [
"--with-iconv-includes=${libiconv}/include" "--with-iconv-includes=${libiconv}/include"
"--with-iconv-libraries=${libiconv}/lib" "--with-iconv-libraries=${libiconv}/lib"
] ++ stdenv.lib.optionals (targetPlatform != hostPlatform) [ ] ++ lib.optionals (targetPlatform != hostPlatform) [
"--enable-bootstrap-with-devel-snapshot" "--enable-bootstrap-with-devel-snapshot"
] ++ stdenv.lib.optionals useLdGold [ ] ++ lib.optionals useLdGold [
"CFLAGS=-fuse-ld=gold" "CFLAGS=-fuse-ld=gold"
"CONF_GCC_LINKER_OPTS_STAGE1=-fuse-ld=gold" "CONF_GCC_LINKER_OPTS_STAGE1=-fuse-ld=gold"
"CONF_GCC_LINKER_OPTS_STAGE2=-fuse-ld=gold" "CONF_GCC_LINKER_OPTS_STAGE2=-fuse-ld=gold"
] ++ stdenv.lib.optionals (disableLargeAddressSpace) [ ] ++ lib.optionals (disableLargeAddressSpace) [
"--disable-large-address-space" "--disable-large-address-space"
]; ];
@ -202,18 +202,18 @@ stdenv.mkDerivation (rec {
buildInputs = [ perl bash ] ++ (libDeps hostPlatform); buildInputs = [ perl bash ] ++ (libDeps hostPlatform);
propagatedBuildInputs = [ targetPackages.stdenv.cc ] propagatedBuildInputs = [ targetPackages.stdenv.cc ]
++ stdenv.lib.optional useLLVM llvmPackages.llvm; ++ lib.optional useLLVM llvmPackages.llvm;
depsTargetTarget = map stdenv.lib.getDev (libDeps targetPlatform); depsTargetTarget = map lib.getDev (libDeps targetPlatform);
depsTargetTargetPropagated = map (stdenv.lib.getOutput "out") (libDeps targetPlatform); depsTargetTargetPropagated = map (lib.getOutput "out") (libDeps targetPlatform);
# required, because otherwise all symbols from HSffi.o are stripped, and # required, because otherwise all symbols from HSffi.o are stripped, and
# that in turn causes GHCi to abort # that in turn causes GHCi to abort
stripDebugFlags = [ "-S" ] ++ stdenv.lib.optional (!targetPlatform.isDarwin) "--keep-file-symbols"; stripDebugFlags = [ "-S" ] ++ lib.optional (!targetPlatform.isDarwin) "--keep-file-symbols";
checkTarget = "test"; checkTarget = "test";
hardeningDisable = [ "format" ] ++ stdenv.lib.optional stdenv.targetPlatform.isMusl "pie"; hardeningDisable = [ "format" ] ++ lib.optional stdenv.targetPlatform.isMusl "pie";
postInstall = '' postInstall = ''
# Install the bash completion file. # Install the bash completion file.
@ -223,7 +223,7 @@ stdenv.mkDerivation (rec {
for i in "$out/bin/"*; do for i in "$out/bin/"*; do
test ! -h $i || continue test ! -h $i || continue
egrep --quiet '^#!' <(head -n 1 $i) || continue egrep --quiet '^#!' <(head -n 1 $i) || continue
sed -i -e '2i export PATH="$PATH:${stdenv.lib.makeBinPath [ targetPackages.stdenv.cc.bintools coreutils ]}"' $i sed -i -e '2i export PATH="$PATH:${lib.makeBinPath [ targetPackages.stdenv.cc.bintools coreutils ]}"' $i
done done
''; '';
@ -240,14 +240,14 @@ stdenv.mkDerivation (rec {
meta = { meta = {
homepage = "http://haskell.org/ghc"; homepage = "http://haskell.org/ghc";
description = "The Glasgow Haskell Compiler"; description = "The Glasgow Haskell Compiler";
maintainers = with stdenv.lib.maintainers; [ marcweber andres peti ]; maintainers = with lib.maintainers; [ marcweber andres peti ];
timeout = 24 * 3600; timeout = 24 * 3600;
inherit (ghc.meta) license platforms; inherit (ghc.meta) license platforms;
}; };
dontStrip = (targetPlatform.useAndroidPrebuilt || targetPlatform.isWasm); dontStrip = (targetPlatform.useAndroidPrebuilt || targetPlatform.isWasm);
} // stdenv.lib.optionalAttrs targetPlatform.useAndroidPrebuilt{ } // lib.optionalAttrs targetPlatform.useAndroidPrebuilt{
dontPatchELF = true; dontPatchELF = true;
noAuditTmpdir = true; noAuditTmpdir = true;
}) })

View file

@ -1,4 +1,4 @@
{ stdenv, pkgsBuildTarget, targetPackages { lib, stdenv, pkgsBuildTarget, targetPackages
# build-tools # build-tools
, bootPkgs , bootPkgs
@ -18,7 +18,7 @@
, # If enabled, GHC will be built with the GPL-free but slower integer-simple , # If enabled, GHC will be built with the GPL-free but slower integer-simple
# library instead of the faster but GPLed integer-gmp library. # library instead of the faster but GPLed integer-gmp library.
enableIntegerSimple ? !(stdenv.lib.any (stdenv.lib.meta.platformMatch stdenv.hostPlatform) gmp.meta.platforms), gmp enableIntegerSimple ? !(lib.any (lib.meta.platformMatch stdenv.hostPlatform) gmp.meta.platforms), gmp
, # If enabled, use -fPIC when compiling static libs. , # If enabled, use -fPIC when compiling static libs.
enableRelocatedStaticLibs ? stdenv.targetPlatform != stdenv.hostPlatform enableRelocatedStaticLibs ? stdenv.targetPlatform != stdenv.hostPlatform
@ -35,7 +35,7 @@
, # What flavour to build. An empty string indicates no , # What flavour to build. An empty string indicates no
# specific flavour and falls back to ghc default values. # specific flavour and falls back to ghc default values.
ghcFlavour ? stdenv.lib.optionalString (stdenv.targetPlatform != stdenv.hostPlatform) ghcFlavour ? lib.optionalString (stdenv.targetPlatform != stdenv.hostPlatform)
(if useLLVM then "perf-cross" else "perf-cross-ncg") (if useLLVM then "perf-cross" else "perf-cross-ncg")
, # Whether to disable the large address space allocator , # Whether to disable the large address space allocator
@ -51,7 +51,7 @@ let
inherit (bootPkgs) ghc; inherit (bootPkgs) ghc;
# TODO(@Ericson2314) Make unconditional # TODO(@Ericson2314) Make unconditional
targetPrefix = stdenv.lib.optionalString targetPrefix = lib.optionalString
(targetPlatform != hostPlatform) (targetPlatform != hostPlatform)
"${targetPlatform.config}-"; "${targetPlatform.config}-";
@ -69,32 +69,32 @@ let
# to actually link to our new Libc. The iOS simulator is a special # to actually link to our new Libc. The iOS simulator is a special
# exception because we cant actually run simulators binaries # exception because we cant actually run simulators binaries
# ourselves. # ourselves.
+ stdenv.lib.optionalString (targetPlatform != hostPlatform) '' + lib.optionalString (targetPlatform != hostPlatform) ''
Stage1Only = ${if (targetPlatform.system == hostPlatform.system && !targetPlatform.isiOS) then "NO" else "YES"} Stage1Only = ${if (targetPlatform.system == hostPlatform.system && !targetPlatform.isiOS) then "NO" else "YES"}
CrossCompilePrefix = ${targetPrefix} CrossCompilePrefix = ${targetPrefix}
HADDOCK_DOCS = NO HADDOCK_DOCS = NO
BUILD_SPHINX_HTML = NO BUILD_SPHINX_HTML = NO
BUILD_SPHINX_PDF = NO BUILD_SPHINX_PDF = NO
'' + stdenv.lib.optionalString dontStrip '' '' + lib.optionalString dontStrip ''
STRIP_CMD = : STRIP_CMD = :
'' + stdenv.lib.optionalString (!enableProfiledLibs) '' '' + lib.optionalString (!enableProfiledLibs) ''
GhcLibWays = "v dyn" GhcLibWays = "v dyn"
'' + stdenv.lib.optionalString enableRelocatedStaticLibs '' '' + lib.optionalString enableRelocatedStaticLibs ''
GhcLibHcOpts += -fPIC GhcLibHcOpts += -fPIC
GhcRtsHcOpts += -fPIC GhcRtsHcOpts += -fPIC
'' + stdenv.lib.optionalString targetPlatform.useAndroidPrebuilt '' '' + lib.optionalString targetPlatform.useAndroidPrebuilt ''
EXTRA_CC_OPTS += -std=gnu99 EXTRA_CC_OPTS += -std=gnu99
''; '';
# Splicer will pull out correct variations # Splicer will pull out correct variations
libDeps = platform: stdenv.lib.optional enableTerminfo ncurses libDeps = platform: lib.optional enableTerminfo ncurses
++ [libffi] ++ [libffi]
++ stdenv.lib.optional (!enableIntegerSimple) gmp ++ lib.optional (!enableIntegerSimple) gmp
++ stdenv.lib.optional (platform.libc != "glibc" && !targetPlatform.isWindows) libiconv; ++ lib.optional (platform.libc != "glibc" && !targetPlatform.isWindows) libiconv;
toolsForTarget = [ toolsForTarget = [
pkgsBuildTarget.targetPackages.stdenv.cc pkgsBuildTarget.targetPackages.stdenv.cc
] ++ stdenv.lib.optional useLLVM buildLlvmPackages.llvm; ] ++ lib.optional useLLVM buildLlvmPackages.llvm;
targetCC = builtins.head toolsForTarget; targetCC = builtins.head toolsForTarget;
@ -128,7 +128,7 @@ stdenv.mkDerivation (rec {
export CC="${targetCC}/bin/${targetCC.targetPrefix}cc" export CC="${targetCC}/bin/${targetCC.targetPrefix}cc"
export CXX="${targetCC}/bin/${targetCC.targetPrefix}cxx" export CXX="${targetCC}/bin/${targetCC.targetPrefix}cxx"
# Use gold to work around https://sourceware.org/bugzilla/show_bug.cgi?id=16177 # Use gold to work around https://sourceware.org/bugzilla/show_bug.cgi?id=16177
export LD="${targetCC.bintools}/bin/${targetCC.bintools.targetPrefix}ld${stdenv.lib.optionalString useLdGold ".gold"}" export LD="${targetCC.bintools}/bin/${targetCC.bintools.targetPrefix}ld${lib.optionalString useLdGold ".gold"}"
export AS="${targetCC.bintools.bintools}/bin/${targetCC.bintools.targetPrefix}as" export AS="${targetCC.bintools.bintools}/bin/${targetCC.bintools.targetPrefix}as"
export AR="${targetCC.bintools.bintools}/bin/${targetCC.bintools.targetPrefix}ar" export AR="${targetCC.bintools.bintools}/bin/${targetCC.bintools.targetPrefix}ar"
export NM="${targetCC.bintools.bintools}/bin/${targetCC.bintools.targetPrefix}nm" export NM="${targetCC.bintools.bintools}/bin/${targetCC.bintools.targetPrefix}nm"
@ -138,13 +138,13 @@ stdenv.mkDerivation (rec {
echo -n "${buildMK dontStrip}" > mk/build.mk echo -n "${buildMK dontStrip}" > mk/build.mk
sed -i -e 's|-isysroot /Developer/SDKs/MacOSX10.5.sdk||' configure sed -i -e 's|-isysroot /Developer/SDKs/MacOSX10.5.sdk||' configure
'' + stdenv.lib.optionalString (!stdenv.isDarwin) '' '' + lib.optionalString (!stdenv.isDarwin) ''
export NIX_LDFLAGS+=" -rpath $out/lib/ghc-${version}" export NIX_LDFLAGS+=" -rpath $out/lib/ghc-${version}"
'' + stdenv.lib.optionalString stdenv.isDarwin '' '' + lib.optionalString stdenv.isDarwin ''
export NIX_LDFLAGS+=" -no_dtrace_dof" export NIX_LDFLAGS+=" -no_dtrace_dof"
'' + stdenv.lib.optionalString targetPlatform.useAndroidPrebuilt '' '' + lib.optionalString targetPlatform.useAndroidPrebuilt ''
sed -i -e '5i ,("armv7a-unknown-linux-androideabi", ("e-m:e-p:32:32-i64:64-v128:64:128-a:0:32-n32-S64", "cortex-a8", ""))' llvm-targets sed -i -e '5i ,("armv7a-unknown-linux-androideabi", ("e-m:e-p:32:32-i64:64-v128:64:128-a:0:32-n32-S64", "cortex-a8", ""))' llvm-targets
'' + stdenv.lib.optionalString targetPlatform.isMusl '' '' + lib.optionalString targetPlatform.isMusl ''
echo "patching llvm-targets for musl targets..." echo "patching llvm-targets for musl targets..."
echo "Cloning these existing '*-linux-gnu*' targets:" echo "Cloning these existing '*-linux-gnu*' targets:"
grep linux-gnu llvm-targets | sed 's/^/ /' grep linux-gnu llvm-targets | sed 's/^/ /'
@ -164,29 +164,29 @@ stdenv.mkDerivation (rec {
# TODO(@Ericson2314): Always pass "--target" and always prefix. # TODO(@Ericson2314): Always pass "--target" and always prefix.
configurePlatforms = [ "build" "host" ] configurePlatforms = [ "build" "host" ]
++ stdenv.lib.optional (targetPlatform != hostPlatform) "target"; ++ lib.optional (targetPlatform != hostPlatform) "target";
# `--with` flags for libraries needed for RTS linker # `--with` flags for libraries needed for RTS linker
configureFlags = [ configureFlags = [
"--datadir=$doc/share/doc/ghc" "--datadir=$doc/share/doc/ghc"
"--with-curses-includes=${ncurses.dev}/include" "--with-curses-libraries=${ncurses.out}/lib" "--with-curses-includes=${ncurses.dev}/include" "--with-curses-libraries=${ncurses.out}/lib"
] ++ stdenv.lib.optionals (libffi != null) [ ] ++ lib.optionals (libffi != null) [
"--with-system-libffi" "--with-system-libffi"
"--with-ffi-includes=${targetPackages.libffi.dev}/include" "--with-ffi-includes=${targetPackages.libffi.dev}/include"
"--with-ffi-libraries=${targetPackages.libffi.out}/lib" "--with-ffi-libraries=${targetPackages.libffi.out}/lib"
] ++ stdenv.lib.optionals (targetPlatform == hostPlatform && !enableIntegerSimple) [ ] ++ lib.optionals (targetPlatform == hostPlatform && !enableIntegerSimple) [
"--with-gmp-includes=${targetPackages.gmp.dev}/include" "--with-gmp-includes=${targetPackages.gmp.dev}/include"
"--with-gmp-libraries=${targetPackages.gmp.out}/lib" "--with-gmp-libraries=${targetPackages.gmp.out}/lib"
] ++ stdenv.lib.optionals (targetPlatform == hostPlatform && hostPlatform.libc != "glibc" && !targetPlatform.isWindows) [ ] ++ lib.optionals (targetPlatform == hostPlatform && hostPlatform.libc != "glibc" && !targetPlatform.isWindows) [
"--with-iconv-includes=${libiconv}/include" "--with-iconv-includes=${libiconv}/include"
"--with-iconv-libraries=${libiconv}/lib" "--with-iconv-libraries=${libiconv}/lib"
] ++ stdenv.lib.optionals (targetPlatform != hostPlatform) [ ] ++ lib.optionals (targetPlatform != hostPlatform) [
"--enable-bootstrap-with-devel-snapshot" "--enable-bootstrap-with-devel-snapshot"
] ++ stdenv.lib.optionals useLdGold [ ] ++ lib.optionals useLdGold [
"CFLAGS=-fuse-ld=gold" "CFLAGS=-fuse-ld=gold"
"CONF_GCC_LINKER_OPTS_STAGE1=-fuse-ld=gold" "CONF_GCC_LINKER_OPTS_STAGE1=-fuse-ld=gold"
"CONF_GCC_LINKER_OPTS_STAGE2=-fuse-ld=gold" "CONF_GCC_LINKER_OPTS_STAGE2=-fuse-ld=gold"
] ++ stdenv.lib.optionals (disableLargeAddressSpace) [ ] ++ lib.optionals (disableLargeAddressSpace) [
"--disable-large-address-space" "--disable-large-address-space"
]; ];
@ -207,18 +207,18 @@ stdenv.mkDerivation (rec {
buildInputs = [ perl bash ] ++ (libDeps hostPlatform); buildInputs = [ perl bash ] ++ (libDeps hostPlatform);
propagatedBuildInputs = [ targetPackages.stdenv.cc ] propagatedBuildInputs = [ targetPackages.stdenv.cc ]
++ stdenv.lib.optional useLLVM llvmPackages.llvm; ++ lib.optional useLLVM llvmPackages.llvm;
depsTargetTarget = map stdenv.lib.getDev (libDeps targetPlatform); depsTargetTarget = map lib.getDev (libDeps targetPlatform);
depsTargetTargetPropagated = map (stdenv.lib.getOutput "out") (libDeps targetPlatform); depsTargetTargetPropagated = map (lib.getOutput "out") (libDeps targetPlatform);
# required, because otherwise all symbols from HSffi.o are stripped, and # required, because otherwise all symbols from HSffi.o are stripped, and
# that in turn causes GHCi to abort # that in turn causes GHCi to abort
stripDebugFlags = [ "-S" ] ++ stdenv.lib.optional (!targetPlatform.isDarwin) "--keep-file-symbols"; stripDebugFlags = [ "-S" ] ++ lib.optional (!targetPlatform.isDarwin) "--keep-file-symbols";
checkTarget = "test"; checkTarget = "test";
hardeningDisable = [ "format" ] ++ stdenv.lib.optional stdenv.targetPlatform.isMusl "pie"; hardeningDisable = [ "format" ] ++ lib.optional stdenv.targetPlatform.isMusl "pie";
postInstall = '' postInstall = ''
# Install the bash completion file. # Install the bash completion file.
@ -228,7 +228,7 @@ stdenv.mkDerivation (rec {
for i in "$out/bin/"*; do for i in "$out/bin/"*; do
test ! -h $i || continue test ! -h $i || continue
egrep --quiet '^#!' <(head -n 1 $i) || continue egrep --quiet '^#!' <(head -n 1 $i) || continue
sed -i -e '2i export PATH="$PATH:${stdenv.lib.makeBinPath [ targetPackages.stdenv.cc.bintools coreutils ]}"' $i sed -i -e '2i export PATH="$PATH:${lib.makeBinPath [ targetPackages.stdenv.cc.bintools coreutils ]}"' $i
done done
''; '';
@ -245,14 +245,14 @@ stdenv.mkDerivation (rec {
meta = { meta = {
homepage = "http://haskell.org/ghc"; homepage = "http://haskell.org/ghc";
description = "The Glasgow Haskell Compiler"; description = "The Glasgow Haskell Compiler";
maintainers = with stdenv.lib.maintainers; [ marcweber andres peti ]; maintainers = with lib.maintainers; [ marcweber andres peti ];
timeout = 24 * 3600; timeout = 24 * 3600;
inherit (ghc.meta) license platforms; inherit (ghc.meta) license platforms;
}; };
dontStrip = (targetPlatform.useAndroidPrebuilt || targetPlatform.isWasm); dontStrip = (targetPlatform.useAndroidPrebuilt || targetPlatform.isWasm);
} // stdenv.lib.optionalAttrs targetPlatform.useAndroidPrebuilt{ } // lib.optionalAttrs targetPlatform.useAndroidPrebuilt{
dontPatchELF = true; dontPatchELF = true;
noAuditTmpdir = true; noAuditTmpdir = true;
}) })

View file

@ -1,4 +1,4 @@
{ stdenv, pkgsBuildTarget, targetPackages { lib, stdenv, pkgsBuildTarget, targetPackages
# build-tools # build-tools
, bootPkgs , bootPkgs
@ -18,7 +18,7 @@
, # If enabled, GHC will be built with the GPL-free but slower integer-simple , # If enabled, GHC will be built with the GPL-free but slower integer-simple
# library instead of the faster but GPLed integer-gmp library. # library instead of the faster but GPLed integer-gmp library.
enableIntegerSimple ? !(stdenv.lib.any (stdenv.lib.meta.platformMatch stdenv.hostPlatform) gmp.meta.platforms), gmp enableIntegerSimple ? !(lib.any (lib.meta.platformMatch stdenv.hostPlatform) gmp.meta.platforms), gmp
, # If enabled, use -fPIC when compiling static libs. , # If enabled, use -fPIC when compiling static libs.
enableRelocatedStaticLibs ? stdenv.targetPlatform != stdenv.hostPlatform enableRelocatedStaticLibs ? stdenv.targetPlatform != stdenv.hostPlatform
@ -35,7 +35,7 @@
, # What flavour to build. An empty string indicates no , # What flavour to build. An empty string indicates no
# specific flavour and falls back to ghc default values. # specific flavour and falls back to ghc default values.
ghcFlavour ? stdenv.lib.optionalString (stdenv.targetPlatform != stdenv.hostPlatform) ghcFlavour ? lib.optionalString (stdenv.targetPlatform != stdenv.hostPlatform)
(if useLLVM then "perf-cross" else "perf-cross-ncg") (if useLLVM then "perf-cross" else "perf-cross-ncg")
, # Whether to disable the large address space allocator , # Whether to disable the large address space allocator
@ -51,7 +51,7 @@ let
inherit (bootPkgs) ghc; inherit (bootPkgs) ghc;
# TODO(@Ericson2314) Make unconditional # TODO(@Ericson2314) Make unconditional
targetPrefix = stdenv.lib.optionalString targetPrefix = lib.optionalString
(targetPlatform != hostPlatform) (targetPlatform != hostPlatform)
"${targetPlatform.config}-"; "${targetPlatform.config}-";
@ -69,32 +69,32 @@ let
# to actually link to our new Libc. The iOS simulator is a special # to actually link to our new Libc. The iOS simulator is a special
# exception because we cant actually run simulators binaries # exception because we cant actually run simulators binaries
# ourselves. # ourselves.
+ stdenv.lib.optionalString (targetPlatform != hostPlatform) '' + lib.optionalString (targetPlatform != hostPlatform) ''
Stage1Only = ${if (targetPlatform.system == hostPlatform.system && !targetPlatform.isiOS) then "NO" else "YES"} Stage1Only = ${if (targetPlatform.system == hostPlatform.system && !targetPlatform.isiOS) then "NO" else "YES"}
CrossCompilePrefix = ${targetPrefix} CrossCompilePrefix = ${targetPrefix}
HADDOCK_DOCS = NO HADDOCK_DOCS = NO
BUILD_SPHINX_HTML = NO BUILD_SPHINX_HTML = NO
BUILD_SPHINX_PDF = NO BUILD_SPHINX_PDF = NO
'' + stdenv.lib.optionalString dontStrip '' '' + lib.optionalString dontStrip ''
STRIP_CMD = : STRIP_CMD = :
'' + stdenv.lib.optionalString (!enableProfiledLibs) '' '' + lib.optionalString (!enableProfiledLibs) ''
GhcLibWays = "v dyn" GhcLibWays = "v dyn"
'' + stdenv.lib.optionalString enableRelocatedStaticLibs '' '' + lib.optionalString enableRelocatedStaticLibs ''
GhcLibHcOpts += -fPIC GhcLibHcOpts += -fPIC
GhcRtsHcOpts += -fPIC GhcRtsHcOpts += -fPIC
'' + stdenv.lib.optionalString targetPlatform.useAndroidPrebuilt '' '' + lib.optionalString targetPlatform.useAndroidPrebuilt ''
EXTRA_CC_OPTS += -std=gnu99 EXTRA_CC_OPTS += -std=gnu99
''; '';
# Splicer will pull out correct variations # Splicer will pull out correct variations
libDeps = platform: stdenv.lib.optional enableTerminfo ncurses libDeps = platform: lib.optional enableTerminfo ncurses
++ [libffi] ++ [libffi]
++ stdenv.lib.optional (!enableIntegerSimple) gmp ++ lib.optional (!enableIntegerSimple) gmp
++ stdenv.lib.optional (platform.libc != "glibc" && !targetPlatform.isWindows) libiconv; ++ lib.optional (platform.libc != "glibc" && !targetPlatform.isWindows) libiconv;
toolsForTarget = [ toolsForTarget = [
pkgsBuildTarget.targetPackages.stdenv.cc pkgsBuildTarget.targetPackages.stdenv.cc
] ++ stdenv.lib.optional useLLVM buildLlvmPackages.llvm; ] ++ lib.optional useLLVM buildLlvmPackages.llvm;
targetCC = builtins.head toolsForTarget; targetCC = builtins.head toolsForTarget;
@ -119,7 +119,7 @@ stdenv.mkDerivation (rec {
postPatch = "patchShebangs ."; postPatch = "patchShebangs .";
# GHC is a bit confused on its cross terminology. # GHC is a bit confused on its cross terminology.
preConfigure = stdenv.lib.optionalString stdenv.isAarch64 '' preConfigure = lib.optionalString stdenv.isAarch64 ''
# Aarch64 allow backward bootstrapping since earlier versions are unstable. # Aarch64 allow backward bootstrapping since earlier versions are unstable.
find . -name \*\.cabal\* -exec sed -i -e 's/\(base.*\)4.14/\14.16/' {} \; \ find . -name \*\.cabal\* -exec sed -i -e 's/\(base.*\)4.14/\14.16/' {} \; \
-exec sed -i -e 's/\(prim.*\)0.6/\10.8/' {} \; -exec sed -i -e 's/\(prim.*\)0.6/\10.8/' {} \;
@ -132,7 +132,7 @@ stdenv.mkDerivation (rec {
export CC="${targetCC}/bin/${targetCC.targetPrefix}cc" export CC="${targetCC}/bin/${targetCC.targetPrefix}cc"
export CXX="${targetCC}/bin/${targetCC.targetPrefix}cxx" export CXX="${targetCC}/bin/${targetCC.targetPrefix}cxx"
# Use gold to work around https://sourceware.org/bugzilla/show_bug.cgi?id=16177 # Use gold to work around https://sourceware.org/bugzilla/show_bug.cgi?id=16177
export LD="${targetCC.bintools}/bin/${targetCC.bintools.targetPrefix}ld${stdenv.lib.optionalString useLdGold ".gold"}" export LD="${targetCC.bintools}/bin/${targetCC.bintools.targetPrefix}ld${lib.optionalString useLdGold ".gold"}"
export AS="${targetCC.bintools.bintools}/bin/${targetCC.bintools.targetPrefix}as" export AS="${targetCC.bintools.bintools}/bin/${targetCC.bintools.targetPrefix}as"
export AR="${targetCC.bintools.bintools}/bin/${targetCC.bintools.targetPrefix}ar" export AR="${targetCC.bintools.bintools}/bin/${targetCC.bintools.targetPrefix}ar"
export NM="${targetCC.bintools.bintools}/bin/${targetCC.bintools.targetPrefix}nm" export NM="${targetCC.bintools.bintools}/bin/${targetCC.bintools.targetPrefix}nm"
@ -142,13 +142,13 @@ stdenv.mkDerivation (rec {
echo -n "${buildMK dontStrip}" > mk/build.mk echo -n "${buildMK dontStrip}" > mk/build.mk
sed -i -e 's|-isysroot /Developer/SDKs/MacOSX10.5.sdk||' configure sed -i -e 's|-isysroot /Developer/SDKs/MacOSX10.5.sdk||' configure
'' + stdenv.lib.optionalString (!stdenv.isDarwin) '' '' + lib.optionalString (!stdenv.isDarwin) ''
export NIX_LDFLAGS+=" -rpath $out/lib/ghc-${version}" export NIX_LDFLAGS+=" -rpath $out/lib/ghc-${version}"
'' + stdenv.lib.optionalString stdenv.isDarwin '' '' + lib.optionalString stdenv.isDarwin ''
export NIX_LDFLAGS+=" -no_dtrace_dof" export NIX_LDFLAGS+=" -no_dtrace_dof"
'' + stdenv.lib.optionalString targetPlatform.useAndroidPrebuilt '' '' + lib.optionalString targetPlatform.useAndroidPrebuilt ''
sed -i -e '5i ,("armv7a-unknown-linux-androideabi", ("e-m:e-p:32:32-i64:64-v128:64:128-a:0:32-n32-S64", "cortex-a8", ""))' llvm-targets sed -i -e '5i ,("armv7a-unknown-linux-androideabi", ("e-m:e-p:32:32-i64:64-v128:64:128-a:0:32-n32-S64", "cortex-a8", ""))' llvm-targets
'' + stdenv.lib.optionalString targetPlatform.isMusl '' '' + lib.optionalString targetPlatform.isMusl ''
echo "patching llvm-targets for musl targets..." echo "patching llvm-targets for musl targets..."
echo "Cloning these existing '*-linux-gnu*' targets:" echo "Cloning these existing '*-linux-gnu*' targets:"
grep linux-gnu llvm-targets | sed 's/^/ /' grep linux-gnu llvm-targets | sed 's/^/ /'
@ -168,29 +168,29 @@ stdenv.mkDerivation (rec {
# TODO(@Ericson2314): Always pass "--target" and always prefix. # TODO(@Ericson2314): Always pass "--target" and always prefix.
configurePlatforms = [ "build" "host" ] configurePlatforms = [ "build" "host" ]
++ stdenv.lib.optional (targetPlatform != hostPlatform) "target"; ++ lib.optional (targetPlatform != hostPlatform) "target";
# `--with` flags for libraries needed for RTS linker # `--with` flags for libraries needed for RTS linker
configureFlags = [ configureFlags = [
"--datadir=$doc/share/doc/ghc" "--datadir=$doc/share/doc/ghc"
"--with-curses-includes=${ncurses.dev}/include" "--with-curses-libraries=${ncurses.out}/lib" "--with-curses-includes=${ncurses.dev}/include" "--with-curses-libraries=${ncurses.out}/lib"
] ++ stdenv.lib.optionals (libffi != null) [ ] ++ lib.optionals (libffi != null) [
"--with-system-libffi" "--with-system-libffi"
"--with-ffi-includes=${targetPackages.libffi.dev}/include" "--with-ffi-includes=${targetPackages.libffi.dev}/include"
"--with-ffi-libraries=${targetPackages.libffi.out}/lib" "--with-ffi-libraries=${targetPackages.libffi.out}/lib"
] ++ stdenv.lib.optionals (targetPlatform == hostPlatform && !enableIntegerSimple) [ ] ++ lib.optionals (targetPlatform == hostPlatform && !enableIntegerSimple) [
"--with-gmp-includes=${targetPackages.gmp.dev}/include" "--with-gmp-includes=${targetPackages.gmp.dev}/include"
"--with-gmp-libraries=${targetPackages.gmp.out}/lib" "--with-gmp-libraries=${targetPackages.gmp.out}/lib"
] ++ stdenv.lib.optionals (targetPlatform == hostPlatform && hostPlatform.libc != "glibc" && !targetPlatform.isWindows) [ ] ++ lib.optionals (targetPlatform == hostPlatform && hostPlatform.libc != "glibc" && !targetPlatform.isWindows) [
"--with-iconv-includes=${libiconv}/include" "--with-iconv-includes=${libiconv}/include"
"--with-iconv-libraries=${libiconv}/lib" "--with-iconv-libraries=${libiconv}/lib"
] ++ stdenv.lib.optionals (targetPlatform != hostPlatform) [ ] ++ lib.optionals (targetPlatform != hostPlatform) [
"--enable-bootstrap-with-devel-snapshot" "--enable-bootstrap-with-devel-snapshot"
] ++ stdenv.lib.optionals useLdGold [ ] ++ lib.optionals useLdGold [
"CFLAGS=-fuse-ld=gold" "CFLAGS=-fuse-ld=gold"
"CONF_GCC_LINKER_OPTS_STAGE1=-fuse-ld=gold" "CONF_GCC_LINKER_OPTS_STAGE1=-fuse-ld=gold"
"CONF_GCC_LINKER_OPTS_STAGE2=-fuse-ld=gold" "CONF_GCC_LINKER_OPTS_STAGE2=-fuse-ld=gold"
] ++ stdenv.lib.optionals (disableLargeAddressSpace) [ ] ++ lib.optionals (disableLargeAddressSpace) [
"--disable-large-address-space" "--disable-large-address-space"
]; ];
@ -211,18 +211,18 @@ stdenv.mkDerivation (rec {
buildInputs = [ perl bash ] ++ (libDeps hostPlatform); buildInputs = [ perl bash ] ++ (libDeps hostPlatform);
propagatedBuildInputs = [ targetPackages.stdenv.cc ] propagatedBuildInputs = [ targetPackages.stdenv.cc ]
++ stdenv.lib.optional useLLVM llvmPackages.llvm; ++ lib.optional useLLVM llvmPackages.llvm;
depsTargetTarget = map stdenv.lib.getDev (libDeps targetPlatform); depsTargetTarget = map lib.getDev (libDeps targetPlatform);
depsTargetTargetPropagated = map (stdenv.lib.getOutput "out") (libDeps targetPlatform); depsTargetTargetPropagated = map (lib.getOutput "out") (libDeps targetPlatform);
# required, because otherwise all symbols from HSffi.o are stripped, and # required, because otherwise all symbols from HSffi.o are stripped, and
# that in turn causes GHCi to abort # that in turn causes GHCi to abort
stripDebugFlags = [ "-S" ] ++ stdenv.lib.optional (!targetPlatform.isDarwin) "--keep-file-symbols"; stripDebugFlags = [ "-S" ] ++ lib.optional (!targetPlatform.isDarwin) "--keep-file-symbols";
checkTarget = "test"; checkTarget = "test";
hardeningDisable = [ "format" ] ++ stdenv.lib.optional stdenv.targetPlatform.isMusl "pie"; hardeningDisable = [ "format" ] ++ lib.optional stdenv.targetPlatform.isMusl "pie";
postInstall = '' postInstall = ''
# Install the bash completion file. # Install the bash completion file.
@ -232,7 +232,7 @@ stdenv.mkDerivation (rec {
for i in "$out/bin/"*; do for i in "$out/bin/"*; do
test ! -h $i || continue test ! -h $i || continue
egrep --quiet '^#!' <(head -n 1 $i) || continue egrep --quiet '^#!' <(head -n 1 $i) || continue
sed -i -e '2i export PATH="$PATH:${stdenv.lib.makeBinPath [ targetPackages.stdenv.cc.bintools coreutils ]}"' $i sed -i -e '2i export PATH="$PATH:${lib.makeBinPath [ targetPackages.stdenv.cc.bintools coreutils ]}"' $i
done done
''; '';
@ -249,14 +249,14 @@ stdenv.mkDerivation (rec {
meta = { meta = {
homepage = "http://haskell.org/ghc"; homepage = "http://haskell.org/ghc";
description = "The Glasgow Haskell Compiler"; description = "The Glasgow Haskell Compiler";
maintainers = with stdenv.lib.maintainers; [ marcweber andres peti ]; maintainers = with lib.maintainers; [ marcweber andres peti ];
timeout = 24 * 3600; timeout = 24 * 3600;
inherit (ghc.meta) license platforms; inherit (ghc.meta) license platforms;
}; };
dontStrip = (targetPlatform.useAndroidPrebuilt || targetPlatform.isWasm); dontStrip = (targetPlatform.useAndroidPrebuilt || targetPlatform.isWasm);
} // stdenv.lib.optionalAttrs targetPlatform.useAndroidPrebuilt{ } // lib.optionalAttrs targetPlatform.useAndroidPrebuilt{
dontPatchELF = true; dontPatchELF = true;
noAuditTmpdir = true; noAuditTmpdir = true;
}) })

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