Merge branch 'master' into gcc-6

This commit is contained in:
Vladimír Čunát
2017-08-12 10:09:41 +02:00
2362 changed files with 36299 additions and 29476 deletions

View File

@@ -7,7 +7,7 @@ stdenv.mkDerivation {
inherit name;
meta = {
homepage = "https://github.com/ashinn/chibi-scheme";
homepage = https://github.com/ashinn/chibi-scheme;
description = "Small Footprint Scheme for use as a C Extension Language";
platforms = stdenv.lib.platforms.all;
license = stdenv.lib.licenses.bsd3;

View File

@@ -15,7 +15,7 @@ stdenv.mkDerivation rec {
'';
meta = with stdenv.lib; {
description = "A Tool for Building Expert Systems";
homepage = "http://www.clipsrules.net/";
homepage = http://www.clipsrules.net/;
longDescription = ''
Developed at NASA's Johnson Space Center from 1985 to 1996,
CLIPS is a rule-based programming language useful for creating

View File

@@ -37,7 +37,7 @@ stdenv.mkDerivation {
meta = {
platforms = [ "i686-linux" "x86_64-linux" ];
homepage = "https://www.dartlang.org/";
homepage = https://www.dartlang.org/;
description = "Scalable programming language, with robust libraries and runtimes, for building web, server, and mobile apps";
longDescription = ''
Dart is a class-based, single inheritance, object-oriented language

View File

@@ -20,7 +20,7 @@ stdenv.mkDerivation {
checkTarget = "test";
meta = with stdenv.lib; {
homepage = "http://www.eff-lang.org";
homepage = http://www.eff-lang.org;
description = "A functional programming language based on algebraic effects and their handlers";
longDescription = ''
Eff is a functional language with handlers of not only exceptions,

View File

@@ -1,7 +1,7 @@
{ mkDerivation }:
mkDerivation rec {
version = "1.5.0-rc.2";
sha256 = "0wfxsfz1qbb6iapg8j1qskva6j4mccxqvv79xbz08fzzb6n1wvxa";
version = "1.5.1";
sha256 = "0q0zr3v9cyb7p9aab8v038hnjm84nf9b60kikffp6w9rfqqqf767";
minimumOTPVersion = "18";
}

View File

@@ -59,7 +59,7 @@ in
'';
meta = with stdenv.lib; {
homepage = "http://elixir-lang.org/";
homepage = https://elixir-lang.org/;
description = "A functional, meta-programming aware language built on top of the Erlang VM";
longDescription = ''

View File

@@ -42,7 +42,7 @@ mkDerivation rec {
'';
meta = {
homepage = "https://github.com/basho/otp/";
homepage = https://github.com/basho/otp/;
description = "Programming language used for massively scalable soft real-time systems, Basho fork";
longDescription = ''

View File

@@ -1,5 +1,5 @@
{ pkgs, stdenv, fetchurl, fetchFromGitHub, makeWrapper, gawk, gnum4, gnused
, libxml2, libxslt, ncurses, openssl, perl, gcc, autoreconfHook
, libxml2, libxslt, ncurses, openssl, perl, autoreconfHook
, openjdk ? null # javacSupport
, unixODBC ? null # odbcSupport
, mesa ? null, wxGTK ? null, wxmac ? null, xorg ? null # wxSupport
@@ -47,9 +47,9 @@ in stdenv.mkDerivation ({
inherit src version;
buildInputs =
[ perl gnum4 ncurses openssl autoreconfHook libxslt libxml2 makeWrapper gcc
]
nativeBuildInputs = [ autoreconfHook makeWrapper perl ];
buildInputs = [ gnum4 ncurses openssl autoreconfHook libxslt libxml2 ]
++ optionals wxSupport wxPackages2
++ optionals odbcSupport odbcPackages
++ optionals javacSupport javacPackages
@@ -102,7 +102,7 @@ in stdenv.mkDerivation ({
setupHook = ./setup-hook.sh;
meta = with stdenv.lib; {
homepage = "http://www.erlang.org/";
homepage = http://www.erlang.org/;
downloadPage = "http://www.erlang.org/download.html";
description = "Programming language used for massively scalable soft real-time systems";

View File

@@ -4,11 +4,11 @@
stdenv.mkDerivation rec {
name = "groovy-${version}";
version = "2.4.10";
version = "2.4.12";
src = fetchurl {
url = "http://dl.bintray.com/groovy/maven/apache-groovy-binary-${version}.zip";
sha256 = "1a8pqcrm014h4x54gqqyxp7r1vkwhphqwrfa7gnqr6nzdqxzyk8w";
sha256 = "1dm7m221pqbgh3lp1q1nvv6qc0fpja3cgsd0mx3ghahcfsfa3fck";
};
buildInputs = [ unzip makeWrapper ];

View File

@@ -15,7 +15,7 @@ stdenv.mkDerivation rec {
meta = {
description = "gtk-server for interpreted GUI programming";
homepage = "http://www.gtk-server.org/";
homepage = http://www.gtk-server.org/;
license = stdenv.lib.licenses.gpl2Plus;
maintainers = [stdenv.lib.maintainers.tohl];
platforms = stdenv.lib.platforms.linux;

View File

@@ -31,7 +31,7 @@ stdenv.mkDerivation rec {
NIX_CFLAGS_COMPILE = [ "-DluaL_reg=luaL_Reg" ]; # needed since luajit-2.1.0-beta3
meta = {
homepage = "http://love2d.org";
homepage = http://love2d.org;
description = "A Lua-based 2D game engine/scripting language";
license = stdenv.lib.licenses.zlib;
platforms = stdenv.lib.platforms.linux;

View File

@@ -41,7 +41,7 @@ stdenv.mkDerivation rec {
'';
meta = {
homepage = "http://love2d.org";
homepage = http://love2d.org;
description = "A Lua-based 2D game engine/scripting language";
license = stdenv.lib.licenses.zlib;

View File

@@ -41,7 +41,7 @@ stdenv.mkDerivation rec {
'';
meta = {
homepage = "http://love2d.org";
homepage = http://love2d.org;
description = "A Lua-based 2D game engine/scripting language";
license = stdenv.lib.licenses.zlib;

View File

@@ -23,7 +23,7 @@ stdenv.mkDerivation rec {
NIX_CFLAGS_COMPILE = [ "-DluaL_reg=luaL_Reg" ]; # needed since luajit-2.1.0-beta3
meta = {
homepage = "http://love2d.org";
homepage = http://love2d.org;
description = "A Lua-based 2D game engine/scripting language";
license = stdenv.lib.licenses.zlib;

View File

@@ -15,7 +15,7 @@ stdenv.mkDerivation {
hardeningDisable = stdenv.lib.optional stdenv.isi686 "stackprotector";
meta = {
homepage = "http://www.lua.org";
homepage = http://www.lua.org;
description = "Powerful, fast, lightweight, embeddable scripting language";
longDescription = ''
Lua combines simple procedural syntax with powerful data

View File

@@ -16,7 +16,7 @@ stdenv.mkDerivation {
installTargets = "install soinstall";
meta = {
homepage = "http://www.lua.org";
homepage = http://www.lua.org;
description = "Powerful, fast, lightweight, embeddable scripting language";
longDescription = ''
Lua combines simple procedural syntax with powerful data

View File

@@ -44,7 +44,7 @@ stdenv.mkDerivation rec {
'';
meta = {
homepage = "http://www.lua.org";
homepage = http://www.lua.org;
description = "Powerful, fast, lightweight, embeddable scripting language";
longDescription = ''
Lua combines simple procedural syntax with powerful data

View File

@@ -82,7 +82,7 @@ stdenv.mkDerivation rec {
};
meta = {
homepage = "http://www.lua.org";
homepage = http://www.lua.org;
description = "Powerful, fast, lightweight, embeddable scripting language";
longDescription = ''
Lua combines simple procedural syntax with powerful data

View File

@@ -81,7 +81,7 @@ stdenv.mkDerivation rec {
};
meta = {
homepage = "http://www.lua.org";
homepage = http://www.lua.org;
description = "Powerful, fast, lightweight, embeddable scripting language";
longDescription = ''
Lua combines simple procedural syntax with powerful data

View File

@@ -19,7 +19,7 @@ stdenv.mkDerivation rec {
'';
meta = {
homepage = "https://github.com/keplerproject/luafilesystem";
homepage = https://github.com/keplerproject/luafilesystem;
hydraPlatforms = stdenv.lib.platforms.linux;
maintainers = [ stdenv.lib.maintainers.flosse ];
};

View File

@@ -18,7 +18,7 @@ stdenv.mkDerivation rec {
buildInputs = [ lua5 ];
meta = {
homepage = "http://w3.impa.br/~diego/software/luasocket/";
homepage = http://w3.impa.br/~diego/software/luasocket/;
hydraPlatforms = stdenv.lib.platforms.linux;
maintainers = [ stdenv.lib.maintainers.mornfall ];
};

View File

@@ -21,7 +21,7 @@ stdenv.mkDerivation rec {
patches = [ ./zip.patch ];
meta = {
homepage = "https://github.com/luaforge/luazip";
homepage = https://github.com/luaforge/luazip;
hydraPlatforms = stdenv.lib.platforms.linux;
license = stdenv.lib.licenses.mit;
};

View File

@@ -47,7 +47,7 @@ stdenv.mkDerivation rec {
'';
meta = {
homepage = "http://maude.cs.illinois.edu/";
homepage = http://maude.cs.illinois.edu/;
description = "High-level specification language";
license = stdenv.lib.licenses.gpl2;

View File

@@ -77,7 +77,7 @@ let
'';
meta = {
description = "A clojure-like lisp, built with the pypy vm toolkit";
homepage = "https://github.com/pixie-lang/pixie";
homepage = https://github.com/pixie-lang/pixie;
license = stdenv.lib.licenses.lgpl3;
platforms = ["x86_64-linux" "i686-linux"];
};

View File

@@ -76,7 +76,7 @@ stdenv.mkDerivation rec {
enableParallelBuilding = true;
meta = {
homepage = "http://python.org";
homepage = http://python.org;
description = "A high-level dynamically-typed programming language";
longDescription = ''
Python is a remarkably powerful dynamic programming language that

View File

@@ -210,7 +210,7 @@ in stdenv.mkDerivation {
enableParallelBuilding = true;
meta = {
homepage = "http://python.org";
homepage = http://python.org;
description = "A high-level dynamically-typed programming language";
longDescription = ''
Python is a remarkably powerful dynamic programming language that

View File

@@ -1,160 +0,0 @@
{ stdenv, fetchurl
, bzip2
, gdbm
, lzma
, ncurses
, openssl
, readline
, sqlite
, tcl ? null, tk ? null, tix ? null, libX11 ? null, xproto ? null, x11Support ? false
, zlib
, callPackage
, self
, CF, configd
, python-setup-hook
# For the Python package set
, pkgs, packageOverrides ? (self: super: {})
}:
assert x11Support -> tcl != null
&& tk != null
&& xproto != null
&& libX11 != null;
with stdenv.lib;
let
majorVersion = "3.3";
minorVersion = "6";
minorVersionSuffix = "";
pythonVersion = majorVersion;
version = "${majorVersion}.${minorVersion}${minorVersionSuffix}";
libPrefix = "python${majorVersion}";
sitePackages = "lib/${libPrefix}/site-packages";
buildInputs = filter (p: p != null) [
zlib bzip2 lzma gdbm sqlite readline ncurses openssl ]
++ optionals x11Support [ tcl tk libX11 xproto ]
++ optionals stdenv.isDarwin [ CF configd ];
in stdenv.mkDerivation {
name = "python3-${version}";
pythonVersion = majorVersion;
inherit majorVersion version;
inherit buildInputs;
src = fetchurl {
url = "https://www.python.org/ftp/python/${majorVersion}.${minorVersion}/Python-${version}.tar.xz";
sha256 = "0gsxpgd5p4mwd01gw501vsyahncyw3h9836ypkr3y32kgazy89jj";
};
NIX_LDFLAGS = stdenv.lib.optionalString stdenv.isLinux "-lgcc_s";
# Determinism: The interpreter is patched to write null timestamps when compiling python files.
# This way python doesn't try to update them when we freeze timestamps in nix store.
DETERMINISTIC_BUILD=1;
# Determinism: We fix the hashes of str, bytes and datetime objects.
PYTHONHASHSEED=0;
postPatch = ''
# Determinism
substituteInPlace "Lib/py_compile.py" --replace "source_stats['mtime']" "(1 if 'DETERMINISTIC_BUILD' in os.environ else source_stats['mtime'])"
# # We do not patch `Lib/importlib/_bootstrap_external.py` because it does not exist.
'' + optionalString (x11Support && (tix != null)) ''
substituteInPlace "Lib/tkinter/tix.py" --replace "os.environ.get('TIX_LIBRARY')" "os.environ.get('TIX_LIBRARY') or '${tix}/lib'"
'';
preConfigure = ''
for i in /usr /sw /opt /pkg; do # improve purity
substituteInPlace ./setup.py --replace $i /no-such-path
done
${optionalString stdenv.isDarwin ''export NIX_CFLAGS_COMPILE="$NIX_CFLAGS_COMPILE -msse2"''}
configureFlagsArray=( --enable-shared --with-threads
CPPFLAGS="${concatStringsSep " " (map (p: "-I${getDev p}/include") buildInputs)}"
LDFLAGS="${concatStringsSep " " (map (p: "-L${getLib p}/lib") buildInputs)}"
LIBS="${optionalString (!stdenv.isDarwin) "-lcrypt"} ${optionalString (ncurses != null) "-lncurses"}"
)
'';
setupHook = python-setup-hook sitePackages;
postInstall = ''
# needed for some packages, especially packages that backport functionality
# to 2.x from 3.x
for item in $out/lib/python${majorVersion}/test/*; do
if [[ "$item" != */test_support.py* ]]; then
rm -rf "$item"
else
echo $item
fi
done
touch $out/lib/python${majorVersion}/test/__init__.py
ln -s "$out/include/python${majorVersion}m" "$out/include/python${majorVersion}"
paxmark E $out/bin/python${majorVersion}
# Python on Nix is not manylinux1 compatible. https://github.com/NixOS/nixpkgs/issues/18484
echo "manylinux1_compatible=False" >> $out/lib/${libPrefix}/_manylinux.py
# Determinism: Windows installers were not deterministic.
# We're also not interested in building Windows installers.
find "$out" -name 'wininst*.exe' | xargs -r rm -f
# Use Python3 as default python
ln -s "$out/bin/idle3" "$out/bin/idle"
ln -s "$out/bin/pip3" "$out/bin/pip"
ln -s "$out/bin/pydoc3" "$out/bin/pydoc"
ln -s "$out/bin/python3" "$out/bin/python"
ln -s "$out/bin/python3-config" "$out/bin/python-config"
ln -s "$out/lib/pkgconfig/python3.pc" "$out/lib/pkgconfig/python.pc"
# Get rid of retained dependencies on -dev packages, and remove
# some $TMPDIR references to improve binary reproducibility.
# Note that the .pyc file of _sysconfigdata.py should be regenerated!
for i in $out/lib/python${majorVersion}/_sysconfigdata.py $out/lib/python${majorVersion}/config-${majorVersion}m/Makefile; do
sed -i $i -e "s|-I/nix/store/[^ ']*||g" -e "s|-L/nix/store/[^ ']*||g" -e "s|$TMPDIR|/no-such-path|g"
done
# Determinism: rebuild all bytecode
# We exclude lib2to3 because that's Python 2 code which fails
# We rebuild three times, once for each optimization level
find $out -name "*.py" | $out/bin/python -m compileall -q -f -x "lib2to3" -i -
find $out -name "*.py" | $out/bin/python -O -m compileall -q -f -x "lib2to3" -i -
find $out -name "*.py" | $out/bin/python -OO -m compileall -q -f -x "lib2to3" -i -
'';
passthru = let
pythonPackages = callPackage ../../../../../top-level/python-packages.nix {python=self; overrides=packageOverrides;};
in rec {
inherit libPrefix sitePackages x11Support;
executable = "${libPrefix}m";
buildEnv = callPackage ../../wrapper.nix { python = self; };
withPackages = import ../../with-packages.nix { inherit buildEnv pythonPackages;};
pkgs = pythonPackages;
isPy3 = true;
isPy33 = true;
is_py3k = true; # deprecated
interpreter = "${self}/bin/${executable}";
};
enableParallelBuilding = true;
meta = {
homepage = http://python.org;
description = "A high-level dynamically-typed programming language";
longDescription = ''
Python is a remarkably powerful dynamic programming language that
is used in a wide variety of application domains. Some of its key
distinguishing features include: clear, readable syntax; strong
introspection capabilities; intuitive object orientation; natural
expression of procedural code; full modularity, supporting
hierarchical packages; exception-based error handling; and very
high level dynamic data types.
'';
license = stdenv.lib.licenses.psfl;
platforms = with stdenv.lib.platforms; linux ++ darwin;
maintainers = with stdenv.lib.maintainers; [ chaoflow cstrahan ];
};
}

View File

@@ -27,7 +27,7 @@ with stdenv.lib;
let
majorVersion = "3.4";
minorVersion = "6";
minorVersion = "7";
minorVersionSuffix = "";
pythonVersion = majorVersion;
version = "${majorVersion}.${minorVersion}${minorVersionSuffix}";
@@ -48,7 +48,7 @@ in stdenv.mkDerivation {
src = fetchurl {
url = "http://www.python.org/ftp/python/${version}/Python-${version}.tar.xz";
sha256 = "0h2z248hkf8x1ix1z8npkqs9cq62i322sl4rcjdkp7mawsxjhd7i";
sha256 = "06wx2ag0dnixny67jfdl5z10243fjga898cgxhnr4dnxaqmwy547";
};
NIX_LDFLAGS = optionalString stdenv.isLinux "-lgcc_s";

View File

@@ -27,7 +27,7 @@ with stdenv.lib;
let
majorVersion = "3.5";
minorVersion = "3";
minorVersion = "4";
minorVersionSuffix = "";
pythonVersion = majorVersion;
version = "${majorVersion}.${minorVersion}${minorVersionSuffix}";
@@ -48,7 +48,7 @@ in stdenv.mkDerivation {
src = fetchurl {
url = "https://www.python.org/ftp/python/${majorVersion}.${minorVersion}/Python-${version}.tar.xz";
sha256 = "1c6v1n9nz4mlx9mw1125fxpmbrgniqdbbx9hnqx44maqazb2mzpf";
sha256 = "0k68ai0a204piwibz013ds6ck7hgj9gk4nin2259y41vpgx3pncl";
};
NIX_LDFLAGS = optionalString stdenv.isLinux "-lgcc_s";
@@ -64,14 +64,6 @@ in stdenv.mkDerivation {
substituteInPlace configure --replace '-Wl,-stack_size,1000000' ' '
'';
patches = [
(fetchpatch {
name = "glibc-2.25-enosys.patch";
url = https://github.com/python/cpython/commit/035ba5da3e53e.patch;
sha256 = "1y74ir1w5cq542w27rgzgp70chhq2x047db9911mihpab8p2nj71";
})
];
postPatch = ''
# Determinism
substituteInPlace "Lib/py_compile.py" --replace "source_stats['mtime']" "(1 if 'DETERMINISTIC_BUILD' in os.environ else source_stats['mtime'])"

View File

@@ -0,0 +1,164 @@
From f0ed87f4066296b7aa3c095d04672c138506fa45 Mon Sep 17 00:00:00 2001
From: Frederik Rietdijk <fridh@fridh.nl>
Date: Sat, 29 Jul 2017 20:33:56 +0200
Subject: [PATCH] Don't use ldconfig and speed up uuid load
---
Lib/ctypes/util.py | 70 ++----------------------------------------------------
Lib/uuid.py | 52 ----------------------------------------
2 files changed, 2 insertions(+), 120 deletions(-)
diff --git a/Lib/ctypes/util.py b/Lib/ctypes/util.py
index 7684eab81d..e9957d7951 100644
--- a/Lib/ctypes/util.py
+++ b/Lib/ctypes/util.py
@@ -95,46 +95,7 @@ elif os.name == "posix":
import re, tempfile
def _findLib_gcc(name):
- # Run GCC's linker with the -t (aka --trace) option and examine the
- # library name it prints out. The GCC command will fail because we
- # haven't supplied a proper program with main(), but that does not
- # matter.
- expr = os.fsencode(r'[^\(\)\s]*lib%s\.[^\(\)\s]*' % re.escape(name))
-
- c_compiler = shutil.which('gcc')
- if not c_compiler:
- c_compiler = shutil.which('cc')
- if not c_compiler:
- # No C compiler available, give up
- return None
-
- temp = tempfile.NamedTemporaryFile()
- try:
- args = [c_compiler, '-Wl,-t', '-o', temp.name, '-l' + name]
-
- env = dict(os.environ)
- env['LC_ALL'] = 'C'
- env['LANG'] = 'C'
- try:
- proc = subprocess.Popen(args,
- stdout=subprocess.PIPE,
- stderr=subprocess.STDOUT,
- env=env)
- except OSError: # E.g. bad executable
- return None
- with proc:
- trace = proc.stdout.read()
- finally:
- try:
- temp.close()
- except FileNotFoundError:
- # Raised if the file was already removed, which is the normal
- # behaviour of GCC if linking fails
- pass
- res = re.search(expr, trace)
- if not res:
- return None
- return os.fsdecode(res.group(0))
+ return None
if sys.platform == "sunos5":
@@ -256,34 +217,7 @@ elif os.name == "posix":
else:
def _findSoname_ldconfig(name):
- import struct
- if struct.calcsize('l') == 4:
- machine = os.uname().machine + '-32'
- else:
- machine = os.uname().machine + '-64'
- mach_map = {
- 'x86_64-64': 'libc6,x86-64',
- 'ppc64-64': 'libc6,64bit',
- 'sparc64-64': 'libc6,64bit',
- 's390x-64': 'libc6,64bit',
- 'ia64-64': 'libc6,IA-64',
- }
- abi_type = mach_map.get(machine, 'libc6')
-
- # XXX assuming GLIBC's ldconfig (with option -p)
- regex = os.fsencode(
- '\s+(lib%s\.[^\s]+)\s+\(%s' % (re.escape(name), abi_type))
- try:
- with subprocess.Popen(['/sbin/ldconfig', '-p'],
- stdin=subprocess.DEVNULL,
- stderr=subprocess.DEVNULL,
- stdout=subprocess.PIPE,
- env={'LC_ALL': 'C', 'LANG': 'C'}) as p:
- res = re.search(regex, p.stdout.read())
- if res:
- return os.fsdecode(res.group(1))
- except OSError:
- pass
+ return None
def find_library(name):
return _findSoname_ldconfig(name) or _get_soname(_findLib_gcc(name))
diff --git a/Lib/uuid.py b/Lib/uuid.py
index e96e7e034c..a099ab4b4a 100644
--- a/Lib/uuid.py
+++ b/Lib/uuid.py
@@ -455,58 +455,6 @@ def _netbios_getnode():
continue
return int.from_bytes(bytes, 'big')
-# Thanks to Thomas Heller for ctypes and for his help with its use here.
-
-# If ctypes is available, use it to find system routines for UUID generation.
-# XXX This makes the module non-thread-safe!
-_uuid_generate_time = _UuidCreate = None
-try:
- import ctypes, ctypes.util
- import sys
-
- # The uuid_generate_* routines are provided by libuuid on at least
- # Linux and FreeBSD, and provided by libc on Mac OS X.
- _libnames = ['uuid']
- if not sys.platform.startswith('win'):
- _libnames.append('c')
- for libname in _libnames:
- try:
- lib = ctypes.CDLL(ctypes.util.find_library(libname))
- except Exception:
- continue
- if hasattr(lib, 'uuid_generate_time'):
- _uuid_generate_time = lib.uuid_generate_time
- break
- del _libnames
-
- # The uuid_generate_* functions are broken on MacOS X 10.5, as noted
- # in issue #8621 the function generates the same sequence of values
- # in the parent process and all children created using fork (unless
- # those children use exec as well).
- #
- # Assume that the uuid_generate functions are broken from 10.5 onward,
- # the test can be adjusted when a later version is fixed.
- if sys.platform == 'darwin':
- import os
- if int(os.uname().release.split('.')[0]) >= 9:
- _uuid_generate_time = None
-
- # On Windows prior to 2000, UuidCreate gives a UUID containing the
- # hardware address. On Windows 2000 and later, UuidCreate makes a
- # random UUID and UuidCreateSequential gives a UUID containing the
- # hardware address. These routines are provided by the RPC runtime.
- # NOTE: at least on Tim's WinXP Pro SP2 desktop box, while the last
- # 6 bytes returned by UuidCreateSequential are fixed, they don't appear
- # to bear any relationship to the MAC address of any network device
- # on the box.
- try:
- lib = ctypes.windll.rpcrt4
- except:
- lib = None
- _UuidCreate = getattr(lib, 'UuidCreateSequential',
- getattr(lib, 'UuidCreate', None))
-except:
- pass
def _unixdll_getnode():
"""Get the hardware address on Unix using ctypes."""
--
2.13.3

View File

@@ -27,7 +27,7 @@ with stdenv.lib;
let
majorVersion = "3.6";
minorVersion = "1";
minorVersion = "2";
minorVersionSuffix = "";
pythonVersion = majorVersion;
version = "${majorVersion}.${minorVersion}${minorVersionSuffix}";
@@ -48,7 +48,7 @@ in stdenv.mkDerivation {
src = fetchurl {
url = "https://www.python.org/ftp/python/${majorVersion}.${minorVersion}/Python-${version}.tar.xz";
sha256 = "0ha03sbakxblzyvlramx5fj0ranzmzx4pa2png6nn8gczkfi0650";
sha256 = "1ab4vlpdax1ihpiyiwchlgsk36apl4kgdw271wvl9l8ywhxpfacj";
};
NIX_LDFLAGS = optionalString stdenv.isLinux "-lgcc_s";
@@ -64,6 +64,10 @@ in stdenv.mkDerivation {
substituteInPlace configure --replace '-Wl,-stack_size,1000000' ' '
'';
patches = [
./no-ldconfig.patch
];
postPatch = ''
# Determinism
substituteInPlace "Lib/py_compile.py" --replace "source_stats['mtime']" "(1 if 'DETERMINISTIC_BUILD' in os.environ else source_stats['mtime'])"

View File

@@ -0,0 +1,163 @@
From a831df344ec1c883a0ef04d8cc8f5c53a942f6de Mon Sep 17 00:00:00 2001
From: Frederik Rietdijk <fridh@fridh.nl>
Date: Sat, 29 Jul 2017 20:17:40 +0200
Subject: [PATCH] Don't use ldconfig and speed up uuid load
---
Lib/ctypes/util.py | 70 ++----------------------------------------------------
Lib/uuid.py | 51 ---------------------------------------
2 files changed, 2 insertions(+), 119 deletions(-)
diff --git a/Lib/ctypes/util.py b/Lib/ctypes/util.py
index 339ae8aa8a..2944985c30 100644
--- a/Lib/ctypes/util.py
+++ b/Lib/ctypes/util.py
@@ -85,46 +85,7 @@ elif os.name == "posix":
import re, tempfile
def _findLib_gcc(name):
- # Run GCC's linker with the -t (aka --trace) option and examine the
- # library name it prints out. The GCC command will fail because we
- # haven't supplied a proper program with main(), but that does not
- # matter.
- expr = os.fsencode(r'[^\(\)\s]*lib%s\.[^\(\)\s]*' % re.escape(name))
-
- c_compiler = shutil.which('gcc')
- if not c_compiler:
- c_compiler = shutil.which('cc')
- if not c_compiler:
- # No C compiler available, give up
- return None
-
- temp = tempfile.NamedTemporaryFile()
- try:
- args = [c_compiler, '-Wl,-t', '-o', temp.name, '-l' + name]
-
- env = dict(os.environ)
- env['LC_ALL'] = 'C'
- env['LANG'] = 'C'
- try:
- proc = subprocess.Popen(args,
- stdout=subprocess.PIPE,
- stderr=subprocess.STDOUT,
- env=env)
- except OSError: # E.g. bad executable
- return None
- with proc:
- trace = proc.stdout.read()
- finally:
- try:
- temp.close()
- except FileNotFoundError:
- # Raised if the file was already removed, which is the normal
- # behaviour of GCC if linking fails
- pass
- res = re.search(expr, trace)
- if not res:
- return None
- return os.fsdecode(res.group(0))
+ return None
if sys.platform == "sunos5":
@@ -246,34 +207,7 @@ elif os.name == "posix":
else:
def _findSoname_ldconfig(name):
- import struct
- if struct.calcsize('l') == 4:
- machine = os.uname().machine + '-32'
- else:
- machine = os.uname().machine + '-64'
- mach_map = {
- 'x86_64-64': 'libc6,x86-64',
- 'ppc64-64': 'libc6,64bit',
- 'sparc64-64': 'libc6,64bit',
- 's390x-64': 'libc6,64bit',
- 'ia64-64': 'libc6,IA-64',
- }
- abi_type = mach_map.get(machine, 'libc6')
-
- # XXX assuming GLIBC's ldconfig (with option -p)
- regex = r'\s+(lib%s\.[^\s]+)\s+\(%s'
- regex = os.fsencode(regex % (re.escape(name), abi_type))
- try:
- with subprocess.Popen(['/sbin/ldconfig', '-p'],
- stdin=subprocess.DEVNULL,
- stderr=subprocess.DEVNULL,
- stdout=subprocess.PIPE,
- env={'LC_ALL': 'C', 'LANG': 'C'}) as p:
- res = re.search(regex, p.stdout.read())
- if res:
- return os.fsdecode(res.group(1))
- except OSError:
- pass
+ return None
def _findLib_ld(name):
# See issue #9998 for why this is needed
diff --git a/Lib/uuid.py b/Lib/uuid.py
index 200c800b34..a099ab4b4a 100644
--- a/Lib/uuid.py
+++ b/Lib/uuid.py
@@ -455,57 +455,6 @@ def _netbios_getnode():
continue
return int.from_bytes(bytes, 'big')
-# Thanks to Thomas Heller for ctypes and for his help with its use here.
-
-# If ctypes is available, use it to find system routines for UUID generation.
-# XXX This makes the module non-thread-safe!
-_uuid_generate_time = _UuidCreate = None
-try:
- import ctypes, ctypes.util
- import sys
-
- # The uuid_generate_* routines are provided by libuuid on at least
- # Linux and FreeBSD, and provided by libc on Mac OS X.
- _libnames = ['uuid']
- if not sys.platform.startswith('win'):
- _libnames.append('c')
- for libname in _libnames:
- try:
- lib = ctypes.CDLL(ctypes.util.find_library(libname))
- except Exception:
- continue
- if hasattr(lib, 'uuid_generate_time'):
- _uuid_generate_time = lib.uuid_generate_time
- break
- del _libnames
-
- # The uuid_generate_* functions are broken on MacOS X 10.5, as noted
- # in issue #8621 the function generates the same sequence of values
- # in the parent process and all children created using fork (unless
- # those children use exec as well).
- #
- # Assume that the uuid_generate functions are broken from 10.5 onward,
- # the test can be adjusted when a later version is fixed.
- if sys.platform == 'darwin':
- if int(os.uname().release.split('.')[0]) >= 9:
- _uuid_generate_time = None
-
- # On Windows prior to 2000, UuidCreate gives a UUID containing the
- # hardware address. On Windows 2000 and later, UuidCreate makes a
- # random UUID and UuidCreateSequential gives a UUID containing the
- # hardware address. These routines are provided by the RPC runtime.
- # NOTE: at least on Tim's WinXP Pro SP2 desktop box, while the last
- # 6 bytes returned by UuidCreateSequential are fixed, they don't appear
- # to bear any relationship to the MAC address of any network device
- # on the box.
- try:
- lib = ctypes.windll.rpcrt4
- except:
- lib = None
- _UuidCreate = getattr(lib, 'UuidCreateSequential',
- getattr(lib, 'UuidCreate', None))
-except:
- pass
def _unixdll_getnode():
"""Get the hardware address on Unix using ctypes."""
--
2.13.3

View File

@@ -1,18 +0,0 @@
# This file was generated and will be overwritten by ./generate.sh
{ stdenv, fetchurl, lib }:
stdenv.mkDerivation rec {
name = "python33-docs-html-3.3.0";
src = fetchurl {
url = http://docs.python.org/ftp/python/doc/3.3.0/python-3.3.0-docs-html.tar.bz2;
sha256 = "0vv24b9qi7gznv687ik0pa2w1rq9grqivy44znvj2ysjfg7mc2c1";
};
installPhase = ''
mkdir -p $out/share/doc/python33
cp -R ./ $out/share/doc/python33/html
'';
meta = {
maintainers = [ lib.maintainers.chaoflow ];
};
}

View File

@@ -1,18 +0,0 @@
# This file was generated and will be overwritten by ./generate.sh
{ stdenv, fetchurl, lib }:
stdenv.mkDerivation rec {
name = "python33-docs-pdf-a4-3.3.0";
src = fetchurl {
url = http://docs.python.org/ftp/python/doc/3.3.0/python-3.3.0-docs-pdf-a4.tar.bz2;
sha256 = "1y6n13bxlw8a11khy3ynfbz8z0kpf2lvh32dvy8scyw3hrk6wdxp";
};
installPhase = ''
mkdir -p $out/share/doc/python33
cp -R ./ $out/share/doc/python33/pdf-a4
'';
meta = {
maintainers = [ lib.maintainers.chaoflow ];
};
}

View File

@@ -1,18 +0,0 @@
# This file was generated and will be overwritten by ./generate.sh
{ stdenv, fetchurl, lib }:
stdenv.mkDerivation rec {
name = "python33-docs-pdf-letter-3.3.0";
src = fetchurl {
url = http://docs.python.org/ftp/python/doc/3.3.0/python-3.3.0-docs-pdf-letter.tar.bz2;
sha256 = "0mcj1i47nx81fc9zk1cic4c4p139qjcqlzf4hnnkzvb3jcgy5z6k";
};
installPhase = ''
mkdir -p $out/share/doc/python33
cp -R ./ $out/share/doc/python33/pdf-letter
'';
meta = {
maintainers = [ lib.maintainers.chaoflow ];
};
}

View File

@@ -1,18 +0,0 @@
# This file was generated and will be overwritten by ./generate.sh
{ stdenv, fetchurl, lib }:
stdenv.mkDerivation rec {
name = "python33-docs-text-3.3.0";
src = fetchurl {
url = http://docs.python.org/ftp/python/doc/3.3.0/python-3.3.0-docs-text.tar.bz2;
sha256 = "10vk2fixg1aglqmsf89kn98rlirrbhnrk1285vzfbynf2iavxw0n";
};
installPhase = ''
mkdir -p $out/share/doc/python33
cp -R ./ $out/share/doc/python33/text
'';
meta = {
maintainers = [ lib.maintainers.chaoflow ];
};
}

View File

@@ -4,36 +4,24 @@ let
pythonDocs = {
html = {
recurseForDerivations = true;
python33 = import ./3.3-html.nix {
inherit stdenv fetchurl lib;
};
python27 = import ./2.7-html.nix {
inherit stdenv fetchurl lib;
};
};
pdf_a4 = {
recurseForDerivations = true;
python33 = import ./3.3-pdf-a4.nix {
inherit stdenv fetchurl lib;
};
python27 = import ./2.7-pdf-a4.nix {
inherit stdenv fetchurl lib;
};
};
pdf_letter = {
recurseForDerivations = true;
python33 = import ./3.3-pdf-letter.nix {
inherit stdenv fetchurl lib;
};
python27 = import ./2.7-pdf-letter.nix {
inherit stdenv fetchurl lib;
};
};
text = {
recurseForDerivations = true;
python33 = import ./3.3-text.nix {
inherit stdenv fetchurl lib;
};
python27 = import ./2.7-text.nix {
inherit stdenv fetchurl lib;
};

View File

@@ -66,7 +66,9 @@ wrapPythonProgramsIn() {
# above. The script will set PYTHONPATH and PATH variables.!
# (see pkgs/build-support/setup-hooks/make-wrapper.sh)
local -a wrap_args=("$f"
--prefix PATH ':' "$program_PATH")
--prefix PATH ':' "$program_PATH"
--set PYTHONNOUSERSITE "true"
)
# Add any additional arguments provided by makeWrapperArgs
# argument to buildPythonPackage.

View File

@@ -6,8 +6,7 @@
# Create a python executable that knows about additional packages.
let
recursivePthLoader = import ../../python-modules/recursive-pth-loader/default.nix { stdenv = stdenv; python = python; };
env = (
let
env = let
paths = stdenv.lib.closePropagation (extraLibs ++ [ python recursivePthLoader ] ) ;
in buildEnv {
name = "${python.name}-env";
@@ -29,26 +28,31 @@ let
for prg in *; do
if [ -f "$prg" ]; then
rm -f "$out/bin/$prg"
makeWrapper "$path/bin/$prg" "$out/bin/$prg" --set PYTHONHOME "$out"
if [ -x "$prg" ]; then
makeWrapper "$path/bin/$prg" "$out/bin/$prg" --set PYTHONHOME "$out" --set PYTHONNOUSERSITE "true"
fi
fi
done
fi
done
'' + postBuild;
passthru.env = stdenv.mkDerivation {
name = "interactive-${python.name}-environment";
nativeBuildInputs = [ env ];
buildCommand = ''
echo >&2 ""
echo >&2 "*** Python 'env' attributes are intended for interactive nix-shell sessions, not for building! ***"
echo >&2 ""
exit 1
'';
};
}) // {
inherit python;
inherit (python) meta;
passthru = python.passthru // {
interpreter = "${env}/bin/${python.executable}";
inherit python;
env = stdenv.mkDerivation {
name = "interactive-${python.name}-environment";
nativeBuildInputs = [ env ];
buildCommand = ''
echo >&2 ""
echo >&2 "*** Python 'env' attributes are intended for interactive nix-shell sessions, not for building! ***"
echo >&2 ""
exit 1
'';
};
};
};
in env

View File

@@ -10,7 +10,7 @@ stdenv.mkDerivation {
meta = {
description = "Ren'Py Visual Novel Engine";
homepage = "http://renpy.org/";
homepage = http://renpy.org/;
license = stdenv.lib.licenses.mit;
platforms = stdenv.lib.platforms.linux;
# This is an ancient version, last updated in 2014 (3d59f42ce); it fails to

View File

@@ -53,7 +53,7 @@ stdenv.mkDerivation rec {
meta = with stdenv.lib; {
description = "Mozilla's JavaScript engine written in C/C++";
homepage = "https://developer.mozilla.org/en/SpiderMonkey";
homepage = https://developer.mozilla.org/en/SpiderMonkey;
# TODO: MPL/GPL/LGPL tri-license.
maintainers = [ maintainers.abbradar ];

View File

@@ -32,7 +32,7 @@ stdenv.mkDerivation rec {
meta = {
description = "Programming language for real time audio synthesis";
homepage = "http://supercollider.sourceforge.net/";
homepage = http://supercollider.sourceforge.net/;
license = stdenv.lib.licenses.gpl3Plus;
platforms = stdenv.lib.platforms.linux;
};