Remove unnecessary packages from derivation and use patches to fix build.bash instead of sed commands.