tangled
alpha
login
or
join now
pyrox.dev
/
nixpkgs
0
fork
atom
lol
0
fork
atom
overview
issues
pulls
pipelines
glib-networking: add installed tests
Jan Tojnar
6 years ago
ecf6f4ae
ce403617
+67
4 changed files
expand all
collapse all
unified
split
nixos
tests
all-tests.nix
glib-networking.nix
pkgs
development
libraries
glib-networking
default.nix
installed-tests-path.patch
+1
nixos/tests/all-tests.nix
reviewed
···
94
94
gitlab = handleTest ./gitlab.nix {};
95
95
gitolite = handleTest ./gitolite.nix {};
96
96
gjs = handleTest ./gjs.nix {};
97
97
+
glib-networking = handleTest ./glib-networking.nix {};
97
98
glusterfs = handleTest ./glusterfs.nix {};
98
99
gnome3-xorg = handleTest ./gnome3-xorg.nix {};
99
100
gnome3 = handleTest ./gnome3.nix {};
+17
nixos/tests/glib-networking.nix
reviewed
···
1
1
+
# run installed tests
2
2
+
import ./make-test.nix ({ pkgs, ... }:
3
3
+
4
4
+
{
5
5
+
name = "glib-networking";
6
6
+
meta = {
7
7
+
maintainers = pkgs.glib-networking.meta.maintainers;
8
8
+
};
9
9
+
10
10
+
machine = { pkgs, ... }: {
11
11
+
environment.systemPackages = with pkgs; [ gnome-desktop-testing ];
12
12
+
};
13
13
+
14
14
+
testScript = ''
15
15
+
$machine->succeed("gnome-desktop-testing-runner -d '${pkgs.glib-networking.installedTests}/share'");
16
16
+
'';
17
17
+
})
+24
pkgs/development/libraries/glib-networking/default.nix
reviewed
···
3
3
, substituteAll
4
4
, meson
5
5
, ninja
6
6
+
, nixosTests
6
7
, pkgconfig
7
8
, glib
8
9
, gettext
10
10
+
, makeWrapper
9
11
, python3
10
12
, gnutls
11
13
, p11-kit
···
18
20
pname = "glib-networking";
19
21
version = "2.60.3";
20
22
23
23
+
outputs = [ "out" "installedTests" ];
24
24
+
21
25
src = fetchurl {
22
26
url = "mirror://gnome/sources/${pname}/${stdenv.lib.versions.majorMinor version}/${pname}-${version}.tar.xz";
23
27
sha256 = "1mfw44qpmwvz6yzj8c6spx6z357wrmkk15byrkc5byagd82860fm";
···
28
32
src = ./hardcode-gsettings.patch;
29
33
gds_gsettings_path = glib.getSchemaPath gsettings-desktop-schemas;
30
34
})
35
35
+
36
36
+
./installed-tests-path.patch
31
37
];
32
38
33
39
postPatch = ''
···
40
46
ninja
41
47
pkgconfig
42
48
gettext
49
49
+
makeWrapper
43
50
python3 # for install_script
44
51
];
45
52
···
53
60
54
61
doCheck = false; # tests need to access the certificates (among other things)
55
62
63
63
+
mesonFlags = [
64
64
+
"-Dinstalled_tests=true"
65
65
+
"-Dinstalled_test_prefix=${placeholder "installedTests"}"
66
66
+
];
67
67
+
68
68
+
postFixup = ''
69
69
+
find "$installedTests/libexec" "$out/libexec" -type f -executable -print0 \
70
70
+
| while IFS= read -r -d "" file; do
71
71
+
echo "Wrapping program '$file'"
72
72
+
wrapProgram "$file" --prefix GIO_EXTRA_MODULES : "$out/lib/gio/modules"
73
73
+
done
74
74
+
'';
75
75
+
56
76
passthru = {
57
77
updateScript = gnome3.updateScript {
58
78
packageName = pname;
79
79
+
};
80
80
+
81
81
+
tests = {
82
82
+
installedTests = nixosTests.glib-networking;
59
83
};
60
84
};
61
85
+25
pkgs/development/libraries/glib-networking/installed-tests-path.patch
reviewed
···
1
1
+
diff --git a/meson.build b/meson.build
2
2
+
index 4d91677..aaaeb2b 100644
3
3
+
--- a/meson.build
4
4
+
+++ b/meson.build
5
5
+
@@ -12,8 +12,8 @@
6
6
+
libexecdir = join_paths(prefix, get_option('libexecdir'))
7
7
+
localedir = join_paths(prefix, get_option('localedir'))
8
8
+
9
9
+
-installed_tests_metadir = join_paths(datadir, 'installed-tests', meson.project_name())
10
10
+
-installed_tests_execdir = join_paths(libexecdir, 'installed-tests', meson.project_name())
11
11
+
+installed_tests_metadir = join_paths(get_option('installed_test_prefix'), 'share', 'installed-tests', meson.project_name())
12
12
+
+installed_tests_execdir = join_paths(get_option('installed_test_prefix'), 'libexec', 'installed-tests', meson.project_name())
13
13
+
14
14
+
cc = meson.get_compiler('c')
15
15
+
host_system = host_machine.system()
16
16
+
diff --git a/meson_options.txt b/meson_options.txt
17
17
+
index 3a525dd..fc86302 100644
18
18
+
--- a/meson_options.txt
19
19
+
+++ b/meson_options.txt
20
20
+
@@ -3,4 +3,5 @@
21
21
+
option('libproxy', type: 'feature', value: 'auto', description: 'support for libproxy proxy configration')
22
22
+
option('gnome_proxy', type: 'feature', value: 'auto', description: 'support for GNOME desktop proxy configuration')
23
23
+
option('installed_tests', type: 'boolean', value: false, description: 'enable installed tests')
24
24
+
+option('installed_test_prefix', type: 'string', value: '', description: 'Prefix for installed tests')
25
25
+
option('static_modules', type: 'boolean', value: false, description: 'build static modules')