Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/master' into HEAD
Browse files Browse the repository at this point in the history
  • Loading branch information
FRidh committed Sep 6, 2017
2 parents 40e917d + 67651d8 commit 38dc9a8
Show file tree
Hide file tree
Showing 41 changed files with 1,681 additions and 1,056 deletions.
7 changes: 6 additions & 1 deletion pkgs/applications/editors/zile/default.nix
Expand Up @@ -9,7 +9,12 @@ stdenv.mkDerivation rec {
};

buildInputs = [ pkgconfig ncurses boehmgc ];
nativeBuildInputs = [ help2man perl ];
nativeBuildInputs = [ perl ]
# `help2man' wants to run Zile, which won't work when the
# newly-produced binary can't be run at build-time.
++ stdenv.lib.optional
(stdenv.hostPlatform == stdenv.buildPlatform)
help2man;

# Tests can't be run because most of them rely on the ability to
# fiddle with the terminal.
Expand Down
9 changes: 5 additions & 4 deletions pkgs/applications/misc/ocropus/default.nix
Expand Up @@ -19,11 +19,11 @@ let
in
pythonPackages.buildPythonApplication rec {
name = "ocropus-${version}";
version = "20150316";
version = "20170811";

src = fetchFromGitHub {
sha256 = "0m5bm2ah3p29c13vp7hz7rm058qnlm840zd8xv20byijhlz0447g";
rev = "5ba07bb959d605ec15424dd2b8f3d7245820084e";
sha256 = "0qx0d8yj0w66qglkrmfavp5dh1sky72njfaqii7bnrpv5n4j3q39";
rev = "ae84a8edaf0b76135f749ba66fc30c272d0726d0";
repo = "ocropy";
owner = "tmbdev";
};
Expand All @@ -37,7 +37,8 @@ pythonPackages.buildPythonApplication rec {
${concatStrings (map (x: "cp -R ${x.src} models/`basename ${x.name}`;")
models)}
substituteInPlace ocrolib/{common,default}.py --replace /usr/local $out
substituteInPlace ocrolib/common.py --replace /usr/local $out
substituteInPlace ocrolib/default.py --replace /usr/local $out
'';

doCheck = false; # fails
Expand Down
@@ -1,15 +1,17 @@
{ stdenv, lib, fetchurl
{ stdenv, lib, fetchFromGitHub
, qt4, qmake4Hook, openssl
, xproto, libX11, libXScrnSaver, scrnsaverproto
, xz, zlib
}:
stdenv.mkDerivation rec {
name = "vacuum-im-${version}";
version = "1.2.4";
version = "1.3.0.20160104";

src = fetchurl {
url = "https://googledrive.com/host/0B7A5K_290X8-d1hjQmJaSGZmTTA/vacuum-${version}.tar.gz";
sha256 = "10qxpfbbaagqcalhk0nagvi5irbbz5hk31w19lba8hxf6pfylrhf";
src = fetchFromGitHub {
owner = "Vacuum-IM";
repo = "vacuum-im";
rev = "1.3.0.20160104-Alpha";
sha256 = "1jcw9c7s75y4c3m4skfc3cc0i519z39b23n997vj5mwcjplxyc76";
};

buildInputs = [
Expand Down
3 changes: 1 addition & 2 deletions pkgs/applications/video/mplayer/default.nix
Expand Up @@ -102,8 +102,7 @@ stdenv.mkDerivation rec {
rm -rf ffmpeg
'';

depsBuildBuild = [ buildPackages.stdenv.cc ];
nativeBuildInputs = [ pkgconfig yasm ];
nativeBuildInputs = [ buildPackages.stdenv.cc pkgconfig yasm ];
buildInputs = with stdenv.lib;
[ freetype ffmpeg ]
++ optional aalibSupport aalib
Expand Down
5 changes: 3 additions & 2 deletions pkgs/applications/virtualization/spice-vdagent/default.nix
@@ -1,5 +1,6 @@
{stdenv, fetchurl, pkgconfig, alsaLib, spice_protocol, glib,
libpciaccess, libxcb, libXrandr, libXinerama, libXfixes, dbus}:
libpciaccess, libxcb, libXrandr, libXinerama, libXfixes, dbus,
systemd}:
stdenv.mkDerivation rec {
name = "spice-vdagent-0.17.0";
src = fetchurl {
Expand All @@ -11,7 +12,7 @@ stdenv.mkDerivation rec {
'';
buildInputs = [ pkgconfig alsaLib spice_protocol glib
libpciaccess libxcb libXrandr libXinerama libXfixes
dbus ] ;
dbus systemd ] ;
meta = {
description = "Enhanced SPICE integration for linux QEMU guest";
longDescription = ''
Expand Down
2 changes: 2 additions & 0 deletions pkgs/development/compilers/gcc/libstdc++-hook.sh
@@ -0,0 +1,2 @@
export NIX_CXXSTDLIB_COMPILE+="-isystem $(echo -n @gcc@/include/c++/*) -isystem $(echo -n @gcc@/include/c++/*)/$(@gcc@/bin/gcc -dumpmachine)"
export NIX_CXXSTDLIB_LINK=" -stdlib=libstdc++"
2 changes: 1 addition & 1 deletion pkgs/development/compilers/ghc/7.10.2.nix
Expand Up @@ -34,7 +34,7 @@ stdenv.mkDerivation rec {
sha256 = "1x8m4rp2v7ydnrz6z9g8x7z3x3d3pxhv2pixy7i7hkbqbdsp7kal";
};

buildInputs = [ ghc perl libxml2 libxslt docbook_xsl docbook_xml_dtd_45 docbook_xml_dtd_42 (stdenv.lib.getBin hscolour) ];
buildInputs = [ ghc perl libxml2 libxslt docbook_xsl docbook_xml_dtd_45 docbook_xml_dtd_42 hscolour ];

patches = [ ./relocation.patch ];

Expand Down
2 changes: 1 addition & 1 deletion pkgs/development/compilers/ghc/7.10.3.nix
Expand Up @@ -30,7 +30,7 @@ stdenv.mkDerivation rec {
./relocation.patch
];

buildInputs = [ ghc perl libxml2 libxslt docbook_xsl docbook_xml_dtd_45 docbook_xml_dtd_42 (stdenv.lib.getBin hscolour) ];
buildInputs = [ ghc perl libxml2 libxslt docbook_xsl docbook_xml_dtd_45 docbook_xml_dtd_42 hscolour ];

enableParallelBuilding = true;

Expand Down
2 changes: 1 addition & 1 deletion pkgs/development/compilers/ghc/8.0.1.nix
Expand Up @@ -33,7 +33,7 @@ stdenv.mkDerivation rec {
(fetchFilteredPatch { url = https://git.haskell.org/ghc.git/patch/2f8cd14fe909a377b3e084a4f2ded83a0e6d44dd; sha256 = "06zvlgcf50ab58bw6yw3krn45dsmhg4cmlz4nqff8k4z1f1bj01v"; })
] ++ stdenv.lib.optional stdenv.isLinux ./ghc-no-madv-free.patch;

buildInputs = [ ghc perl (stdenv.lib.getBin hscolour) sphinx];
buildInputs = [ ghc perl hscolour sphinx];

enableParallelBuilding = true;

Expand Down
2 changes: 1 addition & 1 deletion pkgs/development/compilers/ghc/8.0.2.nix
Expand Up @@ -23,7 +23,7 @@ stdenv.mkDerivation rec {
++ stdenv.lib.optional stdenv.isLinux ./ghc-no-madv-free.patch
++ stdenv.lib.optional stdenv.isDarwin ./ghc-8.0.2-no-cpp-warnings.patch;

buildInputs = [ ghc perl (stdenv.lib.getBin hscolour) sphinx ];
buildInputs = [ ghc perl hscolour sphinx ];

enableParallelBuilding = true;

Expand Down
2 changes: 1 addition & 1 deletion pkgs/development/compilers/ghc/8.2.1.nix
Expand Up @@ -11,7 +11,7 @@ let
inherit (bootPkgs) ghc;
version = "8.2.1";
preReleaseName = "ghc-8.2.1";
commonBuildInputs = [ (stdenv.lib.getBin alex) autoconf automake ghc (stdenv.lib.getBin happy) (stdenv.lib.getBin hscolour) perl python3 sphinx ];
commonBuildInputs = [ alex autoconf automake ghc happy hscolour perl python3 sphinx ];
commonPreConfigure = ''
sed -i -e 's|-isysroot /Developer/SDKs/MacOSX10.5.sdk||' configure
'' + stdenv.lib.optionalString (!stdenv.isDarwin) ''
Expand Down
2 changes: 1 addition & 1 deletion pkgs/development/compilers/ghc/head.nix
Expand Up @@ -11,7 +11,7 @@
let
inherit (bootPkgs) ghc;

commonBuildInputs = [ ghc perl autoconf automake (stdenv.lib.getBin happy) (stdenv.lib.getBin alex) python3 ];
commonBuildInputs = [ ghc perl autoconf automake happy alex python3 ];

rev = "14457cf6a50f708eecece8f286f08687791d51f7";

Expand Down
2 changes: 1 addition & 1 deletion pkgs/development/compilers/ghcjs/base.nix
Expand Up @@ -118,7 +118,7 @@ in mkDerivation (rec {
lens optparse-applicative parallel safe shelly split
stringsearch syb system-fileio system-filepath tar terminfo text-binary
unordered-containers vector wl-pprint-text yaml
(stdenv.lib.getBin alex) (stdenv.lib.getBin happy) git gnumake autoconf automake libtool patch gmp
alex happy git gnumake autoconf automake libtool patch gmp
base16-bytestring cryptohash executable-path haddock-api
transformers-compat QuickCheck haddock hspec xhtml
regex-posix libiconv
Expand Down
181 changes: 181 additions & 0 deletions pkgs/development/compilers/go/1.9.nix
@@ -0,0 +1,181 @@
{ stdenv, fetchFromGitHub, tzdata, iana-etc, go_bootstrap, runCommand, writeScriptBin
, perl, which, pkgconfig, patch, fetchpatch
, pcre, cacert, llvm
, Security, Foundation, bash
, makeWrapper, git, subversion, mercurial, bazaar }:

let

inherit (stdenv.lib) optional optionals optionalString;

clangHack = writeScriptBin "clang" ''
#!${stdenv.shell}
exec ${stdenv.cc}/bin/clang "$@" 2> >(sed '/ld: warning:.*ignoring unexpected dylib file/ d' 1>&2)
'';

goBootstrap = runCommand "go-bootstrap" {} ''
mkdir $out
cp -rf ${go_bootstrap}/* $out/
chmod -R u+w $out
find $out -name "*.c" -delete
cp -rf $out/bin/* $out/share/go/bin/
'';

in

stdenv.mkDerivation rec {
name = "go-${version}";
version = "1.9";

src = fetchFromGitHub {
owner = "golang";
repo = "go";
rev = "go${version}";
sha256 = "06k66x387r93m7d3bd5yzwdm8f8xc43cdjfamqldfc1v8ngak0y9";
};

# perl is used for testing go vet
nativeBuildInputs = [ perl which pkgconfig patch makeWrapper ];
buildInputs = [ pcre ]
++ optionals stdenv.isLinux [ stdenv.glibc.out stdenv.glibc.static ];
propagatedBuildInputs = optionals stdenv.isDarwin [ Security Foundation ];

hardeningDisable = [ "all" ];

prePatch = ''
patchShebangs ./ # replace /bin/bash
# This source produces shell script at run time,
# and thus it is not corrected by patchShebangs.
substituteInPlace misc/cgo/testcarchive/carchive_test.go \
--replace '#!/usr/bin/env bash' '#!${stdenv.shell}'
# Disabling the 'os/http/net' tests (they want files not available in
# chroot builds)
rm src/net/{listen,parse}_test.go
rm src/syscall/exec_linux_test.go
# !!! substituteInPlace does not seems to be effective.
# The os test wants to read files in an existing path. Just don't let it be /usr/bin.
sed -i 's,/usr/bin,'"`pwd`", src/os/os_test.go
sed -i 's,/bin/pwd,'"`type -P pwd`", src/os/os_test.go
# Disable the unix socket test
sed -i '/TestShutdownUnix/areturn' src/net/net_test.go
# Disable the hostname test
sed -i '/TestHostname/areturn' src/os/os_test.go
# ParseInLocation fails the test
sed -i '/TestParseInSydney/areturn' src/time/format_test.go
# Remove the api check as it never worked
sed -i '/src\/cmd\/api\/run.go/ireturn nil' src/cmd/dist/test.go
# Remove the coverage test as we have removed this utility
sed -i '/TestCoverageWithCgo/areturn' src/cmd/go/go_test.go
# Remove the timezone naming test
sed -i '/TestLoadFixed/areturn' src/time/time_test.go
# Remove disable setgid test
sed -i '/TestRespectSetgidDir/areturn' src/cmd/go/internal/work/build_test.go
# Remove cert tests that conflict with NixOS's cert resolution
sed -i '/TestEnvVars/areturn' src/crypto/x509/root_unix_test.go
sed -i 's,/etc/protocols,${iana-etc}/etc/protocols,' src/net/lookup_unix.go
sed -i 's,/etc/services,${iana-etc}/etc/services,' src/net/port_unix.go
# Disable cgo lookup tests not works, they depend on resolver
rm src/net/cgo_unix_test.go
'' + optionalString stdenv.isLinux ''
sed -i 's,/usr/share/zoneinfo/,${tzdata}/share/zoneinfo/,' src/time/zoneinfo_unix.go
'' + optionalString stdenv.isArm ''
sed -i '/TestCurrent/areturn' src/os/user/user_test.go
echo '#!/usr/bin/env bash' > misc/cgo/testplugin/test.bash
'' + optionalString stdenv.isDarwin ''
substituteInPlace src/race.bash --replace \
"sysctl machdep.cpu.extfeatures | grep -qv EM64T" true
sed -i 's,strings.Contains(.*sysctl.*,true {,' src/cmd/dist/util.go
sed -i 's,"/etc","'"$TMPDIR"'",' src/os/os_test.go
sed -i 's,/_go_os_test,'"$TMPDIR"'/_go_os_test,' src/os/path_test.go
sed -i '/TestChdirAndGetwd/areturn' src/os/os_test.go
sed -i '/TestRead0/areturn' src/os/os_test.go
sed -i '/TestNohup/areturn' src/os/signal/signal_test.go
sed -i '/TestCurrent/areturn' src/os/user/user_test.go
sed -i '/TestSystemRoots/areturn' src/crypto/x509/root_darwin_test.go
sed -i '/TestGoInstallRebuildsStalePackagesInOtherGOPATH/areturn' src/cmd/go/go_test.go
sed -i '/TestBuildDashIInstallsDependencies/areturn' src/cmd/go/go_test.go
sed -i '/TestDisasmExtld/areturn' src/cmd/objdump/objdump_test.go
sed -i 's/unrecognized/unknown/' src/cmd/link/internal/ld/lib.go
sed -i 's/unrecognized/unknown/' src/cmd/go/build.go
touch $TMPDIR/group $TMPDIR/hosts $TMPDIR/passwd
sed -i '1 a\exit 0' misc/cgo/errors/test.bash
'';

patches =
[ ./remove-tools-1.9.patch
./ssl-cert-file-1.9.patch
./creds-test.patch
./remove-test-pie-1.9.patch
];

postPatch = optionalString stdenv.isDarwin ''
echo "substitute hardcoded dsymutil with ${llvm}/bin/llvm-dsymutil"
substituteInPlace "src/cmd/link/internal/ld/lib.go" --replace dsymutil ${llvm}/bin/llvm-dsymutil
'';

NIX_SSL_CERT_FILE = "${cacert}/etc/ssl/certs/ca-bundle.crt";

GOOS = if stdenv.isDarwin then "darwin" else "linux";
GOARCH = if stdenv.isDarwin then "amd64"
else if stdenv.system == "i686-linux" then "386"
else if stdenv.system == "x86_64-linux" then "amd64"
else if stdenv.isArm then "arm"
else throw "Unsupported system";
GOARM = optionalString (stdenv.system == "armv5tel-linux") "5";
GO386 = 387; # from Arch: don't assume sse2 on i686
CGO_ENABLED = 1;
GOROOT_BOOTSTRAP = "${goBootstrap}/share/go";

# The go build actually checks for CC=*/clang and does something different, so we don't
# just want the generic `cc` here.
CC = if stdenv.isDarwin then "clang" else "cc";

configurePhase = ''
mkdir -p $out/share/go/bin
export GOROOT=$out/share/go
export GOBIN=$GOROOT/bin
export PATH=$GOBIN:$PATH
'';

postConfigure = optionalString stdenv.isDarwin ''
export PATH=${clangHack}/bin:$PATH
'';

installPhase = ''
cp -r . $GOROOT
( cd $GOROOT/src && ./all.bash )
# (https://github.com/golang/go/wiki/GoGetTools)
wrapProgram $out/share/go/bin/go --prefix PATH ":" "${stdenv.lib.makeBinPath [ git subversion mercurial bazaar ]}"
'';

preFixup = ''
rm -r $out/share/go/pkg/bootstrap
ln -s $out/share/go/bin $out/bin
'';

setupHook = ./setup-hook.sh;

disallowedReferences = [ go_bootstrap ];

meta = with stdenv.lib; {
branch = "1.8";
homepage = http://golang.org/;
description = "The Go Programming language";
license = licenses.bsd3;
maintainers = with maintainers; [ cstrahan wkennington ];
platforms = platforms.linux ++ platforms.darwin;
};
}
26 changes: 26 additions & 0 deletions pkgs/development/compilers/go/remove-test-pie-1.9.patch
@@ -0,0 +1,26 @@
diff --git a/src/cmd/dist/test.go b/src/cmd/dist/test.go
index 73432d31ea..3310f5298d 100644
--- a/src/cmd/dist/test.go
+++ b/src/cmd/dist/test.go
@@ -510,21 +510,6 @@ func (t *tester) registerTests() {
})
}

- // Test internal linking of PIE binaries where it is supported.
- if t.goos == "linux" && t.goarch == "amd64" && !isAlpineLinux() {
- // Issue 18243: We don't have a way to set the default
- // dynamic linker used in internal linking mode. So
- // this test is skipped on Alpine.
- t.tests = append(t.tests, distTest{
- name: "pie_internal",
- heading: "internal linking of -buildmode=pie",
- fn: func(dt *distTest) error {
- t.addCmd(dt, "src", "go", "test", "reflect", "-short", "-buildmode=pie", "-ldflags=-linkmode=internal", t.timeout(60), t.tags(), t.runFlag(""))
- return nil
- },
- })
- }
-
// sync tests
t.tests = append(t.tests, distTest{
name: "sync_cpu",
35 changes: 35 additions & 0 deletions pkgs/development/compilers/go/remove-tools-1.9.patch
@@ -0,0 +1,35 @@
diff --git a/src/go/build/build.go b/src/go/build/build.go
index d8163d0172..dd80a70473 100644
--- a/src/go/build/build.go
+++ b/src/go/build/build.go
@@ -1592,7 +1592,7 @@ func init() {
}

// ToolDir is the directory containing build tools.
-var ToolDir = filepath.Join(runtime.GOROOT(), "pkg/tool/"+runtime.GOOS+"_"+runtime.GOARCH)
+var ToolDir = runtime.GOTOOLDIR()

// IsLocalImport reports whether the import path is
// a local import path, like ".", "..", "./foo", or "../foo".
diff --git a/src/runtime/extern.go b/src/runtime/extern.go
index 6e6c674d96..e9f62f96dc 100644
--- a/src/runtime/extern.go
+++ b/src/runtime/extern.go
@@ -223,6 +223,17 @@ func GOROOT() string {
return sys.DefaultGoroot
}

+// GOTOOLDIR returns the root of the Go tree.
+// It uses the GOTOOLDIR environment variable, if set,
+// or else the root used during the Go build.
+func GOTOOLDIR() string {
+ s := gogetenv("GOTOOLDIR")
+ if s != "" {
+ return s
+ }
+ return GOROOT() + "/pkg/tool/" + GOOS + "_" + GOARCH
+}
+
// Version returns the Go tree's version string.
// It is either the commit hash and date at the time of the build or,
// when possible, a release tag like "go1.3".

0 comments on commit 38dc9a8

Please sign in to comment.