rrdtool: use stdenv to support custom perl and ruby

Closes #19018.