The Hebrew book of Hosea warns: “Those who sow the wind will reap the whirlwind.” So it is with the GOP and race.

True, after Charlottesville a few Republicans criticized President Trump for mainstreaming bigotry. But they decorously ignored their party’s 50-year history of cosseting racism for electoral gain.

After the civil rights legislation of 1964, the party scurried to defend “states’ rights” and “local control,” triggering a mass migration of Southern whites to the GOP. They had not suddenly discovered the virtues of a party Southerners had despised since the Civil War. Rather, like the war itself, this historic turning point turned on race.

It transformed voting patterns — and Republicanism. The party embraced the white supremacist Strom Thurmond. Its “Southern strategy” elected Richard Nixon, who nationalized appeals to racial anxiety by embracing “law and order.” So, too, Ronald Reagan, who cynically opened his 1980 campaign in an otherwise obscure Mississippi hamlet where, 16 years before, white racists had brutally murdered three civil-rights workers.

As president, Reagan deployed showy denunciations of overt racists like the Klan to cover policies embraced by opponents of racial progress. Witness the work of John Roberts in Reagan’s Justice Department.

Relentlessly, Roberts advanced Reagan’s goals. He opposed “race-conscious remedies” which, in his view, resulted in “reverse discrimination” against whites. He encouraged measures to advance “our anti-busing and anti-quota principles.” He opposed broadening the Voting Rights Act of 1965 to facilitate the election of minority officeholders. He asserted that affirmative action meant “the recruiting of inadequately prepared candidates.” He consistently decried measures to counteract de facto segregation.

All this became essential to the warp and weft of the GOP’s electoral strategy. Decades later, as chief justice, Roberts advanced another key Republican objective: repressing minority voting.

In the South and elsewhere, minority voters threatened the GOP’s electoral edge. Its solution was voter ID laws that affected minorities too poor or preoccupied with economic survival to obtain the documents required. There was — and is — no statistically significant evidence of fraud to warrant these laws. Their aim was clear: to preclude voters likely to support Democrats.

Under the Voting Rights Act, Southern states were required to get preclearance for changes in voter laws from the Justice Department. In a 5-4 Supreme Court decision, Roberts held that racial progress in the South rendered preclearance unnecessary. But 30 years before the history he supposedly relied on, Roberts had opposed preclearance as a Justice Department lawyer. Then, as later, the purpose of those laws was political — and racial.

The GOP had conjured the demons of bias, and could not break the spell. Our long and painful grappling with race had divided the two parties: the GOP now depended on whites who, for whatever reason, resented blacks.

Trump did not invent this history. Rather, with amoral shrewdness, he perceived that racial animus could propel his rise.

He began with the birther movement against Barack Obama. An avid audience awaited him within the white working-class base of the Republican Party. Even now, a significant minority of Republican voters believe our first black president was born in Kenya.

In reaction, prominent Republican leaders encouraged the birther movement — Newt Gingrich, Mike Huckabee, Sarah Palin, Michele Bachmann, and Senators Richard Shelby and Roy Blunt. Others, from cynicism or cowardice, disclaimed knowledge of Obama’s birthplace. In essence, they ratified Trump’s appeal to racism.

And racist it was, as these eminences well knew. When Trump turned birtherism on the Canadian-born Ted Cruz, it flatlined among Republican voters. Quite simply, Cruz is white.

Thus enlightened about his adopted party, Trump blatantly appealed, as its candidate, to racial fears. He claimed that minorities were committing massive voter fraud, distorted crime statistics in black inner cities, encouraged violence against black demonstrators, casually endorsed police brutality, and spiced his rallies with speakers hostile to African-Americans. His campaign strategist Steve Bannon targeted the alienated youth of the alt-right, a fount of overt bigotry. For any Republican leader not insensate, Charlottesville should have been no surprise.

Instead, it is the culmination of a sad and simple truth: Long ago, the GOP became addicted to racism and lacked the will to wean itself. Among too many Republican officeholders, Trump’s offense is against decorum. Their GOP is the home of bigots and bigotry, all dressed up for a garden party, smiling benignly at the help.

But the party’s future may be less genteel. For Trump, nothing matters but the passion of his base. The whirlwind comes nearer.

Richard North Patterson’s column appears regularly in the Boston Globe. His latest book is “Fever Swamp.’’ Follow him on Twitter @RicPatterson.