From 38f0b51a3e49d806cce83d020b39c996a159cbdd Mon Sep 17 00:00:00 2001 From: Thomas Gerbet Date: Thu, 9 Feb 2023 22:44:10 +0100 Subject: [PATCH] upx: 3.96 -> 4.0.2 https://github.com/upx/upx/blob/v4.0.2/NEWS --- pkgs/tools/compression/upx/default.nix | 40 ++++++-------------------- 1 file changed, 9 insertions(+), 31 deletions(-) diff --git a/pkgs/tools/compression/upx/default.nix b/pkgs/tools/compression/upx/default.nix index c556f31e6918..d176b32d60cf 100644 --- a/pkgs/tools/compression/upx/default.nix +++ b/pkgs/tools/compression/upx/default.nix @@ -1,39 +1,17 @@ -{ lib, stdenv, fetchurl, ucl, zlib, perl, fetchpatch }: +{ lib, stdenv, fetchFromGitHub, cmake }: stdenv.mkDerivation rec { pname = "upx"; - version = "3.96"; - src = fetchurl { - url = "https://github.com/upx/upx/releases/download/v${version}/${pname}-${version}-src.tar.xz"; - sha256 = "051pk5jk8fcfg5mpgzj43z5p4cn7jy5jbyshyn78dwjqr7slsxs7"; + version = "4.0.2"; + src = fetchFromGitHub { + owner = "upx"; + repo = pname; + rev = "v${version}"; + fetchSubmodules = true; + sha256 = "sha256-5jqEdMlHmsD88kT/EGieL7DktppVdfWyJWGRNRKbRc4="; }; - buildInputs = [ ucl zlib perl ]; - - patches = [ - (fetchpatch { - url = "https://github.com/upx/upx/commit/13bc031163863cb3866aa6cdc018dff0697aa5d4.patch"; - sha256 = "sha256-7uazgx1lOgHh2J7yn3yb1q9lTJsv4BbexdGlWRiAG/M="; - name = "CVE-2021-20285.patch"; - }) - ]; - - preConfigure = '' - export UPX_UCLDIR=${ucl} - ''; - - makeFlags = [ - "-C" "src" - "CHECK_WHITESPACE=true" - - # Disable blanket -Werror. Triggers failues on minor gcc-11 warnings. - "CXXFLAGS_WERROR=" - ]; - - installPhase = '' - mkdir -p $out/bin - cp src/upx.out $out/bin/upx - ''; + nativeBuildInputs = [ cmake ]; meta = with lib; { homepage = "https://upx.github.io/";