For years, we had an Ikea Pax Armoire with glass sliding doors. We used it as a closet, as a dining room storage unit and then again as a closet.
In our most recent move, our bedroom size did not allow for the armoire to be set up in the side by side configuration that allowed for the glass sliding doors. So we bought new doors for the closet and repurposed the Pax glass doors as barn doors for our two bedrooms. This was achieved by drilling holes in the top of the door frames and screwing large bolts into the holes. Then the bolts were pushed through the track in the barn door hardware (purchased from King Architectural Metals for about $150 for two sets) and secured with a hardware nut. Voila! Barn doors.
Note that the barn door track came longer than we needed so we cut it to size. Also, please disregard the trim that has not been repaired above the door frame. That is a project for another day.