nixpkgs mirror (for testing)
github.com/NixOS/nixpkgs
nix
1{
2 lib,
3 stdenv,
4 fetchzip,
5 makeWrapper,
6 perl,
7 perlPackages,
8}:
9
10stdenv.mkDerivation (finalAttrs: {
11 pname = "convmv";
12 version = "2.06";
13
14 outputs = [
15 "bin"
16 "man"
17 "out"
18 ];
19
20 src = fetchzip {
21 url = "https://www.j3e.de/linux/convmv/convmv-${finalAttrs.version}.tar.gz";
22 hash = "sha256-36UPh+eZBT/J2rkvOcHeqkVKSl4yO9GJp/BxWGDrgGU=";
23 };
24
25 strictDeps = true;
26
27 nativeBuildInputs = [
28 makeWrapper
29 perl
30 ];
31
32 buildInputs = [
33 perl
34 perlPackages.EncodeHanExtra
35 perlPackages.EncodeIMAPUTF7
36 perlPackages.EncodeJIS2K
37 ];
38
39 makeFlags = [
40 "PREFIX=${placeholder "bin"}"
41 "MANDIR=${placeholder "man"}/share/man"
42 ];
43
44 checkTarget = "test";
45
46 # testsuite.tar contains filenames that aren't valid UTF-8. Extraction of
47 # testsuite.tar will fail as APFS enforces that filenames are valid UTF-8.
48 doCheck = !stdenv.hostPlatform.isDarwin;
49
50 prePatch =
51 lib.optionalString finalAttrs.finalPackage.doCheck ''
52 tar -xf testsuite.tar
53 ''
54 + ''
55 patchShebangs --host .
56 '';
57
58 dontPatchShebangs = true;
59
60 postFixup = ''
61 wrapProgram "$bin/bin/convmv" --prefix PERL5LIB : "$PERL5LIB"
62 '';
63
64 meta = with lib; {
65 description = "Converts filenames from one encoding to another";
66 downloadPage = "https://www.j3e.de/linux/convmv/";
67 license = with licenses; [
68 gpl2Only
69 gpl3Only
70 ];
71 maintainers = with maintainers; [ al3xtjames ];
72 mainProgram = "convmv";
73 platforms = platforms.unix;
74 };
75})