-
-
Notifications
You must be signed in to change notification settings - Fork 500
freerdp: add package #6933
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
freerdp: add package #6933
Changes from all commits
Commits
Show all changes
20 commits
Select commit
Hold shift + click to select a range
e1a86d1
freerdp: add package
star-hengxing 9314a4a
fix x11
star-hengxing 65db5a5
fix windows
star-hengxing 6b36325
fix windows syslinks
star-hengxing f4b36dc
disable iphoneos
star-hengxing 51b68f7
fix mingw
star-hengxing ba108cf
fix mingw
star-hengxing 7174e1d
Fix mingw like `https://github.com/msys2/MINGW-packages/pull/1845/com…
luadebug fc5c834
Try limit SIMD for mingw@macosx i386
luadebug 32eaa91
Update xmake.lua
luadebug f7fe337
Try rely over existing export
luadebug 271aaaa
Pass `ntdll`
luadebug 33ac45b
Pass `uuid`
luadebug 54ebec2
Update xmake.lua
luadebug 8432056
Update xmake.lua
luadebug b411b1e
Merge branch 'dev' into freerdp
star-hengxing 90f4195
clean code
star-hengxing 500dbd6
fix libusb with eudev
star-hengxing 64a0eab
fix macos frameworks
star-hengxing 47e6ad7
fix fuse
star-hengxing File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,187 @@ | ||
| package("freerdp") | ||
| set_homepage("http://www.freerdp.com") | ||
| set_description("FreeRDP is a free remote desktop protocol library and clients ") | ||
| set_license("Apache-2.0") | ||
|
|
||
| add_urls("https://github.com/FreeRDP/FreeRDP/releases/download/$(version)/freerdp-$(version).tar.gz", | ||
| "https://github.com/FreeRDP/FreeRDP.git") | ||
|
|
||
| add_versions("3.15.0", "e8cd58decef4c970faea2fbea675970eea60e440ebe8033c54889acb83787371") | ||
|
|
||
| add_configs("client", {description = "Build client", default = false, type = "boolean"}) | ||
| add_configs("client_channels", {description = "Build virtual channel plugins", default = false, type = "boolean"}) | ||
| add_configs("server", {description = "Build server", default = false, type = "boolean"}) | ||
| add_configs("server_channels", {description = "Build virtual channel plugins", default = false, type = "boolean"}) | ||
| add_configs("rdtk", {description = "Build rdtk toolkit", default = false, type = "boolean"}) | ||
| add_configs("shadow", {description = "Compile with shadow server", default = false, type = "boolean"}) | ||
| add_configs("proxy", {description = "Compile with proxy server", default = false, type = "boolean"}) | ||
| add_configs("platform_server", {description = "Compile with platform server", default = false, type = "boolean"}) | ||
|
|
||
| add_configs("x11", {description = "Build X11 client/server", default = false, type = "boolean"}) | ||
| add_configs("wayland", {description = "Build with wayland", default = false, type = "boolean"}) | ||
| add_configs("fuse", {description = "Build clipboard with FUSE file copy support", default = false, type = "boolean"}) | ||
| add_configs("json", {description = "Build with any JSON support", default = nil, type = "string", values = {"cjson", "json-c"}}) | ||
| add_configs("uriparser", {description = "use uriparser library to handle URIs", default = false, type = "boolean"}) | ||
| add_configs("ffmpeg", {description = "Enable FFMPEG for audio/video encoding/decoding", default = false, type = "boolean"}) | ||
| add_configs("cairo", {description = "Use CAIRO image library for screen resizing", default = false, type = "boolean"}) | ||
| add_configs("swscale", {description = "Use SWScale image library for screen resizing", default = false, type = "boolean"}) | ||
| add_configs("openh264", {description = "Build openh264", default = false, type = "boolean"}) | ||
| add_configs("krb5", {description = "Compile support for kerberos authentication.", default = false, type = "boolean"}) | ||
| -- Try resolve emmintrin.h:740:1: error: inlining failed in call to 'always_inline' '_mm_storeu_si128': target specific option mismatch | ||
| add_configs("simd", {description = "Build with simd", default = not is_plat("wasm") and not (is_arch("i386") and is_plat("mingw") and is_subhost("macosx")), type = "boolean"}) | ||
|
|
||
| -- winpr | ||
| add_configs("unicode_builtin", {description = "Build builtin unicode", default = true, type = "boolean"}) | ||
| add_configs("timezone_icu", {description = "Use ICU for improved timezone mapping", default = false, type = "boolean"}) | ||
| add_configs("winpr_tools", {description = "Build WinPR helper binaries", default = false, type = "boolean"}) | ||
|
|
||
| if is_plat("windows", "mingw") then | ||
| add_configs("winmm", {description = "Use Windows Multimedia", default = true, type = "boolean"}) | ||
| end | ||
|
|
||
| if is_plat("linux", "bsd") then | ||
| add_syslinks("pthread") | ||
| elseif is_plat("windows", "mingw") then | ||
| add_syslinks("rpcrt4", "ncrypt", "shell32", "ole32", "dbghelp", "shlwapi", "ntdll") | ||
| if is_plat("mingw") then | ||
| add_syslinks("uuid") | ||
| end | ||
| elseif is_plat("macosx") then | ||
| add_frameworks("CoreFoundation", "Carbon") | ||
| end | ||
|
|
||
| add_deps("cmake") | ||
| add_deps("zlib", "openssl3") | ||
|
|
||
| add_includedirs("include", "include/freerdp3", "include/winpr3") | ||
|
|
||
| add_links("freerdp-server3", "freerdp-server-proxy3", "freerdp-client3", "freerdp3", "rdtk0", "winpr3") | ||
|
|
||
| on_load(function (package) | ||
| if package:config("shadow") or package:config("proxy") or package:config("platform_server") then | ||
| package:config_set("server", true) | ||
| end | ||
| if package:config("proxy") then | ||
| package:config_set("client", true) | ||
| end | ||
|
|
||
| local configs_map_to_deps = { | ||
| client = "libusb", | ||
| wayland = "wayland", | ||
| fuse = "libfuse", | ||
| json = package:config("json"), | ||
| uriparser = "uriparser", | ||
| cairo = "cairo", | ||
| openh264 = "openh264", | ||
| ffmpeg = "ffmpeg", | ||
| swscale = "ffmpeg", | ||
| krb5 = "krb5", | ||
| } | ||
| for config, dep in pairs(configs_map_to_deps) do | ||
| if package:config(config) then | ||
| package:add("deps", dep) | ||
| end | ||
| end | ||
|
|
||
| if package:config("x11") or package:config("shadow") then | ||
| package:add("deps", "libx11", "libxext", "libxcursor") | ||
| end | ||
| if not package:config("unicode_builtin") or package:config("timezone_icu") then | ||
| package:add("deps", "icu4c") | ||
| end | ||
|
|
||
| if package:dep("libusb") then | ||
| if is_subhost("windows") then | ||
| package:add("deps", "pkgconf") | ||
| else | ||
| package:add("deps", "pkg-config") | ||
| end | ||
| end | ||
|
|
||
| -- https://github.com/libfuse/libfuse/issues/383 | ||
| if package:config("fuse") then | ||
| package:add("deps", "libfuse", {configs = {shared = true}}) | ||
| end | ||
|
|
||
| if package:is_plat("windows", "mingw") and not package:config("shared") then | ||
| package:add("defines", "FREERDP_EXPORTS") | ||
| end | ||
|
|
||
| if package:config("winmm") and package:is_plat("windows", "mingw") then | ||
| package:add("syslinks", "winmm") | ||
| end | ||
| end) | ||
|
|
||
| on_install("!bsd and !iphoneos", function (package) | ||
| if package:is_plat("mingw") then | ||
| io.replace("winpr/include/winpr/wtypes.h", "typedef ssize_t SSIZE_T;", "#ifndef _SSIZE_T_DEFINED\ntypedef ssize_t SSIZE_T;\n#endif", {plain = true}) | ||
| end | ||
| io.replace("CMakeLists.txt", "include(${CMAKE_CPACK_INCLUDE_FILE})", "", {plain = true}) | ||
star-hengxing marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| io.replace("cmake/MSVCRuntime.cmake", "if(BUILD_SHARED_LIBS)", "if(0)", {plain = true}) | ||
| if package:config("fuse") then | ||
| io.replace("client/common/CMakeLists.txt", "pkg_check_modules(FUSE3 REQUIRED fuse3)", "pkg_check_modules(FUSE3 REQUIRED IMPORTED_TARGET fuse3)", {plain = true}) | ||
| io.replace("client/common/CMakeLists.txt", "${FUSE3_LIBRARIES}", "PkgConfig::FUSE3", {plain = true}) | ||
| end | ||
|
|
||
| local libusb = package:dep("libusb") | ||
| if libusb and not libusb:is_system() and not libusb:config("shared") and package:is_plat("linux", "cross") then | ||
| io.replace("cmake/Findlibusb-1.0.cmake", "set(LIBUSB_1_LIBRARIES ${LIBUSB_1_LIBRARY})", | ||
| [[find_package(PkgConfig) | ||
| pkg_check_modules(PC_LIBUDEV QUIET libudev) | ||
| find_library(UDEV_LIBRARY NAMES udev PATHS ${PC_LIBUDEV_LIBRARY_DIRS} ${PC_LIBUDEV_LIBDIR} PATH_SUFFIXES lib) | ||
| set(LIBUSB_1_LIBRARIES ${LIBUSB_1_LIBRARY} ${UDEV_LIBRARY})]], {plain = true}) | ||
| end | ||
|
|
||
| local configs = { | ||
| "-DWITH_SAMPLE=OFF", | ||
| "-DWITH_MANPAGES=OFF", | ||
| "-DBUILD_TESTING=OFF", | ||
| "-DWITH_CCACHE=OFF", | ||
| "-DWITH_CLANG_FORMAT=OFF", | ||
| "-DCMAKE_INTERPROCEDURAL_OPTIMIZATION=OFF", | ||
| -- build bundle winpr | ||
| "-DFREERDP_UNIFIED_BUILD=ON", | ||
|
|
||
| "-DWITH_CUPS=OFF", | ||
| } | ||
| table.insert(configs, "-DCMAKE_BUILD_TYPE=" .. (package:is_debug() and "Debug" or "Release")) | ||
| table.insert(configs, "-DBUILD_SHARED_LIBS=" .. (package:config("shared") and "ON" or "OFF")) | ||
|
|
||
| local dep = package:config("json") | ||
| table.insert(configs, "-DWITH_JSON_DISABLED=" .. (dep and "OFF" or "ON")) | ||
| table.insert(configs, "-DWITH_CJSON_REQUIRED=" .. (dep == "cjson" and "ON" or "OFF")) | ||
| table.insert(configs, "-DWITH_JSONC_REQUIRED=" .. (dep == "json-c" and "ON" or "OFF")) | ||
| if package:is_plat("mingw") then | ||
| -- winpr/libwinpr/utils/unwind/debug.c require dlfcn.h, try `dlfcn-win32`? | ||
| table.insert(configs, "-DUSE_UNWIND=OFF") | ||
| -- fatal error: bits/libc-header-start.h: No such file or directory | ||
| table.insert(configs, "-DWITH_SMARTCARD_EMULATE=OFF") | ||
| end | ||
|
|
||
| table.insert(configs, "-DWITH_CLIENT_COMMON=" .. (package:config("client") and "ON" or "OFF")) | ||
|
|
||
| for name, enabled in table.orderpairs(package:configs()) do | ||
| if not package:extraconf("configs", name, "builtin") then | ||
| table.insert(configs, format("-DWITH_%s=%s", name:upper(), (enabled and "ON" or "OFF"))) | ||
| end | ||
| end | ||
|
|
||
| local opt = {} | ||
| if package:is_plat("mingw") and package:has_tool("cc", "gcc") then | ||
| opt.cxflags = "-Wno-error=incompatible-pointer-types" | ||
| end | ||
| if package:dep("libx11") then | ||
| opt.packagedeps = {"libx11", "xorgproto", "libxext", "libxcursor"} | ||
| end | ||
| if package:dep("ffmpeg") and not package:has_tool("ld", "link") then | ||
| -- https://stackoverflow.com/questions/44379426/building-shared-library-with-ffmpeg-results-in-relocation-error | ||
| opt.ldflags = "-Wl,-Bsymbolic" | ||
| opt.shflags = "-Wl,-Bsymbolic" | ||
| end | ||
| import("package.tools.cmake").install(package, configs, opt) | ||
| end) | ||
|
|
||
| on_test(function (package) | ||
| assert(package:has_cfuncs("winpr_get_version", {includes = "winpr/winpr.h"})) | ||
| assert(package:has_cfuncs("freerdp_get_version", {includes = "freerdp/freerdp.h"})) | ||
| end) | ||
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.