package perl {
	description = "The Perl Programming language";
	website = "https://www.perl.org";
	anitya = 391221;
	// odd-even versioning
	latest = anityaFallback;

	version# = "5.44.0";
	source = remoteTar {
		url = "https://www.cpan.org/src/5.0/perl-"+version+".tar.gz";
		checksum = "eCurPE3Wfhki9VVY8YfU-JyTNiCO44gVePw-qV9zVSVgy7S_K3xUUnto4X4-Q-Zm";
		compress = gzip;
	};

	// uses source tree as scratch space
	writable = true;
	chmod = true;
	early = `
chmod +w /system/bin && rm -f /system/bin/ps # perl does not like toybox ps

function disable_test {
	echo 'print STDOUT "1..0 # Skip broken test\n";' > "$1"
}

disable_test ext/Pod-Html/t/htmldir3.t
disable_test ext/POSIX/t/time.t
`;

	toyboxEarly = true;
	exec = make {
		defaults = false;
		chdir = false;

		configureName = "./Configure";
		configure = {
			"-des";
			"Dprefix": "/system";
			"Dcc": "clang";
			"Dcflags": "--std=gnu99";
			"Dldflags": `"${LDFLAGS:-''}"`;
			"Doptimize": "'-O2 -fno-strict-aliasing'";
			"Duseithreads";
			"Duseshrplib";
		};

		check = [
			"TEST_JOBS=" + jobsLE,
			"test_harness",
		];

		install = `LD_LIBRARY_PATH="$PWD" ./perl -Ilib -I. installperl --destdir=/work`;
	};
}

package perl-Module-Build {
	description = "build and install Perl modules";
	website = "https://metacpan.org/release/Module-Build";
	anitya = 3077;

	version# = "0.4234";
	source = remoteCPAN {
		author = "LEONT";
		name = "Module-Build";
		version = version;
		checksum = "ZKxEFG4hE1rqZt52zBL2LRZBMkYzhjb5-cTBXcsyA52EbPeeYyVxU176yAea8-Di";
	};

	enterSource = true;
	writable = true;
	chmod = true;

	exec = generic {
		chdir = false;
		build = `
perl Build.PL --prefix=/system
./Build build`;
		check = `
./Build test`;
		install = `
./Build install --destdir=/work
`;
	};

	inputs = [ perl ];
	runtime = [ perl ];
}

package perl-Locale-gettext {
	description = "message handling functions";
	website = "https://metacpan.org/release/Locale-gettext";
	anitya = 7523;

	version# = "1.07";
	source = remoteCPAN {
		author = "PVANDRY";
		name = "Locale-gettext";
		version = version;
		checksum = "cFq4BKFD1MWSoa7lsrPjpdo9kzPqd0jlRcBFUyL1L1isw8m3D_Sge_ff0MAu_9J3";
	};

	exec = makeMaker {};

	runtime = [ perl ];
}

package perl-Pod-Parser {
	description = "base class for creating POD filters and translators";
	website = "https://metacpan.org/release/Pod-Parser";
	anitya = 3244;

	version# = "1.67";
	source = remoteCPAN {
		author = "MAREKR";
		name = "Pod-Parser";
		version = version;
		checksum = "RdURu9mOfExk_loCp6abxlcQV3FycSNbTqhRS9i6JUqnYfGGEgercK30g0gjYyqe";
	};

	exec = makeMaker {};

	runtime = [ perl ];
}

package perl-SGMLS {
	description = "class for postprocessing the output from the sgmls and nsgmls parsers";
	website = "https://metacpan.org/release/RAAB/SGMLSpm-1.1";
	anitya = 389576;
	latest = anityaLegacyCPAN;

	version# = "1.1";
	source = remoteCPAN {
		author = "RAAB";
		name = "SGMLSpm";
		version = version;
		checksum = "aZijn4MUqD-wfyZgdcCruCwl4SgDdu25cNmJ4_UvdAk9a7uz4gzMQdoeB6DQ6QOy";
	};

	exec = makeMaker {};

	runtime = [ perl ];
}

