Merge pull request #321858 from al3xtjames/convmv-darwin

convmv: add Darwin support, reformat & migrate to pkgs/by-name
This commit is contained in:
Sebastián Mancilla
2024-08-21 22:06:48 -04:00
committed by GitHub
3 changed files with 60 additions and 35 deletions
+60
View File
@@ -0,0 +1,60 @@
{
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;
};
})
-33
View File
@@ -1,33 +0,0 @@
{ 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";
};
}
-2
View File
@@ -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 { };