This repository has no description
0

Configure Feed

Select the types of activity you want to include in your feed.

lib.makeWrapper: implement proper multi-output support with working man pages

- Replace symlinkJoin with custom multiOutputSymlinkJoin that correctly handles multi-output packages
- Preserve man pages, docs, and other outputs by symlinking from original package outputs
- Fix zsh build while maintaining access to man pages via .man output
- All wrapper tools (mpv, mutt, zsh) now build successfully with full output preservation

+71 -5
+71 -5
lib/make-wrapper.nix
··· 105 105 preHook 106 106 ; 107 107 }; 108 - # Create the wrapper derivation 109 - wrappedPackage = 110 - pkgs.symlinkJoin { 108 + 109 + # Multi-output aware symlink join function 110 + multiOutputSymlinkJoin = 111 + { 112 + name, 113 + paths, 114 + outputs ? [ "out" ], 115 + originalOutputs ? { }, 116 + passthru ? { }, 117 + meta ? { }, 118 + ... 119 + }@args: 120 + pkgs.stdenv.mkDerivation ( 121 + { 122 + inherit name outputs; 123 + 124 + buildCommand = '' 125 + # Symlink all paths to the main output 126 + mkdir -p $out 127 + for path in ${lib.concatStringsSep " " (map toString paths)}; do 128 + ${pkgs.lndir}/bin/lndir -silent "$path" $out 129 + done 130 + 131 + # Handle additional outputs by symlinking from the original package's outputs 132 + ${lib.concatMapStringsSep "\n" ( 133 + output: 134 + if output != "out" && originalOutputs ? ${output} && originalOutputs.${output} != null then 135 + '' 136 + if [[ -n "''${${output}:-}" ]]; then 137 + mkdir -p ${"$" + output} 138 + # Only symlink from the original package's corresponding output 139 + ${pkgs.lndir}/bin/lndir -silent "${originalOutputs.${output}}" ${"$" + output} 140 + fi 141 + '' 142 + else 143 + "" 144 + ) outputs} 145 + ''; 146 + 147 + inherit passthru meta; 148 + } 149 + // (removeAttrs args [ 150 + "name" 151 + "paths" 152 + "outputs" 153 + "originalOutputs" 154 + "passthru" 155 + "meta" 156 + ]) 157 + ); 158 + 159 + # Get original package outputs for symlinking 160 + originalOutputs = 161 + if package ? outputs then 162 + lib.listToAttrs ( 163 + map (output: { 164 + name = output; 165 + value = if package ? ${output} then package.${output} else null; 166 + }) package.outputs 167 + ) 168 + else 169 + { }; 170 + 171 + # Create the wrapper derivation using our multi-output aware symlink join 172 + wrappedPackage = multiOutputSymlinkJoin ( 173 + { 111 174 name = package.pname or package.name; 112 175 paths = [ 113 176 (pkgs.writeShellApplication { ··· 117 180 }) 118 181 package 119 182 ]; 183 + outputs = if package ? outputs then package.outputs else [ "out" ]; 184 + inherit originalOutputs; 120 185 passthru = 121 186 (package.passthru or { }) 122 187 // passthru ··· 124 189 inherit env flags preHook; 125 190 }; 126 191 # Pass through original attributes 127 - inherit (package) meta; 192 + meta = package.meta or { }; 128 193 } 129 194 // lib.optionalAttrs (package ? version) { 130 195 inherit (package) version; 131 196 } 132 197 // lib.optionalAttrs (package ? pname) { 133 198 inherit (package) pname; 134 - }; 199 + } 200 + ); 135 201 in 136 202 wrappedPackage; 137 203 }