mirror of
https://github.com/NixOS/nixpkgs.git
synced 2024-11-25 00:12:56 +00:00
4a7f99d55d
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
45 lines
1.2 KiB
Nix
45 lines
1.2 KiB
Nix
{ stdenv, lib, fetchurl, makeWrapper, perl
|
||
, unzip, gzip, file
|
||
# extractors which are added to unp’s PATH
|
||
, extraBackends ? []
|
||
}:
|
||
|
||
let
|
||
runtime_bins = [ file unzip gzip ] ++ extraBackends;
|
||
|
||
in stdenv.mkDerivation {
|
||
pname = "unp";
|
||
version = "2.0-pre7";
|
||
buildInputs = [ perl makeWrapper ];
|
||
|
||
src = fetchurl {
|
||
# url = "http://http.debian.net/debian/pool/main/u/unp/unp_2.0~pre7+nmu1.tar.bz2";
|
||
url = "mirror://debian/pool/main/u/unp/unp_2.0~pre7+nmu1.tar.bz2";
|
||
sha256 = "09w2sy7ivmylxf8blf0ywxicvb4pbl0xhrlbb3i9x9d56ll6ybbw";
|
||
name = "unp_2.0_pre7+nmu1.tar.bz2";
|
||
};
|
||
|
||
dontConfigure = true;
|
||
buildPhase = "true";
|
||
installPhase = ''
|
||
mkdir -p $out/bin
|
||
mkdir -p $out/share/man/man1
|
||
install ./unp $out/bin/unp
|
||
install ./ucat $out/bin/ucat
|
||
cp debian/unp.1 $out/share/man/man1
|
||
|
||
wrapProgram $out/bin/unp \
|
||
--prefix PATH : ${lib.makeBinPath runtime_bins}
|
||
wrapProgram $out/bin/ucat \
|
||
--prefix PATH : ${lib.makeBinPath runtime_bins}
|
||
'';
|
||
|
||
meta = with lib; {
|
||
description = "Command line tool for unpacking archives easily";
|
||
homepage = "https://packages.qa.debian.org/u/unp.html";
|
||
license = with licenses; [ gpl2 ];
|
||
maintainers = [ maintainers.timor ];
|
||
platforms = platforms.all;
|
||
};
|
||
}
|