aboutsummaryrefslogtreecommitdiff
path: root/config/init.lua
blob: 2a9dce2ca87d1efaa31fa75c06836a45453f1966 (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
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
local pkgit = require("pkgit")
local cfg = {}

local prefix = os.getenv("HOME") .. "/.local"
cfg.dirs = {
	prefix  = prefix,
	src     = prefix .. "/share/pkgit",
	bin     = prefix .. "/bin",
	lib     = prefix .. "/lib",
	include = prefix .. "/include",
}

cfg.pkgs = {
	["gmp"] = {},
	["mpfr"] = {},
	["mpc"] = {},
	["gcc"] = {
		url = "https://ftp.gnu.org/gnu/gcc/gcc-16.1.0/gcc-16.1.0.tar.xz",
		version = "16.1.0",
		fetcher = cfg.fetchers.tarball,
		dependencies = {
			"gmp", "mpfr", "mpc"
		}
	},
	["luajit"] = {
		url = "https://luajit.org/git/luajit.git",
		version = "v2.1",
		fetcher = cfg.fetchers.git,
		dependencies = {
			"gcc"
		},
	},
	["pkgit"] = {
		url = "https://git.symlinx.net/pkgit",
		version = "HEAD",
		fetcher = cfg.fetchers.git,
		dependencies = {
			"luajit",
		},
		opts = {},
		recipe = cfg.recipes.make,
	}
}

cfg.fetchers = {
	git = {
		get_source = function(url, version, target_dir) return 0 end,
		get_version = function(url, target_dir) return "HEAD" end,
	},
	tarball = {
		get_source = function(url, version, target_dir) return 0 end,
		get_version = function(url, target_dir) return "" end,
	}
}
cfg.fetchers.default = cfg.fetchers.git

cfg.recipes = {}
cfg.recipes.make = {
	build = function(bldit_build)
		return pkgit.run({ "make" })
	end,
	install = function(bldit_install)
		return pkgit.run({ "make install PREFIX=" .. prefix })
	end,
	remove = function(bldit_remove)
		return pkgit.run({ "make uninstall PREFIX=" .. prefix })
	end,
}

return cfg