  Background: Low-energy transfer reactions in which a proton is stripped from
a deuteron projectile and dropped into a target play a crucial role in the
formation of nuclei in both primordial and stellar nucleosynthesis, as well as
in the study of exotic nuclei using radioactive beam facilities and inverse
kinematics. Ab initio approaches have been successfully applied to describe the
$^3$H$(d,n)^4$He and $^3$He$(d,p)^4$He fusion processes.
  Purpose: An ab initio treatment of transfer reactions would also be desirable
for heavier targets. In this work, we extend the ab initio description of
$(d,p)$ reactions to processes with light $p$-shell nuclei. As a first
application, we study the elastic scattering of deuterium on $^7$Li and the
${}^{7}$Li($d$,$p$)${}^{8}$Li transfer reaction based on a two-body
Hamiltonian.
  Methods: We use the no-core shell model to compute the wave functions of the
nuclei involved in the reaction, and describe the dynamics between targets and
projectiles with the help of microscopic-cluster states in the spirit of the
resonating group method.
  Results: The shape of the excitation functions for deuteron impinging on
${}^{7}$Li are qualitatively reproduced up to the deuteron breakup energy. The
interplay between $d$-$^7$Li and $p$-$^8$Li particle-decay channels determines
some features of the ${}^{9}$Be spectrum above the $d$+${}^{7}$Li threshold.
Our prediction for the parity of the 17.298 MeV resonance is at odds with the
experimental assignment
  Conclusions: Deuteron stripping reactions with $p$-shell targets can now be
computed ab initio, but calculations are very demanding. A quantitative
description of the ${}^{7}$Li($d$,$p$)${}^{8}$Li reaction will require further
work to include the effect of three-nucleon forces and additional decay
channels, and improve the convergence rate of our calculations.
