Github messages for voidlinux
 help / color / mirror / Atom feed
* [PR PATCH] libsndfile: update to 1.1.0 (v2)
@ 2022-12-13 20:52 lun-4
  2022-12-18 11:41 ` [PR REVIEW] " paper42
                   ` (5 more replies)
  0 siblings, 6 replies; 7+ messages in thread
From: lun-4 @ 2022-12-13 20:52 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 803 bytes --]

There is a new pull request by lun-4 against master on the void-packages repository

https://github.com/lun-4/void-packages libsndfile-update-1-1-0-v2
https://github.com/void-linux/void-packages/pull/41069

libsndfile: update to 1.1.0 (v2)
This is the sequel to https://github.com/void-linux/void-packages/pull/36908, as the bug shown in musl is now fixed (see https://github.com/libsndfile/libsndfile/issues/830)

#### Testing the changes
- I tested the changes in this PR: **briefly**

#### Local build testing
- I built this PR locally for my native architecture, x86_64-glibc
- I built this PR locally for these architectures (if supported. mark crossbuilds):
  - x86_64-musl (only built, no test)


A patch file from https://github.com/void-linux/void-packages/pull/41069.patch is attached

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-libsndfile-update-1-1-0-v2-41069.patch --]
[-- Type: text/x-diff, Size: 5307 bytes --]

From 5971672e8d31dbc61ab43f033fd3263dab2f99c7 Mon Sep 17 00:00:00 2001
From: Luna <git@l4.pm>
Date: Tue, 13 Dec 2022 17:35:15 -0300
Subject: [PATCH] libsndfile: update to 1.1.0

---
 .../patches/identify-naked-mpeg-last.patch    | 73 +++++++++++++++++++
 srcpkgs/libsndfile/template                   |  9 ++-
 2 files changed, 78 insertions(+), 4 deletions(-)
 create mode 100644 srcpkgs/libsndfile/patches/identify-naked-mpeg-last.patch

diff --git a/srcpkgs/libsndfile/patches/identify-naked-mpeg-last.patch b/srcpkgs/libsndfile/patches/identify-naked-mpeg-last.patch
new file mode 100644
index 000000000000..a817a7e41b12
--- /dev/null
+++ b/srcpkgs/libsndfile/patches/identify-naked-mpeg-last.patch
@@ -0,0 +1,73 @@
+Author: Arthur Taylor <art@ified.ca>
+Reason: The minimal possible MPEG file contains no headers or identification
+other than the brief sync header. This header is only 3 bytes, and is quite
+prone to false-positives. Particularly raw PCM can look like a sync header.
+
+As such, move detection of 'naked' MPEG files in guess_file_type()
+to the very last test. Give more weight to a sync header if it
+follows an ID3 tag.
+
+See https://github.com/libsndfile/libsndfile/pull/898
+Upstream: yes
+--- a/src/sndfile.c
++++ b/src/sndfile.c
+@@ -2771,6 +2771,17 @@ format_from_extension (SF_PRIVATE *psf)
+ 	return format ;
+ } /* format_from_extension */
+ 
++static int
++identify_mpeg (uint32_t marker)
++{	if ((marker & MAKE_MARKER (0xFF, 0xE0, 0, 0)) == MAKE_MARKER (0xFF, 0xE0, 0, 0) && /* Frame sync */
++		(marker & MAKE_MARKER (0, 0x18, 0, 0)) != MAKE_MARKER (0, 0x08, 0, 0) && /* Valid MPEG version */
++		(marker & MAKE_MARKER (0, 0x06, 0, 0)) != MAKE_MARKER (0, 0, 0, 0) && /* Valid layer description */
++		(marker & MAKE_MARKER (0, 0, 0xF0, 0)) != MAKE_MARKER (0, 0, 0xF0, 0) && /* Valid bitrate */
++		(marker & MAKE_MARKER (0, 0, 0x0C, 0)) != MAKE_MARKER (0, 0, 0x0C, 0)) /* Valid samplerate */
++		return SF_FORMAT_MPEG ;
++	return 0 ;
++} /* identify_mpeg */
++
+ static int
+ guess_file_type (SF_PRIVATE *psf)
+ {	uint32_t buffer [3], format ;
+@@ -2872,13 +2883,6 @@ guess_file_type (SF_PRIVATE *psf)
+ 	if (buffer [0] == MAKE_MARKER ('R', 'F', '6', '4') && buffer [2] == MAKE_MARKER ('W', 'A', 'V', 'E'))
+ 		return SF_FORMAT_RF64 ;
+ 
+-	if ((buffer [0] & MAKE_MARKER (0xFF, 0xE0, 0, 0)) == MAKE_MARKER (0xFF, 0xE0, 0, 0) && /* Frame sync */
+-		(buffer [0] & MAKE_MARKER (0, 0x18, 0, 0)) != MAKE_MARKER (0, 0x08, 0, 0) && /* Valid MPEG version */
+-		(buffer [0] & MAKE_MARKER (0, 0x06, 0, 0)) != MAKE_MARKER (0, 0, 0, 0) && /* Valid layer description */
+-		(buffer [0] & MAKE_MARKER (0, 0, 0xF0, 0)) != MAKE_MARKER (0, 0, 0xF0, 0) && /* Valid bitrate */
+-		(buffer [0] & MAKE_MARKER (0, 0, 0x0C, 0)) != MAKE_MARKER (0, 0, 0x0C, 0)) /* Valid samplerate */
+-		return SF_FORMAT_MPEG ;
+-
+ 	if (buffer [0] == MAKE_MARKER ('I', 'D', '3', 2) || buffer [0] == MAKE_MARKER ('I', 'D', '3', 3)
+ 			|| buffer [0] == MAKE_MARKER ('I', 'D', '3', 4))
+ 	{	psf_log_printf (psf, "Found 'ID3' marker.\n") ;
+@@ -2887,6 +2891,10 @@ guess_file_type (SF_PRIVATE *psf)
+ 		return 0 ;
+ 		} ;
+ 
++	/* ID3v2 tags + MPEG */
++	if (psf->id3_header.len > 0 && (format = identify_mpeg (buffer [0])) != 0)
++		return format ;
++
+ 	/* Turtle Beach SMP 16-bit */
+ 	if (buffer [0] == MAKE_MARKER ('S', 'O', 'U', 'N') && buffer [1] == MAKE_MARKER ('D', ' ', 'S', 'A'))
+ 		return 0 ;
+@@ -2898,10 +2906,16 @@ guess_file_type (SF_PRIVATE *psf)
+ 	if (buffer [0] == MAKE_MARKER ('a', 'j', 'k', 'g'))
+ 		return 0 /*-SF_FORMAT_SHN-*/ ;
+ 
+-	/* This must be the last one. */
++	/* This must be (almost) the last one. */
+ 	if (psf->filelength > 0 && (format = try_resource_fork (psf)) != 0)
+ 		return format ;
+ 
++	/* MPEG with no ID3v2 tags. Only have the MPEG sync header for
++	 * identification and it is quite brief, and prone to false positives.
++	 * Check for this last, even after resource forks. */
++	if (psf->id3_header.len == 0 && (format = identify_mpeg (buffer [0])) != 0)
++		return format ;
++
+ 	return 0 ;
+ } /* guess_file_type */
diff --git a/srcpkgs/libsndfile/template b/srcpkgs/libsndfile/template
index 15d21ab8f4a4..cc78a744ef5a 100644
--- a/srcpkgs/libsndfile/template
+++ b/srcpkgs/libsndfile/template
@@ -1,16 +1,17 @@
 # Template file for 'libsndfile'
 pkgname=libsndfile
