From 020aaf624bb12ca337d94ec2cd55e920144faa6f Mon Sep 17 00:00:00 2001 From: aucub <78630225+aucub@users.noreply.github.com> Date: Fri, 13 Dec 2024 00:08:47 +0800 Subject: [PATCH] dart.rhttp: add 0.9.6 --- .../package-source-builders/rhttp/cargokit.patch | 8 ++++---- .../package-source-builders/rhttp/default.nix | 15 ++++++++------- 2 files changed, 12 insertions(+), 11 deletions(-) diff --git a/pkgs/development/compilers/dart/package-source-builders/rhttp/cargokit.patch b/pkgs/development/compilers/dart/package-source-builders/rhttp/cargokit.patch index bbb4771b6657..78e2678723b2 100644 --- a/pkgs/development/compilers/dart/package-source-builders/rhttp/cargokit.patch +++ b/pkgs/development/compilers/dart/package-source-builders/rhttp/cargokit.patch @@ -70,21 +70,21 @@ # If we have actual cmake target provided create target and make existing # target depend on it - add_custom_target("${target}_cargokit" DEPENDS ${OUTPUT_LIB}) -+ add_custom_target("${target}_cargokit" DEPENDS OUTPUT_LIB) ++ add_custom_target("${target}_cargokit" DEPENDS @output_lib@) add_dependencies("${target}" "${target}_cargokit") - target_link_libraries("${target}" PRIVATE "${OUTPUT_LIB}${IMPORT_LIB_EXTENSION}") -+ target_link_libraries("${target}" PRIVATE OUTPUT_LIB) ++ target_link_libraries("${target}" PRIVATE @output_lib@) if(WIN32) target_link_options(${target} PRIVATE "/INCLUDE:${any_symbol_name}") endif() else() # Otherwise (FFI) just use ALL to force building always - add_custom_target("${target}_cargokit" ALL DEPENDS ${OUTPUT_LIB}) -+ add_custom_target("${target}_cargokit" ALL DEPENDS OUTPUT_LIB) ++ add_custom_target("${target}_cargokit" ALL DEPENDS @output_lib@) endif() # Allow adding the output library to plugin bundled libraries - set("${target}_cargokit_lib" ${OUTPUT_LIB} PARENT_SCOPE) -+ set("${target}_cargokit_lib" OUTPUT_LIB PARENT_SCOPE) ++ set("${target}_cargokit_lib" @output_lib@ PARENT_SCOPE) endfunction() diff --git a/pkgs/development/compilers/dart/package-source-builders/rhttp/default.nix b/pkgs/development/compilers/dart/package-source-builders/rhttp/default.nix index 98f4c82c58be..b87acb6bdb2f 100644 --- a/pkgs/development/compilers/dart/package-source-builders/rhttp/default.nix +++ b/pkgs/development/compilers/dart/package-source-builders/rhttp/default.nix @@ -2,6 +2,7 @@ lib, rustPlatform, stdenv, + replaceVars, }: { version, src, ... }: @@ -16,6 +17,7 @@ let cargoHash = { _0_9_1 = "sha256-Gl3ArdSuw3/yi/JX6oloKJqerSJjTfK8HXRNei/LO+4="; + _0_9_6 = "sha256-a11UxG8nbIng+6uOWq/BZxdtRmRINl/7UOc6ap2mgrk="; } .${"_" + (lib.replaceStrings [ "." ] [ "_" ] version)} or (throw '' Unsupported version of pub 'rhttp': '${version}' @@ -34,17 +36,16 @@ stdenv.mkDerivation { inherit version src; inherit (src) passthru; - patches = [ ./cargokit.patch ]; - - postPatch = '' - substituteInPlace ./cargokit/cmake/cargokit.cmake --replace-fail "OUTPUT_LIB" "${rustDep}/${rustDep.passthru.libraryPath}" - ''; + patches = [ + (replaceVars ./cargokit.patch { + output_lib = "${rustDep}/${rustDep.passthru.libraryPath}"; + }) + ]; installPhase = '' runHook preInstall - mkdir $out/ - cp -r ./* $out/ + cp -r . $out runHook postInstall '';