1840, "exaggerated, blind nationalism; patriotism degenerated into a vice," from French chauvinisme (1839), from the character Nicholas Chauvin, soldier of Napoleon's Grand Armee, who idolized Napoleon and the Empire long after it was history, in the Cogniards' popular 1831 vaudeville "La Cocarde Tricolore." Meaning extended to "excessive belief in the superiority of one's race" late 19c. in communist jargon, to (male) "sexism" late 1960s via male chauvinism (q.v.).
The name is a French form of Latin Calvinus and thus Calvinism and chauvinism are, etymologically, twins. The name was a common one in Napoleon's army, and if there was a real person at the base of the character in the play, he has not been certainly identified by etymologists, though memoirs of Waterloo (one published in Paris in 1822) mention "one of our principal piqueurs, named Chauvin, who had returned with Napoleon from Elba," which implies loyalty.