For IRA purposes, taxable income and qualifying compensation are different tests. The IRS generally defines compensation as earnings from working, including wages and self-employment income. Pension and annuity income are excluded. Receiving retirement benefits therefore does not, by itself, establish that you meet the compensation requirement.
If you file a joint return, you may be able to contribute even without compensation of your own when your spouse has it. Each spouse has a separate IRA and an individual annual limit, and combined contributions cannot exceed the joint return’s taxable compensation. Roth contributions also depend on modified adjusted gross income and filing status. Check those limits separately from the compensation rule.
Primary sources
Retirement Topics — IRA Contribution Limits
IRS Topic 309 — Roth IRA contributions
IRS Publication 590-A — operative compensation definitions and exclusions