diff options
author | hacker1024 <hacker1024@users.sourceforge.net> | 2023-08-28 11:59:44 +1000 |
---|---|---|
committer | hacker1024 <hacker1024@users.sourceforge.net> | 2023-08-28 11:59:44 +1000 |
commit | 84347c2195eb5a7df786b2fbe046d34fdfe716c4 (patch) | |
tree | 8a9c410a1957c4ca1d5088daf4a60575c954687a /pkgs/development/compilers/flutter/wrapper.nix | |
parent | 48516a891d020801bc5304375739d2604400c741 (diff) | |
download | nixpkgs-84347c2195eb5a7df786b2fbe046d34fdfe716c4.tar nixpkgs-84347c2195eb5a7df786b2fbe046d34fdfe716c4.tar.gz nixpkgs-84347c2195eb5a7df786b2fbe046d34fdfe716c4.tar.bz2 nixpkgs-84347c2195eb5a7df786b2fbe046d34fdfe716c4.tar.lz nixpkgs-84347c2195eb5a7df786b2fbe046d34fdfe716c4.tar.xz nixpkgs-84347c2195eb5a7df786b2fbe046d34fdfe716c4.tar.zst nixpkgs-84347c2195eb5a7df786b2fbe046d34fdfe716c4.zip |
flutter: Use wrapGAppsHook
Flutter's Linux desktop embedding uses GTK. wrapGAppsHook should be used.
Diffstat (limited to 'pkgs/development/compilers/flutter/wrapper.nix')
-rw-r--r-- | pkgs/development/compilers/flutter/wrapper.nix | 53 |
1 files changed, 33 insertions, 20 deletions
diff --git a/pkgs/development/compilers/flutter/wrapper.nix b/pkgs/development/compilers/flutter/wrapper.nix index a650b1853fd..c090d74a863 100644 --- a/pkgs/development/compilers/flutter/wrapper.nix +++ b/pkgs/development/compilers/flutter/wrapper.nix @@ -33,6 +33,7 @@ , makeWrapper , runCommandLocal , writeShellScript +, wrapGAppsHook , git , which , pkg-config @@ -166,30 +167,42 @@ let includeFlags = map (pkg: "-isystem ${lib.getOutput "dev" pkg}/include") (appStaticBuildDeps ++ extraIncludes); linkerFlags = (map (pkg: "-rpath,${lib.getOutput "lib" pkg}/lib") appRuntimeDeps) ++ extraLinkerFlags; in -(callPackage ./sdk-symlink.nix { }) (runCommandLocal "flutter-wrapped" +(callPackage ./sdk-symlink.nix { }) (stdenv.mkDerivation { - nativeBuildInputs = [ - makeWrapper - ] ++ lib.optionals stdenv.hostPlatform.isDarwin [ darwin.DarwinTools ]; + pname = "flutter-wrapped"; + inherit (flutter) version; + + nativeBuildInputs = [ makeWrapper ] + ++ lib.optionals stdenv.hostPlatform.isDarwin [ darwin.DarwinTools ] + ++ lib.optionals supportsLinuxDesktop [ glib wrapGAppsHook ]; passthru = flutter.passthru // { - inherit (flutter) version; unwrapped = flutter; }; + dontUnpack = true; + dontWrapGApps = true; + + installPhase = '' + runHook preInstall + + for path in ${builtins.concatStringsSep " " (builtins.foldl' (paths: pkg: paths ++ (map (directory: "'${pkg}/${directory}/pkgconfig'") ["lib" "share"])) [ ] pkgConfigPackages)}; do + addToSearchPath FLUTTER_PKG_CONFIG_PATH "$path" + done + + mkdir -p $out/bin + makeWrapper '${immutableFlutter}' $out/bin/flutter \ + --set-default ANDROID_EMULATOR_USE_SYSTEM_LIBS 1 \ + --suffix PATH : '${lib.makeBinPath (tools ++ buildTools)}' \ + --suffix PKG_CONFIG_PATH : "$FLUTTER_PKG_CONFIG_PATH" \ + --suffix LIBRARY_PATH : '${lib.makeLibraryPath appStaticBuildDeps}' \ + --prefix CXXFLAGS "''\t" '${builtins.concatStringsSep " " (includeFlags ++ extraCxxFlags)}' \ + --prefix CFLAGS "''\t" '${builtins.concatStringsSep " " (includeFlags ++ extraCFlags)}' \ + --prefix LDFLAGS "''\t" '${builtins.concatStringsSep " " (map (flag: "-Wl,${flag}") linkerFlags)}' \ + ''${gappsWrapperArgs[@]} + + runHook postInstall + ''; + inherit (flutter) meta; -} '' - for path in ${builtins.concatStringsSep " " (builtins.foldl' (paths: pkg: paths ++ (map (directory: "'${pkg}/${directory}/pkgconfig'") ["lib" "share"])) [ ] pkgConfigPackages)}; do - addToSearchPath FLUTTER_PKG_CONFIG_PATH "$path" - done - - mkdir -p $out/bin - makeWrapper '${immutableFlutter}' $out/bin/flutter \ - --set-default ANDROID_EMULATOR_USE_SYSTEM_LIBS 1 \ - --suffix PATH : '${lib.makeBinPath (tools ++ buildTools)}' \ - --suffix PKG_CONFIG_PATH : "$FLUTTER_PKG_CONFIG_PATH" \ - --suffix LIBRARY_PATH : '${lib.makeLibraryPath appStaticBuildDeps}' \ - --prefix CXXFLAGS "''\t" '${builtins.concatStringsSep " " (includeFlags ++ extraCxxFlags)}' \ - --prefix CFLAGS "''\t" '${builtins.concatStringsSep " " (includeFlags ++ extraCFlags)}' \ - --prefix LDFLAGS "''\t" '${builtins.concatStringsSep " " (map (flag: "-Wl,${flag}") linkerFlags)}' -'') +}) |