peercoin / coinlib

The most feature-complete *coin library in the entire Dart/Flutter ecosystem.
BSD 3-Clause "New" or "Revised" License
6 stars 11 forks source link

Script and document Windows support (rebased on v2.0) #24

Closed sneurlax closed 9 months ago

sneurlax commented 9 months ago

This PR adds basic Windows support.

See the README.md changes and the commit history for a summary of the changes. Basically, I used flutter create . --platforms=windows, added a build_windows.dart build script, a crosscompile_windows.dart Dockerfile-based script, and a build_wsl.dart to be ran on a Windows host in a WSL2 instance, and I documented their use.

sneurlax commented 9 months ago

I marked the PR ready for review while working on the CMake integration on Windows. It's ready on a basic level as-is but could use improvements as discussed on the previous PR. I'm not sure that full Flutter CMake integration will be feasible for me on Windows, but will come back with an update on this point in awhile.

sneurlax commented 9 months ago

To test had to alter coinlib_flutter/example/pubspec.yaml like

diff --git a/coinlib_flutter/example/pubspec.yaml b/coinlib_flutter/example/pubspec.yaml
index c06782d..2a7fccc 100644
--- a/coinlib_flutter/example/pubspec.yaml
+++ b/coinlib_flutter/example/pubspec.yaml
@@ -10,7 +10,12 @@ environment:
 dependencies:
   flutter:
     sdk: flutter
-  coinlib_flutter: ^1.0.0
+  coinlib_flutter:
+    git:
+      url: https://github.com/cypherstack/coinlib.git
+      path: coinlib_flutter
+      ref: windows # TODO change to main.  TODO update to windows-2.0 branch.
+      # TODO pin to specific commit to reduce supply chain attack surface. 
   cupertino_icons: ^1.0.2

 dev_dependencies:

These changes aren't anywhere in this PR, they need to be made locally in order for it to work. However this shouldn't be an issue if/after the changes are published to pub.dev, and picking better version numbers would also work (releasing this with a new version number higher than coinlib's highest version number but lower than 2.0)

It would still be prudent to get another Windows user to test this :)

edit: you can also confirm this locally with a path ref instead of a git ref to our cypherstack/coinlib

sneurlax commented 9 months ago

Is there any hope to get the Windows CMake build working?

Yes, I don't feel that I exhausted every approach towards that end. It could very well be viable. I will try to try again before the New Year, but have been reassigned elsewhere for the time being

MatthewLM commented 9 months ago

Yes, I don't feel that I exhausted every approach towards that end. It could very well be viable. I will try to try again before the New Year, but have been reassigned elsewhere for the time being

OK, no worries. I might be unavailable until the latter part of next week, but I will take another look at anything when I can.

sneurlax commented 9 months ago

I'm working on a native Windows build now. This might be counting my chickens before they hatch, but I wonder about the build scripts names... Right now:

Do you have any preference how these should be named it I can accomplish a native Windows build? I'd assume build_windows.dart would be for running on Windows, personally. I don't know how I'd rename the cross compilation script(s), do you have any preferences there, assuming I do manage to achieve a native Windows build?

sneurlax commented 9 months ago

I have native Windows builds working, but not integrated into coinlib_flutter/src/CMakeLists.txt yet.

sneurlax commented 9 months ago

OK, I have not been able to get the entire build working automagically on Windows by altering coinlib_flutter/src/CMakeLists.txt, but I have native Windows builds working and documented. This is in a good place! It could be better by just using CMake and not coinlib/coinlib/bin/build_windows.dart et al., but I wasn't able to accomplish that yet. Perhaps that's a good topic for some future issues? I have a feeling that Linux could be made automagic...

sneurlax commented 9 months ago

Reverted/resolved by 50c49e173feb12068a3cb8007e1c87dd522a16ba, example app version is 1.0.0

On Fri, Jan 5, 2024 at 11:15 AM Matthew Mitchell @.***> wrote:

@.**** commented on this pull request.

In coinlib_flutter/example/pubspec.yaml https://github.com/peercoin/coinlib/pull/24#discussion_r1443137920:

@@ -2,15 +2,15 @@ name: coinlib_flutter_example description: Demonstrates how to use the coinlib_flutter plugin. publish_to: 'none' # Remove this line if you wish to publish to pub.dev

-version: 1.0.0 +version: 2.1.0

I'd say keep it as 1.0.0 though it's not very important.

— Reply to this email directly, view it on GitHub https://github.com/peercoin/coinlib/pull/24#discussion_r1443137920, or unsubscribe https://github.com/notifications/unsubscribe-auth/AA7K5WJOVEK7GTL5GLGCF73YNAYKBAVCNFSM6AAAAABA3WB4TOVHI2DSMVQWIX3LMV43YUDVNRWFEZLROVSXG5CSMV3GSZLXHMYTQMBWGQZTCMBZHE . You are receiving this because you authored the thread.Message ID: @.***>

MatthewLM commented 9 months ago

@sneurlax I merged a squashed commit to a new windows branch in preparation for a test pre-release. I'll likely get to that on Sunday ready for testing next week. Many thanks.