According to the Contract Law, the gift contract is unilateral, and the donor has the right to cancel it before the gift is implemented. However, there are exceptions, that is, donations involving public welfare cannot be revoked, generally including donations of a public welfare nature.
Donating books to the library should belong to the public welfare category, and the donor should not exercise the unilateral right to terminate the contract. The donor is bound by the contract, and should be liable for breach of contract if he fails to perform the gift obligation!