parsav  Check-in [2687ecbbd9]

Overview
Comment:haphazardly disemfuckulate build system
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | trunk
Files: files | file ages | folders
SHA3-256: 2687ecbbd9d001894a6cdbc9bfd7b7203dfa9c9c3ac827f6d0e9ae6c84e85c16
User & Date: lexi on 2025-02-07 13:14:23
Other Links: manifest | tags
Context
2025-02-07
13:14
haphazardly disemfuckulate build system Leaf check-in: 2687ecbbd9 user: lexi tags: trunk
12:23
misc corrections check-in: 0814075eff user: lexi tags: trunk
Changes

Modified config.lua from [6ab8d1127e] to [9003b8cb61].

199
200
201
202
203
204
205






206
207
208
209
210
211
212
213
214
215

216
217
218
219
220
221
222
			if libdir then libdir = libdir .. libsfx end
		incdir = cnfvar('incdir','includedir') 
			if incdir then incdir = incdir .. incsfx end
	end
	libdir = libdir or (prefix .. '/lib'     .. libsfx)
	incdir = incdir or (prefix .. '/include' .. incsfx)







	local libstr = pkc '--libs-only-l' -- (--static is not reliable)
	local libs = fb and fb.libs or {}
	local linkstatic = locdep
	if (not locdep) and libstr then
		libs = {}
		for m in string.gmatch(libstr, '-l(%g+)') do
			libs[#libs + 1] = m
		end
	else
		if #libs == 0 then libs = { name } end

	end

	conf.pkg[name] = {
		prefix = prefix;
		libdir = libdir;
		incdir = incdir;
		dylibs = {}, statlibs = {};







>
>
>
>
>
>
|
<
|
|
|
|
|
|
|
|
>







199
200
201
202
203
204
205
206
207
208
209
210
211
212

213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
			if libdir then libdir = libdir .. libsfx end
		incdir = cnfvar('incdir','includedir') 
			if incdir then incdir = incdir .. incsfx end
	end
	libdir = libdir or (prefix .. '/lib'     .. libsfx)
	incdir = incdir or (prefix .. '/include' .. incsfx)

	local libs, linkstatic, libstr
	if fb and fb.libs then
		libs = fb.libs
		libstr = pkc('--libs-only-l', unpack(fb.libs))
	else
		libs = {}
		libstr = pkc '--libs-only-l' -- (--static is not reliable)

		linkstatic = locdep
		if (not locdep) and libstr then
			libs = {}
			for m in string.gmatch(libstr, '-l(%g+)') do
				libs[#libs + 1] = m
			end
		else
			if #libs == 0 then libs = { name } end
		end
	end

	conf.pkg[name] = {
		prefix = prefix;
		libdir = libdir;
		incdir = incdir;
		dylibs = {}, statlibs = {};

Modified default.nix from [552f41e3b4] to [3f579bdd06].

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
..
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
..
67
68
69
70
71
72
73
74
75
76
77
let pkg = import <nixpkgs> {};
in {stdenv          ? pkg.stdenv,
	fetchFromGitHub ? pkg.fetchFromGitHub,
	terra           ? pkg.terra,
	pkgconfig       ? pkg.pkgconfig,
	json_c          ? pkg.json_c,
	postgresql      ? pkg.postgresql.lib,
	mbedtlsLegacy   ? pkg.mbedtls,
	glibc           ? pkg.glibc,
	cmark           ? pkg.cmark,
	inkscape        ? pkg.inkscape,
	mongoose        ? null,
	lib             ? pkg.lib,
	pypkgs			? pkg.python310Packages,
	debug           ? true
................................................................................
				owner = "cesanta";
				repo = "mongoose";
				rev = "369f44adfa38e0d8fa9667e9d6bafd7e0e3c6231";
				sha256 = "17rkd7ydic39cw9sfh11mcil02vmi6jjyj2ncbxan6psak09xbrc";
			};
	pkv = val: p: "parsav_pkg_${p}_${val}";
	pkp = pkv "prefix";
	mbedtls = mbedtlsLegacy.overrideAttrs(o: rec{
		version = "3.0-dev";
		nativeBuildInputs = o.nativeBuildInputs ++ [pypkgs.jinja2];
		src = fetchFromGitHub {
			owner = "ARMmbed"; repo = "mbedtls";
			rev = "49e9fbd6bc7c970c221be6e35f6872762ddde0bc";
			sha256 = "1ips4mx8rr0kcqn7vdapx2m9xh4cayb7isbwvr98qp2ybi4pi4ai";
		};
	});
in stdenv.mkDerivation {
	name = "parsav";
	version = "dev";
	nativeBuildInputs = [terra json_c pkgconfig mbedtls];
	buildInputs = [cmark inkscape postgresql postgresql.lib];
	src = ./.;

	dontStrip = debug;
	dbg = if debug then 1 else null;

	${pkp "json-c"} = "${json_c}";
	${pkp "mbedtls"} = "${mbedtls}";
	${pkp "libc"} = "${glibc.out}";
	${pkp "cmark"} = "${cmark}";
	${pkp "inkscape"} = "${inkscape}";
	${pkv "incdir" "libpq"} = "${postgresql.out}/include";
	${pkv "libdir" "libpq"} = "${postgresql.lib}/lib";

	parsav_build_branch = "trunk";
	parsav_build_checkout = "<latest>";
	parsav_builder = "nixpkgs";

	parsav_install_prefix_cfg="/etc/parsav";
................................................................................
	# postInstall = ''
	# 	make prefix=$out install
	# '';
	
	meta = {
		description = "lightweight fediverse server";
		homepage = https://c.hale.su/parsav;
		license = lib.licenses.agpl3;
		platforms = lib.platforms.unix;
	};
} 




|
<

|







 







<
<
<
<
<
<
<
<
<



|






<




|







 







|



1
2
3
4
5

6
7
8
9
10
11
12
13
14
..
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
..
56
57
58
59
60
61
62
63
64
65
66
let pkg = import <nixpkgs> {};
in {stdenv          ? pkg.stdenv,
	fetchFromGitHub ? pkg.fetchFromGitHub,
	terra           ? pkg.terra,
	pkg-config      ? pkg.pkg-config,

	postgresql      ? pkg.postgresql.lib,
	mbedtls         ? pkg.mbedtls,
	glibc           ? pkg.glibc,
	cmark           ? pkg.cmark,
	inkscape        ? pkg.inkscape,
	mongoose        ? null,
	lib             ? pkg.lib,
	pypkgs			? pkg.python310Packages,
	debug           ? true
................................................................................
				owner = "cesanta";
				repo = "mongoose";
				rev = "369f44adfa38e0d8fa9667e9d6bafd7e0e3c6231";
				sha256 = "17rkd7ydic39cw9sfh11mcil02vmi6jjyj2ncbxan6psak09xbrc";
			};
	pkv = val: p: "parsav_pkg_${p}_${val}";
	pkp = pkv "prefix";









in stdenv.mkDerivation {
	name = "parsav";
	version = "dev";
	nativeBuildInputs = [terra pkg-config mbedtls];
	buildInputs = [cmark inkscape postgresql postgresql.lib];
	src = ./.;

	dontStrip = debug;
	dbg = if debug then 1 else null;


	${pkp "mbedtls"} = "${mbedtls}";
	${pkp "libc"} = "${glibc.out}";
	${pkp "cmark"} = "${cmark}";
	${pkp "inkscape"} = "${inkscape}";
	${pkv "incdir" "libpq"} = "${postgresql.dev}/include";
	${pkv "libdir" "libpq"} = "${postgresql.lib}/lib";

	parsav_build_branch = "trunk";
	parsav_build_checkout = "<latest>";
	parsav_builder = "nixpkgs";

	parsav_install_prefix_cfg="/etc/parsav";
................................................................................
	# postInstall = ''
	# 	make prefix=$out install
	# '';
	
	meta = {
		description = "lightweight fediverse server";
		homepage = https://c.hale.su/parsav;
		license = lib.licenses.agpl3Only;
		platforms = lib.platforms.unix;
	};
} 

Modified pkgdata.lua from [0f9c69d77b] to [e32151ca52].

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
local util = dofile('common.lua')
local sthunk = function(...) local a = {...} return function() return util.exec(a) end end

return {
	mbedtls = { 
		libs = {'mbedtls', 'mbedcrypto', 'mbedx509'};
		osvars = {
			linux_nixos = { -- lacks a *.pc on nixos systems
				-- prefix = sthunk('nix', 'path-info', 'nixos.mbedtls');
				prefix = os.getenv("parsav_pkg_mbedtls_prefix");
			}
		};
		vars = { builddir = '/library', srcincdir = '/include' };
	};
	mongoose = { vars = { builddir = '' } };
	mjson = { vars = { builddir = '', srcincdir = '/src' } };
	libpq = {
		osvars = {







|
<
|
<







1
2
3
4
5
6
7
8

9

10
11
12
13
14
15
16
local util = dofile('common.lua')
local sthunk = function(...) local a = {...} return function() return util.exec(a) end end

return {
	mbedtls = { 
		libs = {'mbedtls', 'mbedcrypto', 'mbedx509'};
		osvars = {
			-- used to lack a *.pc on nixos systems

			linux_nixos = { prefix = os.getenv("parsav_pkg_mbedtls_prefix"); }

		};
		vars = { builddir = '/library', srcincdir = '/include' };
	};
	mongoose = { vars = { builddir = '' } };
	mjson = { vars = { builddir = '', srcincdir = '/src' } };
	libpq = {
		osvars = {