diff mbox series

librepo: Fix build on musl

Message ID 20220827162202.2769805-1-raj.khem@gmail.com
State Accepted, archived
Commit 3673c759131d2001937037062bf463698f30895c
Headers show
Series librepo: Fix build on musl | expand

Commit Message

Khem Raj Aug. 27, 2022, 4:22 p.m. UTC
Add missing header file

Signed-off-by: Khem Raj <raj.khem@gmail.com>
---
 ...ownloader-Include-unistd.h-for-lseek.patch | 34 +++++++++++++++++++
 .../librepo/librepo_1.14.4.bb                 |  1 +
 2 files changed, 35 insertions(+)
 create mode 100644 meta/recipes-devtools/librepo/librepo/0001-metadata_downloader-Include-unistd.h-for-lseek.patch
diff mbox series

Patch

diff --git a/meta/recipes-devtools/librepo/librepo/0001-metadata_downloader-Include-unistd.h-for-lseek.patch b/meta/recipes-devtools/librepo/librepo/0001-metadata_downloader-Include-unistd.h-for-lseek.patch
new file mode 100644
index 0000000000..22b3110a61
--- /dev/null
+++ b/meta/recipes-devtools/librepo/librepo/0001-metadata_downloader-Include-unistd.h-for-lseek.patch
@@ -0,0 +1,34 @@ 
+From 5c63ec2e2d4726268ace85e5c61727cbd811d982 Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Sat, 27 Aug 2022 09:00:24 -0700
+Subject: [PATCH] metadata_downloader: Include unistd.h for lseek()
+
+This is found when compiling on musl systems
+
+Fixes
+
+metadata_downloader.c:331:9: error: call to undeclared function 'lseek'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration]
+        lseek(fd_value, SEEK_SET, 0);
+        ^
+
+Upstream-Status: Submitted [https://github.com/rpm-software-management/librepo/pull/263]
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+ librepo/metadata_downloader.c | 1 +
+ 1 file changed, 1 insertion(+)
+
+diff --git a/librepo/metadata_downloader.c b/librepo/metadata_downloader.c
+index 123c77b..6604255 100644
+--- a/librepo/metadata_downloader.c
++++ b/librepo/metadata_downloader.c
+@@ -24,6 +24,7 @@
+ #include <assert.h>
+ #include <string.h>
+ #include <errno.h>
++#include <unistd.h>
+ #include <sys/stat.h>
+ 
+ #include "librepo/librepo.h"
+-- 
+2.37.2
+
diff --git a/meta/recipes-devtools/librepo/librepo_1.14.4.bb b/meta/recipes-devtools/librepo/librepo_1.14.4.bb
index cdd9645298..2b8bd132f3 100644
--- a/meta/recipes-devtools/librepo/librepo_1.14.4.bb
+++ b/meta/recipes-devtools/librepo/librepo_1.14.4.bb
@@ -8,6 +8,7 @@  LIC_FILES_CHKSUM = "file://COPYING;md5=4fbd65380cdd255951079008b364516c"
 SRC_URI = "git://github.com/rpm-software-management/librepo.git;branch=master;protocol=https \
            file://0002-Do-not-try-to-obtain-PYTHON_INSTALL_DIR-by-running-p.patch \
            file://0004-Set-gpgme-variables-with-pkg-config-not-with-cmake-m.patch \
+           file://0001-metadata_downloader-Include-unistd.h-for-lseek.patch \
            "
 
 SRCREV = "2bd1041c741c85bc196ca01dcca1eae6099eb742"