Skip to content

Commit ef48079

Browse files
committed
feat: add fakeroot as a build dependency
fakeroot helps us set SELinux labels which do not exist on host or work on non-SELinux hosts. Signed-off-by: Dmitry Sharshakov <dmitry.sharshakov@siderolabs.com>
1 parent 86b5363 commit ef48079

File tree

6 files changed

+87
-0
lines changed

6 files changed

+87
-0
lines changed

Pkgfile

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -97,6 +97,11 @@ vars:
9797
file_sha256: 28c01a5ef1a127ef71758222ca019ba6c6bfa4a8fe20c2b525ce75943ee9da3c
9898
file_sha512: fdd4c5d13d5ea1d25686c76d8ebc3252c54040c4871e3f0f623c4548b3841795d4e36050292a9453eedf0fbf932573890e9d6ac9fa63ccf577215598ae84b9ea
9999

100+
# renovate: datasource=git-tags extractVersion=^upstream/(?<version>.*)$ depName=git://salsa.debian.org/clint/fakeroot.git
101+
fakeroot_version: 1.36
102+
fakeroot_sha256: 5128dd5df59955d60453aea1817d2f31c29ffb8b8addcc5d7e200460278a6b0a
103+
fakeroot_sha512: 1ff4cfe8bd4637652027b9e994ed39bf9885d6ea1608050ff21343dc2977c0607c2af235f51376e086ec88ee975da5cb7115a9888ee9437c927426a2eac1bf4b
104+
100105
# renovate: datasource=git-tags extractVersion=^v(?<version>.*)$ depName=git://git.savannah.gnu.org/findutils.git
101106
findutils_version: 4.10.0
102107
findutils_sha256: 1387e0b67ff247d2abde998f90dfbf70c1491391a59ddfecb8ae698789f0a4f5

fakeroot/patches/fakeroot-no64.patch

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
This patch fixes building with musl libc
2+
3+
https://github.com/void-linux/void-packages/blob/e3ff6da0aa9f378356cec4184580025ddae771de/srcpkgs/fakeroot/patches/fakeroot-no64.patch
4+
5+
--- a/libfakeroot.c
6+
+++ b/libfakeroot.c
7+
@@ -81,12 +81,14 @@
8+
#define SEND_STAT64(a,b,c) send_stat64(a,b,c)
9+
#define SEND_GET_STAT(a,b) send_get_stat(a,b)
10+
#define SEND_GET_STAT64(a,b) send_get_stat64(a,b)
11+
+#define SEND_GET_XATTR(a,b,c) send_get_xattr(a,b,c)
12+
#define SEND_GET_XATTR64(a,b,c) send_get_xattr64(a,b,c)
13+
#else
14+
#define SEND_STAT(a,b,c) send_stat(a,b)
15+
#define SEND_STAT64(a,b,c) send_stat64(a,b)
16+
#define SEND_GET_STAT(a,b) send_get_stat(a)
17+
#define SEND_GET_STAT64(a,b) send_get_stat64(a)
18+
+#define SEND_GET_XATTR(a,b,c) send_get_xattr(a,b)
19+
#define SEND_GET_XATTR64(a,b,c) send_get_xattr64(a,b)
20+
#endif

fakeroot/patches/fix-shell.patch

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
Description: Fix shell in fakeroot.in
2+
Use /bin/sh instead of @SHELL@ in fakeroot.in
3+
Author: Juan Picca <jumapico@gmail.com>
4+
Source: Debian
5+
Last-Update: 2024-08-22 by Dmitrii Sharshakov
6+
---
7+
--- a/scripts/fakeroot.in
8+
+++ b/scripts/fakeroot.in
9+
@@ -1,4 +1,4 @@
10+
-#!@SHELL@
11+
+#!/toolchain/bin/bash
12+
13+
# This script first starts faked (the daemon), and then it will run
14+
# the requested program with fake root privileges.

fakeroot/patches/no-docs.patch

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
diff --git a/Makefile.am b/Makefile.am
2+
index 46f01eb..4c10cfa 100644
3+
--- a/Makefile.am
4+
+++ b/Makefile.am
5+
@@ -1,6 +1,6 @@
6+
AUTOMAKE_OPTIONS=foreign
7+
ACLOCAL_AMFLAGS = -I build-aux
8+
-SUBDIRS=doc scripts test
9+
+SUBDIRS=scripts test
10+
11+
noinst_LTLIBRARIES = libcommunicate.la libmacosx.la libfakeroot_time64.la
12+
libcommunicate_la_SOURCES = communicate.c

fakeroot/pkg.yaml

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
name: fakeroot
2+
dependencies:
3+
- stage: base
4+
- stage: patch
5+
- stage: autoconf
6+
- stage: automake
7+
- stage: libtool
8+
- stage: libcap
9+
steps:
10+
- sources:
11+
- url: https://salsa.debian.org/clint/fakeroot/-/archive/upstream/{{ .fakeroot_version }}/fakeroot-upstream-{{ .fakeroot_version }}.tar.gz
12+
destination: fakeroot.tar.gz
13+
sha256: "{{ .fakeroot_sha256 }}"
14+
sha512: "{{ .fakeroot_sha512 }}"
15+
prepare:
16+
- |
17+
tar -xzvf fakeroot.tar.gz --strip-components=1
18+
19+
patch -p1 < /pkg/patches/fix-shell.patch
20+
patch -p1 < /pkg/patches/no-docs.patch
21+
patch -p1 < /pkg/patches/fakeroot-no64.patch
22+
23+
autoreconf -vif
24+
./configure \
25+
--prefix=${TOOLCHAIN} \
26+
CFLAGS="${CFLAGS} -fPIC"
27+
build:
28+
- |
29+
make -j $(nproc)
30+
install:
31+
- |
32+
make install DESTDIR=/rootfs PREFIX=/toolchain
33+
finalize:
34+
- from: /rootfs
35+
to: /

tools/pkg.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ dependencies:
2323
- stage: elfutils
2424
- stage: expat
2525
- stage: expect
26+
- stage: fakeroot
2627
- stage: file
2728
- stage: findutils
2829
- stage: flex

0 commit comments

Comments
 (0)