aboutsummaryrefslogtreecommitdiffhomepage
path: root/internal/rosa/package/lua/package.az
blob: 033af0fe452abe7e8d7ab7bec8c8cebb75fa83f4 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
package lua {
	description = "the programming language lua";
	website = "https://www.lua.org/home.html";
	anitya = 1847;

	version# = "5.5.1";
	source = remoteTar {
		url = "https://www.lua.org/ftp/lua-"+version+".tar.gz";
		compress = gzip;
		checksum = "8KCnY3UBf_oRuVhs7gc2pa18favYMzcMsjgeOOWjbbR9Y6W4qvm4gt1A-iMlXYBw";
	};
	patches = [ "conf-prefix.patch" ];

	files = {
		"lua.pc";
	};

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

	exec = make {
		chdir = false;
		configure = nil;
		preMake = `
sed -i 's|@ROSA_PREFIX@|`+prefix+`|g' src/luaconf.h
`;
		make = [ "CC='clang -fPIC'", "all" ];
		check = [ "test" ];
		install = `
make INSTALL_TOP=/work`+prefix+` install
mkdir /work`+prefix+`/lib/pkgconfig
sed \
	-e "s|@MAJOR_VER@|$(cc -P -E -include src/lua.h - <<< LUA_VERSION_MAJOR_N | tail -n 1)|g" \
	-e "s|@MINOR_VER@|$(cc -P -E -include src/lua.h - <<< LUA_VERSION_MINOR_N | tail -n 1)|g" \
	-e "s|@ROSA_PREFIX@|`+prefix+`|g" \
	../lua.pc > /work`+prefix+`/lib/pkgconfig/lua.pc
`;
	};

	unlikely = true;
}