Unverified Commit feb4389e authored by Sebastián Mancilla's avatar Sebastián Mancilla Committed by GitHub
Browse files

Merge pull request #321858 from al3xtjames/convmv-darwin

convmv: add Darwin support, reformat & migrate to pkgs/by-name
parents 6a83f370 d44cc3b6
Loading
Loading
Loading
Loading
+60 −0
Original line number Diff line number Diff line
{
  lib,
  stdenv,
  fetchzip,
  perl,
}:

stdenv.mkDerivation (finalAttrs: {
  pname = "convmv";
  version = "2.05";

  outputs = [
    "out"
    "man"
  ];

  src = fetchzip {
    url = "https://www.j3e.de/linux/convmv/convmv-${finalAttrs.version}.tar.gz";
    hash = "sha256-ts9xAPRGUoS0XBRTmpb+BlGW1hmGyUs+rQLyUEgiZ54=";
  };

  strictDeps = true;

  nativeBuildInputs = [ perl ];

  buildInputs = [ perl ];

  makeFlags = [
    "PREFIX=${placeholder "out"}"
    "MANDIR=${placeholder "man"}/share/man"
  ];

  checkTarget = "test";

  # testsuite.tar contains filenames that aren't valid UTF-8. Extraction of
  # testsuite.tar will fail as APFS enforces that filenames are valid UTF-8.
  doCheck = !stdenv.isDarwin;

  prePatch =
    lib.optionalString finalAttrs.doCheck ''
      tar -xf testsuite.tar
    ''
    + ''
      patchShebangs --host .
    '';

  dontPatchShebangs = true;

  meta = with lib; {
    description = "Converts filenames from one encoding to another";
    downloadPage = "https://www.j3e.de/linux/convmv/";
    license = with licenses; [
      gpl2Only
      gpl3Only
    ];
    maintainers = with maintainers; [ al3xtjames ];
    mainProgram = "convmv";
    platforms = platforms.unix;
  };
})
+0 −33
Original line number Diff line number Diff line
{ lib, stdenv, fetchurl, perl }:

stdenv.mkDerivation rec {
  pname = "convmv";
  version = "2.05";

  src = fetchurl {
    url = "https://www.j3e.de/linux/convmv/convmv-${version}.tar.gz";
    sha256 = "19hwv197p7c23f43vvav5bs19z9b72jzca2npkjsxgprwj5ardjk";
  };

  preBuild=''
    makeFlags="PREFIX=$out"
  '';

  patchPhase=''
    tar -xf testsuite.tar
    patchShebangs .
  '';

  doCheck = true;
  checkTarget = "test";

  buildInputs = [ perl ];

  meta = with lib; {
    description = "Converts filenames from one encoding to another";
    platforms = platforms.linux ++ platforms.freebsd ++ platforms.cygwin;
    maintainers = [ ];
    license = licenses.gpl2Plus;
    mainProgram = "convmv";
  };
}
+0 −2
Original line number Diff line number Diff line
@@ -6876,8 +6876,6 @@ with pkgs;
  convfont = callPackage ../tools/misc/convfont { };
  convmv = callPackage ../tools/misc/convmv { };
  cpcfs = callPackage ../tools/filesystems/cpcfs { };
  coreutils =  callPackage ../tools/misc/coreutils { };