|
46 | 46 | # target the same way nixpkgs does for isStatic platforms. |
47 | 47 | static-liburing = final.liburing.overrideAttrs (old: { |
48 | 48 | dontdisableStatic = true; |
| 49 | + # Workaround for macOS builders: recreate man page symlinks that may be lost |
| 50 | + # during cross-compilation from Darwin to Linux |
| 51 | + preInstall = (old.preInstall or "") + '' |
| 52 | + echo "=== LIBURING PREINSTALL DEBUG ===" |
| 53 | + echo "PWD: $(pwd)" |
| 54 | + echo "Checking man directory contents BEFORE fix:" |
| 55 | + ls -la man/ | grep -E "(IO_URING|io_uring).*VERSION" || echo "No VERSION-related files found" |
| 56 | +
|
| 57 | + echo "Checking if symlink TARGET exists:" |
| 58 | + ls -la man/io_uring_check_version.3 || echo " ✗ TARGET FILE io_uring_check_version.3 DOES NOT EXIST!" |
| 59 | +
|
| 60 | + echo "Listing ALL man/*check_version* files:" |
| 61 | + ls -la man/*check_version* 2>&1 || echo "None found" |
| 62 | +
|
| 63 | + echo "Searching for check_version in all of man/:" |
| 64 | + find man/ -name "*check_version*" -ls || echo "None found" |
| 65 | +
|
| 66 | + # Fix case-hack filenames that Nix creates on case-insensitive filesystems (macOS) |
| 67 | + echo "Renaming case-hacked files back to original names..." |
| 68 | + for f in man/*~nix~case~hack~*; do |
| 69 | + if [ -f "$f" ]; then |
| 70 | + original="''${f%~nix~case~hack~*}" |
| 71 | + echo " Renaming $f -> $original" |
| 72 | + mv "$f" "$original" |
| 73 | + fi |
| 74 | + done |
| 75 | +
|
| 76 | + # Always recreate uppercase symlinks to ensure they exist for install phase |
| 77 | + # (lowercase versions are real files, not symlinks) |
| 78 | + echo "Creating/recreating man page symlinks..." |
| 79 | + ln -sf io_uring_check_version.3 man/IO_URING_CHECK_VERSION.3 |
| 80 | + ln -sf io_uring_check_version.3 man/IO_URING_VERSION_MAJOR.3 |
| 81 | + ln -sf io_uring_check_version.3 man/IO_URING_VERSION_MINOR.3 |
| 82 | +
|
| 83 | + echo "Checking man directory contents AFTER fix:" |
| 84 | + ls -la man/ | grep -E "(IO_URING|io_uring).*VERSION" |
| 85 | +
|
| 86 | + echo "Testing glob expansion of man/*.3:" |
| 87 | + ls man/*.3 | wc -l |
| 88 | + echo "Testing stat of specific failing files:" |
| 89 | + stat man/IO_URING_CHECK_VERSION.3 && echo " ✓ IO_URING_CHECK_VERSION.3 exists" || echo " ✗ IO_URING_CHECK_VERSION.3 missing" |
| 90 | + stat man/IO_URING_VERSION_MAJOR.3 && echo " ✓ IO_URING_VERSION_MAJOR.3 exists" || echo " ✗ IO_URING_VERSION_MAJOR.3 missing" |
| 91 | + stat man/io_uring_major_version.3 && echo " ✓ io_uring_major_version.3 exists" || echo " ✗ io_uring_major_version.3 missing" |
| 92 | +
|
| 93 | + echo "Testing actual install command to /tmp:" |
| 94 | + mkdir -p /tmp/liburing-install-test |
| 95 | + if install -m 644 man/*.3 /tmp/liburing-install-test/; then |
| 96 | + echo " ✓ Install command succeeded! Installed $(ls /tmp/liburing-install-test/*.3 | wc -l) files" |
| 97 | + rm -rf /tmp/liburing-install-test |
| 98 | + else |
| 99 | + echo " ✗ Install command FAILED with exit code $?" |
| 100 | + rm -rf /tmp/liburing-install-test |
| 101 | + exit 1 |
| 102 | + fi |
| 103 | + echo "=== END LIBURING PREINSTALL DEBUG ===" |
| 104 | + ''; |
| 105 | + |
49 | 106 | postInstall = '' |
50 | 107 | # Always builds both static and dynamic libraries, so we need to remove the |
51 | 108 | # dynamic libraries. |
|
0 commit comments