Merge branch 'npiperelay'

main
Shea Levy 2 years ago
commit 4fa17d6e19
No known key found for this signature in database
GPG Key ID: 5C0BD6957D86FE27
  1. 16
      pkgs/development/compilers/go/1.17.nix
  2. 16
      pkgs/development/compilers/go/1.18.nix
  3. 2
      pkgs/os-specific/windows/default.nix
  4. 23
      pkgs/os-specific/windows/npiperelay/default.nix

@ -18,8 +18,12 @@
, buildPackages
, pkgsBuildTarget
, callPackage
, threadsCross ? null # for MinGW
}:
# threadsCross is just for MinGW
assert threadsCross != null -> stdenv.targetPlatform.isWindows;
let
go_bootstrap = buildPackages.callPackage ./bootstrap.nix { };
@ -50,6 +54,8 @@ let
# We need a target compiler which is still runnable at build time,
# to handle the cross-building case where build != host == target
targetCC = pkgsBuildTarget.targetPackages.stdenv.cc;
isCross = stdenv.buildPlatform != stdenv.targetPlatform;
in
stdenv.mkDerivation rec {
@ -71,6 +77,10 @@ stdenv.mkDerivation rec {
depsTargetTargetPropagated = lib.optionals stdenv.isDarwin [ Security Foundation ];
depsBuildTarget = lib.optional isCross targetCC;
depsTargetTarget = lib.optional (threadsCross != null) threadsCross;
hardeningDisable = [ "all" ];
prePatch = ''
@ -194,12 +204,12 @@ stdenv.mkDerivation rec {
# {CC,CXX}_FOR_TARGET must be only set for cross compilation case as go expect those
# to be different from CC/CXX
CC_FOR_TARGET =
if (stdenv.buildPlatform != stdenv.targetPlatform) then
if isCross then
"${targetCC}/bin/${targetCC.targetPrefix}cc"
else
null;
CXX_FOR_TARGET =
if (stdenv.buildPlatform != stdenv.targetPlatform) then
if isCross then
"${targetCC}/bin/${targetCC.targetPrefix}c++"
else
null;
@ -223,7 +233,7 @@ stdenv.mkDerivation rec {
export PATH=$(pwd)/bin:$PATH
${lib.optionalString (stdenv.buildPlatform != stdenv.targetPlatform) ''
${lib.optionalString isCross ''
# Independent from host/target, CC should produce code for the building system.
# We only set it when cross-compiling.
export CC=${buildPackages.stdenv.cc}/bin/cc

@ -18,8 +18,12 @@
, buildPackages
, pkgsBuildTarget
, callPackage
, threadsCross ? null # for MinGW
}:
# threadsCross is just for MinGW
assert threadsCross != null -> stdenv.targetPlatform.isWindows;
let
go_bootstrap = buildPackages.callPackage ./bootstrap.nix { };
@ -50,6 +54,8 @@ let
# We need a target compiler which is still runnable at build time,
# to handle the cross-building case where build != host == target
targetCC = pkgsBuildTarget.targetPackages.stdenv.cc;
isCross = stdenv.buildPlatform != stdenv.targetPlatform;
in
stdenv.mkDerivation rec {
@ -71,6 +77,10 @@ stdenv.mkDerivation rec {
depsTargetTargetPropagated = lib.optionals stdenv.isDarwin [ Security Foundation ];
depsBuildTarget = lib.optional isCross targetCC;
depsTargetTarget = lib.optional (threadsCross != null) threadsCross;
hardeningDisable = [ "all" ];
prePatch = ''
@ -188,12 +198,12 @@ stdenv.mkDerivation rec {
# {CC,CXX}_FOR_TARGET must be only set for cross compilation case as go expect those
# to be different from CC/CXX
CC_FOR_TARGET =
if (stdenv.buildPlatform != stdenv.targetPlatform) then
if isCross then
"${targetCC}/bin/${targetCC.targetPrefix}cc"
else
null;
CXX_FOR_TARGET =
if (stdenv.buildPlatform != stdenv.targetPlatform) then
if isCross then
"${targetCC}/bin/${targetCC.targetPrefix}c++"
else
null;
@ -217,7 +227,7 @@ stdenv.mkDerivation rec {
export PATH=$(pwd)/bin:$PATH
${lib.optionalString (stdenv.buildPlatform != stdenv.targetPlatform) ''
${lib.optionalString isCross ''
# Independent from host/target, CC should produce code for the building system.
# We only set it when cross-compiling.
export CC=${buildPackages.stdenv.cc}/bin/cc

@ -37,6 +37,8 @@ lib.makeScope newScope (self: with self; {
stdenv = crossThreadsStdenv;
};
npiperelay = callPackage ./npiperelay { };
pthreads = callPackage ./pthread-w32 { };
wxMSW = callPackage ./wxMSW-2.8 { };

@ -0,0 +1,23 @@
{ lib, buildGoModule, fetchFromGitHub }:
buildGoModule rec {
pname = "npiperelay";
version = "0.1.0";
src = fetchFromGitHub {
owner = "jstarks";
repo = "npiperelay";
rev = "v${version}";
sha256 = "sha256-cg4aZmpTysc8m1euxIO2XPv8OMnBk1DwhFcuIFHF/1o=";
};
vendorSha256 = null;
meta = {
description = "Access Windows named pipes from WSL";
homepage = "https://github.com/jstarks/npiperelay";
license = lib.licenses.mit;
maintainers = [ lib.maintainers.shlevy ];
platforms = lib.platforms.windows;
};
}
Loading…
Cancel
Save