···1{ lib
2, stdenv
3, git
04, fetchurl
5, wrapGAppsHook
6, alsa-lib
···139 patchelf --set-interpreter "$(cat $NIX_CC/nix-support/dynamic-linker)" \
140 $opt/resources/app.asar.unpacked/node_modules/symbol-provider-ctags/vendor/ctags-linux
141142- '' + lib.optionalString (stdenv.hostPlatform.system == "x86_64-linux") ''
143 # Replace the bundled git with the one from nixpkgs
144 dugite=$opt/resources/app.asar.unpacked/node_modules/dugite
145 rm -f $dugite/git/bin/git
146 ln -s ${git}/bin/git $dugite/git/bin/git
147- rm -f $dugite/git/libexec/git-core/git
148- ln -s ${git}/bin/git $dugite/git/libexec/git-core/git
000001490000000000000000150 # We have to patch a prebuilt binary in the asar archive
151 # But asar complains because the node_gyp unpacked dependency uses a prebuilt Python3 itself
152···208 sourceProvenance = with sourceTypes; [ binaryNativeCode ];
209 license = licenses.mit;
210 platforms = platforms.linux;
211- maintainers = with maintainers; [ colamaroro bryango ];
212 knownVulnerabilities = [
213 "CVE-2023-5217"
214 "CVE-2022-21718"
···1{ lib
2, stdenv
3, git
4+, git-lfs
5, fetchurl
6, wrapGAppsHook
7, alsa-lib
···140 patchelf --set-interpreter "$(cat $NIX_CC/nix-support/dynamic-linker)" \
141 $opt/resources/app.asar.unpacked/node_modules/symbol-provider-ctags/vendor/ctags-linux
1420143 # Replace the bundled git with the one from nixpkgs
144 dugite=$opt/resources/app.asar.unpacked/node_modules/dugite
145 rm -f $dugite/git/bin/git
146 ln -s ${git}/bin/git $dugite/git/bin/git
147+148+ # Not only do we need to replace the git binary itself, we also need to replace
149+ # all the symlinks in dugite/git/libexec/git-core.
150+ for file in "$dugite/git/libexec/git-core"/*; do
151+ if [ -x "$file" ] && file "$file" | grep -q "ELF"; then
152+ # Remove ELF executable
153+ rm "$file"
154155+ # Get the corresponding filename in nixpkgs's git
156+ filename=$(basename "$file")
157+ git_executable="${git}/libexec/git-core/$filename"
158+159+ # Create symlink to $git_executable
160+ ln -s "$git_executable" "$file"
161+162+ echo "Replaced $file with symlink to $git_executable"
163+ fi
164+ done
165+166+ # Was symlinked in previous loop, but actually, nixpkgs has a separate package for git-lfs
167+ # Unlink to avoid a "File exists" error and relink correctly
168+ unlink $dugite/git/libexec/git-core/git-lfs
169+ ln -s ${git-lfs}/bin/git-lfs $dugite/git/libexec/git-core/git-lfs
170+ '' + lib.optionalString (stdenv.hostPlatform.system == "x86_64-linux") ''
171 # We have to patch a prebuilt binary in the asar archive
172 # But asar complains because the node_gyp unpacked dependency uses a prebuilt Python3 itself
173···229 sourceProvenance = with sourceTypes; [ binaryNativeCode ];
230 license = licenses.mit;
231 platforms = platforms.linux;
232+ maintainers = with maintainers; [ bryango ];
233 knownVulnerabilities = [
234 "CVE-2023-5217"
235 "CVE-2022-21718"