package perl-Term-ReadKey {
	description = "a perl module for simple terminal control";
	website = "https://metacpan.org/release/TermReadKey";
	anitya = 3372;

	version# = "2.38";
	source = remoteCPAN {
		author = "JSTOWE";
		name = "TermReadKey";
		version = version;
		checksum = "qerL8Xo7kD0f42PZoiEbmE8Roc_S9pOa27LXelY4DN_0UNy_u5wLrGHI8utNlaiI";
	};

	exec = makeMaker {};

	runtime = [ perl ];
}

package perl-Text-CharWidth {
	description = "get number of occupied columns of a string on terminal";
	website = "https://metacpan.org/release/Text-CharWidth";
	anitya = 14380;

	version# = "0.04";
	source = remoteCPAN {
		author = "KUBOTA";
		name = "Text-CharWidth";
		version = version;
		checksum = "G2p5RHU4_HiZ23ZusBA_enTlVMxz0J4esUx4CGcOPhY6xYTbp-aXWRN6lYZpzBw2";
	};

	exec = makeMaker {};

	runtime = [ perl ];
}

package perl-Text-WrapI18N {
	description = "line wrapping module";
	website = "https://metacpan.org/release/Text-WrapI18N";
	anitya = 14385;

	version# = "0.06";
	source = remoteCPAN {
		author = "KUBOTA";
		name = "Text-WrapI18N";
		version = version;
		checksum = "Vmo89qLgxUqyQ6QmWJVqu60aQAUjrNKRjFQSXGnvClxofzRjiCa6idzPgJ4VkixM";
	};

	exec = makeMaker {};

	inputs = [ perl-Text-CharWidth ];
	runtime = [ perl-Text-CharWidth ];
}

package perl-MIME-Charset {
	description = "Charset Information for MIME";
	website = "https://metacpan.org/release/MIME-Charset";
	anitya = 3070;

	version# = "1.013.1";
	source = remoteCPAN {
		author = "NEZUMI";
		name = "MIME-Charset";
		version = version;
		checksum = "Ou_ukcrOa1cgtE3mptinb-os3bdL1SXzbRDFZQF3prrJj-drc3rp_huay7iDLJol";
	};

	exec = makeMaker {};

	runtime = [ perl ];
}

package perl-Unicode-LineBreak {
	description = "String as Sequence of UAX #29 Grapheme Clusters";
	website = "https://metacpan.org/release/Unicode-LineBreak";
	anitya = 6033;

	version# = "2019.001";
	source = remoteCPAN {
		author = "NEZUMI";
		name = "Unicode-LineBreak";
		version = version;
		checksum = "ZHVkh7EDgAUHnTpvXsnPAuWpgNoBImtY_9_8TIbo2co_WgUwEb0MtXPhI8pAZ5OH";
	};

	exec = makeMaker {};

	inputs = [ perl-MIME-Charset ];
	runtime = [ perl-MIME-Charset ];
}

package perl-YAML-Tiny {
	description = "read/write YAML files with as little code as possible";
	website = "https://metacpan.org/release/YAML-Tiny";
	anitya = 3549;

	version# = "1.76";
	source = remoteCPAN {
		author = "ETHER";
		name = "YAML-Tiny";
		version = version;
		checksum = "V1MV4KPym1LxSw8CRXqPR3K-l1hGHbT5Ob4t-9xju6R9X_CWyw6hI8wsMaNdHdBY";
	};

	exec = makeMaker {};

	runtime = [ perl ];
}

package perl-Test-Cmd {
	description = "portable testing of commands and scripts";
	website = "https://metacpan.org/release/Test-Cmd";
	anitya = 6014;

	version# = "1.09";
	source = remoteCPAN {
		author = "NEILB";
		name = "Test-Cmd";
		version = version;
		checksum = "gpGUwyC9IozDiYSgW_kXARNfXsTPFa6cTowJmmCBbPqcs2-pONZca_SB06FGy-7H";
	};

	exec = makeMaker {};

	runtime = [ perl ];
}