-version=1.0.31
+version=1.1.0
 revision=1
 build_style=gnu-configure
+configure_args="--enable-static"
 hostmakedepends="pkg-config python3"
-makedepends="alsa-lib-devel libvorbis-devel libflac-devel sqlite-devel opus-devel"
+makedepends="alsa-lib-devel libvorbis-devel libflac-devel sqlite-devel opus-devel mpg123-devel lame-devel"
 short_desc="C library for reading and writing files containing sampled sound"
 maintainer="Orphaned <orphan@voidlinux.org>"
 license="LGPL-2.1-or-later"
 homepage="https://libsndfile.github.io/libsndfile/"
-distfiles="https://github.com/libsndfile/${pkgname}/releases/download/${version}/${pkgname}-${version}.tar.bz2"
-checksum=a8cfb1c09ea6e90eff4ca87322d4168cdbe5035cb48717b40bf77e751cc02163
+distfiles="https://github.com/libsndfile/${pkgname}/releases/download/${version}/${pkgname}-${version}.tar.xz"
+checksum=0f98e101c0f7c850a71225fb5feaf33b106227b3d331333ddc9bacee190bcf41
 
 libsndfile-progs_package() {
 	short_desc+=" - bundled cmdline apps"

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PR REVIEW] libsndfile: update to 1.1.0 (v2)
  2022-12-13 20:52 [PR PATCH] libsndfile: update to 1.1.0 (v2) lun-4
@ 2022-12-18 11:41 ` paper42
  2022-12-18 14:34 ` [PR PATCH] [Updated] " lun-4
                   ` (4 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: paper42 @ 2022-12-18 11:41 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 278 bytes --]

New review comment by paper42 on void-packages repository

https://github.com/void-linux/void-packages/pull/41069#discussion_r1051584545

Comment:
```suggestion
distfiles="https://github.com/libsndfile/libsndfile/releases/download/${version}/libsndfile-${version}.tar.xz"
```

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PR PATCH] [Updated] libsndfile: update to 1.1.0 (v2)
  2022-12-13 20:52 [PR PATCH] libsndfile: update to 1.1.0 (v2) lun-4
  2022-12-18 11:41 ` [PR REVIEW] " paper42
