Skip to contentSkip to conversation

zsync: Fix build on musl

PATCH In review Khem Raj 2 participants 3 messages Jun 8, 2021

lore
Share & tools
lore

Khem Raj

author
#0 lore raw

PATCH 1/1 zsync: Fix build on musl

---
 ...0001-sha1-Include-unistd.h-for-off_t.patch | 29 +++++++++++++++++++
 meta-oe/recipes-extended/zsync/zsync_0.6.2.bb |  4 ++-
 2 files changed, 32 insertions(+), 1 deletion(-)
 create mode 100644 meta-oe/recipes-extended/zsync/zsync/0001-sha1-Include-unistd.h-for-off_t.patch
meta-oe/recipes-extended/zsync/zsync/0001-sha1-Include-unistd.h-for-off_t.patch new file +29 -0
new file mode 100644
index 0000000000..60bcd8166f
@@ -0,0 +1,29 @@
+From 72ad6dd95441836afb1f113697339b3c694d0e69 Mon Sep 17 00:00:00 2001
+From: Khem Raj <[email protected]>
+Date: Tue, 8 Jun 2021 09:26:32 -0700
+Subject: [PATCH] sha1: Include unistd.h for off_t
+
+Musl systems do not get this definition indirectly like what happens
+on glibc, therefore include unistd.h to get the definition
+
+Upstream-Status: Pending
+Signed-off-by: Khem Raj <[email protected]>
+---
+ libzsync/sha1.h | 1 +
+ 1 file changed, 1 insertion(+)
+
+diff --git a/libzsync/sha1.h b/libzsync/sha1.h
+index 3946505..23d9434 100644
+--- a/libzsync/sha1.h
++++ b/libzsync/sha1.h
+@@ -16,6 +16,7 @@
+ #else
+ #include <sys/types.h>
+ #endif
++#include <unistd.h>
+ 
+ #define	SHA1_BLOCK_LENGTH		64
+ #define	SHA1_DIGEST_LENGTH		20
+-- 
+2.32.0
+
meta-oe/recipes-extended/zsync/zsync_0.6.2.bb +3 -1
index c61e26309d..b80bf9cded 100644
@@ -5,7 +5,9 @@ LICENSE = "Artistic-2.0"
 LIC_FILES_CHKSUM = "file://COPYING;md5=71c0ac4d86266533509aa0825b8d323c"
 
 SRC_URI = "http://zsync.moria.org.uk/download/${BP}.tar.bz2 \
-           file://out-of-tree.patch"
+           file://out-of-tree.patch \
+           file://0001-sha1-Include-unistd.h-for-off_t.patch \
+           "
 SRC_URI[sha256sum] = "0b9d53433387aa4f04634a6c63a5efa8203070f2298af72a705f9be3dda65af2"
 
 inherit autotools
Signature · 1 line
2.32.0
#1 lore raw

I've a better patch, hold off merging that recipe.

Ross

Quoted 65 lines · Khem Raj
---
 ...0001-sha1-Include-unistd.h-for-off_t.patch | 29 +++++++++++++++++++
 meta-oe/recipes-extended/zsync/zsync_0.6.2.bb |  4 ++-
 2 files changed, 32 insertions(+), 1 deletion(-)
 create mode 100644 meta-oe/recipes-extended/zsync/zsync/0001-sha1-Include-unistd.h-for-off_t.patch
