Commit Graph

21 Commits

Author SHA1 Message Date
Sunghoon Kang
77702747e7
flutter: add darwin support
Signed-off-by: Sunghoon Kang <me@hoon.dev>
2023-07-07 13:07:34 +09:00
FlafyDev
570f3efd1d flutter: Separate cache and unwrapped derivations
flutter-unwrapped will now not come with engine artifacts in its cache directory(`$out/bin/cache`).

To specify a different cache directory, set FLUTTER_CACHE_DIR.

Flutter's wrapper now sets FLUTTER_CACHE_DIR to set engine artifacts.

The sh file `$out/bin/internal/shared.sh` runs when launching Flutter and calls `"$FLUTTER_ROOT/bin/cache/` instead of our environment variable `FLUTTER_CACHE_DIR`.
I decided not to patch it since the script doesn't require engine artifacts(which are the only thing not added by the unwrapped derivation), so it shouldn't fail, and patching it will just be harder to maintain.
2023-06-30 15:23:34 +03:00
FlafyDev
b1efbff8ec flutter: Move artifact installation logic to the wrapper 2023-05-15 01:16:47 +03:00
hacker1024
97b7363358 flutter: Append to search paths in the wrapper
Appending to search paths allows dependencies to be replaced at runtime.

This is useful, for example, to the Dart packaging mechanism, which supplies a wrapped version of Git that spoofs cached Git package revisions for Pub.
2023-05-12 23:09:41 +10:00
hacker1024
f7af9373ed flutter: Generate target PKG_CONFIG_PATH at build time 2023-04-25 14:40:29 +10:00
hacker1024
17cb291df1 flutter: Allow adding extra dependencies to the wrapper
Flutter application derivations can add dependencies and build flags, but it's not as easy during development.

As an alternative to nix-shell, a custom Flutter wrapper can be built with dependencies required by projects.

This feature builds on the existing build environment setup techniques required for Linux desktop support, so is fairly cheap to maintain.
2023-04-16 21:20:25 +10:00
hacker1024
b187edb802 flutter: Pass through the version attribute in the wrapper 2023-04-15 19:25:01 +10:00
hacker1024
b16e344fae flutter: Remove --no-version-check from the immutable wrapper
This is not technically needed anyway, as the feature is removed in disable-auto-update.patch.

Prepending this argument causes issues:
- https://github.com/kevmoo/completion.dart/issues/33
- https://github.com/flutter/flutter/issues/124793
2023-04-14 15:11:31 +10:00
hacker1024
1b2cac51b2 flutter: Use existing libdeflate derivation 2023-04-14 14:21:38 +10:00
hacker1024
13bbb36132 flutter: Move makeWrapper to nativeBuildInputs in wrapper 2023-04-13 22:52:40 +10:00
hacker1024
4196ddbeb5 flutter: Add git and which to PATH 2023-04-13 21:55:50 +10:00
hacker1024
aa9079c678 flutter: Remove prebuilt dependencies from the wrapper
These are no longer needed now that the artifacts are patched.
2023-04-13 18:01:58 +10:00
hacker1024
9e33e35589 flutter: Add zlib to the linker search path 2023-04-13 18:01:32 +10:00
hacker1024
94a34aadf6 flutter: Use autoPatchelfHook for SDK artifacts
This allows SDK artifacts (including build tools and libraries) to use the right interpreter and library locations, abolishing the need for a FHS or post-build patches.

`autoPatchelf` has been used through `autoPatchelfHook`, instead of the `autoPatchelf` command on just the artifact directory, due to the latter method not patching interpreter paths (https://discourse.nixos.org/t/trying-to-use-autopatchelf/24003).

Co-authored-by: FlafyDev <flafyarazi@gmail.com>
Co-authored-by: gilice <gilice@proton.me>
Co-authored-by: hacker1024 <hacker1024@users.sourceforge.net>
2023-04-13 18:01:25 +10:00
hacker1024
341fa709ff flutter: Redesign wrapping architecture
The following principles are now in place:

- All wrappers will include SDK file symlinks. There is not much of a reason to not do so, and removing the option to omit it makes it easier to understand what each wrapper does.
- There is no longer a way to get the previous derivation from a wrapper. This could yield unexpected results based on the wrapping order. Instead, "sdk", "unwrapped", and "noFHS" passthru attributes are provided where appropriate.
2023-02-18 00:43:17 +11:00
hacker1024
aa33cb9956 flutter: Reorganize the wrapper code 2023-02-17 23:55:13 +11:00
hacker1024
240d9bdf43 flutter: Properly set linker flags in wrapper 2023-02-17 22:48:41 +11:00
hacker1024
1d547baee0 flutter: Do not rely on pkg-config setup hook to build search path 2023-02-08 16:11:26 +11:00
hacker1024
fd46552867 flutter: Add libdeflate to build environment 2023-02-08 15:27:18 +11:00
hacker1024
e2adc5d899 flutter: Only enable Linux desktop support by default on Linux 2022-11-14 13:28:45 +11:00
hacker1024
ea48c7c9b6 flutter: Modularize unwrapped, wrapped, and FHS components 2022-11-14 13:11:49 +11:00