@ 2022-12-18 14:34 ` lun-4
  2022-12-18 14:54 ` lun-4
                   ` (3 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: lun-4 @ 2022-12-18 14:34 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 808 bytes --]

There is an updated pull request by lun-4 against master on the void-packages repository

https://github.com/lun-4/void-packages libsndfile-update-1-1-0-v2
https://github.com/void-linux/void-packages/pull/41069

libsndfile: update to 1.1.0 (v2)
This is the sequel to https://github.com/void-linux/void-packages/pull/36908, as the bug shown in musl is now fixed (see https://github.com/libsndfile/libsndfile/issues/830)

#### Testing the changes
- I tested the changes in this PR: **briefly**

#### Local build testing
- I built this PR locally for my native architecture, x86_64-glibc
- I built this PR locally for these architectures (if supported. mark crossbuilds):
  - x86_64-musl (only built, no test)


A patch file from https://github.com/void-linux/void-packages/pull/41069.patch is attached

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-libsndfile-update-1-1-0-v2-41069.patch --]
[-- Type: text/x-diff, Size: 5307 bytes --]

From 70bed60224290fdced8d7e786e26ba6c1b2ad022 Mon Sep 17 00:00:00 2001
From: Luna <git@l4.pm>
Date: Tue, 13 Dec 2022 17:35:15 -0300
Subject: [PATCH] libsndfile: update to 1.1.0

---
 .../patches/identify-naked-mpeg-last.patch    | 73 +++++++++++++++++++
 srcpkgs/libsndfile/template                   |  9 ++-
 2 files changed, 78 insertions(+), 4 deletions(-)
 create mode 100644 srcpkgs/libsndfile/patches/identify-naked-mpeg-last.patch

diff --git a/srcpkgs/libsndfile/patches/identify-naked-mpeg-last.patch b/srcpkgs/libsndfile/patches/identify-naked-mpeg-last.patch
new file mode 100644
index 000000000000..a817a7e41b12
--- /dev/null
+++ b/srcpkgs/libsndfile/patches/identify-naked-mpeg-last.patch
@@ -0,0 +1,73 @@
+Author: Arthur Taylor <art@ified.ca>
+Reason: The minimal possible MPEG file contains no headers or identification
+other than the brief sync header. This header is only 3 bytes, and is quite
+prone to false-positives. Particularly raw PCM can look like a sync header.
+
+As such, move detection of 'naked' MPEG files in guess_file_type()
+to the very last test. Give more weight to a sync header if it
+follows an ID3 tag.
+
+See https://github.com/libsndfile/libsndfile/pull/898
+Upstream: yes
+--- a/src/sndfile.c
++++ b/src/sndfile.c
+@@ -2771,6 +2771,17 @@ format_from_extension (SF_PRIVATE *psf)
+ 	return format ;
+ } /* format_from_extension */
+ 
++static int
++identify_mpeg (uint32_t marker)
++{	if ((marker & MAKE_MARKER (0xFF, 0xE0, 0, 0)) == MAKE_MARKER (0xFF, 0xE0, 0, 0) && /* Frame sync */
++		(marker & MAKE_MARKER (0, 0x18, 0, 0)) != MAKE_MARKER (0, 0x08, 0, 0) && /* Valid MPEG version */
++		(marker & MAKE_MARKER (0, 0x06, 0, 0)) != MAKE_MARKER (0, 0, 0, 0) && /* Valid layer description */
++		(marker & MAKE_MARKER (0, 0, 0xF0, 0)) != MAKE_MARKER (0, 0, 0xF0, 0) && /* Valid bitrate */
++		(marker & MAKE_MARKER (0, 0, 0x0C, 0)) != MAKE_MARKER (0, 0, 0x0C, 0)) /* Valid samplerate */
++		return SF_FORMAT_MPEG ;
++	return 0 ;
++} /* identify_mpeg */
++
+ static int
+ guess_file_type (SF_PRIVATE *psf)
+ {	uint32_t buffer [3], format ;
+@@ -2872,13 +2883,6 @@ guess_file_type (SF_PRIVATE *psf)
+ 	if (buffer [0] == MAKE_MARKER ('R', 'F', '6', '4') && buffer [2] == MAKE_MARKER ('W', 'A', 'V', 'E'))
+ 		return SF_FORMAT_RF64 ;
+ 
+-	if ((buffer [0] & MAKE_MARKER (0xFF, 0xE0, 0, 0)) == MAKE_MARKER (0xFF, 0xE0, 0, 0) && /* Frame sync */
+-		(buffer [0] & MAKE_MARKER (0, 0x18, 0, 0)) != MAKE_MARKER (0, 0x08, 0, 0) && /* Valid MPEG version */
+-		(buffer [0] & MAKE_MARKER (0, 0x06, 0, 0)) != MAKE_MARKER (0, 0, 0, 0) && /* Valid layer description */
+-		(buffer [0] & MAKE_MARKER (0, 0, 0xF0, 0)) != MAKE_MARKER (0, 0, 0xF0, 0) && /* Valid bitrate */
+-		(buffer [0] & MAKE_MARKER (0, 0, 0x0C, 0)) != MAKE_MARKER (0, 0, 0x0C, 0)) /* Valid samplerate */
+-		return SF_FORMAT_MPEG ;
+-
+ 	if (buffer [0] == MAKE_MARKER ('I', 'D', '3', 2) || buffer [0] == MAKE_MARKER ('I', 'D', '3', 3)
+ 			|| buffer [0] == MAKE_MARKER ('I', 'D', '3', 4))
+ 	{	psf_log_printf (psf, "Found 'ID3' marker.\n") ;
+@@ -2887,6 +2891,10 @@ guess_file_type (SF_PRIVATE *psf)
+ 		return 0 ;
+ 		} ;
+ 
++	/* ID3v2 tags + MPEG */
++	if (psf->id3_header.len > 0 && (format = identify_mpeg (buffer [0])) != 0)
++		return format ;
++
+ 	/* Turtle Beach SMP 16-bit */
+ 	if (buffer [0] == MAKE_MARKER ('S', 'O', 'U', 'N') && buffer [1] == MAKE_MARKER ('D', ' ', 'S', 'A'))
+ 		return 0 ;
+@@ -2898,10 +2906,16 @@ guess_file_type (SF_PRIVATE *psf)
+ 	if (buffer [0] == MAKE_MARKER ('a', 'j', 'k', 'g'))
+ 		return 0 /*-SF_FORMAT_SHN-*/ ;
+ 
+-	/* This must be the last one. */
++	/* This must be (almost) the last one. */
+ 	if (psf->filelength > 0 && (format = try_resource_fork (psf)) != 0)
+ 		return format ;
+ 
++	/* MPEG with no ID3v2 tags. Only have the MPEG sync header for
++	 * identification and it is quite brief, and prone to false positives.
++	 * Check for this last, even after resource forks. */
++	if (psf->id3_header.len == 0 && (format = identify_mpeg (buffer [0])) != 0)
++		return format ;
++
+ 	return 0 ;
+ } /* guess_file_type */
diff --git a/srcpkgs/libsndfile/template b/srcpkgs/libsndfile/template
index 15d21ab8f4a4..c57b3b42c3c0 100644
--- a/srcpkgs/libsndfile/template
+++ b/srcpkgs/libsndfile/template
@@ -1,16 +1,17 @@
 # Template file for 'libsndfile'
 pkgname=libsndfile
-version=1.0.31
+version=1.1.0
 revision=1
 build_style=gnu-configure
+configure_args="--enable-static"
 hostmakedepends="pkg-config python3"
-makedepends="alsa-lib-devel libvorbis-devel libflac-devel sqlite-devel opus-devel"
+makedepends="alsa-lib-devel libvorbis-devel libflac-devel sqlite-devel opus-devel mpg123-devel lame-devel"
 short_desc="C library for reading and writing files containing sampled sound"
 maintainer="Orphaned <orphan@voidlinux.org>"
 license="LGPL-2.1-or-later"
 homepage="https://libsndfile.github.io/libsndfile/"
-distfiles="https://github.com/libsndfile/${pkgname}/releases/download/${version}/${pkgname}-${version}.tar.bz2"
-checksum=a8cfb1c09ea6e90eff4ca87322d4168cdbe5035cb48717b40bf77e751cc02163
+distfiles="https://github.com/libsndfile/libsndfile/releases/download/${version}/libsndfile-${version}.tar.xz"
+checksum=0f98e101c0f7c850a71225fb5feaf33b106227b3d331333ddc9bacee190bcf41
 
 libsndfile-progs_package() {
 	short_desc+=" - bundled cmdline apps"

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PR PATCH] [Updated] libsndfile: update to 1.1.0 (v2)
  2022-12-13 20:52 [PR PATCH] libsndfile: update to 1.1.0 (v2) lun-4
  2022-12-18 11:41 ` [PR REVIEW] " paper42
  2022-12-18 14:34 ` [PR PATCH] [Updated] " lun-4
@ 2022-12-18 14:54 ` lun-4
  2022-12-19  4:54 ` [PR REVIEW] " classabbyamp
                   ` (2 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: lun-4 @ 2022-12-18 14:54 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 808 bytes --]

