nixpkgs/pkgs/by-name/rp/rpm2targz/package.nix
aleksana 571c71e6f7 treewide: migrate packages to pkgs/by-name, take 1
We are migrating packages that meet below requirements:

1. using `callPackage`
2. called path is a directory
3. overriding set is empty (`{ }`)
4. not containing path expressions other than relative path (to
makenixpkgs-vet happy)
5. not referenced by nix files outside of the directory, other
than`pkgs/top-level/all-packages.nix`
6. not referencing nix files outside of the directory
7. not referencing `default.nix` (since it's changed to `package.nix`)
8. `outPath` doesn't change after migration

The tool is here: https://github.com/Aleksanaa/by-name-migrate.
2024-11-09 20:04:51 +08:00

51 lines
1.1 KiB
Nix

{ bzip2
, coreutils
, cpio
, fetchurl
, gnutar
, gzip
, lib
, stdenv
, xz
, zstd
}:
stdenv.mkDerivation rec {
pname = "rpm2targz";
version = "2021.03.16";
# git repo: https://gitweb.gentoo.org/proj/rpm2targz.git/
src = fetchurl {
url = "https://dev.gentoo.org/~vapier/dist/${pname}-${version}.tar.xz";
hash = "sha256-rcV+o9V2wWKznqSW2rA8xgnpQ02kpK4te6mYvLRC5vQ=";
};
postPatch = let
shdeps = [
bzip2
coreutils
cpio
gnutar
gzip
xz
zstd
];
in ''
substituteInPlace rpm2targz --replace "=\"rpmoffset\"" "=\"$out/bin/rpmoffset\""
# rpm2targz relies on the executable name
# to guess what compressor it should use
# this is more reliable than wrapProgram
sed -i -e '2iexport PATH="${lib.makeBinPath shdeps}"' rpm2targz
'';
installFlags = [ "prefix=$(out)" ];
meta = with lib; {
description = "Convert a .rpm file to a .tar.gz archive";
homepage = "http://slackware.com/config/packages.php";
license = licenses.bsd1;
maintainers = [ ];
platforms = platforms.all;
};
}