On the nonlocal Cahn-Hilliard-Brinkman and Cahn-Hilliard-Hele-Shaw systems