tangled
alpha
login
or
join now
pyrox.dev
/
nixpkgs
lol
0
fork
atom
overview
issues
pulls
pipelines
schroot: init at 1.6.13-5
Błażej Sowa
1 year ago
4287550e
69c46d44
+289
7 changed files
expand all
collapse all
unified
split
pkgs
by-name
sc
schroot
debian-patches.nix
debian-patches.txt
fix-absolute-paths.patch
no-default-config.patch
no-pam-service.patch
no-setuid.patch
package.nix
+70
pkgs/by-name/sc/schroot/debian-patches.nix
···
1
1
+
# Generated by debian-patches.sh from debian-patches.txt
2
2
+
let
3
3
+
prefix = "https://salsa.debian.org/debian/schroot/-/raw/debian/master/1.6.13-4/debian/patches";
4
4
+
in
5
5
+
[
6
6
+
{
7
7
+
url = "${prefix}/1539621689.revert.schroot-1.6.10-48-g2600bcab.revert-environment-preserve-empty-values.patch";
8
8
+
sha256 = "0kvp47qkhq4s7bqil1pcq7c0a63hiw7xgmrxv460rfb9irvlp2wn";
9
9
+
}
10
10
+
{
11
11
+
url = "${prefix}/1448890714.schroot-1.7.2-72-gbf30a928.setup-d-20copyfiles-canonicalize-destination-path.patch";
12
12
+
sha256 = "09vliqpmqn4yvh3mxsa9iqlwxkfrhfjraizm945ir6v23m622i6k";
13
13
+
}
14
14
+
{
15
15
+
url = "${prefix}/1453505583.schroot-1.7.2-72-g11587fd8.etc-setup-d-20copyfiles-replace-dangling-symlink-during-cp.patch";
16
16
+
sha256 = "036g3br7251ykhmgq48zbjdgyy06m0rhrv1hf540zb7n6ildygkz";
17
17
+
}
18
18
+
{
19
19
+
url = "${prefix}/1496783678.schroot-1.7.2-127-ga5e5d8d9.fix-bash-completion.patch";
20
20
+
sha256 = "0adqpyqkw5kyg1843ygificm2hxawl4pi1lbyn2dvzw11yawvv9k";
21
21
+
}
22
22
+
{
23
23
+
url = "${prefix}/1530433671.schroot-1.7.2-129-g00c0a972.cmake-use-soelim-r-option.patch";
24
24
+
sha256 = "0csn6j6xsi8bd16r7bvd33albwz6v7fv7wawakkiimbj59zbinhn";
25
25
+
}
26
26
+
{
27
27
+
url = "${prefix}/1487872945.schroot-1.7.2-137-g5c36362b.support-copyfiles-installation-into-non-existent-directories.patch";
28
28
+
sha256 = "1iizprcdnisdjgp091y0zjsayq5qqfwh9d2d9zns1d0414jafp7b";
29
29
+
}
30
30
+
{
31
31
+
url = "${prefix}/1487872999.schroot-1.7.2-138-g5a611c49.support-copyfiles-source-destination-specifications.patch";
32
32
+
sha256 = "03f735zyzj4zmrrmynb2xl49i8s8580d9dyp0kxq5aq555sl7hx2";
33
33
+
}
34
34
+
{
35
35
+
url = "${prefix}/1662655911.reschroot-1.6.13-2-g779349dc.replace-usage-of-egrep-and-which.patch";
36
36
+
sha256 = "0f2wziwchfg3v193i8x7s60vr9yx72z3f7ddgsfkshay4m5mrprs";
37
37
+
}
38
38
+
{
39
39
+
url = "${prefix}/1662656169.reschroot-1.6.13-3-ga9e100e5.clean-up-mess-created-in-the-portuguese-translations.patch";
40
40
+
sha256 = "1yq05pc38rkbb0njwllfwjc8dl73i7g7z89spsa7ls3amkyccm7w";
41
41
+
}
42
42
+
{
43
43
+
url = "${prefix}/1664011392.reschroot-1.6.13-4-g93017cff.update-french-translation.patch";
44
44
+
sha256 = "0qhcifjxgipxh67fjf0ydclvxn9yys7hfcwxir9jnw572y9igx1k";
45
45
+
}
46
46
+
{
47
47
+
url = "${prefix}/1665995770.reschroot-1.6.13-5-g81b88b45.document-a-login-shell-might-be-switched-to-a-regular-shell.patch";
48
48
+
sha256 = "1lwslyqrfz1xmi28j1s80pq763k63f9g4qgx9vr3qm247gb7v55l";
49
49
+
}
50
50
+
{
51
51
+
url = "${prefix}/1692468301.reschroot-1.6.13-6-g271acf6e.subject-mount-a-new-instance-of-dev-pts-in-the-chroot.patch";
52
52
+
sha256 = "1j04bxcbg2bigss7sjqyg7cn8547wwmp5zj8406v3vk5g71iaijf";
53
53
+
}
54
54
+
{
55
55
+
url = "${prefix}/1664222056.reschroot-1.6.13-9-g55af32cf.fix-localename-type.patch";
56
56
+
sha256 = "15kjl3g6c79jfqh45mr3h3qbl5gx2pmxqc2pmsjplxdkksx9i6yn";
57
57
+
}
58
58
+
{
59
59
+
url = "${prefix}/1658716738.reschroot-1.6.12-2-g2045008e.fix-variable-usage-in-copyfiles-copy-file-function.patch";
60
60
+
sha256 = "02c6zsmprdvkgf3krl6z1qwvx144arng0s34ry1dq8qvwl5fd66c";
61
61
+
}
62
62
+
{
63
63
+
url = "${prefix}/fix-dupes-in-buildd-configuration.patch";
64
64
+
sha256 = "0s8racsl2s4mix6n7xb09dmncs5w0jmnb0vrjxpwx9c1yhz46dwl";
65
65
+
}
66
66
+
{
67
67
+
url = "${prefix}/fix-example-configuration.patch";
68
68
+
sha256 = "1r6kffc7a4aanksjv4658vs4xs31gmrhpa2gmpqkr21s7zk45yav";
69
69
+
}
70
70
+
]
+17
pkgs/by-name/sc/schroot/debian-patches.txt
···
1
1
+
schroot/1.6.13-5
2
2
+
1539621689.revert.schroot-1.6.10-48-g2600bcab.revert-environment-preserve-empty-values.patch
3
3
+
1448890714.schroot-1.7.2-72-gbf30a928.setup-d-20copyfiles-canonicalize-destination-path.patch
4
4
+
1453505583.schroot-1.7.2-72-g11587fd8.etc-setup-d-20copyfiles-replace-dangling-symlink-during-cp.patch
5
5
+
1496783678.schroot-1.7.2-127-ga5e5d8d9.fix-bash-completion.patch
6
6
+
1530433671.schroot-1.7.2-129-g00c0a972.cmake-use-soelim-r-option.patch
7
7
+
1487872945.schroot-1.7.2-137-g5c36362b.support-copyfiles-installation-into-non-existent-directories.patch
8
8
+
1487872999.schroot-1.7.2-138-g5a611c49.support-copyfiles-source-destination-specifications.patch
9
9
+
1662655911.reschroot-1.6.13-2-g779349dc.replace-usage-of-egrep-and-which.patch
10
10
+
1662656169.reschroot-1.6.13-3-ga9e100e5.clean-up-mess-created-in-the-portuguese-translations.patch
11
11
+
1664011392.reschroot-1.6.13-4-g93017cff.update-french-translation.patch
12
12
+
1665995770.reschroot-1.6.13-5-g81b88b45.document-a-login-shell-might-be-switched-to-a-regular-shell.patch
13
13
+
1692468301.reschroot-1.6.13-6-g271acf6e.subject-mount-a-new-instance-of-dev-pts-in-the-chroot.patch
14
14
+
1664222056.reschroot-1.6.13-9-g55af32cf.fix-localename-type.patch
15
15
+
1658716738.reschroot-1.6.12-2-g2045008e.fix-variable-usage-in-copyfiles-copy-file-function.patch
16
16
+
fix-dupes-in-buildd-configuration.patch
17
17
+
fix-example-configuration.patch
+43
pkgs/by-name/sc/schroot/fix-absolute-paths.patch
···
1
1
+
diff --git a/etc/setup.d/20copyfiles b/etc/setup.d/20copyfiles
2
2
+
index 3247ae2a..eed9fa46 100755
3
3
+
--- a/etc/setup.d/20copyfiles
4
4
+
+++ b/etc/setup.d/20copyfiles
5
5
+
@@ -39,9 +39,9 @@ copy_file()
6
6
+
if [ -e "$2" ]; then
7
7
+
8
8
+
# Device and inode
9
9
+
- da=$(/usr/bin/stat --format="%d %i" "$1")
10
10
+
+ da=$(stat --format="%d %i" "$1")
11
11
+
# This one can fail since it might not exist yet
12
12
+
- db=$(/usr/bin/stat --format="%d %i" "$2" 2>/dev/null || :)
13
13
+
+ db=$(stat --format="%d %i" "$2" 2>/dev/null || :)
14
14
+
15
15
+
if [ "$da" = "$db" ]; then
16
16
+
COPY="false"
17
17
+
@@ -50,8 +50,8 @@ copy_file()
18
18
+
:
19
19
+
elif [ -f "$1" ] && [ -f "$2" ]; then
20
20
+
# Content
21
21
+
- ca=$(/usr/bin/md5sum "$1" | sed -e 's/\(^[0-9a-f][0-9a-f]*\).*$/\1/')
22
22
+
- cb=$(/usr/bin/md5sum "$2" 2>/dev/null || :)
23
23
+
+ ca=$(md5sum "$1" | sed -e 's/\(^[0-9a-f][0-9a-f]*\).*$/\1/')
24
24
+
+ cb=$(md5sum "$2" 2>/dev/null || :)
25
25
+
cb=$(echo "$cb" | sed -e 's/\(^[0-9a-f][0-9a-f]*\).*$/\1/')
26
26
+
# Copy only if file contents differ
27
27
+
if [ "$ca" = "$cb" ]; then
28
28
+
diff --git a/etc/setup.d/20nssdatabases b/etc/setup.d/20nssdatabases
29
29
+
index ac7206b7..00645362 100755
30
30
+
--- a/etc/setup.d/20nssdatabases
31
31
+
+++ b/etc/setup.d/20nssdatabases
32
32
+
@@ -42,9 +42,9 @@ if [ $STAGE = "setup-start" ] || [ $STAGE = "setup-recover" ]; then
33
33
+
fi
34
34
+
35
35
+
# Device and inode
36
36
+
- dr=$(/usr/bin/stat --format="%d %i" "/etc/$db")
37
37
+
+ dr=$(stat --format="%d %i" "/etc/$db")
38
38
+
# This one can fail since it might not exist yet
39
39
+
- dc=$(/usr/bin/stat --format="%d %i" "${CHROOT_PATH}/etc/$db" 2>/dev/null || :)
40
40
+
+ dc=$(stat --format="%d %i" "${CHROOT_PATH}/etc/$db" 2>/dev/null || :)
41
41
+
42
42
+
# If the database inside and outside the chroot is the
43
43
+
# same, it's very likely that dup_nss would blank the
+33
pkgs/by-name/sc/schroot/no-default-config.patch
···
1
1
+
diff --git a/etc/CMakeLists.txt b/etc/CMakeLists.txt
2
2
+
index dd31fd3d..65521010 100644
3
3
+
--- a/etc/CMakeLists.txt
4
4
+
+++ b/etc/CMakeLists.txt
5
5
+
@@ -19,20 +19,20 @@
6
6
+
set(schroot_sysconf_data
7
7
+
schroot.conf)
8
8
+
9
9
+
-install(FILES ${schroot_sysconf_data}
10
10
+
- DESTINATION ${SCHROOT_SYSCONF_DIR})
11
11
+
+# install(FILES ${schroot_sysconf_data}
12
12
+
+# DESTINATION ${SCHROOT_SYSCONF_DIR})
13
13
+
14
14
+
set(files
15
15
+
copyfiles
16
16
+
fstab
17
17
+
nssdatabases)
18
18
+
19
19
+
-set(profiles
20
20
+
- buildd
21
21
+
- default
22
22
+
- desktop
23
23
+
- minimal
24
24
+
- sbuild)
25
25
+
+# set(profiles
26
26
+
+# buildd
27
27
+
+# default
28
28
+
+# desktop
29
29
+
+# minimal
30
30
+
+# sbuild)
31
31
+
32
32
+
set(arches
33
33
+
${SBUILD_PLATFORM})
+10
pkgs/by-name/sc/schroot/no-pam-service.patch
···
1
1
+
--- a/etc/CMakeLists.txt
2
2
+
+++ b/etc/CMakeLists.txt
3
3
+
@@ -68,6 +68,6 @@ foreach(profile ${profiles})
4
4
+
endforeach(file)
5
5
+
endforeach(profile)
6
6
+
7
7
+
-add_subdirectory(pam)
8
8
+
+# add_subdirectory(pam)
9
9
+
add_subdirectory(bash_completion)
10
10
+
add_subdirectory(setup.d)
+12
pkgs/by-name/sc/schroot/no-setuid.patch
···
1
1
+
--- a/bin/schroot/CMakeLists.txt
2
2
+
+++ b/bin/schroot/CMakeLists.txt
3
3
+
@@ -40,8 +40,7 @@ install(TARGETS schroot RUNTIME
4
4
+
DESTINATION ${CMAKE_INSTALL_FULL_BINDIR}
5
5
+
PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE
6
6
+
GROUP_READ GROUP_EXECUTE
7
7
+
- WORLD_READ WORLD_EXECUTE
8
8
+
- SETUID)
9
9
+
+ WORLD_READ WORLD_EXECUTE)
10
10
+
11
11
+
set(installdirs
12
12
+
${SCHROOT_CONF_CHROOT_D}
+104
pkgs/by-name/sc/schroot/package.nix
···
1
1
+
{
2
2
+
lib,
3
3
+
stdenv,
4
4
+
fetchurl,
5
5
+
6
6
+
# Runtime script dependencies
7
7
+
coreutils,
8
8
+
getent,
9
9
+
gnugrep,
10
10
+
gnused,
11
11
+
gnutar,
12
12
+
util-linux,
13
13
+
14
14
+
# Native build inputs
15
15
+
cmake,
16
16
+
findutils,
17
17
+
gettext,
18
18
+
mandoc,
19
19
+
makeWrapper,
20
20
+
perlPackages,
21
21
+
22
22
+
# Build inputs
23
23
+
boost,
24
24
+
}:
25
25
+
26
26
+
let
27
27
+
scripts-bin-path = lib.makeBinPath [
28
28
+
coreutils
29
29
+
getent
30
30
+
gnugrep
31
31
+
gnused
32
32
+
gnutar
33
33
+
util-linux
34
34
+
];
35
35
+
upstream-version = "1.6.13";
36
36
+
in
37
37
+
stdenv.mkDerivation {
38
38
+
pname = "schroot";
39
39
+
version = "${upstream-version}-5";
40
40
+
41
41
+
src = fetchurl {
42
42
+
url = "https://codeberg.org/shelter/reschroot/archive/release/reschroot-${upstream-version}.tar.gz";
43
43
+
hash = "sha256-wF1qG7AhDUAeZSLu4sRl4LQ8bJj3EB1nH56e+Is6zPU=";
44
44
+
};
45
45
+
46
46
+
patches = map fetchurl (import ./debian-patches.nix) ++ [
47
47
+
./no-setuid.patch
48
48
+
./no-pam-service.patch
49
49
+
./no-default-config.patch
50
50
+
./fix-absolute-paths.patch
51
51
+
];
52
52
+
53
53
+
nativeBuildInputs = [
54
54
+
cmake
55
55
+
findutils
56
56
+
gettext
57
57
+
mandoc
58
58
+
makeWrapper
59
59
+
perlPackages.Po4a
60
60
+
];
61
61
+
62
62
+
buildInputs = [
63
63
+
boost
64
64
+
];
65
65
+
66
66
+
cmakeFlags = [
67
67
+
(lib.cmakeFeature "CMAKE_INSTALL_LOCALSTATEDIR" "/var")
68
68
+
(lib.cmakeFeature "SCHROOT_SYSCONF_DIR" "/etc/schroot")
69
69
+
(lib.cmakeFeature "SCHROOT_CONF_SETUP_D" "${placeholder "out"}/etc/schroot/setup.d")
70
70
+
];
71
71
+
72
72
+
postPatch = ''
73
73
+
# Substitute the path to the mount binary
74
74
+
substituteInPlace bin/schroot-mount/schroot-mount-main.cc \
75
75
+
--replace-fail "/bin/mount" "${util-linux}/bin/mount"
76
76
+
'';
77
77
+
78
78
+
postFixup = ''
79
79
+
# Make wrappers for all shell scripts used by schroot
80
80
+
# The wrapped script are put into a separate directory to not be run by schroot during setup
81
81
+
mkdir $out/etc/schroot/setup.d.wrapped
82
82
+
cd $out/etc/schroot/setup.d
83
83
+
find * -type f | while read -r file; do
84
84
+
mv "$file" $out/etc/schroot/setup.d.wrapped
85
85
+
makeWrapper "$out/etc/schroot/setup.d.wrapped/$file" "$file" --set PATH ${scripts-bin-path}
86
86
+
done
87
87
+
88
88
+
# Get rid of stuff that's (probably) not needed
89
89
+
rm -vrf $out/lib $out/include
90
90
+
'';
91
91
+
92
92
+
meta = {
93
93
+
description = "Lightweight virtualisation tool";
94
94
+
longDescription = ''
95
95
+
Schroot is a program that allows the user to run a command or a login shell in a chroot environment.
96
96
+
'';
97
97
+
homepage = "https://codeberg.org/shelter/reschroot";
98
98
+
changelog = "https://codeberg.org/shelter/reschroot/raw/tag/release/reschroot-${upstream-version}/NEWS";
99
99
+
mainProgram = "schroot";
100
100
+
maintainers = with lib.maintainers; [ bjsowa ];
101
101
+
license = lib.licenses.gpl3Plus;
102
102
+
platforms = lib.platforms.linux;
103
103
+
};
104
104
+
}