| Tim Windelschmidt | 98000a5 | 2025-03-06 14:22:15 +0100 | [diff] [blame] | 1 | { pkgs }: with pkgs; |
| 2 | if (!stdenv.hostPlatform.isStatic) then perl else |
| 3 | perl.overrideAttrs (old: { |
| 4 | patches = old.patches ++ [ |
| 5 | ./static_build.patch |
| 6 | ]; |
| 7 | |
| 8 | preConfigure = old.preConfigure + '' |
| 9 | cat >> config.over <<EOF |
| 10 | osvers="musllinux" |
| 11 | EOF |
| 12 | ''; |
| 13 | |
| 14 | configureFlags = old.configureFlags ++ [ |
| 15 | "-Dotherlibdirs=.../../lib/perl5/${old.version}" # Tell perl to use a relative libdir |
| 16 | # 1. Why isn't this the default? |
| 17 | # 2. Apparently nobody uses this option, because it is missing the quotes inside the config_h.SH |
| 18 | # 3. Why should a variable called "procselfexe" be used with a different path than /proc/self/exe? |
| 19 | # 4. I really dislike perl. - fionera |
| 20 | "-Dprocselfexe=\"/proc/self/exe\"" |
| 21 | ]; |
| 22 | |
| 23 | env.NIX_CFLAGS_COMPILE = (old.NIX_CFLAGS_COMPILE or "") + " -Wno-error=implicit-function-declaration"; |
| 24 | }) |