There is an updated pull request by lun-4 against master on the void-packages repository

https://github.com/lun-4/void-packages libsndfile-update-1-1-0-v2
https://github.com/void-linux/void-packages/pull/41069

libsndfile: update to 1.1.0 (v2)
This is the sequel to https://github.com/void-linux/void-packages/pull/36908, as the bug shown in musl is now fixed (see https://github.com/libsndfile/libsndfile/issues/830)

#### Testing the changes
- I tested the changes in this PR: **briefly**

#### Local build testing
- I built this PR locally for my native architecture, x86_64-glibc
- I built this PR locally for these architectures (if supported. mark crossbuilds):
  - x86_64-musl (only built, no test)


A patch file from https://github.com/void-linux/void-packages/pull/41069.patch is attached

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-libsndfile-update-1-1-0-v2-41069.patch --]
[-- Type: text/x-diff, Size: 5307 bytes --]

From b337db70bb543a719d1eaa1ae19def6e40e33b6b Mon Sep 17 00:00:00 2001
From: Luna <git@l4.pm>
Date: Tue, 13 Dec 2022 17:35:15 -0300
Subject: [PATCH] libsndfile: update to 1.1.0

---
 .../patches/identify-naked-mpeg-last.patch    | 73 +++++++++++++++++++
 srcpkgs/libsndfile/template                   |  9 ++-
 2 files changed, 78 insertions(+), 4 deletions(-)
 create mode 100644 srcpkgs/libsndfile/patches/identify-naked-mpeg-last.patch

