Gauging categorical symmetries