Sense of "freethinker" is first recorded 1560s, from French libertin (1540s) originally the name given to certain pantheistic Protestant sects in France and the Low Countries. This sense partakes more of liberty and liberal than of the classical meaning (in Old French, libertin meant "Saracen slave converted to Christianity"). Meaning "dissolute or licentious person, man given to indulgence of lust" is first recorded 1590s; the darkening of meaning being perhaps due to misunderstanding of Latin libertinus in Acts vi:9. For "condition of being a libertine" 17c English tried libertinage; libertinism (from French libertinisme).
"debauchee, libertine; idle, dissolute person; one who goes about in search of vicious pleasure," 1650s, shortening of rakehell. Hogarth's "Rake's Progress" engravings were published in 1735. Generally of men but also used by 1712 of women of similar character.
1706, of persons, also style or appearance, carriage, etc., "debauched, disreputable, having the manners or appearance of a libertine or idle and dissolute person," from rake (n.2) + -ish. Related: Rakishly; rakishness.
The meaning "smart, jaunty, dashing" (1824), at first of ships, is said to be a different word, from nautical rake "slant, slope" (1620s), used of the projection of the upper part of a ship's hull at stem and stern beyond the extremities of the keel, later especially in reference to any deviation from the vertical in a ship's masts. That word is of uncertain origin, perhaps from Scandinavian (compare Old Swedish raka "project, reach;" Danish rage "protrude, project") related to Old English reccan "stretch." "The piratical craft of former times were distinguished for their rakish build" [Century Dictionary].