diff --git a/0001-Fix-compilation-on-Fedora-rawhide.patch b/0001-Fix-compilation-on-Fedora-rawhide.patch new file mode 100644 index 0000000..ebc62e1 --- /dev/null +++ b/0001-Fix-compilation-on-Fedora-rawhide.patch @@ -0,0 +1,36 @@ +From 7e32487df2c7f8b26f3a66ca1d4fee767eff314e Mon Sep 17 00:00:00 2001 +From: Bastien Nocera +Date: Thu, 1 Mar 2018 17:56:01 +0100 +Subject: [PATCH] Fix compilation on Fedora rawhide + +--- + src/umockdev-record.vala | 8 ++++---- + 1 file changed, 4 insertions(+), 4 deletions(-) + +diff --git a/src/umockdev-record.vala b/src/umockdev-record.vala +index 1ed4061..2104417 100644 +--- a/src/umockdev-record.vala ++++ b/src/umockdev-record.vala +@@ -75,15 +75,15 @@ resolve (string dev) + if (Posix.stat(dev, out st) != 0) + exit_error("Cannot access device %s: %s", dev, strerror(errno)); + +- uint major = Posix.major(st.st_rdev); +- uint minor = Posix.minor(st.st_rdev); ++ uint major_int = Posix.major(st.st_rdev); ++ uint minor_int = Posix.minor(st.st_rdev); + + string link; + // character device? + if (Posix.S_ISCHR(st.st_mode)) +- link = "/sys/dev/char/%u:%u".printf(major, minor); ++ link = "/sys/dev/char/%u:%u".printf(major_int, minor_int); + else if (Posix.S_ISBLK(st.st_mode)) +- link = "/sys/dev/block/%u:%u".printf(major, minor); ++ link = "/sys/dev/block/%u:%u".printf(major_int, minor_int); + else + link = dev; + +-- +2.14.3 + diff --git a/umockdev.spec b/umockdev.spec index 46b3b8f..3b2551b 100644 --- a/umockdev.spec +++ b/umockdev.spec @@ -19,6 +19,9 @@ BuildRequires: chrpath BuildRequires: gphoto2 BuildRequires: python3 +# https://github.com/martinpitt/umockdev/issues/76 +Patch0: 0001-Fix-compilation-on-Fedora-rawhide.patch + %description With this program and libraries you can easily create mock udev objects. This is useful for writing tests for software which talks to @@ -35,6 +38,7 @@ using %{name}. %prep %setup -q -n %{name}-%{version} +%patch0 -p1 %build NOCONFIGURE=1 ./autogen.sh