Today I had to modify the evince in my ubuntu. So here are the steeps:
1- download source: apt-get source evince
2- download dependences: sudo apt-get build-dep evince
3- edit code.
5-generate the .deb: dpkg-buildpackage -rfakeroot -uc -b
6- re-install the application: sudo dpkg -i evince_3.18.2-1ubuntu4_amd64.deb
It will work for any application, i think. Nice and Fun =)