|
61 | 61 | # macOS builders via Rosetta, where Determinate Nix's sandbox |
62 | 62 | # behaves differently from Linux. |
63 | 63 | mingw = (final: prev: prev.lib.optionalAttrs prev.stdenv.hostPlatform.isWindows { |
64 | | - # tzdata tarballs extract into '.' (sourceRoot="."). On macOS |
65 | | - # builders with Determinate Nix, the sandbox places a read-only |
66 | | - # builder.json in the build directory. stdenv's genericBuild |
67 | | - # unconditionally runs `chmod +x $sourceRoot` after unpackPhase |
68 | | - # (to ensure cd works), which fails on '.' because the sandbox |
69 | | - # prevents permission changes on the build dir. Fix: extract |
70 | | - # into a subdirectory so sourceRoot != '.'. |
| 64 | + # tzdata tarballs extract into '.' (no subdirectory). stdenv's |
| 65 | + # unpackPhase runs `chmod -R u+w "$sourceRoot"` BEFORE postUnpack, |
| 66 | + # so setting sourceRoot="tzdata-src" with a postUnpack to create |
| 67 | + # the directory fails (chmod runs on nonexistent dir). Fix: skip |
| 68 | + # the automatic chmod and handle it manually in postUnpack. |
71 | 69 | tzdata = prev.tzdata.overrideAttrs (_: { |
72 | 70 | sourceRoot = "tzdata-src"; |
| 71 | + dontMakeSourcesWritable = true; |
73 | 72 | postUnpack = '' |
74 | 73 | mkdir -p tzdata-src |
75 | | - # Move everything except builder.json into subdirectory |
76 | 74 | for f in *; do |
77 | 75 | case "$f" in |
78 | 76 | tzdata-src|builder.json|env-vars) ;; |
79 | 77 | *) mv "$f" tzdata-src/ ;; |
80 | 78 | esac |
81 | 79 | done |
| 80 | + chmod -R u+w tzdata-src |
82 | 81 | ''; |
83 | 82 | }); |
84 | 83 |
|
|
106 | 105 | (prev.lib.cmakeBool "ENABLE_LIB_ONLY" true) |
107 | 106 | ]; |
108 | 107 | }); |
| 108 | + |
| 109 | + # ngtcp2 examples include POSIX-only headers (sys/socket.h, |
| 110 | + # sys/un.h) that don't exist on Windows. The library itself |
| 111 | + # builds fine; only the example client/server programs fail. |
| 112 | + ngtcp2 = prev.ngtcp2.overrideAttrs (old: { |
| 113 | + cmakeFlags = (old.cmakeFlags or []) ++ [ |
| 114 | + (prev.lib.cmakeBool "ENABLE_EXAMPLES" false) |
| 115 | + ]; |
| 116 | + }); |
109 | 117 | }); |
110 | 118 |
|
111 | 119 | musl = (final: prev: prev.lib.optionalAttrs prev.stdenv.hostPlatform.isMusl { |
|
0 commit comments