@@ -2,46 +2,61 @@ package("fltk")
22 set_homepage (" https://www.fltk.org" )
33 set_description (" Fast Light Toolkit" )
44
5- add_urls (" https://www.fltk.org/pub/fltk/$(version)/fltk-$(version)-source.tar.bz2" , {alias = " home" })
6- add_urls (" https://github.com/fltk/fltk/archive/refs/tags/release-$(version).tar.gz" , {alias = " github" })
7- add_urls (" https://github.com/fltk/fltk.git" )
5+ add_urls (" https://github.com/fltk/fltk/archive/refs/tags/release-$(version).tar.gz" , {alias = " archive" })
6+ add_urls (" https://github.com/fltk/fltk.git" , {alias = " github" })
87
9- add_versions (" home:1.3.9" , " 103441134915402808fd45424d4061778609437e804334434e946cfd26b196c2" )
10- add_versions (" github:1.3.9" , " f30661851a61f1931eaaceb9ef4005584c85cb07fd7ffc38a645172b8e4eb3df" )
8+ add_versions (" archive:1.4.3" , " 6a11c0bf91b7b193a87a1928c32a953f36d7dd4b65fef3e9d0c40a51882f97a6" )
9+ add_versions (" archive:1.3.9" , " f30661851a61f1931eaaceb9ef4005584c85cb07fd7ffc38a645172b8e4eb3df" )
10+
11+ add_versions (" github:1.4.3" , " release-1.4.3" )
12+ add_versions (" github:1.3.9" , " release-1.3.9" )
1113
1214 add_patches (" 1.3.9" , " patches/1.3.9/cmake-fluid.patch" , " 06ee1e82a74651a0b4ba4b386e5e5436d8b95584330d02a8a2c53351210a9127" )
1315
1416 if is_plat (" linux" ) then
15- add_configs (" pango" , {description = " Use pango for font support" , default = false , type = " boolean" })
17+ add_configs (" pango" , {description = " Use pango for font support (required if Wayland is enabled) " , default = false , type = " boolean" })
1618 add_configs (" xft" , {description = " Use libXft for font support" , default = false , type = " boolean" })
1719 end
20+ if is_plat (" linux" , " bsd" , " cross" ) then
21+ add_configs (" x11" , {description = " Use X11" , default = true , type = " boolean" })
22+ add_configs (" wayland" , {description = " Support the Wayland backend" , default = true , type = " boolean" })
23+ end
1824 add_configs (" fluid" , {description = " Build fluid" , default = false , type = " boolean" })
1925 add_configs (" forms" , {description = " Build forms" , default = false , type = " boolean" })
2026
2127 if is_plat (" windows" , " mingw" ) then
2228 add_syslinks (" ws2_32" , " comctl32" , " gdi32" , " oleaut32" , " ole32" , " uuid" , " shell32" , " advapi32" , " comdlg32" , " winspool" , " user32" , " kernel32" , " odbc32" )
23- elseif is_plat (" macosx" ) then
29+ elseif is_plat (" macosx" ) then
2430 add_frameworks (" Cocoa" )
2531 elseif is_plat (" android" ) then
2632 add_syslinks (" android" )
2733 add_syslinks (" dl" )
2834 elseif is_plat (" linux" ) then
2935 add_syslinks (" dl" , " pthread" )
30- add_deps (" libx11 " , " libxext " , " libxinerama " , " libxcursor " , " libxrender " , " libxfixes " , " fontconfig" )
36+ add_deps (" fontconfig" )
3137 end
3238
3339 add_deps (" cmake" )
3440 add_deps (" zlib" , " libpng" , " libjpeg" )
3541
3642 on_load (function (package )
43+ if package :is_plat (" linux" , " bsd" , " cross" ) then
44+ if package :config (" x11" ) then
45+ package :add (" deps" , " libx11" , " libxext" , " libxinerama" , " libxcursor" , " libxrender" , " libxfixes" )
46+ end
47+ if package :config (" wayland" ) then
48+ package :add (" deps" , " wayland" , " wayland-protocols" , " dbus" , " libxkbcommon" , " libdecor" )
49+ package :config_set (" pango" , true )
50+ end
51+ end
3752 if package :is_plat (" linux" ) then
3853 if package :version () and package :version ():eq (" 1.3.9" ) then
3954 assert (not package :config (" fluid" ), " package(fltk/1.3.9): Unsupported fluid on linux" )
4055 end
41- if package :config (" pango" ) then
42- package :add (" deps" , " pango-1.0 " , " pangoxft-1.0 " , " gobject-2.0 " , " cairo " , " pangocairo-1.0 " )
56+ if package :config (" pango" ) then
57+ package :add (" deps" , " pango" )
4358 end
44- if package :config (" xft" ) then
59+ if package :config (" xft" ) then
4560 package :add (" deps" , " libxft" )
4661 end
4762 end
@@ -57,16 +72,28 @@ package("fltk")
5772 " -DFLTK_BUILD_EXAMPLES=OFF" ,
5873 " -DOPTION_USE_SYSTEM_LIBPNG=ON" ,
5974 " -DOPTION_USE_SYSTEM_ZLIB=ON" ,
60- " -DOPTION_USE_SYSTEM_LIBJPEG=ON"
75+ " -DOPTION_USE_SYSTEM_LIBJPEG=ON" ,
76+ -- FLTK 1.4.x uses different CMake option names
77+ " -DFLTK_USE_SYSTEM_LIBPNG=ON" ,
78+ " -DFLTK_USE_SYSTEM_ZLIB=ON" ,
79+ " -DFLTK_USE_SYSTEM_LIBJPEG=ON" ,
80+ " -DFLTK_USE_SYSTEM_LIBDECOR=ON" ,
6181 }
6282 table.insert (configs , " -DCMAKE_BUILD_TYPE=" .. (package :is_debug () and " Debug" or " Release" ))
6383 table.insert (configs , " -DOPTION_BUILD_SHARED_LIBS=" .. (package :config (" shared" ) and " ON" or " OFF" ))
84+ table.insert (configs , " -DFLTK_BUILD_SHARED_LIBS=" .. (package :config (" shared" ) and " ON" or " OFF" ))
6485 table.insert (configs , " -DFLTK_MSVC_RUNTIME_DLL=" .. (package :has_runtime (" MD" ) and " ON" or " OFF" ))
6586 table.insert (configs , " -DFLTK_BUILD_FLUID=" .. (package :config (" fluid" ) and " ON" or " OFF" ))
6687 table.insert (configs , " -DFLTK_BUILD_FORMS=" .. (package :config (" forms" ) and " ON" or " OFF" ))
6788 if package :is_plat (" linux" ) then
6889 table.insert (configs , " -DOPTION_USE_PANGO=" .. (package :config (" pango" ) and " ON" or " OFF" ))
90+ table.insert (configs , " -DFLTK_USE_PANGO=" .. (package :config (" pango" ) and " ON" or " OFF" ))
6991 table.insert (configs , " -DOPTION_USE_XFT=" .. (package :config (" xft" ) and " ON" or " OFF" ))
92+ table.insert (configs , " -DFLTK_USE_XFT=" .. (package :config (" xft" ) and " ON" or " OFF" ))
93+ end
94+ if package :is_plat (" linux" , " bsd" , " cross" ) then
95+ table.insert (configs , " -DFLTK_BACKEND_X11=" .. (package :config (" x11" ) and " ON" or " OFF" ))
96+ table.insert (configs , " -DFLTK_BACKEND_WAYLAND=" .. (package :config (" wayland" ) and " ON" or " OFF" ))
7097 end
7198 import (" package.tools.cmake" ).install (package , configs )
7299 end )
0 commit comments