|
160 | 160 | in
|
161 | 161 | lib.genAttrs compilers (c: { compiler-nix-name = c; });
|
162 | 162 |
|
| 163 | + crossPlatforms = p: |
| 164 | + lib.optional (system == "x86_64-linux") p.musl64 ++ |
| 165 | + lib.optional |
| 166 | + (system == "x86_64-linux" && config.compiler-nix-name == "ghc966") |
| 167 | + p.aarch64-multiplatform-musl; |
| 168 | + |
163 | 169 | inputMap = {
|
164 | 170 | "https://chap.intersectmbo.org/" = inputs.CHaP;
|
165 | 171 | };
|
|
249 | 255 | packages.cardano-chain-gen.components.tests.cardano-chain-gen =
|
250 | 256 | postgresTest;
|
251 | 257 | })
|
| 258 | + |
| 259 | + ({ |
| 260 | + packages.double-conversion.ghcOptions = [ |
| 261 | + # stop putting U __gxx_personality_v0 into the library! |
| 262 | + "-optcxx-fno-rtti" |
| 263 | + "-optcxx-fno-exceptions" |
| 264 | + # stop putting U __cxa_guard_release into the library! |
| 265 | + "-optcxx-std=gnu++98" |
| 266 | + "-optcxx-fno-threadsafe-statics" |
| 267 | + ]; |
| 268 | + }) |
| 269 | + |
| 270 | + (lib.mkIf pkgs.haskell-nix.haskellLib.isCrossHost { |
| 271 | + packages.text-icu.patches = [ |
| 272 | + # Fix the following compilation error when cross-compiling: |
| 273 | + # |
| 274 | + # Char.hsc: In function ‘_hsc2hs_test45’: |
| 275 | + # Char.hsc:1227:20: error: storage size of ‘test_array’ isn’t constant |
| 276 | + # Char.hsc:1227:20: warning: unused variable ‘test_array’ [8;;https://gcc.gnu.org/onlinedocs/gcc/Warning-Options.html#index-Wunused-variable-Wunused-variable8;;] |
| 277 | + # compilation failed |
| 278 | + # |
| 279 | + # U_NO_NUMERIC_VALUE is defined to be `((double)-123456789.)` which gcc can't |
| 280 | + # figure out at compile time. |
| 281 | + # |
| 282 | + # More context: |
| 283 | + # |
| 284 | + # https://github.com/haskell/text-icu/issues/7 |
| 285 | + # https://gitlab.haskell.org/ghc/ghc/-/issues/7983 |
| 286 | + # https://gitlab.haskell.org/ghc/ghc/-/issues/12849 |
| 287 | + (builtins.toFile "text-icu.patch" '' |
| 288 | + diff --git c/Data/Text/ICU/Char.hsc i/Data/Text/ICU/Char.hsc |
| 289 | + index 6ea2b39..a0bf995 100644 |
| 290 | + --- c/Data/Text/ICU/Char.hsc |
| 291 | + +++ i/Data/Text/ICU/Char.hsc |
| 292 | + @@ -1223,7 +1223,7 @@ digitToInt c |
| 293 | + -- fractions, negative, or too large to fit in a fixed-width integral type. |
| 294 | + numericValue :: Char -> Maybe Double |
| 295 | + numericValue c |
| 296 | + - | v == (#const U_NO_NUMERIC_VALUE) = Nothing |
| 297 | + + | v == -123456789 = Nothing |
| 298 | + | otherwise = Just v |
| 299 | + where v = u_getNumericValue . fromIntegral . ord $ c |
| 300 | + '') |
| 301 | + ]; |
| 302 | + }) |
252 | 303 | ];
|
253 | 304 | })).appendOverlays [
|
254 | 305 | # Collect local package `exe`s
|
|
287 | 338 | shellcheck = callPackage shellCheck { inherit src; };
|
288 | 339 | };
|
289 | 340 |
|
290 |
| - flake = project.flake ( |
291 |
| - nixpkgs.lib.optionalAttrs (system == "x86_64-linux") { |
292 |
| - crossPlatforms = p: [p.musl64]; |
293 |
| - } |
294 |
| - ); |
| 341 | + flake = project.flake {}; |
295 | 342 | in with nixpkgs; lib.recursiveUpdate flake (
|
296 | 343 | let
|
297 | 344 | mkDist = platform: project:
|
|
0 commit comments