diff options
author | hacker1024 <hacker1024@users.sourceforge.net> | 2023-10-29 01:16:08 +1100 |
---|---|---|
committer | FlafyDev <flafyarazi@gmail.com> | 2023-12-26 18:48:08 +0200 |
commit | 2bd3e5d779f31c751cf2f23e98fc4dbe74f4328c (patch) | |
tree | d05ced737a6f26671f0aad77af48d55e84f7f3c1 /pkgs/development/compilers/dart | |
parent | cf55bc7300560f63f4e76521dbd163a00b060769 (diff) |
buildDartApplication: Use package source builders and setup hooks instead of package overrides
Diffstat (limited to 'pkgs/development/compilers/dart')
12 files changed, 136 insertions, 88 deletions
diff --git a/pkgs/development/compilers/dart/package-overrides/ffigen/default.nix b/pkgs/development/compilers/dart/package-overrides/ffigen/default.nix deleted file mode 100644 index e855cb49f0ad..000000000000 --- a/pkgs/development/compilers/dart/package-overrides/ffigen/default.nix +++ /dev/null @@ -1,14 +0,0 @@ -{ lib -, llvmPackages -}: - -{ ... }: - -{ FFIGEN_COMPILER_OPTS ? "" -, ... -}: - -{ - FFIGEN_LIBCLANG = lib.getLib llvmPackages.libclang; - FFIGEN_COMPILER_OPTS = "-I${FFIGEN_COMPILER_OPTS} ${llvmPackages.clang}/resource-root/include -I${lib.makeSearchPathOutput "dev" "include" [ llvmPackages.clang.libc_dev ]}"; -} diff --git a/pkgs/development/compilers/dart/package-overrides/flutter-secure-storage-linux/default.nix b/pkgs/development/compilers/dart/package-overrides/flutter-secure-storage-linux/default.nix deleted file mode 100644 index 91a61cb6c603..000000000000 --- a/pkgs/development/compilers/dart/package-overrides/flutter-secure-storage-linux/default.nix +++ /dev/null @@ -1,17 +0,0 @@ -{ lib -, pkg-config -, libsecret -, jsoncpp -}: - -{ ... }: - -{ nativeBuildInputs ? [ ] -, buildInputs ? [ ] -, ... -}: - -{ - nativeBuildInputs = [ pkg-config ] ++ nativeBuildInputs; - buildInputs = [ libsecret jsoncpp ] ++ buildInputs; -} diff --git a/pkgs/development/compilers/dart/package-overrides/handy-window/default.nix b/pkgs/development/compilers/dart/package-overrides/handy-window/default.nix deleted file mode 100644 index 49b5d47487e8..000000000000 --- a/pkgs/development/compilers/dart/package-overrides/handy-window/default.nix +++ /dev/null @@ -1,14 +0,0 @@ -{ lib -, cairo -, fribidi -}: - -{ ... }: - -{ CFLAGS ? "" -, ... -}: - -{ - CFLAGS = "${CFLAGS} -isystem ${lib.getOutput "dev" fribidi}/include/fribidi -isystem ${lib.getOutput "dev" cairo}/include"; -} diff --git a/pkgs/development/compilers/dart/package-overrides/matrix/default.nix b/pkgs/development/compilers/dart/package-overrides/matrix/default.nix deleted file mode 100644 index fb1adafa3208..000000000000 --- a/pkgs/development/compilers/dart/package-overrides/matrix/default.nix +++ /dev/null @@ -1,12 +0,0 @@ -{ openssl -}: - -{ ... }: - -{ runtimeDependencies ? [ ] -, ... -}: - -{ - runtimeDependencies = runtimeDependencies ++ [ openssl ]; -} diff --git a/pkgs/development/compilers/dart/package-overrides/olm/default.nix b/pkgs/development/compilers/dart/package-overrides/olm/default.nix deleted file mode 100644 index e91e8f393ca7..000000000000 --- a/pkgs/development/compilers/dart/package-overrides/olm/default.nix +++ /dev/null @@ -1,12 +0,0 @@ -{ olm -}: - -{ ... }: - -{ runtimeDependencies ? [ ] -, ... -}: - -{ - runtimeDependencies = runtimeDependencies ++ [ olm ]; -} diff --git a/pkgs/development/compilers/dart/package-overrides/system-tray/default.nix b/pkgs/development/compilers/dart/package-overrides/system-tray/default.nix deleted file mode 100644 index 531d833a6998..000000000000 --- a/pkgs/development/compilers/dart/package-overrides/system-tray/default.nix +++ /dev/null @@ -1,18 +0,0 @@ -{ libayatana-appindicator -}: - -{ ... }: - -{ preBuild ? "" -, ... -}: - -{ - preBuild = preBuild + '' - # $PUB_CACHE/hosted is a symlink to a store path. - mv $PUB_CACHE/hosted $PUB_CACHE/hosted_copy - cp -HR $PUB_CACHE/hosted_copy $PUB_CACHE/hosted - substituteInPlace $PUB_CACHE/hosted/pub.dev/system_tray-*/linux/tray.cc \ - --replace "libappindicator3.so.1" "${libayatana-appindicator}/lib/libayatana-appindicator3.so.1" - ''; -} diff --git a/pkgs/development/compilers/dart/package-overrides/default.nix b/pkgs/development/compilers/dart/package-source-builders/default.nix index e0467b3987ef..e015d423a1ca 100644 --- a/pkgs/development/compilers/dart/package-overrides/default.nix +++ b/pkgs/development/compilers/dart/package-source-builders/default.nix @@ -1,7 +1,6 @@ { callPackage }: { - ffigen = callPackage ./ffigen { }; flutter_secure_storage_linux = callPackage ./flutter-secure-storage-linux { }; handy_window = callPackage ./handy-window { }; matrix = callPackage ./matrix { }; diff --git a/pkgs/development/compilers/dart/package-source-builders/flutter-secure-storage-linux/default.nix b/pkgs/development/compilers/dart/package-source-builders/flutter-secure-storage-linux/default.nix new file mode 100644 index 000000000000..c111a7364656 --- /dev/null +++ b/pkgs/development/compilers/dart/package-source-builders/flutter-secure-storage-linux/default.nix @@ -0,0 +1,23 @@ +{ stdenv +, libsecret +, jsoncpp +}: + +{ version, src, ... }: + +stdenv.mkDerivation { + pname = "flutter-secure-storage-linux"; + inherit version src; + inherit (src) passthru; + + propagatedBuildInputs = [ libsecret jsoncpp ]; + + installPhase = '' + runHook preInstall + + mkdir -p "$out" + ln -s '${src}'/* "$out" + + runHook postInstall + ''; +} diff --git a/pkgs/development/compilers/dart/package-source-builders/handy-window/default.nix b/pkgs/development/compilers/dart/package-source-builders/handy-window/default.nix new file mode 100644 index 000000000000..bd43e0ed947f --- /dev/null +++ b/pkgs/development/compilers/dart/package-source-builders/handy-window/default.nix @@ -0,0 +1,31 @@ +{ stdenv +, lib +, writeScript +, cairo +, fribidi +}: + +{ version, src, ... }: + +stdenv.mkDerivation rec { + pname = "handy-window"; + inherit version src; + inherit (src) passthru; + + setupHook = writeScript "${pname}-setup-hook" '' + handyWindowConfigureHook() { + export CFLAGS="$CFLAGS -isystem ${lib.getDev fribidi}/include/fribidi -isystem ${lib.getDev cairo}/include" + } + + postConfigureHooks+=(handyWindowConfigureHook) + ''; + + installPhase = '' + runHook preInstall + + mkdir -p "$out" + ln -s '${src}'/* "$out" + + runHook postInstall + ''; +} diff --git a/pkgs/development/compilers/dart/package-source-builders/matrix/default.nix b/pkgs/development/compilers/dart/package-source-builders/matrix/default.nix new file mode 100644 index 000000000000..1e2c3fea80e7 --- /dev/null +++ b/pkgs/development/compilers/dart/package-source-builders/matrix/default.nix @@ -0,0 +1,30 @@ +{ stdenv +, lib +, writeScript +, openssl +}: + +{ version, src, ... }: + +stdenv.mkDerivation rec { + pname = "matrix"; + inherit version src; + inherit (src) passthru; + + setupHook = writeScript "${pname}-setup-hook" '' + matrixFixupHook() { + runtimeDependencies+=('${lib.getLib openssl}') + } + + preFixupHooks+=(matrixFixupHook) + ''; + + installPhase = '' + runHook preInstall + + mkdir -p "$out" + ln -s '${src}'/* "$out" + + runHook postInstall + ''; +} diff --git a/pkgs/development/compilers/dart/package-source-builders/olm/default.nix b/pkgs/development/compilers/dart/package-source-builders/olm/default.nix new file mode 100644 index 000000000000..8d715ff190fc --- /dev/null +++ b/pkgs/development/compilers/dart/package-source-builders/olm/default.nix @@ -0,0 +1,30 @@ +{ stdenv +, lib +, writeScript +, olm +}: + +{ version, src, ... }: + +stdenv.mkDerivation rec { + pname = "olm"; + inherit version src; + inherit (src) passthru; + + setupHook = writeScript "${pname}-setup-hook" '' + olmFixupHook() { + runtimeDependencies+=('${lib.getLib olm}') + } + + preFixupHooks+=(olmFixupHook) + ''; + + installPhase = '' + runHook preInstall + + mkdir -p "$out" + ln -s '${src}'/* "$out" + + runHook postInstall + ''; +} diff --git a/pkgs/development/compilers/dart/package-source-builders/system-tray/default.nix b/pkgs/development/compilers/dart/package-source-builders/system-tray/default.nix new file mode 100644 index 000000000000..81dc88ab2f52 --- /dev/null +++ b/pkgs/development/compilers/dart/package-source-builders/system-tray/default.nix @@ -0,0 +1,22 @@ +{ stdenv +, libayatana-appindicator +}: + +{ version, src, ... }: + +stdenv.mkDerivation rec { + pname = "system-tray"; + inherit version src; + inherit (src) passthru; + + installPhase = '' + runHook preInstall + + mkdir -p "$out" + cp -r '${src}'/* "$out" + substituteInPlace "$out/linux/tray.cc" \ + --replace "libappindicator3.so.1" "${libayatana-appindicator}/lib/libayatana-appindicator3.so.1" + + runHook postInstall + ''; +} |