From 7cad516415c5cb8e63464b2e6f7b642a7d500997 Mon Sep 17 00:00:00 2001 From: Ne_Eo Date: Fri, 6 Sep 2024 03:20:20 +0200 Subject: [PATCH 01/93] Improve Timers --- src/haxe/Timer.hx | 14 +------------- .../_internal/backend/native/NativeApplication.hx | 9 +++++---- 2 files changed, 6 insertions(+), 17 deletions(-) diff --git a/src/haxe/Timer.hx b/src/haxe/Timer.hx index 1b80cf5ed0..425eab35fd 100644 --- a/src/haxe/Timer.hx +++ b/src/haxe/Timer.hx @@ -270,19 +270,7 @@ class Timer public function stop():Void { - if (mRunning) - { - mRunning = false; - - for (i in 0...sRunningTimers.length) - { - if (sRunningTimers[i] == this) - { - sRunningTimers[i] = null; - break; - } - } - } + mRunning = false; } @:noCompletion private function __check(inTime:Float) diff --git a/src/lime/_internal/backend/native/NativeApplication.hx b/src/lime/_internal/backend/native/NativeApplication.hx index 2208624bfb..c5db23e460 100644 --- a/src/lime/_internal/backend/native/NativeApplication.hx +++ b/src/lime/_internal/backend/native/NativeApplication.hx @@ -96,7 +96,8 @@ class NativeApplication var offset = System.getTimer() - pauseTimer; for (i in 0...Timer.sRunningTimers.length) { - if (Timer.sRunningTimers[i] != null) Timer.sRunningTimers[i].mFireAt += offset; + var timer = Timer.sRunningTimers[i]; + if (timer != null && timer.mRunning) timer.mFireAt += offset; } pauseTimer = -1; } @@ -585,9 +586,9 @@ class NativeApplication { timer = Timer.sRunningTimers[i]; - if (timer != null) + if (timer != null && timer.mRunning) { - if (timer.mRunning && currentTime >= timer.mFireAt) + if (currentTime >= timer.mFireAt) { timer.mFireAt += timer.mTime; timer.run(); @@ -603,7 +604,7 @@ class NativeApplication { Timer.sRunningTimers = Timer.sRunningTimers.filter(function(val) { - return val != null; + return val != null && val.mRunning; }); } } From 3554bfe817244e7a76942ee90b2c2dbf2b7a8e8a Mon Sep 17 00:00:00 2001 From: player-03 Date: Thu, 5 Sep 2024 22:52:24 -0400 Subject: [PATCH 02/93] Simplify timer logic. We aren't using `i`, so we can iterate over the array normally. And there are no longer null entries, so we don't have to check for those. --- .../backend/native/NativeApplication.hx | 20 ++++++++----------- 1 file changed, 8 insertions(+), 12 deletions(-) diff --git a/src/lime/_internal/backend/native/NativeApplication.hx b/src/lime/_internal/backend/native/NativeApplication.hx index c5db23e460..d4e2813adb 100644 --- a/src/lime/_internal/backend/native/NativeApplication.hx +++ b/src/lime/_internal/backend/native/NativeApplication.hx @@ -94,10 +94,9 @@ class NativeApplication if (pauseTimer > -1) { var offset = System.getTimer() - pauseTimer; - for (i in 0...Timer.sRunningTimers.length) + for (timer in Timer.sRunningTimers) { - var timer = Timer.sRunningTimers[i]; - if (timer != null && timer.mRunning) timer.mFireAt += offset; + if (timer.mRunning) timer.mFireAt += offset; } pauseTimer = -1; } @@ -579,14 +578,11 @@ class NativeApplication if (Timer.sRunningTimers.length > 0) { var currentTime = System.getTimer(); - var foundNull = false; - var timer; + var foundStopped = false; - for (i in 0...Timer.sRunningTimers.length) + for (timer in Timer.sRunningTimers) { - timer = Timer.sRunningTimers[i]; - - if (timer != null && timer.mRunning) + if (timer.mRunning) { if (currentTime >= timer.mFireAt) { @@ -596,15 +592,15 @@ class NativeApplication } else { - foundNull = true; + foundStopped = true; } } - if (foundNull) + if (foundStopped) { Timer.sRunningTimers = Timer.sRunningTimers.filter(function(val) { - return val != null && val.mRunning; + return val.mRunning; }); } } From 190d1d3998f36b1a4d1981c58fc890c084eae88e Mon Sep 17 00:00:00 2001 From: Zeki Date: Sat, 2 Nov 2024 14:17:14 +0300 Subject: [PATCH 03/93] Memory leak fix in curl bindings --- project/src/net/curl/CURLBindings.cpp | 21 +++++++++++++++++++-- 1 file changed, 19 insertions(+), 2 deletions(-) diff --git a/project/src/net/curl/CURLBindings.cpp b/project/src/net/curl/CURLBindings.cpp index 861bb8536f..6e33bb7a54 100644 --- a/project/src/net/curl/CURLBindings.cpp +++ b/project/src/net/curl/CURLBindings.cpp @@ -57,6 +57,19 @@ namespace lime { std::map xferInfoValues; Mutex curl_gc_mutex; + void free_header_values (const std::vector* values) { + + if (values) { + + for (auto it = values->begin (); it != values->end (); ++it) { + + free (*it); + + } + + } + + } void gc_curl (value handle) { @@ -121,6 +134,7 @@ namespace lime { std::vector* values = headerValues[handle]; headerCallbacks.erase (handle); headerValues.erase (handle); + free_header_values (values); delete callback; delete values; @@ -254,6 +268,7 @@ namespace lime { std::vector* values = headerValues[handle]; headerCallbacks.erase (handle); headerValues.erase (handle); + free_header_values (values); delete callback; delete values; @@ -1681,8 +1696,9 @@ namespace lime { { curl_gc_mutex.Lock (); - if (headerCallbacks.find (handle) == headerCallbacks.end ()) { + if (headerCallbacks.find (handle) != headerCallbacks.end ()) { + free_header_values (headerValues[handle]); delete headerCallbacks[handle]; delete headerValues[handle]; @@ -2108,8 +2124,9 @@ namespace lime { { curl_gc_mutex.Lock (); - if (headerCallbacks.find (handle) == headerCallbacks.end ()) { + if (headerCallbacks.find (handle) != headerCallbacks.end ()) { + free_header_values (headerValues[handle]); delete headerCallbacks[handle]; delete headerValues[handle]; From 434205e0838d69745a0dcb7c5c8191c9b12f6c28 Mon Sep 17 00:00:00 2001 From: player-03 Date: Sat, 2 Nov 2024 14:03:56 -0400 Subject: [PATCH 04/93] Change spaces to tabs. --- project/src/net/curl/CURLBindings.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/project/src/net/curl/CURLBindings.cpp b/project/src/net/curl/CURLBindings.cpp index 6e33bb7a54..1f3403ab2d 100644 --- a/project/src/net/curl/CURLBindings.cpp +++ b/project/src/net/curl/CURLBindings.cpp @@ -1698,7 +1698,7 @@ namespace lime { if (headerCallbacks.find (handle) != headerCallbacks.end ()) { - free_header_values (headerValues[handle]); + free_header_values (headerValues[handle]); delete headerCallbacks[handle]; delete headerValues[handle]; @@ -2126,7 +2126,7 @@ namespace lime { if (headerCallbacks.find (handle) != headerCallbacks.end ()) { - free_header_values (headerValues[handle]); + free_header_values (headerValues[handle]); delete headerCallbacks[handle]; delete headerValues[handle]; @@ -2906,4 +2906,4 @@ extern "C" int lime_curl_register_prims () { return 0; -} \ No newline at end of file +} From 65520709d36489b90643ef829329c50838584e76 Mon Sep 17 00:00:00 2001 From: Zeki Date: Fri, 15 Nov 2024 23:22:23 +0300 Subject: [PATCH 05/93] Fixed memory leak in flush functions. --- project/src/net/curl/CURLBindings.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/project/src/net/curl/CURLBindings.cpp b/project/src/net/curl/CURLBindings.cpp index 1f3403ab2d..9673b5e9bc 100644 --- a/project/src/net/curl/CURLBindings.cpp +++ b/project/src/net/curl/CURLBindings.cpp @@ -596,6 +596,7 @@ namespace lime { } + free_header_values (values); values->clear (); } @@ -703,6 +704,7 @@ namespace lime { } + free_header_values (values); values->clear (); } From 39af23f0ceb4b455a50dfcd7fd15e04bacbfbc65 Mon Sep 17 00:00:00 2001 From: Joshua Granick Date: Thu, 2 Jan 2025 09:29:50 -0800 Subject: [PATCH 06/93] Update LICENSE.md --- LICENSE.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/LICENSE.md b/LICENSE.md index 726f005e6c..2e2eed9183 100644 --- a/LICENSE.md +++ b/LICENSE.md @@ -1,7 +1,7 @@ MIT License =========== -Copyright (c) 2013-2024 Joshua Granick and other Lime contributors +Copyright (c) 2013-2025 Joshua Granick and other Lime contributors Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal From 69086df2060fe2b4c8b547e5538971df256507f4 Mon Sep 17 00:00:00 2001 From: Joshua Granick Date: Thu, 2 Jan 2025 09:32:18 -0800 Subject: [PATCH 07/93] Update NOTICE.md --- NOTICE.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/NOTICE.md b/NOTICE.md index a2f4b4de68..a806789ebd 100644 --- a/NOTICE.md +++ b/NOTICE.md @@ -2,7 +2,7 @@ Notices ======= ### Lime -Copyright (c) 2013-2024 Joshua Granick and other Lime contributors +Copyright (c) 2013-2025 Joshua Granick and other Lime contributors This product bundles cairo 1.15.2, which is available under an "MPL 1.1" license. For details, see [project/lib/cairo/](project/lib). From 37e758072008ab6a13a93087544e5c864e4b8ed0 Mon Sep 17 00:00:00 2001 From: Tobiasz Laskowski Date: Mon, 23 Dec 2024 17:29:43 +0000 Subject: [PATCH 08/93] Fix module paths for haxe 5 Haxe 5 will no longer support module resolution like this. See: https://github.com/HaxeFoundation/haxe/issues/9150 --- src/lime/tools/FlashHelper.hx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/lime/tools/FlashHelper.hx b/src/lime/tools/FlashHelper.hx index bbae4fd0ce..9cc436f858 100644 --- a/src/lime/tools/FlashHelper.hx +++ b/src/lime/tools/FlashHelper.hx @@ -167,7 +167,7 @@ class FlashHelper var frameData = frameDataWriter.getBytes(); - var snd:format.swf.Sound = + var snd:format.swf.Data.Sound = { sid: cid, format: SFMP3, @@ -255,7 +255,7 @@ class FlashHelper { var sampleCount = Std.int(wav.data.length / (hdr.bitsPerSample / 8)); - var snd:format.swf.Sound = + var snd:format.swf.Data.Sound = { sid: cid, format: SFLittleEndianUncompressed, From 57cf88b02d1ffc135fb846c879c701d0cb12d4e1 Mon Sep 17 00:00:00 2001 From: Josh Tynjala Date: Mon, 6 Jan 2025 10:06:24 -0800 Subject: [PATCH 09/93] CommandLineTools: set macos define when using cpp target on macOS (closes #1878) It should behave the same as mac or macos target. --- tools/CommandLineTools.hx | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/tools/CommandLineTools.hx b/tools/CommandLineTools.hx index a5a11fadb9..f2c381759c 100644 --- a/tools/CommandLineTools.hx +++ b/tools/CommandLineTools.hx @@ -1514,6 +1514,11 @@ class CommandLineTools target = System.hostPlatform; targetFlags.set("cpp", ""); + if (target == Platform.MAC) + { + overrides.haxedefs.set("macos", ""); + } + case "neko": target = System.hostPlatform; targetFlags.set("neko", ""); From 44dd331801326e3b5eac7c35f8ee0560ad828bca Mon Sep 17 00:00:00 2001 From: Josh Tynjala Date: Tue, 7 Jan 2025 09:43:21 -0800 Subject: [PATCH 10/93] libjpeg: fix rendering on 32-bit platforms Fixes SIZEOF_SIZE_T on 32-bit platforms that should be 4 instead of 8 Tested on Windows x86_32 and Android armv7 --- project/lib/custom/jpeg/jconfigint.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/project/lib/custom/jpeg/jconfigint.h b/project/lib/custom/jpeg/jconfigint.h index 69767e9176..632329a8b7 100644 --- a/project/lib/custom/jpeg/jconfigint.h +++ b/project/lib/custom/jpeg/jconfigint.h @@ -23,10 +23,10 @@ #define VERSION "2.0.7" /* The size of `size_t', as computed by sizeof. */ -#if defined(RASPBERRYPI) -#define SIZEOF_SIZE_T 4 -#else +#if (__WORDSIZE == 64) || defined(_WIN64) #define SIZEOF_SIZE_T 8 +#else +#define SIZEOF_SIZE_T 4 #endif /* Define if your compiler has __builtin_ctzl() and sizeof(unsigned long) == sizeof(size_t). */ From 951d5510c2b70f994ecfafba16ae0311b4bb5d25 Mon Sep 17 00:00:00 2001 From: Josh Tynjala Date: Tue, 7 Jan 2025 12:47:30 -0800 Subject: [PATCH 11/93] GameActivity: check for VIBRATE permission on Android While we add this permission by default, if a developer sets custom permissions, we want to avoid crashing when we try to access an API that we don't have permission to use --- .../app/src/main/java/org/haxe/lime/GameActivity.java | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/templates/android/template/app/src/main/java/org/haxe/lime/GameActivity.java b/templates/android/template/app/src/main/java/org/haxe/lime/GameActivity.java index 3c28d7a6cb..18a276f6e5 100644 --- a/templates/android/template/app/src/main/java/org/haxe/lime/GameActivity.java +++ b/templates/android/template/app/src/main/java/org/haxe/lime/GameActivity.java @@ -3,6 +3,7 @@ import android.content.Context; import android.content.Intent; +import android.content.pm.PackageManager; import android.content.res.AssetManager; import android.net.Uri; import android.os.Build; @@ -16,6 +17,7 @@ import android.view.KeyEvent; import android.view.View; import android.webkit.MimeTypeMap; +import android.Manifest; import org.haxe.extension.Extension; import org.libsdl.app.SDLActivity; @@ -110,7 +112,13 @@ protected void onCreate (Bundle state) { super.onCreate (state); assetManager = getAssets (); - vibrator = (Vibrator)mSingleton.getSystemService (Context.VIBRATOR_SERVICE); + + if (checkSelfPermission(Manifest.permission.VIBRATE) == PackageManager.PERMISSION_GRANTED) { + + vibrator = (Vibrator)mSingleton.getSystemService (Context.VIBRATOR_SERVICE); + + } + handler = new Handler (); Extension.assetManager = assetManager; From 6a5908b02b70dffd5fd024d6bc1bfa9e662477d2 Mon Sep 17 00:00:00 2001 From: Igor <1659590+pozirk@users.noreply.github.com> Date: Wed, 8 Jan 2025 14:05:26 -0500 Subject: [PATCH 12/93] Just fixing some typo --- src/lime/tools/Keystore.hx | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/lime/tools/Keystore.hx b/src/lime/tools/Keystore.hx index 878ba70a6a..65a0a6f31a 100644 --- a/src/lime/tools/Keystore.hx +++ b/src/lime/tools/Keystore.hx @@ -26,9 +26,9 @@ class Keystore if (keystore != null) { if (keystore.path != null && keystore.path != "") path = keystore.path; - if (keystore.password != null) path = keystore.password; - if (keystore.alias != null) path = keystore.alias; - if (keystore.aliasPassword != null) path = keystore.aliasPassword; + if (keystore.password != null) password = keystore.password; + if (keystore.alias != null) alias = keystore.alias; + if (keystore.aliasPassword != null) aliasPassword = keystore.aliasPassword; } } } From c2c9d0ea7c0fbb99c549c03cc5912272f18e491e Mon Sep 17 00:00:00 2001 From: Igor <1659590+pozirk@users.noreply.github.com> Date: Wed, 8 Jan 2025 14:02:50 -0500 Subject: [PATCH 13/93] Setting ios.non-exempt-encryption to false by default. --- tools/platforms/IOSPlatform.hx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/platforms/IOSPlatform.hx b/tools/platforms/IOSPlatform.hx index e13a9cdffd..bc4c31095b 100644 --- a/tools/platforms/IOSPlatform.hx +++ b/tools/platforms/IOSPlatform.hx @@ -349,7 +349,7 @@ class IOSPlatform extends PlatformTarget } context.IOS_LINKER_FLAGS = ["-stdlib=libc++"].concat(project.config.getArrayString("ios.linker-flags")); - context.IOS_NON_EXEMPT_ENCRYPTION = project.config.getBool("ios.non-exempt-encryption", true); + context.IOS_NON_EXEMPT_ENCRYPTION = project.config.getBool("ios.non-exempt-encryption", false); switch (project.window.orientation) { From f604ae3b0e8a5e32af563c5cb875da6b46c7087e Mon Sep 17 00:00:00 2001 From: Josh Tynjala Date: Fri, 17 Jan 2025 09:14:17 -0800 Subject: [PATCH 14/93] tools: fix haxe 4 function syntax for haxe 3 backcompat --- tools/platforms/MacPlatform.hx | 2 +- tools/platforms/WindowsPlatform.hx | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/tools/platforms/MacPlatform.hx b/tools/platforms/MacPlatform.hx index 6c540b4303..771afd738d 100644 --- a/tools/platforms/MacPlatform.hx +++ b/tools/platforms/MacPlatform.hx @@ -706,7 +706,7 @@ class MacPlatform extends PlatformTarget continue; } } - if (Lambda.exists(homebrewDirs, dirPath -> StringTools.startsWith(resolvedLibPath, dirPath))) + if (Lambda.exists(homebrewDirs, function(dirPath:String):Bool { return StringTools.startsWith(resolvedLibPath, dirPath); })) { homebrewDependencyPaths.push(libPath); pathsToSearchForHomebrewDependencies.push(resolvedLibPath); diff --git a/tools/platforms/WindowsPlatform.hx b/tools/platforms/WindowsPlatform.hx index a3019c0aed..967de958e0 100644 --- a/tools/platforms/WindowsPlatform.hx +++ b/tools/platforms/WindowsPlatform.hx @@ -383,7 +383,7 @@ class WindowsPlatform extends PlatformTarget var visualStudioPath = StringTools.trim(vswhereOutput); var vcvarsallPath = visualStudioPath + "\\VC\\Auxiliary\\Build\\vcvarsall.bat"; // this command sets up the environment variables and things that visual studio requires - var vcvarsallCommand = [vcvarsallPath, "x64"].map(arg -> ~/([&|\(\)<>\^ ])/g.replace(arg, "^$1")); + var vcvarsallCommand = [vcvarsallPath, "x64"].map(function(arg:String):String { return ~/([&|\(\)<>\^ ])/g.replace(arg, "^$1"); }); // this command runs the cl.exe c compiler from visual studio var clCommand = ["cl.exe", "/Ox", "/Fe:" + executablePath, "-I", Path.combine(targetDirectory, "obj"), Path.combine(targetDirectory, "obj/ApplicationMain.c")]; for (file in System.readDirectory(applicationDirectory)) @@ -398,7 +398,7 @@ class WindowsPlatform extends PlatformTarget } clCommand.push("/link"); clCommand.push("/subsystem:windows"); - clCommand = clCommand.map(arg -> ~/([&|\(\)<>\^ ])/g.replace(arg, "^$1")); + clCommand = clCommand.map(function(arg:String):String { return ~/([&|\(\)<>\^ ])/g.replace(arg, "^$1"); }); // combine both commands into one command = ["cmd.exe", "/s", "/c", vcvarsallCommand.join(" ") + " && " + clCommand.join(" ")]; } From 2d22455e5095abdec0a31520c744b62fd55957ae Mon Sep 17 00:00:00 2001 From: Josh Tynjala Date: Fri, 17 Jan 2025 09:25:08 -0800 Subject: [PATCH 15/93] HTML5Thread: Haxe 3 compatibility fixes --- src/lime/_internal/backend/html5/HTML5Thread.hx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/lime/_internal/backend/html5/HTML5Thread.hx b/src/lime/_internal/backend/html5/HTML5Thread.hx index 022a085da1..9f744e59e1 100644 --- a/src/lime/_internal/backend/html5/HTML5Thread.hx +++ b/src/lime/_internal/backend/html5/HTML5Thread.hx @@ -96,7 +96,7 @@ class HTML5Thread { var thread:HTML5Thread = new HTML5Thread(url.href, new Worker(url.href)); // Run `job` on the new thread. - thread.sendMessage(job); + thread.sendMessage(#if !haxe4 cast #end job); return thread; #else @@ -416,7 +416,7 @@ abstract WorkFunction(WorkFunctionData) from Wor else { #if !macro - this.sourceCode = (cast this.func:Function).toString(); + this.sourceCode = (cast this.func #if haxe4 :Function #end).toString(); if (this.sourceCode.indexOf("[native code]") < 0) { // All set. From 5ed71b1204a40bec6bbb61e51dffde6a913d7f57 Mon Sep 17 00:00:00 2001 From: Josh Tynjala Date: Fri, 17 Jan 2025 09:28:07 -0800 Subject: [PATCH 16/93] actions: html5-samples job should have a Haxe version matrix --- .github/workflows/main.yml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index dba7727553..168a13cd29 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -757,13 +757,16 @@ jobs: html5-samples: runs-on: ubuntu-20.04 + strategy: + matrix: + haxe-version: [3.4.7, 4.0.5, 4.1.5, 4.2.5, 4.3.6] steps: - uses: actions/checkout@v4 - uses: krdlab/setup-haxe@v1 with: - haxe-version: ${{ env.HAXE_VERSION }} + haxe-version: ${{ matrix.haxe-version }} - name: Set HAXEPATH run: | From f08cebf9e5b2d48c3a99f585f0150a690a65deed Mon Sep 17 00:00:00 2001 From: Josh Tynjala Date: Fri, 17 Jan 2025 09:30:19 -0800 Subject: [PATCH 17/93] actions: bump haxe 4.3 references to haxe 4.3.6 --- .github/workflows/main.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 168a13cd29..cbddb91036 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -606,7 +606,7 @@ jobs: runs-on: windows-latest strategy: matrix: - haxe-version: [4.0.5, 4.1.5, 4.2.5, 4.3.1] + haxe-version: [4.0.5, 4.1.5, 4.2.5, 4.3.6] steps: - uses: actions/checkout@v4 @@ -715,7 +715,7 @@ jobs: - uses: krdlab/setup-haxe@v1 with: - haxe-version: 4.3.3 # minimum required version for HL/C + haxe-version: 4.3.6 # minimum required version for HL/C is 4.3.3 - name: Set HAXEPATH (Windows) if: runner.os == 'Windows' From 2fdbcd1460529570ba60a656b3fec9252f11fe5c Mon Sep 17 00:00:00 2001 From: Josh Tynjala Date: Fri, 17 Jan 2025 09:41:51 -0800 Subject: [PATCH 18/93] actions: make html5-samples depend on package-haxelib because -eval flag fails on Haxe 3 --- .github/workflows/main.yml | 36 ++++++++++++++++++++---------------- 1 file changed, 20 insertions(+), 16 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index cbddb91036..11e6bc79df 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -756,6 +756,7 @@ jobs: lime build SimpleAudio hlc -release -verbose -nocolor html5-samples: + needs: package-haxelib runs-on: ubuntu-20.04 strategy: matrix: @@ -774,45 +775,48 @@ jobs: - name: Install Haxe dependencies run: | - haxelib install format --quiet - haxelib install hxp --quiet haxelib install genes --quiet haxelib git lime-samples https://github.com/openfl/lime-samples --quiet + - uses: actions/download-artifact@v4 + with: + name: lime-haxelib + path: lime-haxelib + - name: Prepare Lime run: | - haxelib dev lime ${{ github.workspace }} - haxelib run lime setup -alias -y -nocffi -eval + haxelib dev lime lime-haxelib + haxelib run lime setup -alias -y -nocffi - name: Build HelloWorld sample run: | - lime create HelloWorld -verbose -nocolor -eval - lime build HelloWorld html5 -release -verbose -nocolor -eval + lime create HelloWorld -verbose -nocolor + lime build HelloWorld html5 -release -verbose -nocolor - name: Build HelloWorld variants run: | - lime build HelloWorld html5 -clean -release -verbose -nocolor --haxelib=genes -eval - lime build HelloWorld html5 -clean -release -verbose -nocolor -minify -terser -eval + lime build HelloWorld html5 -clean -release -verbose -nocolor --haxelib=genes + lime build HelloWorld html5 -clean -release -verbose -nocolor -minify -terser - name: Build SimpleImage sample run: | - lime create SimpleImage -verbose -nocolor -eval - lime build SimpleImage html5 -release -verbose -nocolor -eval + lime create SimpleImage -verbose -nocolor + lime build SimpleImage html5 -release -verbose -nocolor - name: Build SimpleImage variants run: | - lime build SimpleImage html5 -clean -release -verbose -nocolor --haxelib=genes -eval - lime build SimpleImage html5 -clean -release -verbose -nocolor -minify -terser -eval + lime build SimpleImage html5 -clean -release -verbose -nocolor --haxelib=genes + lime build SimpleImage html5 -clean -release -verbose -nocolor -minify -terser - name: Build SimpleAudio sample run: | - lime create SimpleAudio -verbose -nocolor -eval - lime build SimpleAudio html5 -release -verbose -nocolor -eval + lime create SimpleAudio -verbose -nocolor + lime build SimpleAudio html5 -release -verbose -nocolor - name: Build SimpleAudio variants run: | - lime build SimpleAudio html5 -clean -release -verbose -nocolor --haxelib=genes -eval - lime build SimpleAudio html5 -clean -release -verbose -nocolor -minify -terser -eval + lime build SimpleAudio html5 -clean -release -verbose -nocolor --haxelib=genes + lime build SimpleAudio html5 -clean -release -verbose -nocolor -minify -terser neko-samples: needs: package-haxelib From 5472974379401517f73f0b44e6d336026fed0a46 Mon Sep 17 00:00:00 2001 From: Josh Tynjala Date: Fri, 17 Jan 2025 10:13:22 -0800 Subject: [PATCH 19/93] actions: skip html5-samples variables on Haxe 3 --- .github/workflows/main.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 11e6bc79df..0ff85206d4 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -794,6 +794,7 @@ jobs: lime build HelloWorld html5 -release -verbose -nocolor - name: Build HelloWorld variants + if: ${{ matrix.haxe-version != '3.4.7' }} run: | lime build HelloWorld html5 -clean -release -verbose -nocolor --haxelib=genes lime build HelloWorld html5 -clean -release -verbose -nocolor -minify -terser @@ -804,6 +805,7 @@ jobs: lime build SimpleImage html5 -release -verbose -nocolor - name: Build SimpleImage variants + if: ${{ matrix.haxe-version != '3.4.7' }} run: | lime build SimpleImage html5 -clean -release -verbose -nocolor --haxelib=genes lime build SimpleImage html5 -clean -release -verbose -nocolor -minify -terser @@ -814,6 +816,7 @@ jobs: lime build SimpleAudio html5 -release -verbose -nocolor - name: Build SimpleAudio variants + if: ${{ matrix.haxe-version != '3.4.7' }} run: | lime build SimpleAudio html5 -clean -release -verbose -nocolor --haxelib=genes lime build SimpleAudio html5 -clean -release -verbose -nocolor -minify -terser From abb92a2a849a7ae18d5112fa647e4e6e6f28919d Mon Sep 17 00:00:00 2001 From: Josh Tynjala Date: Fri, 17 Jan 2025 11:47:32 -0800 Subject: [PATCH 20/93] actions: does Haxe 4.3.3 work better on this job than 4.3.6? --- .github/workflows/main.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 0ff85206d4..7e6d041c65 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -715,7 +715,7 @@ jobs: - uses: krdlab/setup-haxe@v1 with: - haxe-version: 4.3.6 # minimum required version for HL/C is 4.3.3 + haxe-version: 4.3.3 # minimum required version for HL/C is 4.3.3 - name: Set HAXEPATH (Windows) if: runner.os == 'Windows' From e0c734d8fe6109e34ccba780d75fc73866cea133 Mon Sep 17 00:00:00 2001 From: Tobiasz Laskowski Date: Wed, 22 Jan 2025 02:08:55 +0000 Subject: [PATCH 21/93] Remove MAC_USE_CURRENT_SDK from lime setup MAC_USE_CURRENT_SDK is an incredibly old relic from a very old version of hxcpp (haxe 2 days). It was removed in: https://github.com/HaxeFoundation/hxcpp/commit/9a7f7f931fbdc4a4d4812c333ead14519b7c05e0 This is now instead controlled by the flag `MACOSX_DEPLOYMENT_TARGET`. The setup command now only does two things: - Sets up haxelibs - Adds cli alias --- tools/utils/PlatformSetup.hx | 10 ---------- 1 file changed, 10 deletions(-) diff --git a/tools/utils/PlatformSetup.hx b/tools/utils/PlatformSetup.hx index 9dee297a59..7e2dee07cf 100644 --- a/tools/utils/PlatformSetup.hx +++ b/tools/utils/PlatformSetup.hx @@ -816,11 +816,6 @@ class PlatformSetup setupHaxelib(new Haxelib("lime")); } - if (System.hostPlatform == MAC) - { - ConfigHelper.writeConfigValue("MAC_USE_CURRENT_SDK", "1"); - } - if (targetFlags.exists("noalias")) { return; @@ -1079,11 +1074,6 @@ class PlatformSetup setupHaxelib(new Haxelib("openfl")); } - if (System.hostPlatform == MAC) - { - ConfigHelper.writeConfigValue("MAC_USE_CURRENT_SDK", "1"); - } - if (targetFlags.exists("noalias")) { return; From 725587389307a51e7f06600960aa6fe8dad5d942 Mon Sep 17 00:00:00 2001 From: Josh Tynjala Date: Fri, 24 Jan 2025 09:46:56 -0800 Subject: [PATCH 22/93] AudioManager: if alc.openDevice() returns null, don't call alc.createContext() to avoid a SIGNAL 11 crash --- src/lime/media/AudioManager.hx | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/lime/media/AudioManager.hx b/src/lime/media/AudioManager.hx index 162ed40e75..8a085f253d 100644 --- a/src/lime/media/AudioManager.hx +++ b/src/lime/media/AudioManager.hx @@ -34,9 +34,12 @@ class AudioManager var alc = context.openal; var device = alc.openDevice(); - var ctx = alc.createContext(device); - alc.makeContextCurrent(ctx); - alc.processContext(ctx); + if (device != null) + { + var ctx = alc.createContext(device); + alc.makeContextCurrent(ctx); + alc.processContext(ctx); + } } #end } From 9bda9ecb32c4bde863dbbe3ef8d13da2e1005768 Mon Sep 17 00:00:00 2001 From: Tobiasz Laskowski Date: Mon, 27 Jan 2025 19:02:41 +0000 Subject: [PATCH 23/93] Update cairo to 1.18.2 The previous version 1.17.6 was an unstable snapshot release. Updating to 1.18.2 seems to resolve some font size bugs on windows. --- project/lib/cairo | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/project/lib/cairo b/project/lib/cairo index b43e7c6f3c..200441e685 160000 --- a/project/lib/cairo +++ b/project/lib/cairo @@ -1 +1 @@ -Subproject commit b43e7c6f3cf7855e16170a06d3a9c7234c60ca94 +Subproject commit 200441e6855854eb4dbf338e44d67b00ababe07f From 65e2c6ba45b72a4850e7f7a424b8b79e21b215e5 Mon Sep 17 00:00:00 2001 From: Tobiasz Laskowski Date: Mon, 27 Jan 2025 19:03:03 +0000 Subject: [PATCH 24/93] Add missing files to freetype build These are required by newer versions of cairo --- project/lib/freetype-files.xml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/project/lib/freetype-files.xml b/project/lib/freetype-files.xml index c9e9e69e58..722fc2508d 100644 --- a/project/lib/freetype-files.xml +++ b/project/lib/freetype-files.xml @@ -16,6 +16,7 @@ + @@ -79,6 +80,7 @@ + From 077ba7e5cad382c3d844ca8057c758d12e34b90c Mon Sep 17 00:00:00 2001 From: Tobiasz Laskowski Date: Tue, 28 Jan 2025 19:23:07 +0000 Subject: [PATCH 25/93] Update harfbuzz to 10.2.0 --- project/lib/harfbuzz | 2 +- project/lib/harfbuzz-files.xml | 5 +++++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/project/lib/harfbuzz b/project/lib/harfbuzz index afcae83a06..7b27c8edd4 160000 --- a/project/lib/harfbuzz +++ b/project/lib/harfbuzz @@ -1 +1 @@ -Subproject commit afcae83a064843d71d47624bc162e121cc56c08b +Subproject commit 7b27c8edd46c674e01dd226fa9e1aa7549f5c436 diff --git a/project/lib/harfbuzz-files.xml b/project/lib/harfbuzz-files.xml index 68f882a6ba..74726e4916 100644 --- a/project/lib/harfbuzz-files.xml +++ b/project/lib/harfbuzz-files.xml @@ -32,6 +32,7 @@ + @@ -39,6 +40,7 @@ + @@ -62,6 +64,9 @@ + + + From a9347de8cea8a83aef74464113c604cd880079b5 Mon Sep 17 00:00:00 2001 From: Tobiasz Laskowski Date: Tue, 28 Jan 2025 20:20:28 +0000 Subject: [PATCH 26/93] Update hb-coretext to hb-coretext-shape The name of this file was changed, see: https://github.com/harfbuzz/harfbuzz/commit/064b24177b398a9ebab16207e303c6725cb544da --- project/lib/harfbuzz-files.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/project/lib/harfbuzz-files.xml b/project/lib/harfbuzz-files.xml index 74726e4916..b3496caa93 100644 --- a/project/lib/harfbuzz-files.xml +++ b/project/lib/harfbuzz-files.xml @@ -30,7 +30,7 @@ - + From 5fd2b560c49c0d27c5c0b097b8637130965f69de Mon Sep 17 00:00:00 2001 From: Tobiasz Laskowski Date: Wed, 29 Jan 2025 01:28:22 +0000 Subject: [PATCH 27/93] Add missing harfbuzz hb-face-builder file --- project/lib/harfbuzz-files.xml | 1 + 1 file changed, 1 insertion(+) diff --git a/project/lib/harfbuzz-files.xml b/project/lib/harfbuzz-files.xml index b3496caa93..60625a997c 100644 --- a/project/lib/harfbuzz-files.xml +++ b/project/lib/harfbuzz-files.xml @@ -34,6 +34,7 @@ + From 8031ed22d9adc18de3064f5b9f9708b165c7f2a3 Mon Sep 17 00:00:00 2001 From: Josh Tynjala Date: Wed, 29 Jan 2025 15:12:30 -0800 Subject: [PATCH 28/93] System: fix typo in openFile() docs --- src/lime/system/System.hx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/lime/system/System.hx b/src/lime/system/System.hx index 71d1812c70..a48489c377 100644 --- a/src/lime/system/System.hx +++ b/src/lime/system/System.hx @@ -361,7 +361,7 @@ class System #end /** - Opens a file with the suste, default application. + Opens a file with the system default application. In a web browser, opens a URL with target `_blank`. **/ From e56c7cd49a8e205b015d3f8d83c81aed277a832d Mon Sep 17 00:00:00 2001 From: Josh Tynjala Date: Thu, 30 Jan 2025 09:46:15 -0800 Subject: [PATCH 29/93] docs: some missing classes in ImportAll Like OpenFL, we should eventually modify the docs build to use include("lime") to automatically include everything instead of manually adding each thing to ImportAll. However, we'll need to use conditional compilation to hide certain classes from targets where they aren't supported. --- docs/ImportAll.hx | 3 +++ 1 file changed, 3 insertions(+) diff --git a/docs/ImportAll.hx b/docs/ImportAll.hx index be172c7d09..e0039724f6 100644 --- a/docs/ImportAll.hx +++ b/docs/ImportAll.hx @@ -112,6 +112,7 @@ import lime.net.HTTPRequest; import lime.net.HTTPRequestHeader; import lime.net.HTTPRequestMethod; import lime.net.URIParser; +import lime.system.BackgroundWorker; import lime.system.CFFI; import lime.system.CFFIPointer; import lime.system.Clipboard; @@ -125,6 +126,7 @@ import lime.system.Sensor; import lime.system.SensorType; import lime.system.System; import lime.system.ThreadPool; +import lime.system.WorkOutput; import lime.text.harfbuzz.HB; import lime.text.harfbuzz.HBBlob; import lime.text.harfbuzz.HBBuffer; @@ -169,6 +171,7 @@ import lime.ui.Window; import lime.ui.WindowAttributes; import lime.utils.ArrayBuffer; import lime.utils.ArrayBufferView; +import lime.utils.AssetBundle; import lime.utils.AssetCache; import lime.utils.AssetLibrary; import lime.utils.AssetManifest; From 112f3f591f53443c8c766a6553cb78039b7db45e Mon Sep 17 00:00:00 2001 From: Josh Tynjala Date: Thu, 30 Jan 2025 16:15:59 -0800 Subject: [PATCH 30/93] actions: missed hashlinkc-samples as a dependency of notify --- .github/workflows/main.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 7e6d041c65..9a53cb45c0 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -874,7 +874,7 @@ jobs: notify: runs-on: ubuntu-20.04 - needs: [package-haxelib, docs, android, flash-samples, air-samples, hashlink-samples, html5-samples, ios, linux, macos, neko-samples, windows] + needs: [package-haxelib, docs, android, flash-samples, air-samples, hashlink-samples, hashlinkc-samples, html5-samples, ios, linux, macos, neko-samples, windows] if: ${{ github.repository == 'openfl/lime' && github.event_name != 'pull_request' }} steps: - name: Notify Discord From dd9f9d40c94fe8d7f4b7aebeddeb2a4deb491c18 Mon Sep 17 00:00:00 2001 From: Tobiasz Laskowski Date: Wed, 22 Jan 2025 00:52:58 +0000 Subject: [PATCH 31/93] Add -cli, -alias, and -noalias setup flags to help The `-cli`/`-alias` flags are useful when you don't want lime to mess with libraries that might be intentionally set to specific versions. --- tools/CommandLineTools.hx | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/tools/CommandLineTools.hx b/tools/CommandLineTools.hx index f2c381759c..e3cb7b4470 100644 --- a/tools/CommandLineTools.hx +++ b/tools/CommandLineTools.hx @@ -952,6 +952,12 @@ class CommandLineTools Log.println(" " + Log.accentColor + "Options:" + Log.resetColor); Log.println(""); + if (command == "setup") + { + Log.println(" \x1b[1m-cli\x1b[0;3m/\x1b[0m\x1b[1m-alias\x1b[0m -- Set up " + defaultLibraryName + " alias only, skipping haxelib installs"); + Log.println(" \x1b[1m-noalias\x1b[0m -- Do not set up " + defaultLibraryName + " alias"); + } + if (isBuildCommand) { Log.println(" \x1b[1m-D\x1b[0;3mvalue\x1b[0m -- Specify a define to use when processing other commands"); From 69bbcaea2708567f501eaf89d29cb2591de18b79 Mon Sep 17 00:00:00 2001 From: Tobiasz Laskowski Date: Wed, 22 Jan 2025 02:35:27 +0000 Subject: [PATCH 32/93] Skip confirmation for alias with -alias/-cli flag The user has already specified this is what they want by passing in the flag, so there is no point in asking again. --- tools/utils/PlatformSetup.hx | 30 ++++++++++++++++++------------ 1 file changed, 18 insertions(+), 12 deletions(-) diff --git a/tools/utils/PlatformSetup.hx b/tools/utils/PlatformSetup.hx index 7e2dee07cf..5d36f0a345 100644 --- a/tools/utils/PlatformSetup.hx +++ b/tools/utils/PlatformSetup.hx @@ -875,13 +875,16 @@ class PlatformSetup var installedCommand = false; var answer = YES; - if (targetFlags.exists("y")) + if (!(targetFlags.exists("alias") || targetFlags.exists("cli"))) { - Sys.println("Do you want to install the \"lime\" command? [y/n/a] y"); - } - else - { - answer = CLIHelper.ask("Do you want to install the \"lime\" command?"); + if (targetFlags.exists("y")) + { + Sys.println("Do you want to install the \"lime\" command? [y/n/a] y"); + } + else + { + answer = CLIHelper.ask("Do you want to install the \"lime\" command?"); + } } if (answer == YES || answer == ALWAYS) @@ -1123,13 +1126,16 @@ class PlatformSetup var installedCommand = false; var answer = YES; - if (targetFlags.exists("y")) + if (!(targetFlags.exists("alias") || targetFlags.exists("cli"))) { - Sys.println("Do you want to install the \"openfl\" command? [y/n/a] y"); - } - else - { - answer = CLIHelper.ask("Do you want to install the \"openfl\" command?"); + if (targetFlags.exists("y")) + { + Sys.println("Do you want to install the \"openfl\" command? [y/n/a] y"); + } + else + { + answer = CLIHelper.ask("Do you want to install the \"openfl\" command?"); + } } if (answer == YES || answer == ALWAYS) From f5ccc3d2aa178a72ae277108082cb9fc5043e1cc Mon Sep 17 00:00:00 2001 From: Tobiasz Laskowski Date: Mon, 10 Feb 2025 01:51:48 +0000 Subject: [PATCH 33/93] Add missing crypt32.lib for static windows build --- templates/cpp/static/BuildMain.xml | 1 + 1 file changed, 1 insertion(+) diff --git a/templates/cpp/static/BuildMain.xml b/templates/cpp/static/BuildMain.xml index 1342c8a9b0..dda4b8a70f 100644 --- a/templates/cpp/static/BuildMain.xml +++ b/templates/cpp/static/BuildMain.xml @@ -35,6 +35,7 @@ + From d1db9e88af0e33ece0405fe8f5f9e33dd92f5717 Mon Sep 17 00:00:00 2001 From: Tobiasz Laskowski Date: Mon, 10 Feb 2025 01:55:10 +0000 Subject: [PATCH 34/93] Fix static debug windows build --- templates/cpp/static/Main.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/templates/cpp/static/Main.cpp b/templates/cpp/static/Main.cpp index 290d63baaa..3afe99351d 100644 --- a/templates/cpp/static/Main.cpp +++ b/templates/cpp/static/Main.cpp @@ -1,6 +1,6 @@ #include -#if defined(HX_WINDOWS) && !defined(HXCPP_DEBUG) +#if defined(HX_WINDOWS) && !defined(HXCPP_DEBUGGER) #include #endif @@ -14,7 +14,7 @@ ::foreach ndlls::::if (registerStatics):: extern "C" int ::nameSafe::_register_prims ();::end::::end:: -#if defined(HX_WINDOWS) && !defined(HXCPP_DEBUG) +#if defined(HX_WINDOWS) && !defined(HXCPP_DEBUGGER) int __stdcall WinMain (HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int nCmdShow) { #else extern "C" int main(int argc, char *argv[]) { From 22fb016d95eabea87554eec464148bb7bbbde61a Mon Sep 17 00:00:00 2001 From: Tobiasz Laskowski Date: Thu, 11 Jul 2024 19:53:51 +0100 Subject: [PATCH 35/93] Link against hxcpp's mbedtls in static builds This avoids lime's mbedtls overwriting hxcpp's, which has caused issues in the past. --- project/Build.xml | 2 +- project/lib/curl-files.xml | 11 ++++++++++- templates/cpp/static/BuildMain.xml | 3 +++ 3 files changed, 14 insertions(+), 2 deletions(-) diff --git a/project/Build.xml b/project/Build.xml index 7fe7c97f2d..15be32417c 100755 --- a/project/Build.xml +++ b/project/Build.xml @@ -389,7 +389,7 @@ - + diff --git a/project/lib/curl-files.xml b/project/lib/curl-files.xml index 5e01a10fe6..aabf1f41c1 100644 --- a/project/lib/curl-files.xml +++ b/project/lib/curl-files.xml @@ -1,4 +1,5 @@ + @@ -23,7 +24,15 @@ - + + +
+ + + + + +
diff --git a/templates/cpp/static/BuildMain.xml b/templates/cpp/static/BuildMain.xml index dda4b8a70f..f49c7e5c8d 100644 --- a/templates/cpp/static/BuildMain.xml +++ b/templates/cpp/static/BuildMain.xml @@ -2,6 +2,8 @@ + + @@ -11,6 +13,7 @@ + ::foreach ndlls:: ::end:: From 7df96b53d7ddf6105485c7983cb6ce2df44b6d01 Mon Sep 17 00:00:00 2001 From: Tobiasz Laskowski Date: Fri, 12 Jul 2024 11:03:56 +0100 Subject: [PATCH 36/93] Support hxcpp older than 4.3.0 for mbedtls linking Hxcpp 4.3.0 has an mbedtls_config.h file in ${HXCPP}/src/hx/libs/ssl, which we have to ensure is included, but older versions do not. To support both 4.3.0 and older versions, we can add an empty mbedtls_config.h and add the include path at the end. This way it will only be used if it does not exist in the previous include paths. --- project/lib/curl-files.xml | 1 + project/lib/custom/mbedtls_hxcpp/mbedtls_config.h | 0 2 files changed, 1 insertion(+) create mode 100644 project/lib/custom/mbedtls_hxcpp/mbedtls_config.h diff --git a/project/lib/curl-files.xml b/project/lib/curl-files.xml index aabf1f41c1..541d3cf4f2 100644 --- a/project/lib/curl-files.xml +++ b/project/lib/curl-files.xml @@ -30,6 +30,7 @@ + diff --git a/project/lib/custom/mbedtls_hxcpp/mbedtls_config.h b/project/lib/custom/mbedtls_hxcpp/mbedtls_config.h new file mode 100644 index 0000000000..e69de29bb2 From c9ad850578a23db969b1bcd7546dfe2a9c0e7b99 Mon Sep 17 00:00:00 2001 From: Tobiasz Laskowski Date: Fri, 12 Jul 2024 10:47:49 +0100 Subject: [PATCH 37/93] Update curl submodule Hxcpp's mbedtls has MBEDTLS_NET_C disabled, which meant that older versions of curl which use this feature cannot be linked against it. This version of curl no longer requires this feature, which avoids the issue. --- project/lib/curl | 2 +- project/lib/curl-files.xml | 8 +++++--- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/project/lib/curl b/project/lib/curl index 462196e6b4..c12fb3ddaf 160000 --- a/project/lib/curl +++ b/project/lib/curl @@ -1 +1 @@ -Subproject commit 462196e6b4a47f924293a0e26b8e9c23d37ac26f +Subproject commit c12fb3ddaf48e709a7a4deaa55ec485e4df163ee diff --git a/project/lib/curl-files.xml b/project/lib/curl-files.xml index 541d3cf4f2..1f25e9962d 100644 --- a/project/lib/curl-files.xml +++ b/project/lib/curl-files.xml @@ -51,7 +51,6 @@ - @@ -68,12 +67,12 @@ + - @@ -86,12 +85,12 @@ - + @@ -99,6 +98,7 @@ + @@ -113,6 +113,7 @@ + @@ -123,6 +124,7 @@ + From d375d74459ed2276f0d052ce5b03dafc7c67e660 Mon Sep 17 00:00:00 2001 From: Tobiasz Laskowski Date: Wed, 22 Jan 2025 15:45:06 +0000 Subject: [PATCH 38/93] Make minor ios/tvos makefile adjustments The targets do not create a file with the target name, so they should be marked as .PHONY We are not using implicit rules either, so we can disable them by making .SUFFIXES empty Group targets together Also remove LIB_BASE variable, it has been unused since: f7ab6ab36b80522261ef3233a4a714c7183f109a --- .../ios/template/{{app.file}}/haxe/makefile | 24 ++++++++++--------- templates/tvos/PROJ/haxe/makefile | 24 ++++++++++--------- 2 files changed, 26 insertions(+), 22 deletions(-) diff --git a/templates/ios/template/{{app.file}}/haxe/makefile b/templates/ios/template/{{app.file}}/haxe/makefile index d0f3b67872..85a0b6fc51 100644 --- a/templates/ios/template/{{app.file}}/haxe/makefile +++ b/templates/ios/template/{{app.file}}/haxe/makefile @@ -5,18 +5,10 @@ endif HAXE_BUILDS := $(ARCHS:%=build-haxe-%) -ifeq ("$(ACTION)","clean") -default: clean -else -default: $(HAXE_BUILDS) -endif - ifeq ("$(CONFIGURATION)","Debug") BUILD_STYLE := Debug endif -default: debug_print - ifeq ("$(BUILD_STYLE)","Debug") DEBUG := -debug CONFIG := Debug @@ -31,12 +23,19 @@ ifeq ("$(HAXE_OS)","iphonesimulator") endif CONFIG := $(CONFIG)-$(HAXE_OS) +LIB_DEST := $(DEBUG)/libApplicationMain.a + +ifeq ("$(ACTION)","clean") +default: clean +else +default: $(HAXE_BUILDS) +endif + +default: debug_print + debug_print: @echo "Make $(HAXE_BUILDS)" -LIB_BASE := build/$(CONFIG)/::CPP_LIBPREFIX::ApplicationMain$(DEBUG) -LIB_DEST := $(DEBUG)/libApplicationMain.a - build-haxe-i386: @echo "Haxe simulator build: $(CONFIG)" haxe Build.hxml -D simulator -cpp build/$(CONFIG) $(DEBUG) @@ -74,3 +73,6 @@ build-haxe-arm64: clean: rm -rf build + +.PHONY: default debug_print clean $(HAXE_BUILDS) +.SUFFIXES: diff --git a/templates/tvos/PROJ/haxe/makefile b/templates/tvos/PROJ/haxe/makefile index c1125e6d7e..dacaa0ed0e 100644 --- a/templates/tvos/PROJ/haxe/makefile +++ b/templates/tvos/PROJ/haxe/makefile @@ -5,18 +5,10 @@ endif HAXE_BUILDS := $(ARCHS:%=build-haxe-%) -ifeq ("$(ACTION)","clean") -default: clean -else -default: $(HAXE_BUILDS) -endif - ifeq ("$(CONFIGURATION)","Debug") BUILD_STYLE := Debug endif -default: debug_print - ifeq ("$(BUILD_STYLE)","Debug") DEBUG := -debug CONFIG := Debug @@ -31,12 +23,19 @@ ifeq ("$(HAXE_OS)","appletvsimulator") endif CONFIG := $(CONFIG)-$(HAXE_OS) +LIB_DEST := $(DEBUG)/libApplicationMain.a + +ifeq ("$(ACTION)","clean") +default: clean +else +default: $(HAXE_BUILDS) +endif + +default: debug_print + debug_print: @echo "Make $(HAXE_BUILDS)" -LIB_BASE := build/$(CONFIG)/::CPP_LIBPREFIX::ApplicationMain$(DEBUG) -LIB_DEST := $(DEBUG)/libApplicationMain.a - build-haxe-x86_64: @echo "Haxe simulator build: $(CONFIG)-64" haxe Build.hxml -D simulator -D HXCPP_M64 -cpp build/$(CONFIG)-64 $(DEBUG) @@ -53,3 +52,6 @@ build-haxe-arm64: clean: rm -rf build + +.PHONY: default debug_print clean $(HAXE_BUILDS) +.SUFFIXES: From d87a849ab05e8a6b3f991d2b031839c2c4b887e6 Mon Sep 17 00:00:00 2001 From: Tobiasz Laskowski Date: Wed, 22 Jan 2025 15:51:43 +0000 Subject: [PATCH 39/93] Use generic make rule for ios/tvos build targets --- .../ios/template/{{app.file}}/haxe/makefile | 52 +++++++------------ templates/tvos/PROJ/haxe/makefile | 25 ++++----- 2 files changed, 32 insertions(+), 45 deletions(-) diff --git a/templates/ios/template/{{app.file}}/haxe/makefile b/templates/ios/template/{{app.file}}/haxe/makefile index 85a0b6fc51..0801f101d5 100644 --- a/templates/ios/template/{{app.file}}/haxe/makefile +++ b/templates/ios/template/{{app.file}}/haxe/makefile @@ -25,6 +25,20 @@ CONFIG := $(CONFIG)-$(HAXE_OS) LIB_DEST := $(DEBUG)/libApplicationMain.a +SIMULATOR_ARCH = i386 x86_64 + +SUFFIX_i386 = +SUFFIX_x86_64 = -64 +SUFFIX_armv6 = +SUFFIX_armv7 = -v7 +SUFFIX_arm64 = -64 + +HXCPP_FLAGS_i386 = -D simulator +HXCPP_FLAGS_x86_64 = -D simulator -D HXCPP_M64 +HXCPP_FLAGS_armv6 = -D HXCPP_ARMV6 +HXCPP_FLAGS_armv7 = -D HXCPP_ARMV7 +HXCPP_FLAGS_arm64 = -D HXCPP_ARM64 + ifeq ("$(ACTION)","clean") default: clean else @@ -36,39 +50,11 @@ default: debug_print debug_print: @echo "Make $(HAXE_BUILDS)" -build-haxe-i386: - @echo "Haxe simulator build: $(CONFIG)" - haxe Build.hxml -D simulator -cpp build/$(CONFIG) $(DEBUG) - cd build/$(CONFIG); ::HAXELIB_PATH:: export HXCPP_NO_COLOR=1; haxelib run ::CPP_BUILD_LIBRARY:: Build.xml $(DEBUG) -options Options.txt - cp build/$(CONFIG)/::CPP_LIBPREFIX::ApplicationMain$(DEBUG).iphonesim.a ../lib/i386$(LIB_DEST) - touch ../Classes/Main.mm - -build-haxe-x86_64: - @echo "Haxe simulator build: $(CONFIG)-64" - haxe Build.hxml -D simulator -D HXCPP_M64 -cpp build/$(CONFIG)-64 $(DEBUG) - cd build/$(CONFIG)-64; ::HAXELIB_PATH:: export HXCPP_NO_COLOR=1; haxelib run ::CPP_BUILD_LIBRARY:: Build.xml $(DEBUG) -options Options.txt - cp build/$(CONFIG)-64/::CPP_LIBPREFIX::ApplicationMain$(DEBUG).iphonesim-64.a ../lib/x86_64$(LIB_DEST) - touch ../Classes/Main.mm - -build-haxe-armv6: - @echo "Haxe device build: $(CONFIG)" - haxe Build.hxml -D HXCPP_ARMV6 -cpp build/$(CONFIG) $(DEBUG) - cd build/$(CONFIG); ::HAXELIB_PATH:: export HXCPP_NO_COLOR=1; haxelib run ::CPP_BUILD_LIBRARY:: Build.xml $(DEBUG) -options Options.txt - cp build/$(CONFIG)/::CPP_LIBPREFIX::ApplicationMain$(DEBUG).iphoneos.a ../lib/armv6$(LIB_DEST) - touch ../Classes/Main.mm - -build-haxe-armv7: - @echo "Haxe device build: $(CONFIG)-v7" - haxe Build.hxml -D HXCPP_ARMV7 -cpp build/$(CONFIG)-v7 $(DEBUG) - cd build/$(CONFIG)-v7; ::HAXELIB_PATH:: export HXCPP_NO_COLOR=1; haxelib run ::CPP_BUILD_LIBRARY:: Build.xml $(DEBUG) -options Options.txt - cp build/$(CONFIG)-v7/::CPP_LIBPREFIX::ApplicationMain$(DEBUG).iphoneos-v7.a ../lib/armv7$(LIB_DEST) - touch ../Classes/Main.mm - -build-haxe-arm64: - @echo "Haxe device build: $(CONFIG)-64" - haxe Build.hxml -D HXCPP_ARM64 -cpp build/$(CONFIG)-64 $(DEBUG) - cd build/$(CONFIG)-64; ::HAXELIB_PATH:: export HXCPP_NO_COLOR=1; haxelib run ::CPP_BUILD_LIBRARY:: Build.xml $(DEBUG) -options Options.txt - cp build/$(CONFIG)-64/::CPP_LIBPREFIX::ApplicationMain$(DEBUG).iphoneos-64.a ../lib/arm64$(LIB_DEST) +$(HAXE_BUILDS): build-haxe-%: + @echo "Haxe $(if $(filter $*,$(SIMULATOR_ARCH)),simulator,device) build: $(CONFIG)$(SUFFIX_$*)" + haxe Build.hxml $(HXCPP_FLAGS_$*) -cpp build/$(CONFIG)$(SUFFIX_$*) $(DEBUG) + cd build/$(CONFIG)$(SUFFIX_$*); ::HAXELIB_PATH:: export HXCPP_NO_COLOR=1; haxelib run ::CPP_BUILD_LIBRARY:: Build.xml $(DEBUG) -options Options.txt + cp build/$(CONFIG)$(SUFFIX_$*)/::CPP_LIBPREFIX::ApplicationMain$(DEBUG).iphone$(if $(filter $*,$(SIMULATOR_ARCH)),sim,os)$(SUFFIX_$*).a ../lib/$*$(LIB_DEST) touch ../Classes/Main.mm clean: diff --git a/templates/tvos/PROJ/haxe/makefile b/templates/tvos/PROJ/haxe/makefile index dacaa0ed0e..3ba3d64b48 100644 --- a/templates/tvos/PROJ/haxe/makefile +++ b/templates/tvos/PROJ/haxe/makefile @@ -25,6 +25,14 @@ CONFIG := $(CONFIG)-$(HAXE_OS) LIB_DEST := $(DEBUG)/libApplicationMain.a +SIMULATOR_ARCH = x86_64 + +SUFFIX_arm64 = -64 +SUFFIX_x86_64 = -64 + +HXCPP_FLAGS_x86_64 = -D simulator -D HXCPP_M64 +HXCPP_FLAGS_arm64 = -D HXCPP_ARM64 + ifeq ("$(ACTION)","clean") default: clean else @@ -36,18 +44,11 @@ default: debug_print debug_print: @echo "Make $(HAXE_BUILDS)" -build-haxe-x86_64: - @echo "Haxe simulator build: $(CONFIG)-64" - haxe Build.hxml -D simulator -D HXCPP_M64 -cpp build/$(CONFIG)-64 $(DEBUG) - cd build/$(CONFIG)-64; ::HAXELIB_PATH:: export HXCPP_NO_COLOR=1; haxelib run ::CPP_BUILD_LIBRARY:: Build.xml $(DEBUG) -options Options.txt - cp build/$(CONFIG)-64/::CPP_LIBPREFIX::ApplicationMain$(DEBUG).appletvsim-64.a ../lib/x86_64$(LIB_DEST) - touch ../Classes/Main.mm - -build-haxe-arm64: - @echo "Haxe device build: $(CONFIG)-64" - haxe Build.hxml -D HXCPP_ARM64 -cpp build/$(CONFIG)-64 $(DEBUG) - cd build/$(CONFIG)-64; ::HAXELIB_PATH:: export HXCPP_NO_COLOR=1; haxelib run ::CPP_BUILD_LIBRARY:: Build.xml $(DEBUG) -options Options.txt - cp build/$(CONFIG)-64/::CPP_LIBPREFIX::ApplicationMain$(DEBUG).appletvos-64.a ../lib/arm64$(LIB_DEST) +$(HAXE_BUILDS): build-haxe-%: + @echo "Haxe $(if $(filter $*,$(SIMULATOR_ARCH)),simulator,device) build: $(CONFIG)$(SUFFIX_$*)" + haxe Build.hxml $(HXCPP_FLAGS_$*) -cpp build/$(CONFIG)$(SUFFIX_$*) $(DEBUG) + cd build/$(CONFIG)$(SUFFIX_$*); ::HAXELIB_PATH:: export HXCPP_NO_COLOR=1; haxelib run ::CPP_BUILD_LIBRARY:: Build.xml $(DEBUG) -options Options.txt + cp build/$(CONFIG)$(SUFFIX_$*)/::CPP_LIBPREFIX::ApplicationMain$(DEBUG).appletv$(if $(filter $*,$(SIMULATOR_ARCH)),sim,os)$(SUFFIX_$*).a ../lib/$*$(LIB_DEST) touch ../Classes/Main.mm clean: From 3208c8772cc8e2d90c3bcfd680d2451ac5bebf40 Mon Sep 17 00:00:00 2001 From: Tobiasz Laskowski Date: Wed, 22 Jan 2025 16:35:10 +0000 Subject: [PATCH 40/93] Use hxcpp -Ddestination flag to copy ios/tvos lib This requires explicitly running the 'haxe' target, as the 'default' target does not output a file. It was added in hxcpp 3.2: https://github.com/HaxeFoundation/hxcpp/commit/3ff97332d18be027fa81fe037bc191b22dec0663 --- templates/ios/template/{{app.file}}/haxe/makefile | 5 +++-- templates/tvos/PROJ/haxe/makefile | 5 +++-- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/templates/ios/template/{{app.file}}/haxe/makefile b/templates/ios/template/{{app.file}}/haxe/makefile index 0801f101d5..bc3b13660f 100644 --- a/templates/ios/template/{{app.file}}/haxe/makefile +++ b/templates/ios/template/{{app.file}}/haxe/makefile @@ -53,8 +53,9 @@ debug_print: $(HAXE_BUILDS): build-haxe-%: @echo "Haxe $(if $(filter $*,$(SIMULATOR_ARCH)),simulator,device) build: $(CONFIG)$(SUFFIX_$*)" haxe Build.hxml $(HXCPP_FLAGS_$*) -cpp build/$(CONFIG)$(SUFFIX_$*) $(DEBUG) - cd build/$(CONFIG)$(SUFFIX_$*); ::HAXELIB_PATH:: export HXCPP_NO_COLOR=1; haxelib run ::CPP_BUILD_LIBRARY:: Build.xml $(DEBUG) -options Options.txt - cp build/$(CONFIG)$(SUFFIX_$*)/::CPP_LIBPREFIX::ApplicationMain$(DEBUG).iphone$(if $(filter $*,$(SIMULATOR_ARCH)),sim,os)$(SUFFIX_$*).a ../lib/$*$(LIB_DEST) + cd build/$(CONFIG)$(SUFFIX_$*); ::HAXELIB_PATH:: export HXCPP_NO_COLOR=1; \ + haxelib run ::CPP_BUILD_LIBRARY:: Build.xml haxe -Ddestination=$(CURDIR)/../lib/$*$(LIB_DEST) \ + -options Options.txt $(DEBUG) touch ../Classes/Main.mm clean: diff --git a/templates/tvos/PROJ/haxe/makefile b/templates/tvos/PROJ/haxe/makefile index 3ba3d64b48..d57d1a9044 100644 --- a/templates/tvos/PROJ/haxe/makefile +++ b/templates/tvos/PROJ/haxe/makefile @@ -47,8 +47,9 @@ debug_print: $(HAXE_BUILDS): build-haxe-%: @echo "Haxe $(if $(filter $*,$(SIMULATOR_ARCH)),simulator,device) build: $(CONFIG)$(SUFFIX_$*)" haxe Build.hxml $(HXCPP_FLAGS_$*) -cpp build/$(CONFIG)$(SUFFIX_$*) $(DEBUG) - cd build/$(CONFIG)$(SUFFIX_$*); ::HAXELIB_PATH:: export HXCPP_NO_COLOR=1; haxelib run ::CPP_BUILD_LIBRARY:: Build.xml $(DEBUG) -options Options.txt - cp build/$(CONFIG)$(SUFFIX_$*)/::CPP_LIBPREFIX::ApplicationMain$(DEBUG).appletv$(if $(filter $*,$(SIMULATOR_ARCH)),sim,os)$(SUFFIX_$*).a ../lib/$*$(LIB_DEST) + cd build/$(CONFIG)$(SUFFIX_$*); ::HAXELIB_PATH:: export HXCPP_NO_COLOR=1; \ + haxelib run ::CPP_BUILD_LIBRARY:: Build.xml haxe -Ddestination=$(CURDIR)/../lib/$*$(LIB_DEST) \ + -options Options.txt $(DEBUG) touch ../Classes/Main.mm clean: From 1b5958f6ff28d86703662b92a43e1afb21c31a4d Mon Sep 17 00:00:00 2001 From: Tobiasz Laskowski Date: Thu, 23 Jan 2025 15:33:17 +0000 Subject: [PATCH 41/93] Remove CPP_LIBPREFIX from ios/tvos template It is no longer used, and was only there to provide compatibility with hxcpp versions older than 3.2 --- tools/platforms/IOSPlatform.hx | 17 ----------------- tools/platforms/TVOSPlatform.hx | 17 ----------------- 2 files changed, 34 deletions(-) diff --git a/tools/platforms/IOSPlatform.hx b/tools/platforms/IOSPlatform.hx index bc4c31095b..94bc43f6f6 100644 --- a/tools/platforms/IOSPlatform.hx +++ b/tools/platforms/IOSPlatform.hx @@ -331,23 +331,6 @@ class IOSPlatform extends PlatformTarget context.IOS_COMPILER = project.config.getString("ios.compiler", "clang"); context.CPP_BUILD_LIBRARY = project.config.getString("cpp.buildLibrary", "hxcpp"); - var json = Json.parse(File.getContent(Haxelib.getPath(new Haxelib("hxcpp"), true) + "/haxelib.json")); - - var version = Std.string(json.version); - var versionSplit = version.split("."); - - while (versionSplit.length > 2) - versionSplit.pop(); - - if (Std.parseFloat(versionSplit.join(".")) > 3.1) - { - context.CPP_LIBPREFIX = "lib"; - } - else - { - context.CPP_LIBPREFIX = ""; - } - context.IOS_LINKER_FLAGS = ["-stdlib=libc++"].concat(project.config.getArrayString("ios.linker-flags")); context.IOS_NON_EXEMPT_ENCRYPTION = project.config.getBool("ios.non-exempt-encryption", false); diff --git a/tools/platforms/TVOSPlatform.hx b/tools/platforms/TVOSPlatform.hx index 76714971c7..567750639e 100644 --- a/tools/platforms/TVOSPlatform.hx +++ b/tools/platforms/TVOSPlatform.hx @@ -262,23 +262,6 @@ class TVOSPlatform extends PlatformTarget context.IOS_COMPILER = project.config.getString("tvos.compiler", "clang"); context.CPP_BUILD_LIBRARY = project.config.getString("cpp.buildLibrary", "hxcpp"); - var json = Json.parse(File.getContent(Haxelib.getPath(new Haxelib("hxcpp"), true) + "/haxelib.json")); - - var version = Std.string(json.version); - var versionSplit = version.split("."); - - while (versionSplit.length > 2) - versionSplit.pop(); - - if (Std.parseFloat(versionSplit.join(".")) > 3.1) - { - context.CPP_LIBPREFIX = "lib"; - } - else - { - context.CPP_LIBPREFIX = ""; - } - context.IOS_LINKER_FLAGS = ["-stdlib=libc++"].concat(project.config.getArrayString("tvos.linker-flags")); context.IOS_NON_EXEMPT_ENCRYPTION = project.config.getBool("tvos.non-exempt-encryption", true); From 6bfbe12df3ade219b21e43de17c9bd78f8715ae9 Mon Sep 17 00:00:00 2001 From: Tobiasz Laskowski Date: Wed, 22 Jan 2025 16:36:50 +0000 Subject: [PATCH 42/93] Link static hxcpp_mbedtls library for ios/tvos --- .../template/{{app.file}}.xcodeproj/project.pbxproj | 2 ++ .../template/{{app.file}}/haxe/BuildHxcppMbedtls.xml | 12 ++++++++++++ templates/ios/template/{{app.file}}/haxe/makefile | 4 ++++ templates/tvos/PROJ.xcodeproj/project.pbxproj | 2 ++ templates/tvos/PROJ/haxe/BuildHxcppMbedtls.xml | 12 ++++++++++++ templates/tvos/PROJ/haxe/makefile | 4 ++++ 6 files changed, 36 insertions(+) create mode 100644 templates/ios/template/{{app.file}}/haxe/BuildHxcppMbedtls.xml create mode 100644 templates/tvos/PROJ/haxe/BuildHxcppMbedtls.xml diff --git a/templates/ios/template/{{app.file}}.xcodeproj/project.pbxproj b/templates/ios/template/{{app.file}}.xcodeproj/project.pbxproj index cf019c959a..001a200690 100644 --- a/templates/ios/template/{{app.file}}.xcodeproj/project.pbxproj +++ b/templates/ios/template/{{app.file}}.xcodeproj/project.pbxproj @@ -396,6 +396,7 @@ "\"$(SRCROOT)/::APP_FILE::/lib/x86_64\"", ); OTHER_LDFLAGS = ( + "-lmbedtls_hxcpp", ::foreach ndlls:: "-l::name::", ::end:: ::foreach linkedLibraries:: "-l::__current__::", @@ -448,6 +449,7 @@ "\"$(SRCROOT)/::APP_FILE::/lib/x86_64\"", ); OTHER_LDFLAGS = ( + "-lmbedtls_hxcpp", ::foreach ndlls:: "-l::name::", ::end:: ::foreach linkedLibraries:: "-l::__current__::", diff --git a/templates/ios/template/{{app.file}}/haxe/BuildHxcppMbedtls.xml b/templates/ios/template/{{app.file}}/haxe/BuildHxcppMbedtls.xml new file mode 100644 index 0000000000..f55252a1de --- /dev/null +++ b/templates/ios/template/{{app.file}}/haxe/BuildHxcppMbedtls.xml @@ -0,0 +1,12 @@ + + + + + + + + + + + + diff --git a/templates/ios/template/{{app.file}}/haxe/makefile b/templates/ios/template/{{app.file}}/haxe/makefile index bc3b13660f..ed3a88c544 100644 --- a/templates/ios/template/{{app.file}}/haxe/makefile +++ b/templates/ios/template/{{app.file}}/haxe/makefile @@ -24,6 +24,7 @@ endif CONFIG := $(CONFIG)-$(HAXE_OS) LIB_DEST := $(DEBUG)/libApplicationMain.a +LIB_MBEDTLS_DEST := $(DEBUG)/libmbedtls_hxcpp.a SIMULATOR_ARCH = i386 x86_64 @@ -57,6 +58,9 @@ $(HAXE_BUILDS): build-haxe-%: haxelib run ::CPP_BUILD_LIBRARY:: Build.xml haxe -Ddestination=$(CURDIR)/../lib/$*$(LIB_DEST) \ -options Options.txt $(DEBUG) touch ../Classes/Main.mm + cd build/$(CONFIG)$(SUFFIX_$*); ::HAXELIB_PATH:: export HXCPP_NO_COLOR=1; \ + haxelib run ::CPP_BUILD_LIBRARY:: $(CURDIR)/BuildHxcppMbedtls.xml \ + -Ddestination=$(CURDIR)/../lib/$*$(LIB_MBEDTLS_DEST) -options Options.txt $(DEBUG) clean: rm -rf build diff --git a/templates/tvos/PROJ.xcodeproj/project.pbxproj b/templates/tvos/PROJ.xcodeproj/project.pbxproj index 459d3242c1..67b3c4a641 100644 --- a/templates/tvos/PROJ.xcodeproj/project.pbxproj +++ b/templates/tvos/PROJ.xcodeproj/project.pbxproj @@ -335,6 +335,7 @@ "\"$(SRCROOT)/::APP_FILE::/lib/x86_64\"", ); OTHER_LDFLAGS = ( + "-lmbedtls_hxcpp", ::foreach ndlls:: "-l::name::", ::end:: ::foreach linkedLibraries:: "-l::__current__::", @@ -383,6 +384,7 @@ "\"$(SRCROOT)/::APP_FILE::/lib/x86_64\"", ); OTHER_LDFLAGS = ( + "-lmbedtls_hxcpp", ::foreach ndlls:: "-l::name::", ::end:: ::foreach linkedLibraries:: "-l::__current__::", diff --git a/templates/tvos/PROJ/haxe/BuildHxcppMbedtls.xml b/templates/tvos/PROJ/haxe/BuildHxcppMbedtls.xml new file mode 100644 index 0000000000..f55252a1de --- /dev/null +++ b/templates/tvos/PROJ/haxe/BuildHxcppMbedtls.xml @@ -0,0 +1,12 @@ + + + + + + + + + + + + diff --git a/templates/tvos/PROJ/haxe/makefile b/templates/tvos/PROJ/haxe/makefile index d57d1a9044..e75ed9a805 100644 --- a/templates/tvos/PROJ/haxe/makefile +++ b/templates/tvos/PROJ/haxe/makefile @@ -24,6 +24,7 @@ endif CONFIG := $(CONFIG)-$(HAXE_OS) LIB_DEST := $(DEBUG)/libApplicationMain.a +LIB_MBEDTLS_DEST := $(DEBUG)/libmbedtls_hxcpp.a SIMULATOR_ARCH = x86_64 @@ -51,6 +52,9 @@ $(HAXE_BUILDS): build-haxe-%: haxelib run ::CPP_BUILD_LIBRARY:: Build.xml haxe -Ddestination=$(CURDIR)/../lib/$*$(LIB_DEST) \ -options Options.txt $(DEBUG) touch ../Classes/Main.mm + cd build/$(CONFIG)$(SUFFIX_$*); ::HAXELIB_PATH:: export HXCPP_NO_COLOR=1; \ + haxelib run ::CPP_BUILD_LIBRARY:: $(CURDIR)/BuildHxcppMbedtls.xml \ + -Ddestination=$(CURDIR)/../lib/$*$(LIB_MBEDTLS_DEST) -options Options.txt $(DEBUG) clean: rm -rf build From 00edf47529e6d37962f76c3a6c045df6b798f5b3 Mon Sep 17 00:00:00 2001 From: Tobiasz Laskowski Date: Thu, 11 Jul 2024 23:42:20 +0100 Subject: [PATCH 43/93] Add support for linking mbedtls on latest hxcpp The latest hxcpp makes it easier to link against the internal mbedtls, however we still need backwards compatibility. https://github.com/HaxeFoundation/hxcpp/pull/1133 --- project/lib/curl-files.xml | 18 +++++++++++++----- templates/cpp/static/BuildMain.xml | 7 +++++-- .../{{app.file}}/haxe/BuildHxcppMbedtls.xml | 9 ++++++--- templates/tvos/PROJ/haxe/BuildHxcppMbedtls.xml | 9 ++++++--- 4 files changed, 30 insertions(+), 13 deletions(-) diff --git a/project/lib/curl-files.xml b/project/lib/curl-files.xml index 1f25e9962d..69220ce05f 100644 --- a/project/lib/curl-files.xml +++ b/project/lib/curl-files.xml @@ -1,5 +1,7 @@ - + + + @@ -28,10 +30,16 @@
- - - - + + +
+ + + + + + +
diff --git a/templates/cpp/static/BuildMain.xml b/templates/cpp/static/BuildMain.xml index f49c7e5c8d..6813ce32dc 100644 --- a/templates/cpp/static/BuildMain.xml +++ b/templates/cpp/static/BuildMain.xml @@ -2,7 +2,9 @@ - + + + @@ -13,7 +15,8 @@ - + + ::foreach ndlls:: ::end:: diff --git a/templates/ios/template/{{app.file}}/haxe/BuildHxcppMbedtls.xml b/templates/ios/template/{{app.file}}/haxe/BuildHxcppMbedtls.xml index f55252a1de..5c2ddf007c 100644 --- a/templates/ios/template/{{app.file}}/haxe/BuildHxcppMbedtls.xml +++ b/templates/ios/template/{{app.file}}/haxe/BuildHxcppMbedtls.xml @@ -1,11 +1,14 @@ - - + + + + - + + diff --git a/templates/tvos/PROJ/haxe/BuildHxcppMbedtls.xml b/templates/tvos/PROJ/haxe/BuildHxcppMbedtls.xml index f55252a1de..5c2ddf007c 100644 --- a/templates/tvos/PROJ/haxe/BuildHxcppMbedtls.xml +++ b/templates/tvos/PROJ/haxe/BuildHxcppMbedtls.xml @@ -1,11 +1,14 @@ - - + + + + - + + From ade8ca77a0c4362e74d51b38a390c36a72428a7c Mon Sep 17 00:00:00 2001 From: Tobiasz Laskowski Date: Wed, 22 Jan 2025 18:29:55 +0000 Subject: [PATCH 44/93] Fix options path for BuildHxcppMbedtls.xml See: https://github.com/HaxeFoundation/hxcpp/issues/1178 --- templates/ios/template/{{app.file}}/haxe/makefile | 3 ++- templates/tvos/PROJ/haxe/makefile | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/templates/ios/template/{{app.file}}/haxe/makefile b/templates/ios/template/{{app.file}}/haxe/makefile index ed3a88c544..6f498a72e0 100644 --- a/templates/ios/template/{{app.file}}/haxe/makefile +++ b/templates/ios/template/{{app.file}}/haxe/makefile @@ -60,7 +60,8 @@ $(HAXE_BUILDS): build-haxe-%: touch ../Classes/Main.mm cd build/$(CONFIG)$(SUFFIX_$*); ::HAXELIB_PATH:: export HXCPP_NO_COLOR=1; \ haxelib run ::CPP_BUILD_LIBRARY:: $(CURDIR)/BuildHxcppMbedtls.xml \ - -Ddestination=$(CURDIR)/../lib/$*$(LIB_MBEDTLS_DEST) -options Options.txt $(DEBUG) + -Ddestination=$(CURDIR)/../lib/$*$(LIB_MBEDTLS_DEST) \ + -options $(CURDIR)/build/$(CONFIG)$(SUFFIX_$*)/Options.txt $(DEBUG) clean: rm -rf build diff --git a/templates/tvos/PROJ/haxe/makefile b/templates/tvos/PROJ/haxe/makefile index e75ed9a805..0123454de6 100644 --- a/templates/tvos/PROJ/haxe/makefile +++ b/templates/tvos/PROJ/haxe/makefile @@ -54,7 +54,8 @@ $(HAXE_BUILDS): build-haxe-%: touch ../Classes/Main.mm cd build/$(CONFIG)$(SUFFIX_$*); ::HAXELIB_PATH:: export HXCPP_NO_COLOR=1; \ haxelib run ::CPP_BUILD_LIBRARY:: $(CURDIR)/BuildHxcppMbedtls.xml \ - -Ddestination=$(CURDIR)/../lib/$*$(LIB_MBEDTLS_DEST) -options Options.txt $(DEBUG) + -Ddestination=$(CURDIR)/../lib/$*$(LIB_MBEDTLS_DEST) \ + -options $(CURDIR)/build/$(CONFIG)$(SUFFIX_$*)/Options.txt $(DEBUG) clean: rm -rf build From 99ca58d06f2c27149850365e12cf67c425356dc0 Mon Sep 17 00:00:00 2001 From: Tobiasz Laskowski Date: Thu, 23 Jan 2025 00:17:39 +0000 Subject: [PATCH 45/93] Add workaround for hxcpp compiler cache bug See: https://github.com/HaxeFoundation/hxcpp/issues/1180 --- templates/ios/template/{{app.file}}/haxe/makefile | 2 +- templates/tvos/PROJ/haxe/makefile | 2 +- tools/platforms/IOSPlatform.hx | 2 ++ tools/platforms/TVOSPlatform.hx | 2 ++ 4 files changed, 6 insertions(+), 2 deletions(-) diff --git a/templates/ios/template/{{app.file}}/haxe/makefile b/templates/ios/template/{{app.file}}/haxe/makefile index 6f498a72e0..aeead274e8 100644 --- a/templates/ios/template/{{app.file}}/haxe/makefile +++ b/templates/ios/template/{{app.file}}/haxe/makefile @@ -59,7 +59,7 @@ $(HAXE_BUILDS): build-haxe-%: -options Options.txt $(DEBUG) touch ../Classes/Main.mm cd build/$(CONFIG)$(SUFFIX_$*); ::HAXELIB_PATH:: export HXCPP_NO_COLOR=1; \ - haxelib run ::CPP_BUILD_LIBRARY:: $(CURDIR)/BuildHxcppMbedtls.xml \ + ::CPP_CACHE_WORKAROUND:: haxelib run ::CPP_BUILD_LIBRARY:: $(CURDIR)/BuildHxcppMbedtls.xml \ -Ddestination=$(CURDIR)/../lib/$*$(LIB_MBEDTLS_DEST) \ -options $(CURDIR)/build/$(CONFIG)$(SUFFIX_$*)/Options.txt $(DEBUG) diff --git a/templates/tvos/PROJ/haxe/makefile b/templates/tvos/PROJ/haxe/makefile index 0123454de6..77286dae24 100644 --- a/templates/tvos/PROJ/haxe/makefile +++ b/templates/tvos/PROJ/haxe/makefile @@ -53,7 +53,7 @@ $(HAXE_BUILDS): build-haxe-%: -options Options.txt $(DEBUG) touch ../Classes/Main.mm cd build/$(CONFIG)$(SUFFIX_$*); ::HAXELIB_PATH:: export HXCPP_NO_COLOR=1; \ - haxelib run ::CPP_BUILD_LIBRARY:: $(CURDIR)/BuildHxcppMbedtls.xml \ + ::CPP_CACHE_WORKAROUND:: haxelib run ::CPP_BUILD_LIBRARY:: $(CURDIR)/BuildHxcppMbedtls.xml \ -Ddestination=$(CURDIR)/../lib/$*$(LIB_MBEDTLS_DEST) \ -options $(CURDIR)/build/$(CONFIG)$(SUFFIX_$*)/Options.txt $(DEBUG) diff --git a/tools/platforms/IOSPlatform.hx b/tools/platforms/IOSPlatform.hx index 94bc43f6f6..0c6c0eba4c 100644 --- a/tools/platforms/IOSPlatform.hx +++ b/tools/platforms/IOSPlatform.hx @@ -331,6 +331,8 @@ class IOSPlatform extends PlatformTarget context.IOS_COMPILER = project.config.getString("ios.compiler", "clang"); context.CPP_BUILD_LIBRARY = project.config.getString("cpp.buildLibrary", "hxcpp"); + context.CPP_CACHE_WORKAROUND = "unset HXCPP_COMPILE_CACHE;"; + context.IOS_LINKER_FLAGS = ["-stdlib=libc++"].concat(project.config.getArrayString("ios.linker-flags")); context.IOS_NON_EXEMPT_ENCRYPTION = project.config.getBool("ios.non-exempt-encryption", false); diff --git a/tools/platforms/TVOSPlatform.hx b/tools/platforms/TVOSPlatform.hx index 567750639e..eea70a31ac 100644 --- a/tools/platforms/TVOSPlatform.hx +++ b/tools/platforms/TVOSPlatform.hx @@ -262,6 +262,8 @@ class TVOSPlatform extends PlatformTarget context.IOS_COMPILER = project.config.getString("tvos.compiler", "clang"); context.CPP_BUILD_LIBRARY = project.config.getString("cpp.buildLibrary", "hxcpp"); + context.CPP_CACHE_WORKAROUND = "unset HXCPP_COMPILE_CACHE;"; + context.IOS_LINKER_FLAGS = ["-stdlib=libc++"].concat(project.config.getArrayString("tvos.linker-flags")); context.IOS_NON_EXEMPT_ENCRYPTION = project.config.getBool("tvos.non-exempt-encryption", true); From c975a31f12ced524d243961567b21b7c84fb3376 Mon Sep 17 00:00:00 2001 From: Josh Tynjala Date: Tue, 11 Feb 2025 10:01:48 -0800 Subject: [PATCH 46/93] README: community links --- README.md | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/README.md b/README.md index 992c2ee1d0..c6803fb1a5 100644 --- a/README.md +++ b/README.md @@ -107,3 +107,12 @@ Lime currently supports the following targets: lime test hl Desktop builds are currently designed to be built on the same host OS + + +Join the Community +================== + +Have a question? Want a new place to hang out? + + * [Forums](https://community.openfl.org/c/lime/19) + * [Discord](https://discordapp.com/invite/tDgq8EE) From b8435aa8945d1e9df89da1df35d32a2c9f494574 Mon Sep 17 00:00:00 2001 From: Josh Tynjala Date: Thu, 20 Feb 2025 10:19:55 -0800 Subject: [PATCH 47/93] PlatformSetup: Further refine HL setup to explain how to remove a custom HL_PATH value --- tools/utils/PlatformSetup.hx | 2 ++ 1 file changed, 2 insertions(+) diff --git a/tools/utils/PlatformSetup.hx b/tools/utils/PlatformSetup.hx index 5d36f0a345..52d489a9e7 100644 --- a/tools/utils/PlatformSetup.hx +++ b/tools/utils/PlatformSetup.hx @@ -1238,6 +1238,8 @@ class PlatformSetup var message = "Absolute path to a custom version of HashLink."; if (ConfigHelper.getConfigValue("HL_PATH") == null) { message += " Leave empty to use Lime's default bundled version."; + } else { + message += " Leave empty to keep the currently configured version. To restore Lime's default bundled version, run the command: lime config remove HL_PATH"; } getDefineValue("HL_PATH", message); if (System.hostPlatform == MAC) From be461754a309799d3a985e9e038ada43e7970494 Mon Sep 17 00:00:00 2001 From: Ralty <78720179+Raltyro@users.noreply.github.com> Date: Sun, 21 Jul 2024 17:43:25 +0700 Subject: [PATCH 48/93] Fix typo on EFFECT_AUTOWAH --- src/lime/media/openal/AL.hx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/lime/media/openal/AL.hx b/src/lime/media/openal/AL.hx index f8fced192e..f5c328c4d4 100644 --- a/src/lime/media/openal/AL.hx +++ b/src/lime/media/openal/AL.hx @@ -203,7 +203,7 @@ class AL public static inline var EFFECT_VOCAL_MORPHER:Int = 0x0007; public static inline var EFFECT_PITCH_SHIFTER:Int = 0x0008; public static inline var EFFECT_RING_MODULATOR:Int = 0x0009; - public static inline var FFECT_AUTOWAH:Int = 0x000A; + public static inline var EFFECT_AUTOWAH:Int = 0x000A; public static inline var EFFECT_COMPRESSOR:Int = 0x000B; public static inline var EFFECT_EQUALIZER:Int = 0x000C; /* Auxiliary Effect Slot properties. */ From ebab7dd2c2d145adbc23b1f6f6c7f9bcc3f4e3b9 Mon Sep 17 00:00:00 2001 From: Josh Tynjala Date: Mon, 24 Feb 2025 15:36:36 -0800 Subject: [PATCH 49/93] AL: keep old constant to avoid breaking user code --- src/lime/media/openal/AL.hx | 1 + 1 file changed, 1 insertion(+) diff --git a/src/lime/media/openal/AL.hx b/src/lime/media/openal/AL.hx index f5c328c4d4..f1bcdb7a33 100644 --- a/src/lime/media/openal/AL.hx +++ b/src/lime/media/openal/AL.hx @@ -203,6 +203,7 @@ class AL public static inline var EFFECT_VOCAL_MORPHER:Int = 0x0007; public static inline var EFFECT_PITCH_SHIFTER:Int = 0x0008; public static inline var EFFECT_RING_MODULATOR:Int = 0x0009; + public static inline var FFECT_AUTOWAH:Int = 0x000A; // TODO: deprecate and remove public static inline var EFFECT_AUTOWAH:Int = 0x000A; public static inline var EFFECT_COMPRESSOR:Int = 0x000B; public static inline var EFFECT_EQUALIZER:Int = 0x000C; From 3aa32e21672b3063ce8b4eb6fde3abbab2738aef Mon Sep 17 00:00:00 2001 From: Josh Tynjala Date: Mon, 3 Mar 2025 11:44:44 -0800 Subject: [PATCH 50/93] Image: __fromBytes() null and length check to avoid EXC_BAD_ACCESS lime::PNG::Decode (closes #1894) --- src/lime/graphics/Image.hx | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/lime/graphics/Image.hx b/src/lime/graphics/Image.hx index 97385cdc3a..f528d5d50e 100644 --- a/src/lime/graphics/Image.hx +++ b/src/lime/graphics/Image.hx @@ -1483,6 +1483,11 @@ class Image __fromBase64(Base64.encode(bytes), type, onload); return true; #elseif (lime_cffi && !macro) + if (bytes == null || bytes.length == 0) + { + return false; + } + var imageBuffer:ImageBuffer = null; #if !cs From 504df5e0d01abf0cb3b25a0b8ad2def35ad45e31 Mon Sep 17 00:00:00 2001 From: Tobiasz Laskowski Date: Mon, 10 Mar 2025 01:17:41 +0000 Subject: [PATCH 51/93] Add missing utf8 conversion for hb_buffer_add_utf8 A HxString is not guaranteed to be utf8 on hxcpp, so we need to use hxs_utf8 to convert it otherwise it incorrectly displays any utf16 encoded string. Unfortunately, hxs_utf8 doesn't give us the length of the utf8 string. The best thing we can do is to tell harfbuzz it is null terminated. This isn't perfect because technically hxcpp strings are allowed to contain NULL, but it's better than all utf16 strings being broken. --- project/src/text/harfbuzz/HarfbuzzBindings.cpp | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/project/src/text/harfbuzz/HarfbuzzBindings.cpp b/project/src/text/harfbuzz/HarfbuzzBindings.cpp index 5b1270c850..0fa206124c 100644 --- a/project/src/text/harfbuzz/HarfbuzzBindings.cpp +++ b/project/src/text/harfbuzz/HarfbuzzBindings.cpp @@ -258,7 +258,13 @@ namespace lime { void lime_hb_buffer_add_utf8 (value buffer, HxString text, int itemOffset, int itemLength) { - hb_buffer_add_utf8 ((hb_buffer_t*)val_data (buffer), text.c_str (), text.length, itemOffset, itemLength); + int textLength = text.length; + if (hxs_encoding (text) == hx::StringUtf16) { + // hxs_utf8 doesn't give us the length, so treat it as null terminated + textLength = -1; + } + + hb_buffer_add_utf8 ((hb_buffer_t*)val_data (buffer), hxs_utf8 (text, nullptr), textLength, itemOffset, itemLength); } From 0ca7c392e093783cc1f7e9abe25dadf9a92cb394 Mon Sep 17 00:00:00 2001 From: Tobiasz Laskowski Date: Mon, 10 Mar 2025 01:45:37 +0000 Subject: [PATCH 52/93] Fix length for hl_hb_buffer_add_utf8 This function wants the utf8 length, but text->length does not give this. We can instead use -1 to tell harfbuzz to treat it as null- terminating, which is the case with all hashlink strings anyway. --- project/src/text/harfbuzz/HarfbuzzBindings.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/project/src/text/harfbuzz/HarfbuzzBindings.cpp b/project/src/text/harfbuzz/HarfbuzzBindings.cpp index 0fa206124c..cd5b5b892e 100644 --- a/project/src/text/harfbuzz/HarfbuzzBindings.cpp +++ b/project/src/text/harfbuzz/HarfbuzzBindings.cpp @@ -271,7 +271,7 @@ namespace lime { HL_PRIM void HL_NAME(hl_hb_buffer_add_utf8) (HL_CFFIPointer* buffer, hl_vstring* text, int itemOffset, int itemLength) { - hb_buffer_add_utf8 ((hb_buffer_t*)buffer->ptr, text ? hl_to_utf8 (text->bytes) : NULL, text ? text->length : 0, itemOffset, itemLength); + hb_buffer_add_utf8 ((hb_buffer_t*)buffer->ptr, text ? hl_to_utf8 (text->bytes) : NULL, -1, itemOffset, itemLength); } From 99209da43084b0732cd651db137646008626b8d0 Mon Sep 17 00:00:00 2001 From: Josh Tynjala Date: Mon, 10 Mar 2025 11:05:53 -0700 Subject: [PATCH 53/93] IOSHelper: if `xcrun devicectl list devices` fails, try to fall back to ios-deploy Devices running iOS 16 and older don't support xcrun devicectl, but they should still work with ios-deploy. --- src/lime/tools/IOSHelper.hx | 60 ++++++++++++++++++++++++++++++++++++- 1 file changed, 59 insertions(+), 1 deletion(-) diff --git a/src/lime/tools/IOSHelper.hx b/src/lime/tools/IOSHelper.hx index b7c7edf4aa..29fc5ce597 100644 --- a/src/lime/tools/IOSHelper.hx +++ b/src/lime/tools/IOSHelper.hx @@ -377,9 +377,18 @@ class IOSHelper break; } if (deviceUUID == null || deviceUUID.length == 0) { - Log.error("No device connected"); + // iOS 16 and older don't support xcrun devicectl + // so fall back to the ios-deploy executable + fallbackLaunch(project, applicationPath); + // Log.error("No device connected"); return; } + + if (Log.verbose) + { + Log.info("Detected iOS device UUID: " + deviceUUID); + } + System.runCommand("", "xcrun", ["devicectl", "device", "install", "app", "--device", deviceUUID, FileSystem.fullPath(applicationPath)]); System.runCommand("", "xcrun", ["devicectl", "device", "process", "launch", "--console", "--device", deviceUUID, project.meta.packageName]); } else { @@ -400,6 +409,55 @@ class IOSHelper } } + private static function fallbackLaunch(project:HXProject, applicationPath:String):Void + { + var templatePaths = [ + Path.combine(Haxelib.getPath(new Haxelib(#if lime "lime" #else "hxp" #end)), #if lime "templates" #else "" #end) + ].concat(project.templatePaths); + + var launcher = System.findTemplate(templatePaths, "bin/ios-deploy"); + + Sys.command("chmod", ["+x", launcher]); + + var deviceUUID:String = null; + var detectOutput = System.runProcess("", launcher, ["--detect"]); + for (line in detectOutput.split("\n")) + { + var startIndex = line.indexOf("Found "); + if (startIndex == -1) + { + continue; + } + var endIndex = line.indexOf(" ", startIndex + 6); + if (endIndex == -1) + { + continue; + } + deviceUUID = line.substring(startIndex + 6, endIndex); + } + + if (deviceUUID == null || deviceUUID.length == 0) + { + Log.error("No device connected"); + return; + } + + if (Log.verbose) + { + Log.info("Detected iOS device UUID: " + deviceUUID); + } + + System.runCommand("", launcher, [ + "install", + "--id", + deviceUUID, + "--noninteractive", + "--debug", + "--bundle", + FileSystem.fullPath(applicationPath) + ]); + } + public static function sign(project:HXProject, workingDirectory:String):Void { initialize(project); From 6f2f88ca74db62e9015bc252e178edf6bb9ed96b Mon Sep 17 00:00:00 2001 From: Josh Tynjala Date: Mon, 10 Mar 2025 14:17:20 -0700 Subject: [PATCH 54/93] IOSHelper: if no iOS device is connected, look for one that is available (paired) and wired (closes #1918) Consolidate fallback to ios-deploy when Xcode version < 16 and when xcrun devicectl doesn't find any devices --- src/lime/tools/IOSHelper.hx | 69 +++++++++++-------------------------- 1 file changed, 21 insertions(+), 48 deletions(-) diff --git a/src/lime/tools/IOSHelper.hx b/src/lime/tools/IOSHelper.hx index 29fc5ce597..2150531dd4 100644 --- a/src/lime/tools/IOSHelper.hx +++ b/src/lime/tools/IOSHelper.hx @@ -365,8 +365,9 @@ class IOSHelper // find DeveloperDiskImage.dmg. however, Xcode 16 adds new // commands for installing and launching apps on connected // devices, so we'll prefer those, if available. - var listDevicesOutput = System.runProcess("", "xcrun", ["devicectl", "list", "devices", "--hide-default-columns", "--columns", "Identifier", "--filter", "Platform == 'iOS' AND State == 'connected'"]); var deviceUUID:String = null; + // prefer an iOS device with State == 'connected' + var listDevicesOutput = System.runProcess("", "xcrun", ["devicectl", "list", "devices", "--hide-default-columns", "--columns", "Identifier", "--filter", "Platform == 'iOS' AND State == 'connected'"]); var ready = false; for (line in listDevicesOutput.split("\n")) { if (!ready) { @@ -377,8 +378,23 @@ class IOSHelper break; } if (deviceUUID == null || deviceUUID.length == 0) { - // iOS 16 and older don't support xcrun devicectl - // so fall back to the ios-deploy executable + // preferred fallback is an iOS device that is both + // available and wired + var listDevicesOutput = System.runProcess("", "xcrun", ["devicectl", "list", "devices", "--hide-default-columns", "--columns", "Identifier", "--filter", "Platform == 'iOS' AND State == 'available (paired)' AND connectionProperties.transportType == 'wired'"]); + ready = false; + for (line in listDevicesOutput.split("\n")) { + if (!ready) { + ready = StringTools.startsWith(line, "----"); + continue; + } + deviceUUID = line; + break; + } + } + if (deviceUUID == null || deviceUUID.length == 0) { + // devices running iOS 16 and older don't support + // xcrun devicectl, so if no device was found, try falling + // back to ios-deploy fallbackLaunch(project, applicationPath); // Log.error("No device connected"); return; @@ -392,19 +408,8 @@ class IOSHelper System.runCommand("", "xcrun", ["devicectl", "device", "install", "app", "--device", deviceUUID, FileSystem.fullPath(applicationPath)]); System.runCommand("", "xcrun", ["devicectl", "device", "process", "launch", "--console", "--device", deviceUUID, project.meta.packageName]); } else { - var templatePaths = [ - Path.combine(Haxelib.getPath(new Haxelib(#if lime "lime" #else "hxp" #end)), #if lime "templates" #else "" #end) - ].concat(project.templatePaths); - var launcher = System.findTemplate(templatePaths, "bin/ios-deploy"); - Sys.command("chmod", ["+x", launcher]); - - System.runCommand("", launcher, [ - "install", - "--noninteractive", - "--debug", - "--bundle", - FileSystem.fullPath(applicationPath) - ]); + // continue using ios-deploy if Xcode version is 15 or older + fallbackLaunch(project, applicationPath); } } } @@ -414,43 +419,11 @@ class IOSHelper var templatePaths = [ Path.combine(Haxelib.getPath(new Haxelib(#if lime "lime" #else "hxp" #end)), #if lime "templates" #else "" #end) ].concat(project.templatePaths); - var launcher = System.findTemplate(templatePaths, "bin/ios-deploy"); - Sys.command("chmod", ["+x", launcher]); - var deviceUUID:String = null; - var detectOutput = System.runProcess("", launcher, ["--detect"]); - for (line in detectOutput.split("\n")) - { - var startIndex = line.indexOf("Found "); - if (startIndex == -1) - { - continue; - } - var endIndex = line.indexOf(" ", startIndex + 6); - if (endIndex == -1) - { - continue; - } - deviceUUID = line.substring(startIndex + 6, endIndex); - } - - if (deviceUUID == null || deviceUUID.length == 0) - { - Log.error("No device connected"); - return; - } - - if (Log.verbose) - { - Log.info("Detected iOS device UUID: " + deviceUUID); - } - System.runCommand("", launcher, [ "install", - "--id", - deviceUUID, "--noninteractive", "--debug", "--bundle", From 70e55b1fa5b9bcf3449bb6084accd96259274cb3 Mon Sep 17 00:00:00 2001 From: Tobiasz Laskowski Date: Mon, 10 Mar 2025 20:25:45 +0000 Subject: [PATCH 55/93] Fix rebuild warning about unknown option on msvc cl : Command line warning D9002 : ignoring unknown option '-std=c11' --- project/lib/mbedtls-files.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/project/lib/mbedtls-files.xml b/project/lib/mbedtls-files.xml index 486b01653a..3b5c90dcc6 100644 --- a/project/lib/mbedtls-files.xml +++ b/project/lib/mbedtls-files.xml @@ -2,7 +2,7 @@ - + From 5488eee50c54a7a992911928843da6a321a57397 Mon Sep 17 00:00:00 2001 From: Josh Tynjala Date: Mon, 10 Mar 2025 14:57:58 -0700 Subject: [PATCH 56/93] IOSHelper: comment about how the Platform == 'iOS' filter used by xcrun devicectl includes iPadOS, so there's no need to check for that one separately --- src/lime/tools/IOSHelper.hx | 1 + 1 file changed, 1 insertion(+) diff --git a/src/lime/tools/IOSHelper.hx b/src/lime/tools/IOSHelper.hx index 2150531dd4..465427ef61 100644 --- a/src/lime/tools/IOSHelper.hx +++ b/src/lime/tools/IOSHelper.hx @@ -367,6 +367,7 @@ class IOSHelper // devices, so we'll prefer those, if available. var deviceUUID:String = null; // prefer an iOS device with State == 'connected' + // Note: Platform == 'iOS' includes iPadOS var listDevicesOutput = System.runProcess("", "xcrun", ["devicectl", "list", "devices", "--hide-default-columns", "--columns", "Identifier", "--filter", "Platform == 'iOS' AND State == 'connected'"]); var ready = false; for (line in listDevicesOutput.split("\n")) { From 6283017adbaf80ca9dcee806e8b2640628b69b9d Mon Sep 17 00:00:00 2001 From: Tobiasz Laskowski Date: Tue, 11 Mar 2025 01:13:28 +0000 Subject: [PATCH 57/93] Fix GetGlyphIndices returning array of 0 on hl Previously, the first for loop would reach the end of the characters, so no further characters were read in the second loop. This meant that the array remained filled with 0 values. --- project/src/text/Font.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/project/src/text/Font.cpp b/project/src/text/Font.cpp index 8234ccad30..686a93e606 100644 --- a/project/src/text/Font.cpp +++ b/project/src/text/Font.cpp @@ -1064,6 +1064,7 @@ namespace lime { unsigned long character; int index; int count = 0; + const char* characters_start = characters; // TODO: Determine array size first @@ -1076,6 +1077,7 @@ namespace lime { hl_varray* indices = (hl_varray*)hl_alloc_array (&hlt_i32, count); int* indicesData = hl_aptr (indices, int); + characters = characters_start; while (*characters != 0) { From f495b777ab96d32ec4647375c93f009cb654028e Mon Sep 17 00:00:00 2001 From: Tobiasz Laskowski Date: Tue, 11 Mar 2025 01:14:18 +0000 Subject: [PATCH 58/93] Remove old comment for hl GetGlyphIndices The array size is already determined by the first loop --- project/src/text/Font.cpp | 2 -- 1 file changed, 2 deletions(-) diff --git a/project/src/text/Font.cpp b/project/src/text/Font.cpp index 686a93e606..1f076ea1f8 100644 --- a/project/src/text/Font.cpp +++ b/project/src/text/Font.cpp @@ -1066,8 +1066,6 @@ namespace lime { int count = 0; const char* characters_start = characters; - // TODO: Determine array size first - while (*characters != 0) { character = readNextChar (characters); From 23b90dff3fc41f4d3290b09f9ad970003703035b Mon Sep 17 00:00:00 2001 From: Tobiasz Laskowski Date: Tue, 11 Mar 2025 01:18:41 +0000 Subject: [PATCH 59/93] Fix loop in GetGlyphIndices with invalid input If the text is invalid, then readNextChar returns -1 and does not progress to the next character. This previously meant that we got stuck and looped indefinitely. --- project/src/text/Font.cpp | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/project/src/text/Font.cpp b/project/src/text/Font.cpp index 1f076ea1f8..3318901bc1 100644 --- a/project/src/text/Font.cpp +++ b/project/src/text/Font.cpp @@ -1052,6 +1052,10 @@ namespace lime { while (*characters != 0) { character = readNextChar (characters); + + if (character == -1) + break; + index = FT_Get_Char_Index ((FT_Face)face, character); val_array_push (indices, alloc_int (index)); @@ -1069,6 +1073,10 @@ namespace lime { while (*characters != 0) { character = readNextChar (characters); + + if (character == -1) + break; + count++; } @@ -1080,6 +1088,10 @@ namespace lime { while (*characters != 0) { character = readNextChar (characters); + + if (character == -1) + break; + *indicesData++ = FT_Get_Char_Index ((FT_Face)face, character); } From b709a5bb0d2cf2d2be7ed128b8fe5f33a042dc48 Mon Sep 17 00:00:00 2001 From: Tobiasz Laskowski Date: Fri, 14 Mar 2025 07:41:17 +0000 Subject: [PATCH 60/93] Fix old android ndk error not showing The error flag is not valid inside ``, so this wasn't actually doing anything. The error now shows properly --- project/lib/openal-files.xml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/project/lib/openal-files.xml b/project/lib/openal-files.xml index d07ad13bae..a99790d79d 100644 --- a/project/lib/openal-files.xml +++ b/project/lib/openal-files.xml @@ -1,5 +1,9 @@ +
+ +
+ @@ -155,7 +159,6 @@
- From 20c9bec3bc1e267988f077d5858668b6f5ac2f02 Mon Sep 17 00:00:00 2001 From: Chris Speciale Date: Fri, 14 Mar 2025 05:29:18 -0400 Subject: [PATCH 61/93] Update Build.xml Hxcpp doesn't respect HXCPP_CPP11 for android. We can avoid this issue just by adding -std=c++11 here. This resolves a conflict with openal soft 1.20.1 for android builds. This works because the library assumes c++17 and invokes a function that isn't available in android sdk below 28. --- project/Build.xml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/project/Build.xml b/project/Build.xml index 15be32417c..2c326e8968 100755 --- a/project/Build.xml +++ b/project/Build.xml @@ -55,7 +55,8 @@ - + + From 52072d1f21a9090ed87aabce5ed4e8d7f6896331 Mon Sep 17 00:00:00 2001 From: Tobiasz Laskowski Date: Fri, 14 Mar 2025 10:04:25 +0000 Subject: [PATCH 62/93] Apply -std=c++11 to openal-soft build on android openal-soft assumes that aligned_alloc is available with c++17. Newer android ndks set c++17 by default, however they do not expose aligned_alloc without setting min sdk version to 28. We can avoid this issue by forcing openal to be compiled with c++11. Also note, we have HXCPP_CPP11 defined, however, hxcpp ignores this for the android toolchain. This means we must set it explicitly See: https://github.com/kcat/openal-soft/blob/f5e0eef34db3a3ab94b61a2f99f84f078ba947e7/common/almalloc.cpp#L15 --- project/Build.xml | 3 +-- project/lib/openal-files.xml | 2 ++ 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/project/Build.xml b/project/Build.xml index 2c326e8968..15be32417c 100755 --- a/project/Build.xml +++ b/project/Build.xml @@ -55,8 +55,7 @@ - - + diff --git a/project/lib/openal-files.xml b/project/lib/openal-files.xml index d07ad13bae..6fbdd33eb1 100644 --- a/project/lib/openal-files.xml +++ b/project/lib/openal-files.xml @@ -2,6 +2,8 @@ + + From 6e869172b1c5cd3f58379f539fa738055e27f955 Mon Sep 17 00:00:00 2001 From: Josh Tynjala Date: Tue, 18 Mar 2025 10:53:08 -0700 Subject: [PATCH 63/93] IOSHelper: use xcrun simctl boot deviceID to ensure that correct device is running If the simulator was already running with a different device, it might not start the selected device --- src/lime/tools/IOSHelper.hx | 1 + 1 file changed, 1 insertion(+) diff --git a/src/lime/tools/IOSHelper.hx b/src/lime/tools/IOSHelper.hx index 465427ef61..56f2438d46 100644 --- a/src/lime/tools/IOSHelper.hx +++ b/src/lime/tools/IOSHelper.hx @@ -340,6 +340,7 @@ class IOSHelper System.runCommand("", "open", ["-a", "Simulator", "--args", "-CurrentDeviceUDID", currentDeviceID]); } + waitForDeviceState("xcrun", ["simctl", "boot", currentDeviceID]); waitForDeviceState("xcrun", ["simctl", "uninstall", currentDeviceID, project.meta.packageName]); waitForDeviceState("xcrun", ["simctl", "install", currentDeviceID, applicationPath]); waitForDeviceState("xcrun", ["simctl", "launch", currentDeviceID, project.meta.packageName]); From 9d10e10f5fb7fbcca5c31bd181ea7739c5c0d3a9 Mon Sep 17 00:00:00 2001 From: Josh Tynjala Date: Tue, 18 Mar 2025 11:08:59 -0700 Subject: [PATCH 64/93] XCodeHelper: improve selection of default iPhone and iPad simulator Falls back to any ipad- or iphone- simulator, if necessary --- src/lime/tools/XCodeHelper.hx | 65 +++++++++++++++++++++++++++++++++-- 1 file changed, 63 insertions(+), 2 deletions(-) diff --git a/src/lime/tools/XCodeHelper.hx b/src/lime/tools/XCodeHelper.hx index 62109c5bee..d006eaf627 100644 --- a/src/lime/tools/XCodeHelper.hx +++ b/src/lime/tools/XCodeHelper.hx @@ -5,8 +5,17 @@ import lime.tools.HXProject; class XCodeHelper { - private static inline var DEFAULT_IPAD_SIMULATOR = "ipad-air"; + // different computers may have different sets of simulators installed + // so there isn't necessarily a reasonable default for ipads + private static var DEFAULT_IPAD_SIMULATOR_NAMES = [ + "ipad", + "ipad-air" + ]; + private static var DEFAULT_IPAD_AIR_SIMULATOR_FALLBACK_REGEX = ~/ipad-air-.+/g; + private static var DEFAULT_IPAD_SIMULATOR_FALLBACK_REGEX = ~/ipad-.+/g; + // this should be a standard iPhone of a particular generation private static var DEFAULT_IPHONE_SIMULATOR_REGEX = ~/iphone-\d+/g; + private static var DEFAULT_IPHONE_SIMULATOR_FALLBACK_REGEX = ~/iphone-.+/g; private static function extractSimulatorFlagName(line:String):String { @@ -92,18 +101,70 @@ class XCodeHelper { if (project.targetFlags.exists("ipad")) { - currentDevice = devices.get(DEFAULT_IPAD_SIMULATOR); + for (device in DEFAULT_IPAD_SIMULATOR_NAMES) + { + // try to find a relatively standard ipad simulator + currentDevice = devices.get(device); + if (currentDevice != null) + { + break; + } + } + // if we couldn't find one of the default names, let's try to + // find any iPad Air, which should be a reasonable default + if (currentDevice == null) + { + for (device in devices.keys()) + { + if (DEFAULT_IPAD_AIR_SIMULATOR_FALLBACK_REGEX.match(device)) + { + currentDevice = devices.get(device); + break; + } + } + } + // worst case, if we still haven't found a good name, choose the + // first ipad that we find. it could be a mini or pro, which + // might not necessarily be ideal, but it's better than nothing. + if (currentDevice == null) + { + for (device in devices.keys()) + { + if (DEFAULT_IPAD_SIMULATOR_FALLBACK_REGEX.match(device)) + { + currentDevice = devices.get(device); + break; + } + } + } } else { for (device in devices.keys()) { + // try to find a standard iphone, which should have an name + // like iphone-15 or iphone-16 if (DEFAULT_IPHONE_SIMULATOR_REGEX.match(device)) { currentDevice = devices.get(device); break; } } + // of we can't find a standard iphone for some reason, choose + // the first iphone- name that we find. it could be a plus, pro, + // se, or something that might not necessarily be ideal, but + // it's better than nothing at all. + if (currentDevice == null) + { + for (device in devices.keys()) + { + if (DEFAULT_IPHONE_SIMULATOR_FALLBACK_REGEX.match(device)) + { + currentDevice = devices.get(device); + break; + } + } + } } } From a9f72d65d906b6dec70f9237a9f6e85e6695bf83 Mon Sep 17 00:00:00 2001 From: Josh Tynjala Date: Tue, 18 Mar 2025 11:09:33 -0700 Subject: [PATCH 65/93] XCodeHelper: if project.xml contains , default to ipad simulator instead of iphone simulator --- src/lime/tools/XCodeHelper.hx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/lime/tools/XCodeHelper.hx b/src/lime/tools/XCodeHelper.hx index d006eaf627..7abd0c08dd 100644 --- a/src/lime/tools/XCodeHelper.hx +++ b/src/lime/tools/XCodeHelper.hx @@ -99,7 +99,7 @@ class XCodeHelper if (currentDevice == null) { - if (project.targetFlags.exists("ipad")) + if (project.targetFlags.exists("ipad") || project.config.getString("ios.device", "universal") == "ipad") { for (device in DEFAULT_IPAD_SIMULATOR_NAMES) { From 12d3ee5916d4f941a64ea3ccb4f73573194c6adf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bar=C4=B1=C5=9F=20Y=C4=B1ld=C4=B1r=C4=B1m?= <25794892+barisyild@users.noreply.github.com> Date: Sat, 25 Jan 2025 13:45:43 +0300 Subject: [PATCH 66/93] curl encoding support added --- project/src/net/curl/CURLBindings.cpp | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/project/src/net/curl/CURLBindings.cpp b/project/src/net/curl/CURLBindings.cpp index 861bb8536f..a3e0e80b11 100644 --- a/project/src/net/curl/CURLBindings.cpp +++ b/project/src/net/curl/CURLBindings.cpp @@ -1074,6 +1074,11 @@ namespace lime { writeBufferPosition[handle] = 0; writeBufferSize[handle] = 0; + CURLcode setopt_result = curl_easy_setopt(curl, CURLOPT_ACCEPT_ENCODING, ""); + if(setopt_result != CURLE_OK) { + printf("Failed to set CURLOPT_ACCEPT_ENCODING: %s\n", curl_easy_strerror(setopt_result)); + } + curl_gc_mutex.Unlock (); return handle; @@ -1125,6 +1130,11 @@ namespace lime { writeBufferPosition[handle] = 0; writeBufferSize[handle] = 0; + CURLcode setopt_result = curl_easy_setopt(curl, CURLOPT_ACCEPT_ENCODING, ""); + if(setopt_result != CURLE_OK) { + printf("Failed to set CURLOPT_ACCEPT_ENCODING: %s\n", curl_easy_strerror(setopt_result)); + } + curl_gc_mutex.Unlock (); return handle; @@ -2889,4 +2899,4 @@ extern "C" int lime_curl_register_prims () { return 0; -} \ No newline at end of file +} From b10d845ca00e328587323a3a1a280535851e9769 Mon Sep 17 00:00:00 2001 From: Chris Speciale Date: Wed, 2 Apr 2025 10:55:52 -0400 Subject: [PATCH 67/93] Create MAINTAINERS.md --- MAINTAINERS.md | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) create mode 100644 MAINTAINERS.md diff --git a/MAINTAINERS.md b/MAINTAINERS.md new file mode 100644 index 0000000000..cc698419e6 --- /dev/null +++ b/MAINTAINERS.md @@ -0,0 +1,27 @@ +# Maintainer Collaboration Guidelines + +## Ownership Boundaries +Core ownership includes final authority on major project direction, branding, external representation (e.g., website, GitHub org settings), and financial decisions. Project leadership roles should support this structure, not compete with it. +Joshua Granick remains the primary owner of OpenFL and related projects under its umbrella, including all copyrights, branding, and rights to external representations. + +## Commit Transparency +All commits — especially those involving the website or project structure — should be clearly described. Avoid vague or misleading commit messages. + +## No Unilateral Decisions +Significant changes to the public-facing site, GitHub structure, or future policies (including donation links) must be discussed with the core team before being merged. +High contribution volume does not entitle anyone to override team consensus or operate outside the established process. We value impact, but we expect humility and collaboration in return. + +## Respect Other Maintainers’ Work +Reverting, overwriting, or contradicting another maintainer’s contribution must go through discussion first — ideally via PR, not direct commit. + +## Escalation Policy +If collaboration issues persist after a discussion, core owners may revoke elevated roles or privileges to protect the health of the project. This isn’t personal — it’s structural. + +## Donations & Monetization +Any personal monetization links (Patreon, Ko-fi, etc.) require approval by the core **owners**. We want to keep funding equitable and transparent. + +## Communication First +If you disagree with a decision or direction, bring it up in team chat or discussion threads — not by taking action in silence. + +## We Are a Team +Leadership means contributing to both the codebase and the culture. If you’re not supporting both, you’re not fulfilling the role. From 236e143a8e10487478522dc394b6db47ada1c232 Mon Sep 17 00:00:00 2001 From: Chris Speciale Date: Thu, 10 Apr 2025 10:52:15 -0400 Subject: [PATCH 68/93] [fix] Extract values before locking to avoid deadlock with GC Attempts to fix reported freezes/crashes related to possible gc contention related to: https://github.com/openfl/lime/issues/1943 --- project/src/utils/Bytes.cpp | 87 +++++++++++++++++-------------------- 1 file changed, 40 insertions(+), 47 deletions(-) diff --git a/project/src/utils/Bytes.cpp b/project/src/utils/Bytes.cpp index 3a6333c619..79cfb49b65 100644 --- a/project/src/utils/Bytes.cpp +++ b/project/src/utils/Bytes.cpp @@ -178,52 +178,45 @@ namespace lime { } - void Bytes::Set (value bytes) { - - mutex.Lock (); - - if (val_is_null (bytes)) { - - if (usingValue.find (this) != usingValue.end ()) { - - usingValue.erase (this); - - } - - length = 0; - b = 0; - - } else { - - hadValue[this] = true; - usingValue[this] = true; - - length = val_int (val_field (bytes, id_length)); - - if (length > 0) { - - value _b = val_field (bytes, id_b); - - if (val_is_string (_b)) { - - b = (unsigned char*)val_string (_b); - - } else { - - b = (unsigned char*)buffer_data (val_to_buffer (_b)); - - } - - } else { - - b = 0; - - } - - } - - mutex.Unlock (); - + void Bytes::Set(value bytes) { + + int newLength = 0; + unsigned char* newB = 0; + bool isNull = val_is_null(bytes); + + if (!isNull) { + + //here we can extract the values before calling our mutex to avoid potential deadlock or contention + value lengthVal = val_field(bytes, id_length); + value bVal = val_field(bytes, id_b); + + newLength = val_int(lengthVal); + + if (newLength > 0) { + + if (val_is_string(bVal)) { + newB = (unsigned char*)val_string(bVal); + } else { + newB = (unsigned char*)buffer_data(val_to_buffer(bVal)); + } + } + } + + //and now it should be save to lock + mutex.Lock(); + + if (isNull) { + usingValue.erase(this); + length = 0; + b = 0; + } else { + hadValue[this] = true; + usingValue[this] = true; + length = newLength; + b = newB; + } + + mutex.Unlock(); } @@ -311,4 +304,4 @@ namespace lime { } -} \ No newline at end of file +} From aadf0789b17eb92b44d3974c971cbde57240423d Mon Sep 17 00:00:00 2001 From: Chris Speciale Date: Thu, 10 Apr 2025 11:49:27 -0400 Subject: [PATCH 69/93] [ci] use the latest haxelib version --- .github/workflows/main.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 9a53cb45c0..b8a4807c10 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -30,6 +30,7 @@ jobs: - name: Install Haxe dependencies run: | curl --output ../hxcpp-4.3.45.zip --location https://github.com/HaxeFoundation/hxcpp/releases/download/v4.3.45/hxcpp-4.3.45.zip + haxelib --global update haxelib --quiet haxelib install ../hxcpp-4.3.45.zip --quiet haxelib install format --quiet haxelib install hxp --quiet From 241edd9d100e282c95a15a96342a4387290d017a Mon Sep 17 00:00:00 2001 From: Josh Tynjala Date: Mon, 14 Apr 2025 15:27:24 -0700 Subject: [PATCH 70/93] efsw 1.4.1 Upgrading required to compile with latest Xcode and macOS SDK --- project/lib/efsw | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/project/lib/efsw b/project/lib/efsw index 41feca17c0..62f785c56b 160000 --- a/project/lib/efsw +++ b/project/lib/efsw @@ -1 +1 @@ -Subproject commit 41feca17c0a4ec85b78552d8cb7eb641149b8735 +Subproject commit 62f785c56b7a34f035193d4cb831921347b586b8 From 97466c63608328557f08298f78276cf51a1d7d4b Mon Sep 17 00:00:00 2001 From: Josh Tynjala Date: Mon, 14 Apr 2025 15:28:01 -0700 Subject: [PATCH 71/93] png 1.6.46 Upgrading required to compile with latest Xcode and macOS SDK --- project/lib/png | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/project/lib/png b/project/lib/png index a40189cf88..0024abd279 160000 --- a/project/lib/png +++ b/project/lib/png @@ -1 +1 @@ -Subproject commit a40189cf881e9f0db80511c382292a5604c3c3d1 +Subproject commit 0024abd279d3a06435c0309a3f4172eed7c7a19a From bc8f9df60f926cfa309040f998206fba30abd9cc Mon Sep 17 00:00:00 2001 From: Josh Tynjala Date: Mon, 14 Apr 2025 15:28:26 -0700 Subject: [PATCH 72/93] zlib 1.2.13 Upgrading required to compile with latest Xcode and macOS SDK --- project/lib/zlib | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/project/lib/zlib b/project/lib/zlib index 21767c654d..51b7f2abda 160000 --- a/project/lib/zlib +++ b/project/lib/zlib @@ -1 +1 @@ -Subproject commit 21767c654d31d2dccdde4330529775c6c5fd5389 +Subproject commit 51b7f2abdade71cd9bb0e7a373ef2610ec6f9daf From 09b6d151ad017fa2a4e26148578da4e7401659bb Mon Sep 17 00:00:00 2001 From: Josh Tynjala Date: Mon, 5 May 2025 09:47:22 -0700 Subject: [PATCH 73/93] FileDialog: uses SINGLE_THREADED ThreadPool on all Windows targets to prevent application hang (closes #1946) (references #1849) Previously, it seemed that only Windows HashLink would hang when opening a FileDialog, but I was able to reproduce #1946 on Windows CPP too. Not sure why I couldn't before because I don't see any obvious changes to FileDialog or ThreadPool that would cause it to happen now, but not when it was affecting HashLink previously. Does not seem to affect other operating systems. We might consider going back to BackgroundWorker instead, which we used in Lime 8.1 and older. --- src/lime/ui/FileDialog.hx | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/lime/ui/FileDialog.hx b/src/lime/ui/FileDialog.hx index d5bc70d990..c6eed08032 100644 --- a/src/lime/ui/FileDialog.hx +++ b/src/lime/ui/FileDialog.hx @@ -99,7 +99,7 @@ class FileDialog if (type == null) type = FileDialogType.OPEN; #if desktop - var worker = new ThreadPool(#if (windows && hl) SINGLE_THREADED #end); + var worker = new ThreadPool(#if windows SINGLE_THREADED #end); worker.onComplete.add(function(result) { @@ -224,7 +224,7 @@ class FileDialog public function open(filter:String = null, defaultPath:String = null, title:String = null):Bool { #if (desktop && sys) - var worker = new ThreadPool(#if (windows && hl) SINGLE_THREADED #end); + var worker = new ThreadPool(#if windows SINGLE_THREADED #end); worker.onComplete.add(function(path:String) { @@ -287,7 +287,7 @@ class FileDialog } #if (desktop && sys) - var worker = new ThreadPool(#if (windows && hl) SINGLE_THREADED #end); + var worker = new ThreadPool(#if windows SINGLE_THREADED #end); worker.onComplete.add(function(path:String) { From c1f79fbfba2c1721ba2f5f2331c5016672852c7d Mon Sep 17 00:00:00 2001 From: Josh Tynjala Date: Mon, 5 May 2025 10:19:03 -0700 Subject: [PATCH 74/93] actions: use ubuntu-22.04 because GitHub removed ubuntu-20.04 --- .github/workflows/main.yml | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index b8a4807c10..edd7f91e75 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -7,7 +7,7 @@ env: jobs: linux: - runs-on: ubuntu-20.04 + runs-on: ubuntu-22.04 steps: - uses: actions/checkout@v4 @@ -273,7 +273,7 @@ jobs: lime build SimpleAudio windows -release -verbose -nocolor android: - runs-on: ubuntu-20.04 + runs-on: ubuntu-22.04 steps: - uses: actions/checkout@v4 @@ -418,7 +418,7 @@ jobs: package-haxelib: needs: [linux, macos, windows, android, ios] - runs-on: ubuntu-20.04 + runs-on: ubuntu-22.04 steps: - uses: actions/checkout@v4 @@ -534,7 +534,7 @@ jobs: if-no-files-found: error docs: - runs-on: ubuntu-20.04 + runs-on: ubuntu-22.04 steps: - uses: actions/checkout@v4 @@ -564,7 +564,7 @@ jobs: if-no-files-found: error flash-samples: - runs-on: ubuntu-20.04 + runs-on: ubuntu-22.04 steps: - uses: actions/checkout@v4 @@ -660,7 +660,7 @@ jobs: needs: package-haxelib strategy: matrix: - os: [windows-latest, ubuntu-20.04, macos-13] + os: [windows-latest, ubuntu-22.04, macos-13] runs-on: ${{ matrix.os }} steps: @@ -710,7 +710,7 @@ jobs: needs: package-haxelib strategy: matrix: - os: [windows-latest, ubuntu-20.04, macos-13] + os: [windows-latest, ubuntu-22.04, macos-13] runs-on: ${{ matrix.os }} steps: @@ -758,7 +758,7 @@ jobs: html5-samples: needs: package-haxelib - runs-on: ubuntu-20.04 + runs-on: ubuntu-22.04 strategy: matrix: haxe-version: [3.4.7, 4.0.5, 4.1.5, 4.2.5, 4.3.6] @@ -827,7 +827,7 @@ jobs: strategy: matrix: haxe-version: [3.4.7, 4.2.5] - os: [windows-latest, ubuntu-20.04, macos-13] + os: [windows-latest, ubuntu-22.04, macos-13] runs-on: ${{ matrix.os }} steps: @@ -874,7 +874,7 @@ jobs: lime build SimpleAudio neko -release -verbose -nocolor notify: - runs-on: ubuntu-20.04 + runs-on: ubuntu-22.04 needs: [package-haxelib, docs, android, flash-samples, air-samples, hashlink-samples, hashlinkc-samples, html5-samples, ios, linux, macos, neko-samples, windows] if: ${{ github.repository == 'openfl/lime' && github.event_name != 'pull_request' }} steps: From 95e63398c871f9c280db41dce064a4fc65b91186 Mon Sep 17 00:00:00 2001 From: Josh Tynjala Date: Thu, 5 Jun 2025 08:48:21 -0700 Subject: [PATCH 75/93] CommandLineTools: fix ability to specify in project with local .haxelib directory If the version of Lime tools doesn't match the version of Lime specified by , and Lime is found in .haxelib, append the -nolocalrepocheck option to avoid redundantly checking for .haxelib again and potentially comparing to a path resolved without accounting for yet. --- tools/CommandLineTools.hx | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/tools/CommandLineTools.hx b/tools/CommandLineTools.hx index e3cb7b4470..ea960923cc 100644 --- a/tools/CommandLineTools.hx +++ b/tools/CommandLineTools.hx @@ -1825,6 +1825,13 @@ class CommandLineTools args.push("-notoolscheck"); + var projectDirectory = Path.directory(projectFile); + var localRepository = Path.combine(projectDirectory, ".haxelib"); + if (FileSystem.exists(localRepository) && FileSystem.isDirectory(localRepository) && StringTools.startsWith(path, localRepository)) + { + args.push("-nolocalrepocheck"); + } + Sys.setCwd(path); var args = [Path.combine(path, "run.n")].concat(args); args.push(workingDirectory); From 0f6f01287a42c1476cd5552dc3c42964c14185b3 Mon Sep 17 00:00:00 2001 From: Josh Tynjala Date: Mon, 9 Jun 2025 15:25:52 -0700 Subject: [PATCH 76/93] actions: add pip3 to python3 execs that need to be removed --- .github/workflows/main.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index edd7f91e75..c624e62368 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -117,6 +117,7 @@ jobs: rm /usr/local/bin/idle3* rm /usr/local/bin/pydoc3* rm /usr/local/bin/python3* + rm /usr/local/bin/pip3* brew bundle popd From 4be7cc924e8f72c1b0545ea165b667caca971081 Mon Sep 17 00:00:00 2001 From: Josh Tynjala Date: Fri, 20 Jun 2025 14:04:57 -0700 Subject: [PATCH 77/93] FileDialog: if the defaultPath passed to browse() is a directory, fixes issue where parent directory was used as default path instead Tiny file dialogs seems to choose the parent directory if the path doesn't end with a separator. --- src/lime/ui/FileDialog.hx | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/src/lime/ui/FileDialog.hx b/src/lime/ui/FileDialog.hx index c6eed08032..014c11b8b5 100644 --- a/src/lime/ui/FileDialog.hx +++ b/src/lime/ui/FileDialog.hx @@ -14,6 +14,7 @@ import hl.Bytes as HLBytes; import hl.NativeArray; #end #if sys +import sys.FileSystem; import sys.io.File; #end #if (js && html5) @@ -98,6 +99,29 @@ class FileDialog { if (type == null) type = FileDialogType.OPEN; + #if sys + if (defaultPath != null && defaultPath.length > 0 + && FileSystem.exists(defaultPath) + && FileSystem.isDirectory(defaultPath)) + { + // if the default path is a directory, and the default path doesn't + // end with a separator, tiny file dialogs may open its parent + // directory instead. + var lastChar = defaultPath.charAt(defaultPath.length - 1); + #if windows + if (lastChar != "/" && lastChar != "\\") + { + defaultPath = defaultPath + "\\"; + } + #else + if (lastChar != "/") + { + defaultPath = defaultPath + "/"; + } + #end + } + #end + #if desktop var worker = new ThreadPool(#if windows SINGLE_THREADED #end); @@ -148,6 +172,7 @@ class FileDialog var path = null; #if (!macro && lime_cffi) + trace(defaultPath); path = CFFI.stringValue(NativeCFFI.lime_file_dialog_open_file(title, filter, defaultPath)); #end From 112664aa35d2c1f3570b2835ab436b2708a6b7de Mon Sep 17 00:00:00 2001 From: player-03 Date: Sun, 13 Jul 2025 19:48:01 -0400 Subject: [PATCH 78/93] Fix deprecation warning. --- .../template/app/src/main/java/org/haxe/lime/GameActivity.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/templates/android/template/app/src/main/java/org/haxe/lime/GameActivity.java b/templates/android/template/app/src/main/java/org/haxe/lime/GameActivity.java index 18a276f6e5..a38781ac34 100644 --- a/templates/android/template/app/src/main/java/org/haxe/lime/GameActivity.java +++ b/templates/android/template/app/src/main/java/org/haxe/lime/GameActivity.java @@ -9,6 +9,7 @@ import android.os.Build; import android.os.Bundle; import android.os.Handler; +import android.os.Looper; import android.os.VibrationEffect; import android.os.Vibrator; import android.util.DisplayMetrics; @@ -119,7 +120,7 @@ protected void onCreate (Bundle state) { } - handler = new Handler (); + handler = new Handler (Looper.getMainLooper ()); Extension.assetManager = assetManager; Extension.callbackHandler = handler; From 3c86d2cd399951f70a83c3a8d0acca2c17411b32 Mon Sep 17 00:00:00 2001 From: player-03 Date: Sun, 13 Jul 2025 21:15:39 -0400 Subject: [PATCH 79/93] Simplify logic in `createCanvas()`. I assume we used `untyped __js__` to get around incomplete externs, but Haxe 3.2 updated the externs, and they've included the second argument ever since. --- src/lime/_internal/graphics/ImageCanvasUtil.hx | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/src/lime/_internal/graphics/ImageCanvasUtil.hx b/src/lime/_internal/graphics/ImageCanvasUtil.hx index 539bce20cc..3102bcc2c1 100644 --- a/src/lime/_internal/graphics/ImageCanvasUtil.hx +++ b/src/lime/_internal/graphics/ImageCanvasUtil.hx @@ -189,13 +189,10 @@ class ImageCanvasUtil if (!image.transparent) { - if (!image.transparent) buffer.__srcCanvas.setAttribute("moz-opaque", "true"); - buffer.__srcContext = untyped #if haxe4 js.Syntax.code #else __js__ #end ('buffer.__srcCanvas.getContext ("2d", { alpha: false })'); - } - else - { - buffer.__srcContext = buffer.__srcCanvas.getContext("2d"); + buffer.__srcCanvas.setAttribute("moz-opaque", "true"); } + + buffer.__srcContext = buffer.__srcCanvas.getContext("2d", {alpha: image.transparent}); } #end } From b9fecd2ab03510d250342ee877895839aa8b94d4 Mon Sep 17 00:00:00 2001 From: Josh Tynjala Date: Wed, 23 Jul 2025 10:32:40 -0700 Subject: [PATCH 80/93] IOSHelper: more refinements to selecting a physical device for lime test ios (closes #1957) Followup to 6f2f88ca74db62e9015bc252e178edf6bb9ed96b Now checks for devices with filters in the following order of preference: 1. State == 'connected' AND transportType == 'wired' 2. State == 'connected' AND transportType == 'localNetwork' 3. State == 'available (paired)' AND transportType == 'wired' 3. State == 'available (paired)' AND transportType == 'localNetwork' Also adds developerModeStatus == 'enabled' filter as a requirement for all checks. If the app is meant to be iPhone-only or iPad-only, adds the appropriate filter for that too. --- src/lime/tools/IOSHelper.hx | 94 ++++++++++++++++++++++++++++--------- 1 file changed, 72 insertions(+), 22 deletions(-) diff --git a/src/lime/tools/IOSHelper.hx b/src/lime/tools/IOSHelper.hx index 56f2438d46..50fa343411 100644 --- a/src/lime/tools/IOSHelper.hx +++ b/src/lime/tools/IOSHelper.hx @@ -360,39 +360,68 @@ class IOSHelper applicationPath = workingDirectory + "/build/" + configuration + "-iphoneos/" + project.app.file + ".app"; } + var requireIPad = project.config.getString("ios.device", "universal") == "ipad"; + var requireIPhone = project.config.getString("ios.device", "universal") == "iphone"; + var xcodeVersion = Std.parseFloat(getXcodeVersion()); if (!Math.isNaN(xcodeVersion) && xcodeVersion >= 16) { // ios-deploy doesn't work with newer iOS SDKs where it can't // find DeveloperDiskImage.dmg. however, Xcode 16 adds new // commands for installing and launching apps on connected // devices, so we'll prefer those, if available. + var deviceUUID:String = null; - // prefer an iOS device with State == 'connected' - // Note: Platform == 'iOS' includes iPadOS - var listDevicesOutput = System.runProcess("", "xcrun", ["devicectl", "list", "devices", "--hide-default-columns", "--columns", "Identifier", "--filter", "Platform == 'iOS' AND State == 'connected'"]); - var ready = false; - for (line in listDevicesOutput.split("\n")) { - if (!ready) { - ready = StringTools.startsWith(line, "----"); - continue; - } - deviceUUID = line; - break; + + // we'll try various combinations of the following filters to + // select an iOS device. there may be multiple devices to choose + // from, so these filters help us figure out the best one. + + var filterPlatformIOS = "Platform == 'iOS'"; // includes iPadOS + var filterDeveloperModeEnabled = "deviceProperties.developerModeStatus == 'enabled'"; + var filterStateConnected = "State == 'connected'"; + var filterStateAvailable = "State == 'available (paired)'"; + var filterTransportTypeWired = "connectionProperties.transportType == 'wired'"; + var filterTransportTypeLocalNetwork = "connectionProperties.transportType == 'localNetwork'"; + var filterDeviceTypeIPhone = "hardwareProperties.deviceType == 'iPhone'"; + var filterDeviceTypeIPad = "hardwareProperties.deviceType == 'iPad'"; + + // first, some strictly required filters: + // 1. the platform must always be iOS (which includes iPadOS). + // 2. the device must be in developer mode. + // 3. if required by the project config, limit to iPhone or iPad only + var baseFilters = [ + filterPlatformIOS, + filterDeveloperModeEnabled, + ]; + if (requireIPad) + { + baseFilters.push(filterDeviceTypeIPad); } - if (deviceUUID == null || deviceUUID.length == 0) { - // preferred fallback is an iOS device that is both - // available and wired - var listDevicesOutput = System.runProcess("", "xcrun", ["devicectl", "list", "devices", "--hide-default-columns", "--columns", "Identifier", "--filter", "Platform == 'iOS' AND State == 'available (paired)' AND connectionProperties.transportType == 'wired'"]); - ready = false; - for (line in listDevicesOutput.split("\n")) { - if (!ready) { - ready = StringTools.startsWith(line, "----"); - continue; + else if (requireIPhone) + { + baseFilters.push(filterDeviceTypeIPhone); + } + + // after that, we have the following preferences, in order: + // 1. state: "connected" preferred over "available (paired)" + // 2. transportType: "wired" preferred over "localNetwork" + var stateFilters = [filterStateConnected, filterStateAvailable]; + var transportTypeFilters = [filterTransportTypeWired, filterTransportTypeLocalNetwork]; + for (stateFilter in stateFilters) + { + for (transportTypeFilter in transportTypeFilters) + { + deviceUUID = findDeviceUUIDWithFilters(baseFilters.concat([ + stateFilter, + transportTypeFilter + ])); + if (deviceUUID != null && deviceUUID.length > 0) + { + break; } - deviceUUID = line; - break; } } + if (deviceUUID == null || deviceUUID.length == 0) { // devices running iOS 16 and older don't support // xcrun devicectl, so if no device was found, try falling @@ -416,6 +445,27 @@ class IOSHelper } } + private static function findDeviceUUIDWithFilters(filters:Array):String + { + var listDevicesOutput = System.runProcess("", "xcrun", + [ + "devicectl", "list", "devices", + "--hide-default-columns", "--columns", "Identifier", + "--filter", filters.join(" AND ") + ]); + var ready = false; + for (line in listDevicesOutput.split("\n")) + { + if (!ready) + { + ready = StringTools.startsWith(line, "----"); + continue; + } + return line; + } + return null; + } + private static function fallbackLaunch(project:HXProject, applicationPath:String):Void { var templatePaths = [ From 1e47c4d0be3c19c93517ff676fe32ee58ccc6c58 Mon Sep 17 00:00:00 2001 From: Joseph Cloutier Date: Thu, 24 Jul 2025 15:47:19 -0400 Subject: [PATCH 81/93] Fix tinyfiledialogs compatibility with zenity. --- project/lib/tinyfiledialogs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/project/lib/tinyfiledialogs b/project/lib/tinyfiledialogs index 2681e426dd..b736119e5d 160000 --- a/project/lib/tinyfiledialogs +++ b/project/lib/tinyfiledialogs @@ -1 +1 @@ -Subproject commit 2681e426ddaebc8e2764a7823b4b9d69564d1684 +Subproject commit b736119e5de13b32001b63614dd65f8966e6adb8 From a999a7b2198197aafdbab393c32c2c1f14efbcfa Mon Sep 17 00:00:00 2001 From: Josh Tynjala Date: Mon, 11 Aug 2025 15:02:40 -0700 Subject: [PATCH 82/93] Assets: document getImage() result behavior Multiple calls to getImage() with the same ID may return a new Image instance on some targets, but the same Image instance on other targets. --- src/lime/utils/Assets.hx | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/src/lime/utils/Assets.hx b/src/lime/utils/Assets.hx index ec6de0cc01..87808483ed 100644 --- a/src/lime/utils/Assets.hx +++ b/src/lime/utils/Assets.hx @@ -181,7 +181,23 @@ class Assets } /** - * Gets an instance of an embedded bitmap + * Gets an instance of an embedded bitmap. + * + * _Note:_ This method may behave differently, depending on the target + * platform. On targets that can quickly create a new image synchronously, + * every call to `Assets.getImage()` with the same ID will return a new + * `Image` instance. However, on other targets where creating images + * synchronously is unacceptably slow, or where images may not be created + * synchronously and must be created asynchronously, every call to + * `Assets.getImage()` with the same ID may return a single, shared `Image` + * instance. + * + * With that in mind, modifying or disposing the contents of the `Image` + * returned by `Assets.getImage()` may affect the results of future calls to + * Assets.getImage()` on some targets. To access an `Image` instance that + * may be modified without affecting future calls to `Assets.getImage()`, + * call the `Image` instance's `clone()` method to manually create a copy. + * * @usage var bitmap = new Bitmap(Assets.getBitmapData("image.jpg")); * @param id The ID or asset path for the bitmap * @param useCache (Optional) Whether to use BitmapData from the cache(Default: true) From 52ad5b1b24d166b088ba3379af1047dde01e3070 Mon Sep 17 00:00:00 2001 From: Thomas Cashman Date: Fri, 14 Feb 2025 17:34:40 +0000 Subject: [PATCH 83/93] Fix GetDirectory UTF16 encoding issue --- project/src/backend/sdl/SDLSystem.cpp | 32 ++++++++++----------------- 1 file changed, 12 insertions(+), 20 deletions(-) diff --git a/project/src/backend/sdl/SDLSystem.cpp b/project/src/backend/sdl/SDLSystem.cpp index 058f2d3dd8..688fc38c2c 100644 --- a/project/src/backend/sdl/SDLSystem.cpp +++ b/project/src/backend/sdl/SDLSystem.cpp @@ -142,11 +142,9 @@ namespace lime { #elif defined (HX_WINDOWS) - char folderPath[MAX_PATH] = ""; - SHGetFolderPath (NULL, CSIDL_DESKTOPDIRECTORY, NULL, SHGFP_TYPE_CURRENT, folderPath); - //WIN_StringToUTF8 (folderPath); - std::wstring_convert> converter; - result = new std::wstring (converter.from_bytes (folderPath)); + WCHAR folderPath[MAX_PATH] = L""; + SHGetFolderPathW (NULL, CSIDL_DESKTOPDIRECTORY, NULL, SHGFP_TYPE_CURRENT, folderPath); + result = new std::wstring (folderPath); #elif defined (IPHONE) @@ -179,11 +177,9 @@ namespace lime { #elif defined (HX_WINDOWS) - char folderPath[MAX_PATH] = ""; - SHGetFolderPath (NULL, CSIDL_MYDOCUMENTS, NULL, SHGFP_TYPE_CURRENT, folderPath); - //WIN_StringToUTF8 (folderPath); - std::wstring_convert> converter; - result = new std::wstring (converter.from_bytes (folderPath)); + WCHAR folderPath[MAX_PATH] = L""; + SHGetFolderPathW (NULL, CSIDL_MYDOCUMENTS, NULL, SHGFP_TYPE_CURRENT, folderPath); + result = new std::wstring (folderPath); #elif defined (IPHONE) @@ -217,11 +213,9 @@ namespace lime { #elif defined (HX_WINDOWS) - char folderPath[MAX_PATH] = ""; - SHGetFolderPath (NULL, CSIDL_FONTS, NULL, SHGFP_TYPE_CURRENT, folderPath); - //WIN_StringToUTF8 (folderPath); - std::wstring_convert> converter; - result = new std::wstring (converter.from_bytes (folderPath)); + WCHAR folderPath[MAX_PATH] = L""; + SHGetFolderPathW (NULL, CSIDL_FONTS, NULL, SHGFP_TYPE_CURRENT, folderPath); + result = new std::wstring (folderPath); #elif defined (HX_MACOS) @@ -257,11 +251,9 @@ namespace lime { #elif defined (HX_WINDOWS) - char folderPath[MAX_PATH] = ""; - SHGetFolderPath (NULL, CSIDL_PROFILE, NULL, SHGFP_TYPE_CURRENT, folderPath); - //WIN_StringToUTF8 (folderPath); - std::wstring_convert> converter; - result = new std::wstring (converter.from_bytes (folderPath)); + WCHAR folderPath[MAX_PATH] = L""; + SHGetFolderPathW (NULL, CSIDL_PROFILE, NULL, SHGFP_TYPE_CURRENT, folderPath); + result = new std::wstring (folderPath); #elif defined (IPHONE) From 99e986ce39cf438c64768c20f20d8161566c77de Mon Sep 17 00:00:00 2001 From: Tobiasz Laskowski Date: Fri, 15 Aug 2025 18:52:19 +0100 Subject: [PATCH 84/93] Fix typos in mbedtls xml includes --- project/lib/curl-files.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/project/lib/curl-files.xml b/project/lib/curl-files.xml index 69220ce05f..06fecab8a6 100644 --- a/project/lib/curl-files.xml +++ b/project/lib/curl-files.xml @@ -1,5 +1,5 @@ - + @@ -30,7 +30,7 @@
- +
From cbcb5f029ec7e43ef96bed5589f4e4aee6426da6 Mon Sep 17 00:00:00 2001 From: Tobiasz Laskowski Date: Sun, 17 Aug 2025 12:30:47 +0100 Subject: [PATCH 85/93] Fix crash on null returns from sdl path functions On android SDL_GetBasePath is not implemented and returns NULL, which means that calling strlen causes a crash: https://github.com/libsdl-org/SDL/blob/1f21aae242ba7e1e040d93d1932e64d3e4246438/src/filesystem/android/SDL_sysfilesystem.c#L35-L40 According to sdl docs, SDL_GetPrefPath can also return NULL, so we also need to check for that: https://wiki.libsdl.org/SDL2/SDL_GetPrefPath#return-value https://wiki.libsdl.org/SDL2/SDL_GetBasePath#return-value --- project/src/backend/sdl/SDLSystem.cpp | 38 +++++++++++++++++---------- 1 file changed, 24 insertions(+), 14 deletions(-) diff --git a/project/src/backend/sdl/SDLSystem.cpp b/project/src/backend/sdl/SDLSystem.cpp index 688fc38c2c..1cad2dd07d 100644 --- a/project/src/backend/sdl/SDLSystem.cpp +++ b/project/src/backend/sdl/SDLSystem.cpp @@ -108,13 +108,19 @@ namespace lime { case APPLICATION: { char* path = SDL_GetBasePath (); - #ifdef HX_WINDOWS - std::wstring_convert> converter; - result = new std::wstring (converter.from_bytes(path)); - #else - result = new std::wstring (path, path + strlen (path)); - #endif - SDL_free (path); + + if (path != nullptr) { + + #ifdef HX_WINDOWS + std::wstring_convert> converter; + result = new std::wstring (converter.from_bytes(path)); + #else + result = new std::wstring (path, path + strlen (path)); + #endif + SDL_free (path); + + } + break; } @@ -122,13 +128,17 @@ namespace lime { case APPLICATION_STORAGE: { char* path = SDL_GetPrefPath (company, title); - #ifdef HX_WINDOWS - std::wstring_convert> converter; - result = new std::wstring (converter.from_bytes(path)); - #else - result = new std::wstring (path, path + strlen (path)); - #endif - SDL_free (path); + + if (path != nullptr) { + #ifdef HX_WINDOWS + std::wstring_convert> converter; + result = new std::wstring (converter.from_bytes(path)); + #else + result = new std::wstring (path, path + strlen (path)); + #endif + SDL_free (path); + } + break; } From c81d70c30347d25bd9ca981b09a7e9b2d5b4dd51 Mon Sep 17 00:00:00 2001 From: Tobiasz Laskowski Date: Sun, 17 Aug 2025 12:38:34 +0100 Subject: [PATCH 86/93] Fix NULL handling in `GetDirectory(DESKTOP)` If HOME is NULL, we cannot return here immediately, since we haven't called `System::GCExitBlocking()`. This currently causes: ``` Critical Error: Allocating from a GC-free thread ``` This is already handled correctly for `USER` and `DOCUMENTS`, however `DESKTOP` was missed out in f6e38208d368b503031898538d1d3f13b3d43d11 --- project/src/backend/sdl/SDLSystem.cpp | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/project/src/backend/sdl/SDLSystem.cpp b/project/src/backend/sdl/SDLSystem.cpp index 1cad2dd07d..2d4ed1063f 100644 --- a/project/src/backend/sdl/SDLSystem.cpp +++ b/project/src/backend/sdl/SDLSystem.cpp @@ -164,15 +164,13 @@ namespace lime { char const* home = getenv ("HOME"); - if (home == NULL) { + if (home != NULL) { - return 0; + std::string path = std::string (home) + std::string ("/Desktop"); + result = new std::wstring (path.begin (), path.end ()); } - std::string path = std::string (home) + std::string ("/Desktop"); - result = new std::wstring (path.begin (), path.end ()); - #endif break; From 985e0994d906e6cad669d1897be61069ff34364d Mon Sep 17 00:00:00 2001 From: Tobiasz Laskowski Date: Sat, 16 Aug 2025 15:37:18 +0100 Subject: [PATCH 87/93] Fix unicode system path conversions on linux For non windows platforms, we previously just passed char* into wstring, which didn't perform the necessary conversion into utf32 which is expected when hxcpp converts a wchar string to a hxstring on platforms where wchar has 4 bytes. --- project/src/backend/sdl/SDLSystem.cpp | 33 ++++++++++++++------------- 1 file changed, 17 insertions(+), 16 deletions(-) diff --git a/project/src/backend/sdl/SDLSystem.cpp b/project/src/backend/sdl/SDLSystem.cpp index 2d4ed1063f..70219b1bfb 100644 --- a/project/src/backend/sdl/SDLSystem.cpp +++ b/project/src/backend/sdl/SDLSystem.cpp @@ -38,10 +38,10 @@ #include #include -#ifdef HX_WINDOWS #include #include -#endif + +using wstring_convert = std::wstring_convert>; namespace lime { @@ -111,12 +111,8 @@ namespace lime { if (path != nullptr) { - #ifdef HX_WINDOWS - std::wstring_convert> converter; + wstring_convert converter; result = new std::wstring (converter.from_bytes(path)); - #else - result = new std::wstring (path, path + strlen (path)); - #endif SDL_free (path); } @@ -130,13 +126,11 @@ namespace lime { char* path = SDL_GetPrefPath (company, title); if (path != nullptr) { - #ifdef HX_WINDOWS - std::wstring_convert> converter; + + wstring_convert converter; result = new std::wstring (converter.from_bytes(path)); - #else - result = new std::wstring (path, path + strlen (path)); - #endif SDL_free (path); + } break; @@ -167,10 +161,15 @@ namespace lime { if (home != NULL) { std::string path = std::string (home) + std::string ("/Desktop"); - result = new std::wstring (path.begin (), path.end ()); + wstring_convert converter; + result = new std::wstring (converter.from_bytes(path)); } + std::string path = std::string (home) + std::string ("/Desktop"); + wstring_convert converter; + result = new std::wstring (converter.from_bytes(path)); + #endif break; @@ -204,7 +203,8 @@ namespace lime { if (home != NULL) { std::string path = std::string (home) + std::string ("/Documents"); - result = new std::wstring (path.begin (), path.end ()); + wstring_convert converter; + result = new std::wstring (converter.from_bytes(path)); } @@ -278,7 +278,8 @@ namespace lime { if (home != NULL) { std::string path = std::string (home); - result = new std::wstring (path.begin (), path.end ()); + wstring_convert converter; + result = new std::wstring (converter.from_bytes(path)); } @@ -878,4 +879,4 @@ namespace lime { } -} \ No newline at end of file +} From d1369f1aaa4c6bc4131c6ca30c30fef47a22c71c Mon Sep 17 00:00:00 2001 From: Tobiasz Laskowski Date: Mon, 18 Aug 2025 18:40:13 +0100 Subject: [PATCH 88/93] Fix merge error from 985e0994d906e6cad669d1897be61069ff34364d --- project/src/backend/sdl/SDLSystem.cpp | 4 ---- 1 file changed, 4 deletions(-) diff --git a/project/src/backend/sdl/SDLSystem.cpp b/project/src/backend/sdl/SDLSystem.cpp index 70219b1bfb..8b76afbaee 100644 --- a/project/src/backend/sdl/SDLSystem.cpp +++ b/project/src/backend/sdl/SDLSystem.cpp @@ -166,10 +166,6 @@ namespace lime { } - std::string path = std::string (home) + std::string ("/Desktop"); - wstring_convert converter; - result = new std::wstring (converter.from_bytes(path)); - #endif break; From 945a2ec8e0d488b78f347dc9ce8d3bdbebac027f Mon Sep 17 00:00:00 2001 From: Rainy <939029835@qq.com> Date: Thu, 14 Aug 2025 13:52:35 +0800 Subject: [PATCH 89/93] Perform null check for XMLHttpRequest.upload Some browsers may not support uploading, and accessing upload will return null. --- src/lime/_internal/backend/html5/HTML5HTTPRequest.hx | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/lime/_internal/backend/html5/HTML5HTTPRequest.hx b/src/lime/_internal/backend/html5/HTML5HTTPRequest.hx index d6f741f3a2..3625782886 100644 --- a/src/lime/_internal/backend/html5/HTML5HTTPRequest.hx +++ b/src/lime/_internal/backend/html5/HTML5HTTPRequest.hx @@ -64,7 +64,8 @@ class HTML5HTTPRequest if (parent.method == POST) { - request.upload.addEventListener("progress", progress, false); + if(request.upload != null) + request.upload.addEventListener("progress", progress, false); } else { From 2b1a627ed0ffba228847a1643e3160f2f1e75eb9 Mon Sep 17 00:00:00 2001 From: Chris Speciale Date: Sun, 31 Aug 2025 03:43:19 -0400 Subject: [PATCH 90/93] Clarify versioning and branching guidelines Documented semver-based versioning flow - Explained usage of patch (develop), minor (x.x.x-dev), and major (x.0.0-dev) branches - Added guidance on where to submit bug fixes, new features, and breaking changes - Improves contributor clarity and aligns with current project workflow (e.g., Lime 8.2.2 -> 8.3.0-dev, 9.0.0-dev) This helps reduce confusion about where to submit changes and ensures consistency across releases. --- CONTRIBUTING.md | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index ff63737f75..c483f354e6 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -16,3 +16,24 @@ You may consider creating a branch specific to the fix or improvement you wish t It is our goal to help Lime evolve as a clean, easy-to-use (but powerful) layer for cross-platform development. Thanks for being a part of making this possible! +## Versioning and Branching Guidelines + +We follow Semantic Versioning (semver): MAJOR.MINOR.PATCH. + +### Patch Updates (x.x.x) + +All bug fixes should be submitted to the current stable development branch (e.g., develop). + +These changes are released as patch versions (e.g., 8.2.3 → 8.2.4). + +### Minor Updates (x.x.0) + +All new features (non-breaking) should be submitted to the next minor development branch, named x.x.x-dev. + +For example, if the current version is 8.2.2, features targeting 8.3.0 should go into 8.3.0-dev. + +### Major Updates (x.0.0) + +Any breaking changes or major version updates must be submitted to the next major development branch, named x.0.0-dev. + +For example, breaking changes intended for 9.0.0 go into 9.0.0-dev. From afbac6d35f3131f8f962f7f1c3d695ff5232b123 Mon Sep 17 00:00:00 2001 From: Josh Tynjala Date: Fri, 12 Sep 2025 12:24:38 -0700 Subject: [PATCH 91/93] some more API docs --- src/lime/ui/KeyCode.hx | 8 ++++++++ src/lime/ui/ScanCode.hx | 8 ++++++++ src/lime/ui/Window.hx | 43 +++++++++++++++++++++++++++++++++++++++++ 3 files changed, 59 insertions(+) diff --git a/src/lime/ui/KeyCode.hx b/src/lime/ui/KeyCode.hx index 1843e6d4f5..54f0c3ddd9 100644 --- a/src/lime/ui/KeyCode.hx +++ b/src/lime/ui/KeyCode.hx @@ -2,6 +2,14 @@ package lime.ui; import lime._internal.backend.native.NativeCFFI; +/** + Used by keyboard event listeners to identify which key was pressed + down or released. + + @see `lime.ui.Window.onKeyDown` + @see `lime.ui.Window.onKeyUp` + @see `lime.ui.ScanCode` +**/ @:access(lime._internal.backend.native.NativeCFFI) #if (haxe_ver >= 4.0) enum #else @:enum #end abstract KeyCode(Int) from Int to Int from UInt to UInt { diff --git a/src/lime/ui/ScanCode.hx b/src/lime/ui/ScanCode.hx index 52cca0a5da..1d115499ed 100644 --- a/src/lime/ui/ScanCode.hx +++ b/src/lime/ui/ScanCode.hx @@ -2,6 +2,14 @@ package lime.ui; import lime._internal.backend.native.NativeCFFI; +/** + May be used to identify the scan code associated with the `KeyCode` passed + to keyboard event listeners. + + @see `lime.ui.Window.onKeyDown` + @see `lime.ui.Window.onKeyUp` + @see `lime.ui.KeyCode` +**/ @:access(lime._internal.backend.native.NativeCFFI) @:access(lime.ui.KeyCode) #if (haxe_ver >= 4.0) enum #else @:enum #end abstract ScanCode(Int) from Int to Int from UInt to UInt diff --git a/src/lime/ui/Window.hx b/src/lime/ui/Window.hx index 64810eba3b..7c6bf088f5 100644 --- a/src/lime/ui/Window.hx +++ b/src/lime/ui/Window.hx @@ -67,25 +67,68 @@ class Window public var onFocusOut(default, null) = new EventVoid>(); public var onFullscreen(default, null) = new EventVoid>(); public var onHide(default, null) = new EventVoid>(); + + /** + Fired when the user presses a key down when this window has focus. + **/ public var onKeyDown(default, null) = new EventKeyModifier->Void>(); + + /** + Fired when the user releases a key that was down. + **/ public var onKeyUp(default, null) = new EventKeyModifier->Void>(); + public var onLeave(default, null) = new EventVoid>(); + + /** + Fired when the window is maximized. + **/ public var onMaximize(default, null) = new EventVoid>(); + + /** + Fired when the window is minimized. + **/ public var onMinimize(default, null) = new EventVoid>(); + + /** + Fired when the user pressed a mouse button down. + **/ public var onMouseDown(default, null) = new EventFloat->MouseButton->Void>(); + + /** + Fired when the mouse is moved over the window. + **/ public var onMouseMove(default, null) = new EventFloat->Void>(); public var onMouseMoveRelative(default, null) = new EventFloat->Void>(); + + /** + Fired when the user releases a mouse button that was pressed down. + **/ public var onMouseUp(default, null) = new EventFloat->Int->Void>(); + + /** + Fired when the user interacts with the mouse wheel. + **/ public var onMouseWheel(default, null) = new EventFloat->MouseWheelMode->Void>(); + + /** + Fired when the window is moved to a new position. + **/ public var onMove(default, null) = new EventFloat->Void>(); public var onRender(default, null) = new EventVoid>(); public var onRenderContextLost(default, null) = new EventVoid>(); public var onRenderContextRestored(default, null) = new EventVoid>(); + + /** + Fired when the window is resized with new dimensions. + **/ public var onResize(default, null) = new EventInt->Void>(); + public var onRestore(default, null) = new EventVoid>(); public var onShow(default, null) = new EventVoid>(); public var onTextEdit(default, null) = new EventInt->Int->Void>(); public var onTextInput(default, null) = new EventVoid>(); + public var opacity(get, set):Float; public var parameters:Dynamic; public var resizable(get, set):Bool; From 05591ebdb0ca830c5b7cd6b175c2e7e7662fa804 Mon Sep 17 00:00:00 2001 From: Josh Tynjala Date: Fri, 12 Sep 2025 15:57:44 -0700 Subject: [PATCH 92/93] NativeCFFI: fix key_code_to_scan_code and key_code_from_scan_code They were using float values, but they should have been int values instead. The numeric type conversion was causing some kind of data loss that resulted in wrong values being returned in some cases. In particular, arrow keys. --- project/src/ExternalInterface.cpp | 12 ++++++------ src/lime/_internal/backend/native/NativeCFFI.hx | 16 ++++++++-------- src/lime/ui/KeyCode.hx | 4 ++-- 3 files changed, 16 insertions(+), 16 deletions(-) diff --git a/project/src/ExternalInterface.cpp b/project/src/ExternalInterface.cpp index 1718f4aa00..93ac90a07e 100644 --- a/project/src/ExternalInterface.cpp +++ b/project/src/ExternalInterface.cpp @@ -2427,28 +2427,28 @@ namespace lime { } - float lime_key_code_from_scan_code (float scanCode) { + int lime_key_code_from_scan_code (int scanCode) { return KeyCode::FromScanCode (scanCode); } - HL_PRIM float HL_NAME(hl_key_code_from_scan_code) (float scanCode) { + HL_PRIM int HL_NAME(hl_key_code_from_scan_code) (int scanCode) { return KeyCode::FromScanCode (scanCode); } - float lime_key_code_to_scan_code (float keyCode) { + int lime_key_code_to_scan_code (int keyCode) { return KeyCode::ToScanCode (keyCode); } - HL_PRIM float HL_NAME(hl_key_code_to_scan_code) (float keyCode) { + HL_PRIM int HL_NAME(hl_key_code_to_scan_code) (int keyCode) { return KeyCode::ToScanCode (keyCode); @@ -4197,8 +4197,8 @@ namespace lime { DEFINE_HL_PRIM (_I32, hl_joystick_get_num_hats, _I32); DEFINE_HL_PRIM (_TIMAGEBUFFER, hl_jpeg_decode_bytes, _TBYTES _BOOL _TIMAGEBUFFER); DEFINE_HL_PRIM (_TIMAGEBUFFER, hl_jpeg_decode_file, _STRING _BOOL _TIMAGEBUFFER); - DEFINE_HL_PRIM (_F32, hl_key_code_from_scan_code, _F32); - DEFINE_HL_PRIM (_F32, hl_key_code_to_scan_code, _F32); + DEFINE_HL_PRIM (_I32, hl_key_code_from_scan_code, _I32); + DEFINE_HL_PRIM (_I32, hl_key_code_to_scan_code, _I32); DEFINE_HL_PRIM (_VOID, hl_key_event_manager_register, _FUN (_VOID, _NO_ARG) _TKEY_EVENT); DEFINE_HL_PRIM (_BYTES, hl_locale_get_system_locale, _NO_ARG); DEFINE_HL_PRIM (_TBYTES, hl_lzma_compress, _TBYTES _TBYTES); diff --git a/src/lime/_internal/backend/native/NativeCFFI.hx b/src/lime/_internal/backend/native/NativeCFFI.hx index dd3403c8cc..4efefb98a7 100644 --- a/src/lime/_internal/backend/native/NativeCFFI.hx +++ b/src/lime/_internal/backend/native/NativeCFFI.hx @@ -219,9 +219,9 @@ class NativeCFFI @:cffi private static function lime_jpeg_decode_file(path:String, decodeData:Bool, buffer:Dynamic):Dynamic; - @:cffi private static function lime_key_code_from_scan_code(scanCode:Float32):Float32; + @:cffi private static function lime_key_code_from_scan_code(scanCode:Int):Int; - @:cffi private static function lime_key_code_to_scan_code(keyCode:Float32):Float32; + @:cffi private static function lime_key_code_to_scan_code(keyCode:Int):Int; @:cffi private static function lime_key_event_manager_register(callback:Dynamic, eventObject:Dynamic):Void; @@ -499,10 +499,10 @@ class NativeCFFI "lime_jpeg_decode_bytes", "oboo", false)); private static var lime_jpeg_decode_file = new cpp.CallableBool->cpp.Object->cpp.Object>(cpp.Prime._loadPrime("lime", "lime_jpeg_decode_file", "sboo", false)); - private static var lime_key_code_from_scan_code = new cpp.Callablecpp.Float32>(cpp.Prime._loadPrime("lime", "lime_key_code_from_scan_code", - "ff", false)); - private static var lime_key_code_to_scan_code = new cpp.Callablecpp.Float32>(cpp.Prime._loadPrime("lime", "lime_key_code_to_scan_code", - "ff", false)); + private static var lime_key_code_from_scan_code = new cpp.CallableInt>(cpp.Prime._loadPrime("lime", "lime_key_code_from_scan_code", + "ii", false)); + private static var lime_key_code_to_scan_code = new cpp.CallableInt>(cpp.Prime._loadPrime("lime", "lime_key_code_to_scan_code", + "ii", false)); private static var lime_key_event_manager_register = new cpp.Callablecpp.Object->cpp.Void>(cpp.Prime._loadPrime("lime", "lime_key_event_manager_register", "oov", false)); private static var lime_lzma_compress = new cpp.Callablecpp.Object->cpp.Object>(cpp.Prime._loadPrime("lime", "lime_lzma_compress", "ooo", @@ -1121,12 +1121,12 @@ class NativeCFFI return null; } - @:hlNative("lime", "hl_key_code_from_scan_code") private static function lime_key_code_from_scan_code(scanCode:hl.F32):hl.F32 + @:hlNative("lime", "hl_key_code_from_scan_code") private static function lime_key_code_from_scan_code(scanCode:Int):Int { return 0; } - @:hlNative("lime", "hl_key_code_to_scan_code") private static function lime_key_code_to_scan_code(keyCode:hl.F32):hl.F32 + @:hlNative("lime", "hl_key_code_to_scan_code") private static function lime_key_code_to_scan_code(keyCode:Int):Int { return 0; } diff --git a/src/lime/ui/KeyCode.hx b/src/lime/ui/KeyCode.hx index 54f0c3ddd9..36bdedf7de 100644 --- a/src/lime/ui/KeyCode.hx +++ b/src/lime/ui/KeyCode.hx @@ -254,7 +254,7 @@ import lime._internal.backend.native.NativeCFFI; { #if (lime_cffi && !macro) var code:Int = scanCode; - return Std.int(NativeCFFI.lime_key_code_from_scan_code(code)); + return NativeCFFI.lime_key_code_from_scan_code(code); #else return KeyCode.UNKNOWN; #end @@ -264,7 +264,7 @@ import lime._internal.backend.native.NativeCFFI; { #if (lime_cffi && !macro) var code:Int = keyCode; - return Std.int(NativeCFFI.lime_key_code_to_scan_code(code)); + return NativeCFFI.lime_key_code_to_scan_code(code); #else return ScanCode.UNKNOWN; #end From 68107eeaa8c9a819f90a5f74d4111ff6f3676277 Mon Sep 17 00:00:00 2001 From: Josh Tynjala Date: Thu, 18 Sep 2025 10:18:00 -0700 Subject: [PATCH 93/93] IOSHelper: fix missing break from outer loop when device UUID is found Followup to commit b9fecd2ab03510d250342ee877895839aa8b94d4 --- src/lime/tools/IOSHelper.hx | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/lime/tools/IOSHelper.hx b/src/lime/tools/IOSHelper.hx index 50fa343411..e1b704c36e 100644 --- a/src/lime/tools/IOSHelper.hx +++ b/src/lime/tools/IOSHelper.hx @@ -420,6 +420,10 @@ class IOSHelper break; } } + if (deviceUUID != null && deviceUUID.length > 0) + { + break; + } } if (deviceUUID == null || deviceUUID.length == 0) {