From 4d3ac9fe9d25f6cdfb632a0b3b21ac135b17d411 Mon Sep 17 00:00:00 2001 From: Mathias Zhang Date: Wed, 9 Apr 2025 00:58:37 +0800 Subject: [PATCH] flaca: 3.2.3 -> 3.3.2 --- pkgs/by-name/fl/flaca/package.nix | 45 ++++++++++++++----------------- 1 file changed, 20 insertions(+), 25 deletions(-) diff --git a/pkgs/by-name/fl/flaca/package.nix b/pkgs/by-name/fl/flaca/package.nix index 9fa928f5d300..c1fd5efe544d 100644 --- a/pkgs/by-name/fl/flaca/package.nix +++ b/pkgs/by-name/fl/flaca/package.nix @@ -3,46 +3,41 @@ fetchFromGitHub, rustPlatform, fetchurl, - runCommand, - lndir, }: -rustPlatform.buildRustPackage rec { +rustPlatform.buildRustPackage (finalAttrs: { pname = "flaca"; - version = "3.2.3"; + version = "3.3.2"; - src = - let - source = fetchFromGitHub { - owner = "Blobfolio"; - repo = "flaca"; - rev = "v${version}"; - hash = "sha256-GpxOTu7yjJ9IFMKVkgjLeKGNEUiKw0ZeWQorfhaOTsg="; - }; - lockFile = fetchurl { - url = "https://github.com/Blobfolio/flaca/releases/download/v${version}/Cargo.lock"; - hash = "sha256-SaqQ4U8JXTFlp1EqkNZ6VV8KyPXHYtEycfZn/68SeHY="; - }; - in - runCommand "source-with-lock" { nativeBuildInputs = [ lndir ]; } '' - mkdir -p $out - ln -s ${lockFile} $out/Cargo.lock - lndir -silent ${source} $out - ''; + lockFile = fetchurl { + url = "https://github.com/Blobfolio/flaca/releases/download/v${finalAttrs.version}/Cargo.lock"; + hash = "sha256-AFEuJQAz+cXUuyLefqsV2VyytJ+sfLrJQSArITqQZZU="; + }; + + src = fetchFromGitHub { + owner = "Blobfolio"; + repo = "flaca"; + tag = "v${finalAttrs.version}"; + hash = "sha256-sxBP3L9Abk3/NYkE1UeFFulGEhDe4wKqS71wrX6mA9c="; + }; + + postUnpack = '' + ln -s ${finalAttrs.lockFile} ${finalAttrs.src.name}/Cargo.lock + ''; nativeBuildInputs = [ rustPlatform.bindgenHook ]; useFetchCargoVendor = true; - cargoHash = "sha256-MdPPLv0836rVxVrl8PXMDufHdTtmBBhJ/EuG4qcK3Kk="; + cargoHash = "sha256-i4eYyS3s7q/1PaqwawpWeDbUHUGEvIfN65xfvpLkOpY="; meta = with lib; { description = "CLI tool to losslessly compress JPEG and PNG images"; longDescription = "A CLI tool for x86-64 Linux machines that simplifies the task of maximally, losslessly compressing JPEG and PNG images for use in production web environments"; homepage = "https://github.com/Blobfolio/flaca"; - changelog = "https://github.com/Blobfolio/flaca/releases/tag/v${version}"; + changelog = "https://github.com/Blobfolio/flaca/releases/tag/v${finalAttrs.version}"; maintainers = with maintainers; [ zzzsy ]; platforms = platforms.linux; license = licenses.wtfpl; mainProgram = "flaca"; }; -} +})