{ stdenv, fetchFromGitHub, runCommand, ncurses, gettext , pkgconfig, cscope, ruby, tcl, perl, luajit , darwin , usePython27 ? false , python27 ? null, python37 ? null }: let python = if usePython27 then { pkg = python27; name = "python"; } else { pkg = python37; name = "python3"; }; in assert python.pkg != null; let # Building requires a few system tools to be in PATH. # Some of these we could patch into the relevant source files (such as xcodebuild and # qlmanage) but some are used by Xcode itself and we have no choice but to put them in PATH. # Symlinking them in this way is better than just putting all of /usr/bin in there. buildSymlinks = runCommand "macvim-build-symlinks" {} '' mkdir -p $out/bin ln -s /usr/bin/xcrun /usr/bin/xcodebuild /usr/bin/tiffutil /usr/bin/qlmanage $out/bin ''; in stdenv.mkDerivation { pname = "macvim"; version = "8.1.2234"; src = fetchFromGitHub { owner = "macvim-dev"; repo = "macvim"; rev = "snapshot-161"; sha256 = "1hp3y85pj1icz053g627a1wp5pnwgxhk07pyd4arwcxs2103agw4"; }; enableParallelBuilding = true; nativeBuildInputs = [ pkgconfig buildSymlinks ]; buildInputs = [ gettext ncurses cscope luajit ruby tcl perl python.pkg ]; patches = [ ./macvim.patch ./macvim-sparkle.patch ]; # The sparkle patch modified the nibs, so we have to recompile them postPatch = '' for nib in MainMenu Preferences; do # redirect stdin/stdout/stderr to /dev/null because ibtool marks them nonblocking # and not redirecting screws with subsequent commands. # redirecting stderr is unfortunate but I don't know of a reasonable way to remove O_NONBLOCK # from the fds. /usr/bin/ibtool --compile src/MacVim/English.lproj/$nib.nib/keyedobjects.nib src/MacVim/English.lproj/$nib.nib >/dev/null 2>/dev/null