diff --git a/srcpkgs/libsndfile/patches/identify-naked-mpeg-last.patch b/srcpkgs/libsndfile/patches/identify-naked-mpeg-last.patch
new file mode 100644
index 000000000000..a817a7e41b12
--- /dev/null
+++ b/srcpkgs/libsndfile/patches/identify-naked-mpeg-last.patch
@@ -0,0 +1,73 @@
+Author: Arthur Taylor <art@ified.ca>
+Reason: The minimal possible MPEG file contains no headers or identification
+other than the brief sync header. This header is only 3 bytes, and is quite
+prone to false-positives. Particularly raw PCM can look like a sync header.
+
+As such, move detection of 'naked' MPEG files in guess_file_type()
+to the very last test. Give more weight to a sync header if it
+follows an ID3 tag.
+
+See https://github.com/libsndfile/libsndfile/pull/898
+Upstream: yes
+--- a/src/sndfile.c
++++ b/src/sndfile.c
+@@ -2771,6 +2771,17 @@ format_from_extension (SF_PRIVATE *psf)
+ 	return format ;
+ } /* format_from_extension */
+ 
++static int
++identify_mpeg (uint32_t marker)
++{	if ((marker & MAKE_MARKER (0xFF, 0xE0, 0, 0)) == MAKE_MARKER (0xFF, 0xE0, 0, 0) && /* Frame sync */
++		(marker & MAKE_MARKER (0, 0x18, 0, 0)) != MAKE_MARKER (0, 0x08, 0, 0) && /* Valid MPEG version */
++		(marker & MAKE_MARKER (0, 0x06, 0, 0)) != MAKE_MARKER (0, 0, 0, 0) && /* Valid layer description */
++		(marker & MAKE_MARKER (0, 0, 0xF0, 0)) != MAKE_MARKER (0, 0, 0xF0, 0) && /* Valid bitrate */
++		(marker & MAKE_MARKER (0, 0, 0x0C, 0)) != MAKE_MARKER (0, 0, 0x0C, 0)) /* Valid samplerate */
++		return SF_FORMAT_MPEG ;
++	return 0 ;
++} /* identify_mpeg */
++
+ static int
+ guess_file_type (SF_PRIVATE *psf)
+ {	uint32_t buffer [3], format ;
+@@ -2872,13 +2883,6 @@ guess_file_type (SF_PRIVATE *psf)
+ 	if (buffer [0] == MAKE_MARKER ('R', 'F', '6', '4') && buffer [2] == MAKE_MARKER ('W', 'A', 'V', 'E'))
+ 		return SF_FORMAT_RF64 ;
+ 
+-	if ((buffer [0] & MAKE_MARKER (0xFF, 0xE0, 0, 0)) == MAKE_MARKER (0xFF, 0xE0, 0, 0) && /* Frame sync */
+-		(buffer [0] & MAKE_MARKER (0, 0x18, 0, 0)) != MAKE_MARKER (0, 0x08, 0, 0) && /* Valid MPEG version */
+-		(buffer [0] & MAKE_MARKER (0, 0x06, 0, 0)) != MAKE_MARKER (0, 0, 0, 0) && /* Valid layer description */
+-		(buffer [0] & MAKE_MARKER (0, 0, 0xF0, 0)) != MAKE_MARKER (0, 0, 0xF0, 0) && /* Valid bitrate */
+-		(buffer [0] & MAKE_MARKER (0, 0, 0x0C, 0)) != MAKE_MARKER (0, 0, 0x0C, 0)) /* Valid samplerate */
+-		return SF_FORMAT_MPEG ;
+-
+ 	if (buffer [0] == MAKE_MARKER ('I', 'D', '3', 2) || buffer [0] == MAKE_MARKER ('I', 'D', '3', 3)
+ 			|| buffer [0] == MAKE_MARKER ('I', 'D', '3', 4))
+ 	{	psf_log_printf (psf, "Found 'ID3' marker.\n") ;
+@@ -2887,6 +2891,10 @@ guess_file_type (SF_PRIVATE *psf)
+ 		return 0 ;
+ 		} ;
+ 
++	/* ID3v2 tags + MPEG */
++	if (psf->id3_header.len > 0 && (format = identify_mpeg (buffer [0])) != 0)
++		return format ;
++
+ 	/* Turtle Beach SMP 16-bit */
+ 	if (buffer [0] == MAKE_MARKER ('S', 'O', 'U', 'N') && buffer [1] == MAKE_MARKER ('D', ' ', 'S', 'A'))
+ 		return 0 ;
+@@ -2898,10 +2906,16 @@ guess_file_type (SF_PRIVATE *psf)
+ 	if (buffer [0] == MAKE_MARKER ('a', 'j', 'k', 'g'))
+ 		return 0 /*-SF_FORMAT_SHN-*/ ;
+ 
+-	/* This must be the last one. */
++	/* This must be (almost) the last one. */
+ 	if (psf->filelength > 0 && (format = try_resource_fork (psf)) != 0)
+ 		return format ;
+ 
++	/* MPEG with no ID3v2 tags. Only have the MPEG sync header for
++	 * identification and it is quite brief, and prone to false positives.
++	 * Check for this last, even after resource forks. */
++	if (psf->id3_header.len == 0 && (format = identify_mpeg (buffer [0])) != 0)
++		return format ;
++
+ 	return 0 ;
+ } /* guess_file_type */
diff --git a/srcpkgs/libsndfile/template b/srcpkgs/libsndfile/template
index 15d21ab8f4a4..c57b3b42c3c0 100644
--- a/srcpkgs/libsndfile/template
+++ b/srcpkgs/libsndfile/template
@@ -1,16 +1,17 @@
 # Template file for 'libsndfile'
 pkgname=libsndfile
