nixpkgs/pkgs/tools/compression/advancecomp/default.nix
Profpatsch 4a7f99d55d treewide: with stdenv.lib; in meta -> with lib;
Part of: https://github.com/NixOS/nixpkgs/issues/108938

meta = with stdenv.lib;

is a widely used pattern. We want to slowly remove
the `stdenv.lib` indirection and encourage people
to use `lib` directly. Thus let’s start with the meta
field.

This used a rewriting script to mostly automatically
replace all occurances of this pattern, and add the
`lib` argument to the package header if it doesn’t
exist yet.

The script in its current form is available at
https://cs.tvl.fyi/depot@2f807d7f141068d2d60676a89213eaa5353ca6e0/-/blob/users/Profpatsch/nixpkgs-rewriter/default.nix
2021-01-11 10:38:22 +01:00

47 lines
1.2 KiB
Nix

{ lib, stdenv
, fetchFromGitHub
, fetchpatch
, autoreconfHook
, zlib
}:
stdenv.mkDerivation rec {
pname = "advancecomp";
version = "2.1";
src = fetchFromGitHub {
owner = "amadvance";
repo = "advancecomp";
rev = "v${version}";
sha256 = "1pd6czamamrd0ppk5a3a65hcgdlqwja98aandhqiajhnibwldv8x";
};
nativeBuildInputs = [ autoreconfHook ];
buildInputs = [ zlib ];
patches = [
(fetchpatch {
name = "CVE-2019-9210.patch";
url = "https://github.com/amadvance/advancecomp/commit/fcf71a89265c78fc26243574dda3a872574a5c02.patch";
sha256 = "0cdv9g87c1y8zwhqkd9ba2zjw4slcvg7yzcqv43idvnwb5fl29n7";
excludes = [ "doc/history.d" ];
})
];
# autover.sh relies on 'git describe', which obviously doesn't work as we're not cloning
# the full git repo. so we have to put the version number in `.version`, otherwise
# the binaries get built reporting "none" as their version number.
postPatch = ''
echo "${version}" >.version
'';
meta = with lib; {
description = ''A set of tools to optimize deflate-compressed files'';
license = licenses.gpl3 ;
maintainers = [ maintainers.raskin ];
platforms = platforms.linux ++ platforms.darwin;
homepage = "https://github.com/amadvance/advancecomp";
};
}