diff --git a/devel/apitrace/Makefile b/devel/apitrace/Makefile index 3f1f560c0e9a..60f04c7eacd0 100644 --- a/devel/apitrace/Makefile +++ b/devel/apitrace/Makefile @@ -1,51 +1,56 @@ PORTNAME= apitrace -DISTVERSION= 9.0 -PORTREVISION= 2 +DISTVERSION= 12.0 CATEGORIES= devel -PATCH_SITES= https://github.com/a17r/${GH_PROJECT}/commit/ -# use system brotli: https://github.com/apitrace/apitrace/pull/610 -PATCHFILES= cd3486343001d6a47.patch:-p1 \ - b0f5a220c41af013d.patch:-p1 -# detect RTLD_DEEPBIND: https://github.com/apitrace/apitrace/pull/571 -PATCHFILES+= 2d31d49eac9bcc010.patch:-p1 - -MAINTAINER= ports@FreeBSD.org +MAINTAINER= freebsd@sysctl.cz COMMENT= Tools for tracing OpenGL and other graphics APIs WWW= https://apitrace.github.io LICENSE= MIT LICENSE_FILE= ${WRKSRC}/LICENSE +BUILD_DEPENDS= brotli>0:archivers/brotli \ + googletest>0:devel/googletest \ + libbacktrace>0:devel/libbacktrace \ + png>0:graphics/png \ + snappy>0:archivers/snappy + LIB_DEPENDS= libbrotlidec.so:archivers/brotli \ - libpng.so:graphics/png + libbacktrace.so:devel/libbacktrace \ + libpng.so:graphics/png \ + libsnappy.so:archivers/snappy -USES= cmake compiler:c++11-lang pkgconfig python shebangfix xorg -USE_GITHUB= yes +USES= cmake compiler:c++11-lang desktop-file-utils pkgconfig python shebangfix xorg USE_XORG= x11 +USE_GITHUB= yes +GH_ACCOUNT= apitrace +GH_PROJECT= apitrace +GH_TUPLE= microsoft:DirectXMath:e95d848:DirectXMath/thirdparty/directxmath + SHEBANG_FILES= scripts/*.py OPTIONS_DEFINE= DOCS QT5 WAFFLE OPTIONS_DEFAULT= QT5 WAFFLE OPTIONS_SUB= yes -WAFFLE_DESC= Use Waffle library to allow retrace on Wayland, headless etc. - -QT5_USES= qt:5 -QT5_USE= QT=core,gui,network,widgets,buildtools:build,qmake:build -QT5_CMAKE_BOOL= ENABLE_GUI +QT5_USES= qt:5 +QT5_USE= QT=core,gui,network,widgets,buildtools:build,qmake:build +QT5_CMAKE_BOOL= ENABLE_GUI +WAFFLE_DESC= Use Waffle library to allow retrace on Wayland, headless etc. WAFFLE_LIB_DEPENDS= libwaffle-1.so:graphics/waffle WAFFLE_CMAKE_BOOL= ENABLE_WAFFLE +LDFLAGS+= -L${LOCALBASE}/lib + post-patch: ${REINPLACE_CMD} -e 's|__linux__|__unix__|' ${WRKSRC}/retrace/glstate_images.cpp post-install: ${RM} ${STAGEDIR}${DOCSDIR}/LICENSE.txt post-install-QT5-on: ${INSTALL_DATA} ${FILESDIR}/qapitrace.desktop ${STAGEDIR}${PREFIX}/share/applications .include diff --git a/devel/apitrace/distinfo b/devel/apitrace/distinfo index 7047417ff067..2feb17a37a07 100644 --- a/devel/apitrace/distinfo +++ b/devel/apitrace/distinfo @@ -1,9 +1,5 @@ -TIMESTAMP = 1577315225 -SHA256 (apitrace-apitrace-9.0_GH0.tar.gz) = 0eec81ba7d3799622336319785465a2982a0621898842517a07894d7e2aa18eb -SIZE (apitrace-apitrace-9.0_GH0.tar.gz) = 3623693 -SHA256 (cd3486343001d6a47.patch) = 2cb56f451791f2155aa5f5f12aa19eb92cb44dd00ca51ca9a5f0d5645ca6eb77 -SIZE (cd3486343001d6a47.patch) = 1840 -SHA256 (b0f5a220c41af013d.patch) = e2f46c862d97ff45b57fed043342b8875b310c5d6bb6d7d7f7122bb2f1ac5bb0 -SIZE (b0f5a220c41af013d.patch) = 2866 -SHA256 (2d31d49eac9bcc010.patch) = 315733330ab80a19b5565a439bdac8c62a80605302db03721e05c93e6ce9db52 -SIZE (2d31d49eac9bcc010.patch) = 633 +TIMESTAMP = 1741604876 +SHA256 (apitrace-apitrace-12.0_GH0.tar.gz) = d6d3c8eb582f2953dd2ca780ce2750e44208d1b4e73d973e3f72c5326307faf3 +SIZE (apitrace-apitrace-12.0_GH0.tar.gz) = 2273615 +SHA256 (microsoft-DirectXMath-e95d848_GH0.tar.gz) = efc8fe6c7cebe8e90d5d29020e2f09e7af41570959ec7ab501b55a7d36aad318 +SIZE (microsoft-DirectXMath-e95d848_GH0.tar.gz) = 219785 diff --git a/devel/apitrace/files/patch-CMakeLists.txt b/devel/apitrace/files/patch-CMakeLists.txt index ed25e71f8bf1..f4ecc1842560 100644 --- a/devel/apitrace/files/patch-CMakeLists.txt +++ b/devel/apitrace/files/patch-CMakeLists.txt @@ -1,13 +1,13 @@ ---- CMakeLists.txt.orig 2021-04-07 12:23:46 UTC +--- CMakeLists.txt.orig 2024-05-30 18:10:10 UTC +++ CMakeLists.txt -@@ -408,6 +408,10 @@ test_big_endian (HAVE_BIGENDIAN) - if (HAVE_BIGENDIAN) - add_definitions (-DHAVE_BIGENDIAN) +@@ -411,6 +411,10 @@ endif () + elseif (ENABLE_STATIC_EXE) + set (CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -static-libgcc -static-libstdc++") endif () +# CMake 3.20 doesn't do the tests internally in TestBigEndian +# that end up setting HAVE_STDINT_H and similar. +include(CheckTypeSize) +CHECK_TYPE_SIZE("unsigned short" CMAKE_SIZEOF_UNSIGNED_SHORT LANGUAGE C) - # Force certain components to always be built as release - macro (force_release_build) + if (ENABLE_FRAME_POINTER) + # disable frame pointer omission diff --git a/devel/apitrace/files/patch-lib_trace_CMakeLists.txt b/devel/apitrace/files/patch-lib_trace_CMakeLists.txt new file mode 100644 index 000000000000..9e61019d6f69 --- /dev/null +++ b/devel/apitrace/files/patch-lib_trace_CMakeLists.txt @@ -0,0 +1,11 @@ +--- lib/trace/CMakeLists.txt.orig 2024-05-30 18:10:10 UTC ++++ lib/trace/CMakeLists.txt +@@ -27,6 +27,8 @@ add_convenience_library (common + trace_ostream_zlib.cpp + ) + ++find_package(Snappy REQUIRED) ++ + target_link_libraries (common + guids + highlight diff --git a/devel/apitrace/files/patch-retrace_CMakeLists.txt b/devel/apitrace/files/patch-retrace_CMakeLists.txt deleted file mode 100644 index ff0869b1a724..000000000000 --- a/devel/apitrace/files/patch-retrace_CMakeLists.txt +++ /dev/null @@ -1,26 +0,0 @@ ---- retrace/CMakeLists.txt.orig 2019-11-26 14:27:11 UTC -+++ retrace/CMakeLists.txt -@@ -123,6 +123,7 @@ if (WIN32 OR APPLE OR X11_FOUND) - retrace_common - glretrace_common - glhelpers -+ glproc - glproc_gl - ) - -@@ -169,6 +170,7 @@ if (ENABLE_EGL AND X11_FOUND AND NOT WIN32 AND NOT APP - retrace_common - glretrace_common - glhelpers -+ glproc - glproc_egl - ${X11_X11_LIB} - ${CMAKE_THREAD_LIBS_INIT} -@@ -184,6 +186,7 @@ if (ENABLE_EGL AND ENABLE_WAFFLE) - - add_dependencies (eglretrace glproc) - include_directories (${Waffle_INCLUDE_DIRS}) -+ target_link_directories (eglretrace PRIVATE ${Waffle_LIBRARY_DIRS}) - - target_link_libraries (eglretrace - retrace_common diff --git a/devel/apitrace/files/patch-thirdparty_CMakeLists.txt b/devel/apitrace/files/patch-thirdparty_CMakeLists.txt new file mode 100644 index 000000000000..982275526b6c --- /dev/null +++ b/devel/apitrace/files/patch-thirdparty_CMakeLists.txt @@ -0,0 +1,113 @@ +--- thirdparty/CMakeLists.txt.orig 2024-05-30 18:10:10 UTC ++++ thirdparty/CMakeLists.txt +@@ -16,54 +16,69 @@ endfunction () + include (${ARGV}) + endfunction () + +-set (SUBMODULES_MISSING FALSE) +-foreach (path IN ITEMS +- brotli/LICENSE +- gtest/LICENSE +- libbacktrace/LICENSE +- libpng/LICENSE +- snappy/COPYING +- zlib/README +- directxmath/LICENSE +-) +- if (NOT EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/${path}") +- message (SEND_ERROR "error: ${CMAKE_CURRENT_SOURCE_DIR}/${path} does not exist") +- set (SUBMODULES_MISSING TRUE) +- endif () +-endforeach () +-if (SUBMODULES_MISSING) +- message (FATAL_ERROR "Update Git submodules by running\ngit submodule update --init --depth 1 --recursive") +-endif () ++#set (SUBMODULES_MISSING FALSE) ++#foreach (path IN ITEMS ++# brotli/LICENSE ++# gtest/LICENSE ++# libbacktrace/LICENSE ++# libpng/LICENSE ++# snappy/COPYING ++# zlib/README ++# directxmath/LICENSE ++#) ++# if (NOT EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/${path}") ++# message (SEND_ERROR "error: ${CMAKE_CURRENT_SOURCE_DIR}/${path} does not exist") ++# set (SUBMODULES_MISSING TRUE) ++# endif () ++#endforeach () ++#if (SUBMODULES_MISSING) ++# message (FATAL_ERROR "Update Git submodules by running\ngit submodule update --init --depth 1 --recursive") ++#endif () + +-if (ENABLE_STATIC_SNAPPY OR NOT Snappy_FOUND) +- message (STATUS "Using bundled Snappy") +- include_with_scope (snappy.cmake) +-endif () ++#if (ENABLE_STATIC_SNAPPY OR NOT Snappy_FOUND) ++# message (STATUS "Using bundled Snappy") ++# include_with_scope (snappy.cmake) ++#endif () + +-if (NOT ZLIB_FOUND) +- message (STATUS "Using bundled ZLIB") +- include_with_scope (zlib.cmake) +-endif () ++#if (NOT ZLIB_FOUND) ++# message (STATUS "Using bundled ZLIB") ++# include_with_scope (zlib.cmake) ++#endif () + +-if (NOT PNG_FOUND) +- message (STATUS "Using bundled PNG") +- include_with_scope (libpng.cmake) +-endif () ++#if (NOT PNG_FOUND) ++# message (STATUS "Using bundled PNG") ++# include_with_scope (libpng.cmake) ++#endif () + +-if (NOT BROTLIDEC_FOUND OR NOT BROTLIENC_FOUND) +- message (STATUS "Using bundled Brotli") +- include_with_scope (brotli.cmake) +-endif () ++#if (NOT BROTLIDEC_FOUND OR NOT BROTLIENC_FOUND) ++# message (STATUS "Using bundled Brotli") ++# include_with_scope (brotli.cmake) ++#endif () + +-if (CMAKE_EXECUTABLE_FORMAT STREQUAL "ELF") +- include_with_scope (libbacktrace.cmake) +-endif () ++#if (CMAKE_EXECUTABLE_FORMAT STREQUAL "ELF") ++# include_with_scope (libbacktrace.cmake) ++#endif () + + # We use non-standard C++ flags, so we can't just use GTest's CMakeLists.txt +-if (NOT GTEST_FOUND) +- message (STATUS "Using bundled GTest") +- include_with_scope (gtest.cmake) +-endif () ++#if (NOT GTEST_FOUND) ++# message (STATUS "Using bundled GTest") ++# include_with_scope (gtest.cmake) ++#endif () ++find_path(Snappy_INCLUDE_DIR NAMES snappy.h ++ PATHS ${Snappy_ROOT_DIR} ${Snappy_ROOT_DIR}/include /usr/local/include) ++ ++find_library(Snappy_LIBRARIES NAMES snappy ++ PATHS ${Snappy_ROOT_DIR} ${Snappy_ROOT_DIR}/lib /usr/local/lib) ++ ++include(FindPackageHandleStandardArgs) ++find_package_handle_standard_args(Snappy DEFAULT_MSG Snappy_INCLUDE_DIR Snappy_LIBRARIES) ++ ++if(SNAPPY_FOUND) ++ message(STATUS "Found Snappy (include: ${Snappy_INCLUDE_DIR}, library: ${Snappy_LIBRARIES})") ++ mark_as_advanced(Snappy_INCLUDE_DIR Snappy_LIBRARIES) ++ find_package(Snappy REQUIRED) ++ target_link_libraries(Snappy::snappy) ++endif() + + if (MSVC) + add_subdirectory (getopt) diff --git a/devel/apitrace/files/patch-thirdparty_libbacktrace_dwarf.c b/devel/apitrace/files/patch-thirdparty_libbacktrace_dwarf.c deleted file mode 100644 index 6f58dcfe953a..000000000000 --- a/devel/apitrace/files/patch-thirdparty_libbacktrace_dwarf.c +++ /dev/null @@ -1,156 +0,0 @@ ---- thirdparty/libbacktrace/dwarf.c.orig 2017-10-13 17:18:18 UTC -+++ thirdparty/libbacktrace/dwarf.c -@@ -768,21 +768,27 @@ read_attribute (enum dwarf_form form, st - version, addrsize, dwarf_str, dwarf_str_size, - val); - } -+#if defined(DW_FORM_sec_offset) // not defined on 10 - case DW_FORM_sec_offset: - val->encoding = ATTR_VAL_REF_SECTION; - val->u.uint = read_offset (buf, is_dwarf64); - return 1; -+#endif -+#if defined(DW_FORM_exprloc) // not defined on 10 - case DW_FORM_exprloc: - val->encoding = ATTR_VAL_EXPR; - return advance (buf, read_uleb128 (buf)); -+#endif - case DW_FORM_flag_present: - val->encoding = ATTR_VAL_UINT; - val->u.uint = 1; - return 1; -+#if defined(DW_FORM_ref_sig8) // not defined on 10 - case DW_FORM_ref_sig8: - val->encoding = ATTR_VAL_REF_TYPE; - val->u.uint = read_uint64 (buf); - return 1; -+#endif - case DW_FORM_GNU_addr_index: - val->encoding = ATTR_VAL_REF_SECTION; - val->u.uint = read_uleb128 (buf); -@@ -1314,7 +1320,7 @@ find_address_ranges (struct backtrace_st - highpc_is_relative = 1; - } - break; -- -+#if defined(DW_AT_ranges) // not defined on 10 - case DW_AT_ranges: - if (val.encoding == ATTR_VAL_UINT - || val.encoding == ATTR_VAL_REF_SECTION) -@@ -1323,7 +1329,7 @@ find_address_ranges (struct backtrace_st - have_ranges = 1; - } - break; -- -+#endif - case DW_AT_stmt_list: - if (abbrev->tag == DW_TAG_compile_unit - && (val.encoding == ATTR_VAL_UINT -@@ -1851,10 +1857,6 @@ read_line_program (struct backtrace_stat - } - } - break; -- case DW_LNE_set_discriminator: -- /* We don't care about discriminators. */ -- read_uleb128 (line_buf); -- break; - default: - if (!advance (line_buf, len - 1)) - return 0; -@@ -2108,16 +2110,24 @@ read_referenced_name (struct dwarf_data - if (val.encoding == ATTR_VAL_STRING) - ret = val.u.string; - break; -- -+#if defined(DW_AT_linkage_name) - case DW_AT_linkage_name: -+#endif -+#if defined(DW_AT_MIPS_linkage_name) - case DW_AT_MIPS_linkage_name: -+#endif -+#if defined(DW_AT_linkage_name) || defined(DW_AT_MIPS_linkage_name) - if (val.encoding == ATTR_VAL_STRING) - return val.u.string; - break; -- -+#endif - case DW_AT_specification: - if (abbrev->attrs[i].form == DW_FORM_ref_addr -+#if defined(DW_FORM_ref_sig8) // not defined on 10 - || abbrev->attrs[i].form == DW_FORM_ref_sig8) -+#else -+ || 0) // not defined -+#endif - { - /* This refers to a specification defined in some other - compilation unit. We can handle this case if we -@@ -2325,6 +2335,7 @@ read_function_entry (struct backtrace_st - { - switch (abbrev->attrs[i].name) - { -+#if defined(DW_AT_call_file) - case DW_AT_call_file: - if (val.encoding == ATTR_VAL_UINT) - { -@@ -2344,16 +2355,21 @@ read_function_entry (struct backtrace_st - } - } - break; -- -+#endif -+#if defined(DW_AT_call_line) - case DW_AT_call_line: - if (val.encoding == ATTR_VAL_UINT) - function->caller_lineno = val.u.uint; - break; -- -+#endif - case DW_AT_abstract_origin: - case DW_AT_specification: - if (abbrev->attrs[i].form == DW_FORM_ref_addr -+#if defined(DW_FORM_ref_sig8) // not defined on 10 - || abbrev->attrs[i].form == DW_FORM_ref_sig8) -+#else -+ || 0) // not defined -+#endif - { - /* This refers to an abstract origin defined in - some other compilation unit. We can handle -@@ -2383,13 +2399,17 @@ read_function_entry (struct backtrace_st - function->name = val.u.string; - } - break; -- -+#if defined(DW_AT_linkage_name) - case DW_AT_linkage_name: -+#endif -+#if defined(DW_AT_MIPS_linkage_name) - case DW_AT_MIPS_linkage_name: -+#endif -+#if defined(DW_AT_linkage_name) || defined(DW_AT_MIPS_linkage_name) - if (val.encoding == ATTR_VAL_STRING) - function->name = val.u.string; - break; -- -+#endif - case DW_AT_low_pc: - if (val.encoding == ATTR_VAL_ADDRESS) - { -@@ -2411,7 +2431,7 @@ read_function_entry (struct backtrace_st - highpc_is_relative = 1; - } - break; -- -+#if defined(DW_AT_ranges) // not defined on 10 - case DW_AT_ranges: - if (val.encoding == ATTR_VAL_UINT - || val.encoding == ATTR_VAL_REF_SECTION) -@@ -2420,7 +2440,7 @@ read_function_entry (struct backtrace_st - have_ranges = 1; - } - break; -- -+#endif - default: - break; - } diff --git a/devel/apitrace/pkg-plist b/devel/apitrace/pkg-plist index 76d3a004c279..8f5b878be5a1 100644 --- a/devel/apitrace/pkg-plist +++ b/devel/apitrace/pkg-plist @@ -1,24 +1,25 @@ bin/apitrace bin/eglretrace bin/glretrace +bin/gltrim %%QT5%%bin/qapitrace -%%QT5%%share/applications/qapitrace.desktop -lib/apitrace/scripts/apitrace.PIXExp +%%QT5%%lib/apitrace/scripts/apitrace.PIXExp lib/apitrace/scripts/convert.py lib/apitrace/scripts/highlight.py lib/apitrace/scripts/jsondiff.py lib/apitrace/scripts/jsonextractimages.py lib/apitrace/scripts/leaks.py lib/apitrace/scripts/profileshader.py lib/apitrace/scripts/retracediff.py lib/apitrace/scripts/snapdiff.py lib/apitrace/scripts/tracecheck.py lib/apitrace/scripts/tracediff.py lib/apitrace/scripts/unpickle.py lib/apitrace/wrappers/egltrace.so lib/apitrace/wrappers/glxtrace.so +share/applications/qapitrace.desktop %%PORTDOCS%%%%DOCSDIR%%/BUGS.markdown -%%PORTDOCS%%%%DOCSDIR%%/LICENSE-snappy.txt %%PORTDOCS%%%%DOCSDIR%%/NEWS.markdown %%PORTDOCS%%%%DOCSDIR%%/README.markdown %%PORTDOCS%%%%DOCSDIR%%/USAGE.markdown +