From 4b907c88918a2e08ce69a3db777af522391102af Mon Sep 17 00:00:00 2001 From: Ben Siraphob Date: Tue, 16 Mar 2021 19:43:47 +0700 Subject: [PATCH] mmv: 1.01b -> 2.0 --- pkgs/tools/misc/mmv/default.nix | 53 +++++++++++---------------------- 1 file changed, 17 insertions(+), 36 deletions(-) diff --git a/pkgs/tools/misc/mmv/default.nix b/pkgs/tools/misc/mmv/default.nix index ed45c2682039..8c242a5c83e6 100644 --- a/pkgs/tools/misc/mmv/default.nix +++ b/pkgs/tools/misc/mmv/default.nix @@ -1,49 +1,30 @@ -{ lib, stdenv, fetchurl }: +{ lib, stdenv, fetchFromGitHub, pkg-config, gengetopt, m4, gnupg +, git, perl, autoconf, automake, help2man, boehmgc }: stdenv.mkDerivation rec { pname = "mmv"; - version = "1.01b"; + version = "2.0"; - src = fetchurl { - url = "mirror://debian/pool/main/m/mmv/mmv_${version}.orig.tar.gz"; - sha256 = "0399c027ea1e51fd607266c1e33573866d4db89f64a74be8b4a1d2d1ff1fdeef"; + src = fetchFromGitHub { + owner = "rrthomas"; + repo = "mmv"; + rev = "v${version}"; + sha256 = "sha256-MmxDk3PBtvK/thrh6x67M+nMdCDlOQQHkREqLmzF2Mk="; + fetchSubmodules = true; }; - hardeningDisable = [ "format" ]; - - patches = [ - # Use Debian patched version, as upstream is no longer maintained and it - # contains a _lot_ of fixes. - (fetchurl { - url = "mirror://debian/pool/main/m/mmv/mmv_${version}-15.diff.gz"; - sha256 = "9ad3e3d47510f816b4a18bae04ea75913588eec92248182f85dd09bc5ad2df13"; - }) - ]; - - postPatch = '' - sed -i \ - -e 's/^\s*LDFLAGS\s*=\s*-s\s*-N/LDFLAGS = -s/' \ - -e "s|/usr/bin|$out/bin|" \ - -e "s|/usr/man|$out/share/man|" \ - Makefile + preConfigure = '' + ./bootstrap ''; - preInstall = '' - mkdir -p "$out/bin" "$out/share/man/man1" - ''; - - postInstall = '' - for variant in mcp mad mln - do - ln -s mmv "$out/bin/$variant" - ln -s mmv.1 "$out/share/man/man1/$variant.1" - done - ''; + nativeBuildInputs = [ gengetopt m4 git gnupg perl autoconf automake help2man pkg-config ]; + buildInputs = [ boehmgc ]; meta = { - homepage = "http://linux.maruhn.com/sec/mmv.html"; + homepage = "https://github.com/rrthomas/mmv"; description = "Utility for wildcard renaming, copying, etc"; - license = lib.licenses.gpl2; - platforms = lib.platforms.linux; + license = lib.licenses.gpl3Plus; + platforms = lib.platforms.all; + maintainers = with lib.maintainers; [ siraben ]; }; }