Skip to content
Snippets Groups Projects
Commit e3d7e96f authored by Alessandro Di Federico's avatar Alessandro Di Federico
Browse files

Import ui/libudev

parent 505b759d
No related branches found
No related tags found
No related merge requests found
Pipeline #3001 passed
......@@ -49,12 +49,15 @@ apt-get install --no-install-recommends --yes \
# Dependencies for Qt
apt install --no-install-recommends --yes \
gperf \
libcap-dev \
libfontconfig1-dev \
libfreetype6-dev \
libgl-dev \
libgl1-mesa-dev \
libgles2-mesa-dev \
libinput-dev \
libmount-dev \
libssl-dev \
libx11-dev \
libx11-xcb-dev \
......
#@ load("@ytt:data", "data")
#@ load("@ytt:overlay", "overlay")
#@ load("/lib/create_component.lib.yml", "single_build_component")
#@ source_url = "https://github.com/systemd/systemd/archive/v246.tar.gz"
#@yaml/text-templated-strings
---
#@ def libudev_args():
license: source/LICENSE.LGPL2.1
configure: |
mkdir -p "$BUILD_DIR" "$BUILD_DIR/source"
extract.sh --into "$BUILD_DIR/source" "(@= source_url @)"
find "$BUILD_DIR/source/" -name meson.build -exec sed -i "s|install\s*:\s*|install_rpath : '$RPATH_PLACEHOLDER/lib', \0|" {} \;
patch-if-exists "${ORCHESTRA_DOTDIR}/patches/systemd-libudev-old-glibc-compatibility.patch" "$BUILD_DIR/source"
export CC=clang
export CXX=clang++
meson setup \
--buildtype plain \
--libdir=lib \
--prefix "$ORCHESTRA_ROOT" \
--wrap-mode nodownload \
-Drootprefix=/ \
-Drootlibdir=/usr/lib64 \
-Dima=true \
-Ddefault-hierarchy=unified \
-Dacl=false \
-Dapparmor=false \
-Daudit=false \
-Dlibcryptsetup=false \
-Dlibcurl=false \
-Ddns-over-tls=false \
-Delfutils=false \
-Dgcrypt=false \
-Dgnu-efi=false \
-Dhomed=false \
-Dhwdb=false \
-Dmicrohttpd=false \
-Didn=false \
-Dimportd=false \
-Dbzip2=false \
-Dzlib=false \
-Dkmod=false \
-Dlz4=false \
-Dxz=false \
-Dzstd=false \
-Dlibiptc=false \
-Dpam=false \
-Dp11kit=false \
-Dpcre2=false \
-Dpolkit=false \
-Dpwquality=false \
-Dqrencode=false \
-Drepart=false \
-Dseccomp=false \
-Dselinux=false \
-Ddbus=false \
-Dxkbcommon=false \
-Ddefault-kill-user-processes=false \
-Dcreate-log-dirs=false \
-Dbacklight=false \
-Dbinfmt=false \
-Dcoredump=false \
-Denvironment-d=false \
-Dfirstboot=false \
-Dhibernate=false \
-Dhostnamed=false \
-Dldconfig=false \
-Dlocaled=false \
-Dman=false \
-Dnetworkd=false \
-Dquotacheck=false \
-Drandomseed=false \
-Drfkill=false \
-Dsysusers=false \
-Dtimedated=false \
-Dtimesyncd=false \
-Dtmpfiles=false \
-Dvconsole=false \
-Dstatic-libsystemd=false \
-Dstatic-libudev=false \
-Ddebug-gui=false \
-Ddocumentation=false \
-Dlibwacom=false \
-Dtests=false \
-Dudev-dir=/lib/udev \
-Db_ndebug=true \
-Dc_args="(@= data.values.use_old_glibc_cflags @) -w -DO_PATH=010000000 -DAT_EMPTY_PATH=0x1000 -Dsecure_getenv=getenv -DCLOCK_BOOTTIME=7 -DCLOCK_REALTIME_ALARM=8 -DCLOCK_BOOTTIME_ALARM=9" \
-Dc_link_args="(@= data.values.use_old_glibc_ldflags @) -fuse-ld=gold -L$ORCHESTRA_ROOT/lib -Wl,-z,origin -Wl,--enable-new-dtags -Wl,-rpath,$RPATH_PLACEHOLDER/lib" \
"$BUILD_DIR" \
"$BUILD_DIR/source"
install: |
cd "$BUILD_DIR"
ninja src/udev/libudev.so.1.6.18
cd "${DESTDIR}${ORCHESTRA_ROOT}"
cp -a "$BUILD_DIR/src/udev/libudev.so.1.6.18" lib/
ln -s libudev.so.1.6.18 lib/libudev.so.1.6
ln -s libudev.so.1.6 lib/libudev.so.1
ln -s libudev.so.1 lib/libudev.so
mkdir -p share/pkgconfig include
cp -a "$BUILD_DIR/source/src/libudev/libudev.h" include/
cp -a "$BUILD_DIR/src/libudev/libudev.pc" share/pkgconfig/
build_dependencies:
- host-c-toolchain
#@ end
#@overlay/match by=overlay.all, expects=1
#@overlay/match-child-defaults missing_ok=True
---
components:
ui/libudev: #@ single_build_component(**libudev_args())
......@@ -144,6 +144,7 @@ builds:
- ui/mesa
- ui/libxcb
- ui/libinput
- ui/libudev
- ui/xcbutil-image
- ui/xcbutil-renderutil
- ui/xcbutil-wm
......
diff -ur source-original/src/basic/escape.h source/src/basic/escape.h
--- source-original/src/basic/escape.h 2020-07-30 21:02:36.000000000 +0200
+++ source/src/basic/escape.h 2020-11-23 12:13:14.814557793 +0100
@@ -5,7 +5,6 @@
#include <stddef.h>
#include <stdint.h>
#include <sys/types.h>
-#include <uchar.h>
#include "string-util.h"
#include "missing_type.h"
diff -ur source-original/src/basic/meson.build source/src/basic/meson.build
--- source-original/src/basic/meson.build 2020-11-23 12:10:49.829864428 +0100
+++ source/src/basic/meson.build 2020-11-23 12:22:16.133388391 +0100
@@ -3,8 +3,6 @@
basic_sources = files('''
MurmurHash2.c
MurmurHash2.h
- af-list.c
- af-list.h
alloc-util.c
alloc-util.h
architecture.c
@@ -17,8 +15,6 @@
audit-util.h
blockdev-util.c
blockdev-util.h
- btrfs-util.c
- btrfs-util.h
build.h
bus-label.c
bus-label.h
@@ -241,8 +237,6 @@
util.h
virt.c
virt.h
- xattr-util.c
- xattr-util.h
'''.split())
missing_audit_h = files('missing_audit.h')
diff -ur source-original/src/basic/missing_type.h source/src/basic/missing_type.h
--- source-original/src/basic/missing_type.h 2020-07-30 21:02:36.000000000 +0200
+++ source/src/basic/missing_type.h 2020-11-23 12:11:45.334125170 +0100
@@ -1,12 +1,5 @@
/* SPDX-License-Identifier: LGPL-2.1+ */
#pragma once
-#include <uchar.h>
-
-#if !HAVE_CHAR32_T
#define char32_t uint32_t
-#endif
-
-#if !HAVE_CHAR16_T
#define char16_t uint16_t
-#endif
diff -ur source-original/src/basic/mountpoint-util.c source/src/basic/mountpoint-util.c
--- source-original/src/basic/mountpoint-util.c 2020-07-30 21:02:36.000000000 +0200
+++ source/src/basic/mountpoint-util.c 2020-11-23 12:30:49.476242034 +0100
@@ -22,6 +24,7 @@
* with large file handles anyway. */
#define ORIGINAL_MAX_HANDLE_SZ 128
+#if 0
int name_to_handle_at_loop(
int fd,
const char *path,
@@ -85,6 +88,7 @@
h = mfree(h);
}
}
+#endif
static int fd_fdinfo_mnt_id(int fd, const char *filename, int flags, int *mnt_id) {
char path[STRLEN("/proc/self/fdinfo/") + DECIMAL_STR_MAX(int)];
@@ -156,7 +160,7 @@
* systems with a variety of st_dev reported. Also, btrfs
* subvolumes have different st_dev, even though they aren't
* real mounts of their own. */
-
+#if 0
r = name_to_handle_at_loop(fd, filename, &h, &mount_id, flags);
if (IN_SET(r, -ENOSYS, -EACCES, -EPERM, -EOVERFLOW, -EINVAL))
/* This kernel does not support name_to_handle_at() at all (ENOSYS), or the syscall was blocked
@@ -183,6 +187,7 @@
return 1;
} else if (r < 0)
return r;
+#endif
/* The parent can do name_to_handle_at() but the
* directory we are interested in can't? If so, it
@@ -194,11 +199,12 @@
* interested in and its parent are identical, we
* assume this is the root directory, which is a mount
* point. */
-
+#if 0
if (h->handle_bytes == h_parent->handle_bytes &&
h->handle_type == h_parent->handle_type &&
memcmp(h->f_handle, h_parent->f_handle, h->handle_bytes) == 0)
return 1;
+#endif
return mount_id != mount_id_parent;
@@ -277,6 +283,7 @@
return fd_is_mount_point(fd, last_path_component(t), flags);
}
+#if 0
int path_get_mnt_id(const char *path, int *ret) {
int r;
@@ -286,6 +293,7 @@
return r;
}
+#endif
bool fstype_is_network(const char *fstype) {
const char *x;
@@ -386,9 +394,11 @@
int mount_id, r;
char *e;
+#if 0
r = path_get_mnt_id("/dev", &mount_id);
if (r < 0)
return r;
+#endif
r = fopen_unlocked("/proc/self/mountinfo", "re", &proc_self_mountinfo);
if (r < 0)
diff -ur source-original/src/basic/mountpoint-util.h source/src/basic/mountpoint-util.h
--- source-original/src/basic/mountpoint-util.h 2020-07-30 21:02:36.000000000 +0200
+++ source/src/basic/mountpoint-util.h 2020-11-23 12:23:34.413816875 +0100
@@ -5,7 +5,6 @@
#include <stdbool.h>
#include <sys/types.h>
-int name_to_handle_at_loop(int fd, const char *path, struct file_handle **ret_handle, int *ret_mnt_id, int flags);
int path_get_mnt_id(const char *path, int *ret);
diff -ur source-original/src/basic/random-util.c source/src/basic/random-util.c
--- source-original/src/basic/random-util.c 2020-07-30 21:02:36.000000000 +0200
+++ source/src/basic/random-util.c 2020-11-23 12:31:12.160369916 +0100
@@ -307,7 +307,7 @@
if (srand_called)
return;
-#if HAVE_SYS_AUXV_H
+#if 0
/* The kernel provides us with 16 bytes of entropy in auxv, so let's try to make use of that to seed
* the pseudo-random generator. It's better than nothing... But let's first hash it to make it harder
* to recover the original value by watching any pseudo-random bits we generate. After all the
diff -ur source-original/src/basic/utf8.h source/src/basic/utf8.h
--- source-original/src/basic/utf8.h 2020-07-30 21:02:36.000000000 +0200
+++ source/src/basic/utf8.h 2020-11-23 12:11:33.242067835 +0100
@@ -4,7 +4,6 @@
#include <stdbool.h>
#include <stddef.h>
#include <stdint.h>
-#include <uchar.h>
#include "macro.h"
#include "missing_type.h"
diff -ur source-original/src/shared/meson.build source/src/shared/meson.build
--- source-original/src/shared/meson.build 2020-11-23 12:10:49.845864503 +0100
+++ source/src/shared/meson.build 2020-11-23 12:19:50.268599618 +0100
@@ -132,8 +132,6 @@
install.h
ipvlan-util.c
ipvlan-util.h
- ip-protocol-list.c
- ip-protocol-list.h
journal-importer.c
journal-importer.h
journal-util.c
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment