Skip to content

Commit

Permalink
Add libcdio
Browse files Browse the repository at this point in the history
  • Loading branch information
bwrsandman committed Dec 25, 2023
1 parent ff68673 commit 34d326e
Show file tree
Hide file tree
Showing 8 changed files with 213 additions and 0 deletions.
53 changes: 53 additions & 0 deletions ports/libcdio/0001-Remove-doc-from-config-and-make.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
From f9193bfea663da751c8e2e7ed089c255daf2b673 Mon Sep 17 00:00:00 2001
From: Sandy Carter <sandy.carter@unity3d.com>
Date: Wed, 20 Dec 2023 16:24:59 -0500
Subject: [PATCH] Remove doc from config and make

---
Makefile.am | 2 +-
autogen.sh | 2 --
src/Makefile.am | 5 -----
3 files changed, 1 insertion(+), 8 deletions(-)

diff --git a/Makefile.am b/Makefile.am
index 24769c60..76de6dfb 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -40,7 +40,7 @@ EXTRA_DIST = \
make-check-filter.rb \
package/libcdio.spec.in

-SUBDIRS = doc include lib src test example
+SUBDIRS = include lib src

# pkg-config(1) related rules
pkgconfigdir = $(libdir)/pkgconfig
diff --git a/autogen.sh b/autogen.sh
index 408af0ad..275bcbe5 100755
--- a/autogen.sh
+++ b/autogen.sh
@@ -14,5 +14,3 @@ if [ $? -ne 0 ]; then
fi

./configure --enable-maintainer-mode "$@"
-
-(cd doc && make)
diff --git a/src/Makefile.am b/src/Makefile.am
index dcea939f..326ed68d 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -90,11 +90,6 @@ bin_PROGRAMS = $(bin_cd_drive) $(bin_cd_info) $(bin_cdinfo_linux) $(bin_cd_read

AM_CPPFLAGS = -I$(top_srcdir) $(LIBCDIO_CFLAGS) $(VCDINFO_CFLAGS) $(CDDB_CFLAGS)

-man_MANS = $(man_cd_drive) $(man_cd_info) $(man_cd_read) $(man_iso_read) $(man_iso_info)
-EXTRA_DIST = cd-drive.help2man cd-info.help2man cd-read.help2man \
- iso-info.help2man iso-read.help2man $(GETOPT_C) getopt_int.h \
- $(man_MANS)
-
check-leaks: $(check_programs)
for p in $(check_programs); do \
valgrind ./$$p; \
--
2.39.3 (Apple Git-145)

27 changes: 27 additions & 0 deletions ports/libcdio/0002-Typedef-POSIX-types-on-Windows.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
From 255fc7b45c75eb1ea034beed335912b95474467e Mon Sep 17 00:00:00 2001
From: Sandy Carter <sandy.carter@unity3d.com>
Date: Wed, 20 Dec 2023 17:40:35 -0500
Subject: [PATCH] Typedef POSIX types on Windows

---
include/cdio/types.h | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/include/cdio/types.h b/include/cdio/types.h
index fd735786..8fea19a4 100644
--- a/include/cdio/types.h
+++ b/include/cdio/types.h
@@ -55,7 +55,9 @@ typedef uint8_t ubyte;
unistd.h that defines them. Such a file is provided with
the libcdio source, in the MSVC/missing directory */
#if defined(_MSC_VER)
-#include <unistd.h>
+#include <BaseTsd.h>
+typedef int mode_t;
+typedef SSIZE_T ssize_t;
#endif

/* default HP/UX macros are broken */
--
2.39.3 (Apple Git-145)

Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
From 471cd834e2ae094c5cdca17c9048869ea569e4d1 Mon Sep 17 00:00:00 2001
From: Thomas Schmitt <scdbackup@gmx.net>
Date: Mon, 18 May 2020 19:12:20 +0100
Subject: Fix free while still in use in iso9660.hpp

C++ method IFS::readdir() freed the iso9660_stat_t objects which it handed out to its caller.
---
include/cdio++/iso9660.hpp | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)

(limited to 'include/cdio++/iso9660.hpp')

diff --git a/include/cdio++/iso9660.hpp b/include/cdio++/iso9660.hpp
index dd87664..9bcefd6 100644
--- a/include/cdio++/iso9660.hpp
+++ b/include/cdio++/iso9660.hpp
@@ -384,7 +384,10 @@ public:
(iso9660_stat_t *) _cdio_list_node_data (p_entnode);
stat_vector.push_back(new ISO9660::Stat(p_statbuf));
}
- iso9660_filelist_free(p_stat_list);
+ /* explicitely not iso9660_filelist_free(p_stat_list) because the
+ p_statbuf objects live on in stat_vector.
+ */
+ _cdio_list_free(p_stat_list, false, (CdioDataFree_t) NULL);
return true;
} else {
return false;
--
cgit v1.1

Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
From 2adb43c60afc6e98e94d86dad9f93d3df52862b1 Mon Sep 17 00:00:00 2001
From: Sergei Trofimovich <slyich@gmail.com>
Date: Mon, 1 Nov 2021 08:00:30 +0000
Subject: [PATCH] src/cdda-player.c: always use "%s"-style format for
printf()-style functions

`ncuses-6.3` added printf-style function attributes and now makes
it easier to catch cases when user input is used in palce of format
string when built with CFLAGS=-Werror=format-security:

cdda-player.c:1032:31:
error: format not a string literal and no format arguments [-Werror=format-security]
1032 | mvprintw(i_line++, 0, line);
| ^~~~

Let's wrap all the missing places with "%s" format.
---
src/cdda-player.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/src/cdda-player.c b/src/cdda-player.c
index 69eddee1..8834d606 100644
--- a/src/cdda-player.c
+++ b/src/cdda-player.c
@@ -298,7 +298,7 @@ action(const char *psz_action)
psz_action);
else
snprintf(psz_action_line, sizeof(psz_action_line), "%s", "" );
- mvprintw(LINE_ACTION, 0, psz_action_line);
+ mvprintw(LINE_ACTION, 0, "%s", psz_action_line);
clrtoeol();
refresh();
}
@@ -1029,10 +1029,10 @@ display_tracks(void)
}
if (sub.track == i) {
attron(A_STANDOUT);
- mvprintw(i_line++, 0, line);
+ mvprintw(i_line++, 0, "%s", line);
attroff(A_STANDOUT);
} else
- mvprintw(i_line++, 0, line);
+ mvprintw(i_line++, 0, "%s", line);
clrtoeol();
}
}
--
2.39.3 (Apple Git-145)

30 changes: 30 additions & 0 deletions ports/libcdio/portfile.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
vcpkg_download_distfile(ARCHIVE
URLS "http://git.savannah.gnu.org/cgit/libcdio.git/snapshot/libcdio-release-${VERSION}.tar.gz"
FILENAME "libcdio-release-${VERSION}.tar.gz"
SHA512 c67be0f6a86a67cb91e6ac473dae9612732a29f26547a38321ed9d7048bf38549ae98ff65c939221cb30b9bab42a3c05d6e0ae1b7dbaebd7cadf7d25e053ce1a
)

vcpkg_extract_source_archive_ex(

Check warning on line 7 in ports/libcdio/portfile.cmake

View workflow job for this annotation

GitHub Actions / Check

The function vcpkg_extract_source_archive_ex is deprecated. Please use vcpkg_extract_source_archive https://learn.microsoft.com/en-us/vcpkg/maintainers/functions/vcpkg_extract_source_archive
OUT_SOURCE_PATH SOURCE_PATH
ARCHIVE "${ARCHIVE}"
PATCHES
0001-Remove-doc-from-config-and-make.patch
0002-Typedef-POSIX-types-on-Windows.patch
0003-Fix-free-while-still-in-use-in-iso9660.hpp.patch
0004-src-cdda-player.c-always-use-s-style-format-for-prin.patch
)

vcpkg_configure_make(
SOURCE_PATH "${SOURCE_PATH}"
AUTOCONFIG
)
vcpkg_install_make()

vcpkg_copy_pdbs()

vcpkg_fixup_pkgconfig()
vcpkg_replace_string("${CURRENT_PACKAGES_DIR}/include/cdio/cdio_config.h" "${CURRENT_BUILDTREES_DIR}" "")

file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/share")

vcpkg_install_copyright(FILE_LIST "${SOURCE_PATH}/COPYING")
10 changes: 10 additions & 0 deletions ports/libcdio/vcpkg.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"name": "libcdio",
"version": "2.1.0",
"description": "The GNU Compact Disc Input and Control library.",
"homepage": "http://savannah.gnu.org/projects/libcdio/",
"license": "GPL-3.0-only",
"dependencies": [
"libiconv"
]
}
4 changes: 4 additions & 0 deletions versions/baseline.json
Original file line number Diff line number Diff line change
Expand Up @@ -4128,6 +4128,10 @@
"baseline": "0.10.2",
"port-version": 0
},
"libcdio": {
"baseline": "2.1.0",
"port-version": 0
},
"libcds": {
"baseline": "2.3.3",
"port-version": 4
Expand Down
9 changes: 9 additions & 0 deletions versions/l-/libcdio.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"versions": [
{
"git-tree": "6ae4856c64cdd6c17134cb340ad7cd9e1c29cb1c",
"version": "2.1.0",
"port-version": 0
}
]
}

0 comments on commit 34d326e

Please sign in to comment.