meta-oe/recipes-extended/zsync/zsync/0001-sha1-Include-unistd.h-for-off_t.patch new file +29 -0
new file mode 100644
index 0000000000..60bcd8166f
@@ -0,0 +1,29 @@
+From 72ad6dd95441836afb1f113697339b3c694d0e69 Mon Sep 17 00:00:00 2001
+From: Khem Raj <[email protected]>
+Date: Tue, 8 Jun 2021 09:26:32 -0700
+Subject: [PATCH] sha1: Include unistd.h for off_t
+
+Musl systems do not get this definition indirectly like what happens
+on glibc, therefore include unistd.h to get the definition
+
+Upstream-Status: Pending
+Signed-off-by: Khem Raj <[email protected]>
+---
+ libzsync/sha1.h | 1 +
+ 1 file changed, 1 insertion(+)
+
+diff --git a/libzsync/sha1.h b/libzsync/sha1.h
+index 3946505..23d9434 100644
+--- a/libzsync/sha1.h
++++ b/libzsync/sha1.h
+@@ -16,6 +16,7 @@
+ #else
+ #include <sys/types.h>
+ #endif
++#include <unistd.h>
+
+ #define       SHA1_BLOCK_LENGTH               64
+ #define       SHA1_DIGEST_LENGTH              20
+--
+2.32.0
+
meta-oe/recipes-extended/zsync/zsync_0.6.2.bb +3 -2
index c61e26309d..b80bf9cded 100644
@@ -5,7 +5,9 @@ LICENSE = "Artistic-2.0"
 LIC_FILES_CHKSUM = "file://COPYING;md5=71c0ac4d86266533509aa0825b8d323c"
 
 SRC_URI = "http://zsync.moria.org.uk/download/${BP}.tar.bz2 \
-           file://out-of-tree.patch"
+           file://out-of-tree.patch \
+           file://0001-sha1-Include-unistd.h-for-off_t.patch \
+           "
 SRC_URI[sha256sum] = "0b9d53433387aa4f04634a6c63a5efa8203070f2298af72a705f9be3dda65af2"
 
 inherit autotools
--

2.32.0

author
#2 lore raw
Quoted 3 lines · Ross Burton

I've a better patch, hold off merging that recipe.

ok

Quoted 68 lines

Ross

Quoted 65 lines · Khem Raj
---
 ...0001-sha1-Include-unistd.h-for-off_t.patch | 29 +++++++++++++++++++
 meta-oe/recipes-extended/zsync/zsync_0.6.2.bb |  4 ++-
 2 files changed, 32 insertions(+), 1 deletion(-)
 create mode 100644 meta-oe/recipes-extended/zsync/zsync/0001-sha1-Include-unistd.h-for-off_t.patch
meta-oe/recipes-extended/zsync/zsync/0001-sha1-Include-unistd.h-for-off_t.patch new file +29 -0
new file mode 100644
index 0000000000..60bcd8166f
@@ -0,0 +1,29 @@
+From 72ad6dd95441836afb1f113697339b3c694d0e69 Mon Sep 17 00:00:00 2001
+From: Khem Raj <[email protected]>
+Date: Tue, 8 Jun 2021 09:26:32 -0700
+Subject: [PATCH] sha1: Include unistd.h for off_t
+
+Musl systems do not get this definition indirectly like what happens
+on glibc, therefore include unistd.h to get the definition
+
+Upstream-Status: Pending
+Signed-off-by: Khem Raj <[email protected]>
+---
+ libzsync/sha1.h | 1 +
+ 1 file changed, 1 insertion(+)
+
+diff --git a/libzsync/sha1.h b/libzsync/sha1.h
+index 3946505..23d9434 100644
+--- a/libzsync/sha1.h
++++ b/libzsync/sha1.h
+@@ -16,6 +16,7 @@
+ #else
+ #include <sys/types.h>
+ #endif
++#include <unistd.h>
+
+ #define       SHA1_BLOCK_LENGTH               64
+ #define       SHA1_DIGEST_LENGTH              20
+--
+2.32.0
+
meta-oe/recipes-extended/zsync/zsync_0.6.2.bb +3 -2
index c61e26309d..b80bf9cded 100644
@@ -5,7 +5,9 @@ LICENSE = "Artistic-2.0"
 LIC_FILES_CHKSUM = "file://COPYING;md5=71c0ac4d86266533509aa0825b8d323c"
 
 SRC_URI = "http://zsync.moria.org.uk/download/${BP}.tar.bz2 \
-           file://out-of-tree.patch"
+           file://out-of-tree.patch \
+           file://0001-sha1-Include-unistd.h-for-off_t.patch \
+           "
 SRC_URI[sha256sum] = "0b9d53433387aa4f04634a6c63a5efa8203070f2298af72a705f9be3dda65af2"
 
 inherit autotools
--

2.32.0