Merge branch 'npiperelay'

+51 -6
+13 -3
pkgs/development/compilers/go/1.17.nix
··· 18 , buildPackages 19 , pkgsBuildTarget 20 , callPackage 21 }: 22 23 let 24 go_bootstrap = buildPackages.callPackage ./bootstrap.nix { }; ··· 50 # We need a target compiler which is still runnable at build time, 51 # to handle the cross-building case where build != host == target 52 targetCC = pkgsBuildTarget.targetPackages.stdenv.cc; 53 in 54 55 stdenv.mkDerivation rec { ··· 70 propagatedBuildInputs = lib.optionals stdenv.isDarwin [ xcbuild ]; 71 72 depsTargetTargetPropagated = lib.optionals stdenv.isDarwin [ Security Foundation ]; 73 74 hardeningDisable = [ "all" ]; 75 ··· 194 # {CC,CXX}_FOR_TARGET must be only set for cross compilation case as go expect those 195 # to be different from CC/CXX 196 CC_FOR_TARGET = 197 - if (stdenv.buildPlatform != stdenv.targetPlatform) then 198 "${targetCC}/bin/${targetCC.targetPrefix}cc" 199 else 200 null; 201 CXX_FOR_TARGET = 202 - if (stdenv.buildPlatform != stdenv.targetPlatform) then 203 "${targetCC}/bin/${targetCC.targetPrefix}c++" 204 else 205 null; ··· 223 224 export PATH=$(pwd)/bin:$PATH 225 226 - ${lib.optionalString (stdenv.buildPlatform != stdenv.targetPlatform) '' 227 # Independent from host/target, CC should produce code for the building system. 228 # We only set it when cross-compiling. 229 export CC=${buildPackages.stdenv.cc}/bin/cc
··· 18 , buildPackages 19 , pkgsBuildTarget 20 , callPackage 21 + , threadsCross ? null # for MinGW 22 }: 23 + 24 + # threadsCross is just for MinGW 25 + assert threadsCross != null -> stdenv.targetPlatform.isWindows; 26 27 let 28 go_bootstrap = buildPackages.callPackage ./bootstrap.nix { }; ··· 54 # We need a target compiler which is still runnable at build time, 55 # to handle the cross-building case where build != host == target 56 targetCC = pkgsBuildTarget.targetPackages.stdenv.cc; 57 + 58 + isCross = stdenv.buildPlatform != stdenv.targetPlatform; 59 in 60 61 stdenv.mkDerivation rec { ··· 76 propagatedBuildInputs = lib.optionals stdenv.isDarwin [ xcbuild ]; 77 78 depsTargetTargetPropagated = lib.optionals stdenv.isDarwin [ Security Foundation ]; 79 + 80 + depsBuildTarget = lib.optional isCross targetCC; 81 + 82 + depsTargetTarget = lib.optional (threadsCross != null) threadsCross; 83 84 hardeningDisable = [ "all" ]; 85 ··· 204 # {CC,CXX}_FOR_TARGET must be only set for cross compilation case as go expect those 205 # to be different from CC/CXX 206 CC_FOR_TARGET = 207 + if isCross then 208 "${targetCC}/bin/${targetCC.targetPrefix}cc" 209 else 210 null; 211 CXX_FOR_TARGET = 212 + if isCross then 213 "${targetCC}/bin/${targetCC.targetPrefix}c++" 214 else 215 null; ··· 233 234 export PATH=$(pwd)/bin:$PATH 235 236 + ${lib.optionalString isCross '' 237 # Independent from host/target, CC should produce code for the building system. 238 # We only set it when cross-compiling. 239 export CC=${buildPackages.stdenv.cc}/bin/cc
+13 -3
pkgs/development/compilers/go/1.18.nix
··· 18 , buildPackages 19 , pkgsBuildTarget 20 , callPackage 21 }: 22 23 let 24 go_bootstrap = buildPackages.callPackage ./bootstrap.nix { }; ··· 50 # We need a target compiler which is still runnable at build time, 51 # to handle the cross-building case where build != host == target 52 targetCC = pkgsBuildTarget.targetPackages.stdenv.cc; 53 in 54 55 stdenv.mkDerivation rec { ··· 70 propagatedBuildInputs = lib.optionals stdenv.isDarwin [ xcbuild ]; 71 72 depsTargetTargetPropagated = lib.optionals stdenv.isDarwin [ Security Foundation ]; 73 74 hardeningDisable = [ "all" ]; 75 ··· 188 # {CC,CXX}_FOR_TARGET must be only set for cross compilation case as go expect those 189 # to be different from CC/CXX 190 CC_FOR_TARGET = 191 - if (stdenv.buildPlatform != stdenv.targetPlatform) then 192 "${targetCC}/bin/${targetCC.targetPrefix}cc" 193 else 194 null; 195 CXX_FOR_TARGET = 196 - if (stdenv.buildPlatform != stdenv.targetPlatform) then 197 "${targetCC}/bin/${targetCC.targetPrefix}c++" 198 else 199 null; ··· 217 218 export PATH=$(pwd)/bin:$PATH 219 220 - ${lib.optionalString (stdenv.buildPlatform != stdenv.targetPlatform) '' 221 # Independent from host/target, CC should produce code for the building system. 222 # We only set it when cross-compiling. 223 export CC=${buildPackages.stdenv.cc}/bin/cc
··· 18 , buildPackages 19 , pkgsBuildTarget 20 , callPackage 21 + , threadsCross ? null # for MinGW 22 }: 23 + 24 + # threadsCross is just for MinGW 25 + assert threadsCross != null -> stdenv.targetPlatform.isWindows; 26 27 let 28 go_bootstrap = buildPackages.callPackage ./bootstrap.nix { }; ··· 54 # We need a target compiler which is still runnable at build time, 55 # to handle the cross-building case where build != host == target 56 targetCC = pkgsBuildTarget.targetPackages.stdenv.cc; 57 + 58 + isCross = stdenv.buildPlatform != stdenv.targetPlatform; 59 in 60 61 stdenv.mkDerivation rec { ··· 76 propagatedBuildInputs = lib.optionals stdenv.isDarwin [ xcbuild ]; 77 78 depsTargetTargetPropagated = lib.optionals stdenv.isDarwin [ Security Foundation ]; 79 + 80 + depsBuildTarget = lib.optional isCross targetCC; 81 + 82 + depsTargetTarget = lib.optional (threadsCross != null) threadsCross; 83 84 hardeningDisable = [ "all" ]; 85 ··· 198 # {CC,CXX}_FOR_TARGET must be only set for cross compilation case as go expect those 199 # to be different from CC/CXX 200 CC_FOR_TARGET = 201 + if isCross then 202 "${targetCC}/bin/${targetCC.targetPrefix}cc" 203 else 204 null; 205 CXX_FOR_TARGET = 206 + if isCross then 207 "${targetCC}/bin/${targetCC.targetPrefix}c++" 208 else 209 null; ··· 227 228 export PATH=$(pwd)/bin:$PATH 229 230 + ${lib.optionalString isCross '' 231 # Independent from host/target, CC should produce code for the building system. 232 # We only set it when cross-compiling. 233 export CC=${buildPackages.stdenv.cc}/bin/cc
+2
pkgs/os-specific/windows/default.nix
··· 37 stdenv = crossThreadsStdenv; 38 }; 39 40 pthreads = callPackage ./pthread-w32 { }; 41 42 wxMSW = callPackage ./wxMSW-2.8 { };
··· 37 stdenv = crossThreadsStdenv; 38 }; 39 40 + npiperelay = callPackage ./npiperelay { }; 41 + 42 pthreads = callPackage ./pthread-w32 { }; 43 44 wxMSW = callPackage ./wxMSW-2.8 { };
+23
pkgs/os-specific/windows/npiperelay/default.nix
···
··· 1 + { lib, buildGoModule, fetchFromGitHub }: 2 + 3 + buildGoModule rec { 4 + pname = "npiperelay"; 5 + version = "0.1.0"; 6 + 7 + src = fetchFromGitHub { 8 + owner = "jstarks"; 9 + repo = "npiperelay"; 10 + rev = "v${version}"; 11 + sha256 = "sha256-cg4aZmpTysc8m1euxIO2XPv8OMnBk1DwhFcuIFHF/1o="; 12 + }; 13 + 14 + vendorSha256 = null; 15 + 16 + meta = { 17 + description = "Access Windows named pipes from WSL"; 18 + homepage = "https://github.com/jstarks/npiperelay"; 19 + license = lib.licenses.mit; 20 + maintainers = [ lib.maintainers.shlevy ]; 21 + platforms = lib.platforms.windows; 22 + }; 23 + }