An interesting approach is the dual GPL and commercial license. This is used for example by the CGAL geometry library [1]. In this case, a user of the library has the choice of either paying for the library, or open sourcing the code of their software.
[1]: https://doc.cgal.org/latest/Manual/license.html