Download raw body.
update emulators/libchdr-1.0pl20250608
Here is a diff for emulators/libchdr to update to a newer commit on
20250608. It is needed for a emulators/flycast I am sending after.
This diff:
- adds a minor bump
- links with archivers/zstd instead of the newly bundled zstd
huffman.h has a function that now returns enum huffman_error instead of
void. But, this function seems to be mostly internal and is not used by
consumers emulators/libretro-pcsx-rearmed and emulators/flycast. This
does not necessitate a major bump. Whereas before the code in libchdr
ignored the return value, it now uses the return value.
--8<---------------cut here---------------start------------->8---
$ diff -u /usr/obj/pobj/libchdr-1.0pl{20230220,20250608}/fake-amd64/usr/local/include/libchdr/huffman.h
--- /usr/obj/pobj/libchdr-1.0pl20230220/fake-amd64/usr/local/include/libchdr/huffman.h Mon Feb 20 06:24:40 2023
+++ /usr/obj/pobj/libchdr-1.0pl20250608/fake-amd64/usr/local/include/libchdr/huffman.h Wed Dec 11 03:28:49 2024
@@ -85,6 +85,6 @@
enum huffman_error huffman_assign_canonical_codes(struct huffman_decoder* decoder);
enum huffman_error huffman_compute_tree_from_histo(struct huffman_decoder* decoder);
-void huffman_build_lookup_table(struct huffman_decoder* decoder);
+enum huffman_error huffman_build_lookup_table(struct huffman_decoder* decoder);
--8<---------------cut here---------------end--------------->8---
There are some new symbols so I propose a minor bump.
--8<---------------cut here---------------start------------->8---
/usr/obj/pobj/libchdr-1.0pl20230220/fake-amd64/usr/local/lib/libchdr.so.1.0 --> /usr/obj/pobj/libchdr-1.0pl20250608/fake-amd64/usr/local/lib/libchdr.so.1.1
Dynamic export changes:
added:
chd_read_header_core_file
chd_read_header_file
External reference changes:
added:
ZSTD_trace_decompress_begin
ZSTD_trace_decompress_end
calloc
puts
--8<---------------cut here---------------end--------------->8---
I tested all consumers opening chd files in
emulators/libretro-pcsx-rearmed and emulators/flycast. I tested running
some zstd compressed chd files and it works, now that libchdr added zstd
support. chdman was used to compress some audio data using zstd when
creating the chd files.
I noticed that in retroarch for libretro-pcsx-rearmed, I had to use
desktop program mode, which was known before. Also, the input menu for
configuring controls was empty. My playstation 4 controller worked, but
there were messages of using a "fallback method" for the controller.
Feedback and tests are welcome. OK?
Index: Makefile
===================================================================
RCS file: /cvs/ports/emulators/libchdr/Makefile,v
diff -u -p -r1.5 Makefile
--- Makefile 17 Oct 2024 10:50:02 -0000 1.5
+++ Makefile 4 Sep 2025 09:56:16 -0000
@@ -2,27 +2,30 @@ BROKEN-aarch64 = looks for sys/auxv.h
COMMENT = library for reading MAME's CHDv1-v5 formats
-V = 1.0pl20230220
+V = 1.0pl20250608
DISTNAME = libchdr-$V
GH_ACCOUNT = rtissera
GH_PROJECT = libchdr
-GH_COMMIT = fec8ab94212cc65d9d9a62cb3da924f5830c04b0
+GH_COMMIT = cb077337d53392454e7100a0fd07139ca678e527
-SHARED_LIBS += chdr 1.0 # 0.1
+SHARED_LIBS += chdr 1.1 # 0.2
CATEGORIES = emulators devel games
HOMEPAGE = https://github.com/rtissera/libchdr
-CONFIGURE_ARGS += -DWITH_SYSTEM_ZLIB=ON
+LIB_DEPENDS = archivers/zstd
+
+CONFIGURE_ARGS += -DWITH_SYSTEM_ZLIB=ON \
+ -DWITH_SYSTEM_ZSTD=ON
# BSD 3-Clause
# Public Domain (lzma)
# zlib (zlib)
PERMIT_PACKAGE = Yes
-WANTLIB += z
+WANTLIB += z zstd
MODULES = devel/cmake
Index: distinfo
===================================================================
RCS file: /cvs/ports/emulators/libchdr/distinfo,v
diff -u -p -r1.2 distinfo
--- distinfo 26 Apr 2023 18:46:14 -0000 1.2
+++ distinfo 4 Sep 2025 09:56:16 -0000
@@ -1,2 +1,2 @@
-SHA256 (libchdr-1.0pl20230220-fec8ab94.tar.gz) = i4fxorIt44yfsWdRN8jxl0MQW4NzrYynDs8DpjngT88=
-SIZE (libchdr-1.0pl20230220-fec8ab94.tar.gz) = 1748513
+SHA256 (libchdr-1.0pl20250608-cb077337.tar.gz) = fGEvS4eSlb+C0NxIHAwFX8HM7v5Wtd6hsJSw3eCVI5I=
+SIZE (libchdr-1.0pl20250608-cb077337.tar.gz) = 4222519
Index: patches/patch-CMakeLists_txt
===================================================================
RCS file: /cvs/ports/emulators/libchdr/patches/patch-CMakeLists_txt,v
diff -u -p -r1.1.1.1 patch-CMakeLists_txt
--- patches/patch-CMakeLists_txt 25 Apr 2023 19:21:00 -0000 1.1.1.1
+++ patches/patch-CMakeLists_txt 4 Sep 2025 09:56:16 -0000
@@ -1,12 +1,18 @@
+link with archivers/zstd
+
Index: CMakeLists.txt
--- CMakeLists.txt.orig
+++ CMakeLists.txt
-@@ -79,7 +79,7 @@ if (BUILD_SHARED_LIBS)
- elseif(APPLE)
- target_link_libraries(chdr PRIVATE -Wl,-dead_strip -Wl,-exported_symbol,_chd_*)
- else()
-- target_link_libraries(chdr PRIVATE -Wl,--version-script ${CMAKE_CURRENT_SOURCE_DIR}/src/link.T -Wl,--no-undefined)
-+ target_link_libraries(chdr PRIVATE -Wl,--version-script ${CMAKE_CURRENT_SOURCE_DIR}/src/link.T)
- endif()
+@@ -51,8 +51,10 @@ endif()
- set_target_properties(chdr PROPERTIES C_VISIBILITY_PRESET hidden)
+ # zstd
+ if (WITH_SYSTEM_ZSTD)
+- find_package(zstd REQUIRED)
+- list(APPEND PLATFORM_LIBS zstd::libzstd_shared)
++ find_package(PkgConfig)
++ pkg_check_modules(ZSTD REQUIRED libzstd)
++ list(APPEND CHDR_INCLUDES ${ZSTD_INCLUDE_DIRS})
++ list(APPEND PLATFORM_LIBS ${ZSTD_LINK_LIBRARIES})
+ else()
+ option(ZSTD_BUILD_SHARED "BUILD SHARED LIBRARIES" OFF)
+ option(ZSTD_BUILD_PROGRAMS "BUILD PROGRAMS" OFF)
update emulators/libchdr-1.0pl20250608