-version=1.0.31
+version=1.1.0
 revision=1
 build_style=gnu-configure
+configure_args="--enable-static"
 hostmakedepends="pkg-config python3"
-makedepends="alsa-lib-devel libvorbis-devel libflac-devel sqlite-devel opus-devel"
+makedepends="alsa-lib-devel libvorbis-devel libflac-devel sqlite-devel opus-devel mpg123-devel lame-devel"
 short_desc="C library for reading and writing files containing sampled sound"
 maintainer="Orphaned <orphan@voidlinux.org>"
 license="LGPL-2.1-or-later"
 homepage="https://libsndfile.github.io/libsndfile/"
-distfiles="https://github.com/libsndfile/${pkgname}/releases/download/${version}/${pkgname}-${version}.tar.bz2"
-checksum=a8cfb1c09ea6e90eff4ca87322d4168cdbe5035cb48717b40bf77e751cc02163
+distfiles="https://github.com/libsndfile/libsndfile/releases/download/${version}/libsndfile-${version}.tar.xz"
+checksum=0f98e101c0f7c850a71225fb5feaf33b106227b3d331333ddc9bacee190bcf41
 
 libsndfile-progs_package() {
 	short_desc+=" - bundled cmdline apps"

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PR REVIEW] libsndfile: update to 1.1.0 (v2)
  2022-12-13 20:52 [PR PATCH] libsndfile: update to 1.1.0 (v2) lun-4
                   ` (2 preceding siblings ...)
  2022-12-18 14:54 ` lun-4
@ 2022-12-19  4:54 ` classabbyamp
  2022-12-19 14:06 ` [PR PATCH] [Updated] " lun-4
  2022-12-24 23:33 ` [PR PATCH] [Merged]: " paper42
  5 siblings, 0 replies; 7+ messages in thread
From: classabbyamp @ 2022-12-19  4:54 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 302 bytes --]

New review comment by classabbyamp on void-packages repository

https://github.com/void-linux/void-packages/pull/41069#discussion_r1051796319

Comment:
```suggestion
homepage="https://libsndfile.github.io/libsndfile/"
changelog="https://github.com/libsndfile/libsndfile/raw/master/CHANGELOG.md"
```

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PR PATCH] [Updated] libsndfile: update to 1.1.0 (v2)
  2022-12-13 20:52 [PR PATCH] libsndfile: update to 1.1.0 (v2) lun-4
                   ` (3 preceding siblings ...)
  2022-12-19  4:54 ` [PR REVIEW] " classabbyamp
@ 2022-12-19 14:06 ` lun-4
  2022-12-24 23:33 ` [PR PATCH] [Merged]: " paper42
  5 siblings, 0 replies; 7+ messages in thread
From: lun-4 @ 2022-12-19 14:06 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 808 bytes --]

There is an updated pull request by lun-4 against master on the void-packages repository

https://github.com/lun-4/void-packages libsndfile-update-1-1-0-v2
https://github.com/void-linux/void-packages/pull/41069

libsndfile: update to 1.1.0 (v2)
This is the sequel to https://github.com/void-linux/void-packages/pull/36908, as the bug shown in musl is now fixed (see https://github.com/libsndfile/libsndfile/issues/830)

#### Testing the changes
- I tested the changes in this PR: **briefly**

#### Local build testing
- I built this PR locally for my native architecture, x86_64-glibc
- I built this PR locally for these architectures (if supported. mark crossbuilds):
  - x86_64-musl (only built, no test)


A patch file from https://github.com/void-linux/void-packages/pull/41069.patch is attached

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-libsndfile-update-1-1-0-v2-41069.patch --]
[-- Type: text/x-diff, Size: 5385 bytes --]

From 9c894bd91a26d2d80ff4cb381fca4deca95afbc3 Mon Sep 17 00:00:00 2001
From: Luna <git@l4.pm>
Date: Tue, 13 Dec 2022 17:35:15 -0300
Subject: [PATCH] libsndfile: update to 1.1.0

---
 .../patches/identify-naked-mpeg-last.patch    | 73 +++++++++++++++++++
 srcpkgs/libsndfile/template                   | 10 ++-
 2 files changed, 79 insertions(+), 4 deletions(-)
 create mode 100644 srcpkgs/libsndfile/patches/identify-naked-mpeg-last.patch

diff --git a/srcpkgs/libsndfile/patches/identify-naked-mpeg-last.patch b/srcpkgs/libsndfile/patches/identify-naked-mpeg-last.patch
new file mode 100644
index 000000000000..a817a7e41b12
--- /dev/null
+++ b/srcpkgs/libsndfile/patches/identify-naked-mpeg-last.patch
@@ -0,0 +1,73 @@
+Author: Arthur Taylor <art@ified.ca>
+Reason: The minimal possible MPEG file contains no headers or identification
+other than the brief sync header. This header is only 3 bytes, and is quite
+prone to false-positives. Particularly raw PCM can look like a sync header.
+
+As such, move detection of 'naked' MPEG files in guess_file_type()
+to the very last test. Give more weight to a sync header if it
+follows an ID3 tag.
+
+See https://github.com/libsndfile/libsndfile/pull/898
+Upstream: yes
+--- a/src/sndfile.c
++++ b/src/sndfile.c
+@@ -2771,6 +2771,17 @@ format_from_extension (SF_PRIVATE *psf)
+ 	return format ;
+ } /* format_from_extension */
+ 
++static int
++identify_mpeg (uint32_t marker)
++{	if ((marker & MAKE_MARKER (0xFF, 0xE0, 0, 0)) == MAKE_MARKER (0xFF, 0xE0, 0, 0) && /* Frame sync */
++		(marker & MAKE_MARKER (0, 0x18, 0, 0)) != MAKE_MARKER (0, 0x08, 0, 0) && /* Valid MPEG version */
++		(marker & MAKE_MARKER (0, 0x06, 0, 0)) != MAKE_MARKER (0, 0, 0, 0) && /* Valid layer description */
++		(marker & MAKE_MARKER (0, 0, 0xF0, 0)) != MAKE_MARKER (0, 0, 0xF0, 0) && /* Valid bitrate */
++		(marker & MAKE_MARKER (0, 0, 0x0C, 0)) != MAKE_MARKER (0, 0, 0x0C, 0)) /* Valid samplerate */
++		return SF_FORMAT_MPEG ;
++	return 0 ;
++} /* identify_mpeg */
++
+ static int
+ guess_file_type (SF_PRIVATE *psf)
+ {	uint32_t buffer [3], format ;
+@@ -2872,13 +2883,6 @@ guess_file_type (SF_PRIVATE *psf)
+ 	if (buffer [0] == MAKE_MARKER ('R', 'F', '6', '4') && buffer [2] == MAKE_MARKER ('W', 'A', 'V', 'E'))
+ 		return SF_FORMAT_RF64 ;
+ 
+-	if ((buffer [0] & MAKE_MARKER (0xFF, 0xE0, 0, 0)) == MAKE_MARKER (0xFF, 0xE0, 0, 0) && /* Frame sync */
+-		(buffer [0] & MAKE_MARKER (0, 0x18, 0, 0)) != MAKE_MARKER (0, 0x08, 0, 0) && /* Valid MPEG version */
+-		(buffer [0] & MAKE_MARKER (0, 0x06, 0, 0)) != MAKE_MARKER (0, 0, 0, 0) && /* Valid layer description */
+-		(buffer [0] & MAKE_MARKER (0, 0, 0xF0, 0)) != MAKE_MARKER (0, 0, 0xF0, 0) && /* Valid bitrate */
+-		(buffer [0] & MAKE_MARKER (0, 0, 0x0C, 0)) != MAKE_MARKER (0, 0, 0x0C, 0)) /* Valid samplerate */
+-		return SF_FORMAT_MPEG ;
+-
+ 	if (buffer [0] == MAKE_MARKER ('I', 'D', '3', 2) || buffer [0] == MAKE_MARKER ('I', 'D', '3', 3)
+ 			|| buffer [0] == MAKE_MARKER ('I', 'D', '3', 4))
+ 	{	psf_log_printf (psf, "Found 'ID3' marker.\n") ;
+@@ -2887,6 +2891,10 @@ guess_file_type (SF_PRIVATE *psf)
+ 		return 0 ;
+ 		} ;
+ 
++	/* ID3v2 tags + MPEG */
++	if (psf->id3_header.len > 0 && (format = identify_mpeg (buffer [0])) != 0)
++		return format ;
++
+ 	/* Turtle Beach SMP 16-bit */
+ 	if (buffer [0] == MAKE_MARKER ('S', 'O', 'U', 'N') && buffer [1] == MAKE_MARKER ('D', ' ', 'S', 'A'))
+ 		return 0 ;
+@@ -2898,10 +2906,16 @@ guess_file_type (SF_PRIVATE *psf)
+ 	if (buffer [0] == MAKE_MARKER ('a', 'j', 'k', 'g'))
+ 		return 0 /*-SF_FORMAT_SHN-*/ ;
+ 
+-	/* This must be the last one. */
++	/* This must be (almost) the last one. */
+ 	if (psf->filelength > 0 && (format = try_resource_fork (psf)) != 0)
+ 		return format ;
+ 
++	/* MPEG with no ID3v2 tags. Only have the MPEG sync header for
++	 * identification and it is quite brief, and prone to false positives.
++	 * Check for this last, even after resource forks. */
++	if (psf->id3_header.len == 0 && (format = identify_mpeg (buffer [0])) != 0)
++		return format ;
++
+ 	return 0 ;
+ } /* guess_file_type */
diff --git a/srcpkgs/libsndfile/template b/srcpkgs/libsndfile/template
index 15d21ab8f4a4..3ffbe1026e4c 100644
--- a/srcpkgs/libsndfile/template
+++ b/srcpkgs/libsndfile/template
@@ -1,16 +1,18 @@
 # Template file for 'libsndfile'
 pkgname=libsndfile
-version=1.0.31
+version=1.1.0
 revision=1
 build_style=gnu-configure
+configure_args="--enable-static"
 hostmakedepends="pkg-config python3"
-makedepends="alsa-lib-devel libvorbis-devel libflac-devel sqlite-devel opus-devel"
+makedepends="alsa-lib-devel libvorbis-devel libflac-devel sqlite-devel opus-devel mpg123-devel lame-devel"
 short_desc="C library for reading and writing files containing sampled sound"
 maintainer="Orphaned <orphan@voidlinux.org>"
 license="LGPL-2.1-or-later"
 homepage="https://libsndfile.github.io/libsndfile/"
-distfiles="https://github.com/libsndfile/${pkgname}/releases/download/${version}/${pkgname}-${version}.tar.bz2"
-checksum=a8cfb1c09ea6e90eff4ca87322d4168cdbe5035cb48717b40bf77e751cc02163
+changelog="https://github.com/libsndfile/libsndfile/raw/master/CHANGELOG.md"
+distfiles="https://github.com/libsndfile/libsndfile/releases/download/${version}/libsndfile-${version}.tar.xz"
+checksum=0f98e101c0f7c850a71225fb5feaf33b106227b3d331333ddc9bacee190bcf41
 
 libsndfile-progs_package() {
 	short_desc+=" - bundled cmdline apps"

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PR PATCH] [Merged]: libsndfile: update to 1.1.0 (v2)
  2022-12-13 20:52 [PR PATCH] libsndfile: update to 1.1.0 (v2) lun-4
                   ` (4 preceding siblings ...)
  2022-12-19 14:06 ` [PR PATCH] [Updated] " lun-4
@ 2022-12-24 23:33 ` paper42
  5 siblings, 0 replies; 7+ messages in thread
From: paper42 @ 2022-12-24 23:33 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 637 bytes --]

There's a merged pull request on the void-packages repository

libsndfile: update to 1.1.0 (v2)
https://github.com/void-linux/void-packages/pull/41069

Description:
This is the sequel to https://github.com/void-linux/void-packages/pull/36908, as the bug shown in musl is now fixed (see https://github.com/libsndfile/libsndfile/issues/830)

#### Testing the changes
- I tested the changes in this PR: **briefly**

#### Local build testing
- I built this PR locally for my native architecture, x86_64-glibc
- I built this PR locally for these architectures (if supported. mark crossbuilds):
  - x86_64-musl (only built, no test)


^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2022-12-24 23:33 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-12-13 20:52 [PR PATCH] libsndfile: update to 1.1.0 (v2) lun-4
2022-12-18 11:41 ` [PR REVIEW] " paper42
2022-12-18 14:34 ` [PR PATCH] [Updated] " lun-4
2022-12-18 14:54 ` lun-4
2022-12-19  4:54 ` [PR REVIEW] " classabbyamp
2022-12-19 14:06 ` [PR PATCH] [Updated] " lun-4
2022-12-24 23:33 ` [PR PATCH] [Merged]: " paper42

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).