···11{ lib
22, stdenv
33, git
44+, git-lfs
45, fetchurl
56, wrapGAppsHook
67, alsa-lib
···139140 patchelf --set-interpreter "$(cat $NIX_CC/nix-support/dynamic-linker)" \
140141 $opt/resources/app.asar.unpacked/node_modules/symbol-provider-ctags/vendor/ctags-linux
141142142142- '' + lib.optionalString (stdenv.hostPlatform.system == "x86_64-linux") ''
143143 # Replace the bundled git with the one from nixpkgs
144144 dugite=$opt/resources/app.asar.unpacked/node_modules/dugite
145145 rm -f $dugite/git/bin/git
146146 ln -s ${git}/bin/git $dugite/git/bin/git
147147- rm -f $dugite/git/libexec/git-core/git
148148- ln -s ${git}/bin/git $dugite/git/libexec/git-core/git
147147+148148+ # Not only do we need to replace the git binary itself, we also need to replace
149149+ # all the symlinks in dugite/git/libexec/git-core.
150150+ for file in "$dugite/git/libexec/git-core"/*; do
151151+ if [ -x "$file" ] && file "$file" | grep -q "ELF"; then
152152+ # Remove ELF executable
153153+ rm "$file"
149154155155+ # Get the corresponding filename in nixpkgs's git
156156+ filename=$(basename "$file")
157157+ git_executable="${git}/libexec/git-core/$filename"
158158+159159+ # Create symlink to $git_executable
160160+ ln -s "$git_executable" "$file"
161161+162162+ echo "Replaced $file with symlink to $git_executable"
163163+ fi
164164+ done
165165+166166+ # Was symlinked in previous loop, but actually, nixpkgs has a separate package for git-lfs
167167+ # Unlink to avoid a "File exists" error and relink correctly
168168+ unlink $dugite/git/libexec/git-core/git-lfs
169169+ ln -s ${git-lfs}/bin/git-lfs $dugite/git/libexec/git-core/git-lfs
170170+ '' + lib.optionalString (stdenv.hostPlatform.system == "x86_64-linux") ''
150171 # We have to patch a prebuilt binary in the asar archive
151172 # But asar complains because the node_gyp unpacked dependency uses a prebuilt Python3 itself
152173···208229 sourceProvenance = with sourceTypes; [ binaryNativeCode ];
209230 license = licenses.mit;
210231 platforms = platforms.linux;
211211- maintainers = with maintainers; [ colamaroro bryango ];
232232+ maintainers = with maintainers; [ bryango ];
212233 knownVulnerabilities = [
213234 "CVE-2023-5217"
214235 "CVE-2022-21718"