From a45ff03c612a539fa5469e017ee753c4835dff8e Mon Sep 17 00:00:00 2001 From: Christian Kellner Date: Sep 27 2017 12:19:51 +0000 Subject: Initial import (#1492746) --- diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..a53fc5d --- /dev/null +++ b/.gitignore @@ -0,0 +1,2 @@ +/renderdoc-0.91.tar.gz +/swig-modified-1.tar.gz diff --git a/README.md b/README.md deleted file mode 100644 index 0a9c039..0000000 --- a/README.md +++ /dev/null @@ -1,3 +0,0 @@ -# renderdoc - -The renderdoc package \ No newline at end of file diff --git a/renderdoc.spec b/renderdoc.spec new file mode 100644 index 0000000..62bb7d1 --- /dev/null +++ b/renderdoc.spec @@ -0,0 +1,133 @@ +%global vswig modified-1 +Name: renderdoc +Version: 0.91 +Release: 4%{?dist} +Summary: A stand-alone graphics debugging tool + +License: MIT +URL: https://renderdoc.org +Source0: https://github.com/baldurk/renderdoc/archive/v%{version}/%{name}-%{version}.tar.gz +Source1: https://github.com/baldurk/swig/archive/renderdoc-%{vswig}/swig-%{vswig}.tar.gz + +# Install the private library into a private directory +# https://github.com/baldurk/renderdoc/issues/750 +Patch0: subfolder.patch + +# plthook library, used by renderdoc is only supported on x86 +ExclusiveArch: %{ix86} x86_64 + +# for the local swig +BuildRequires: autoconf +BuildRequires: automake +BuildRequires: pcre-devel + +# for the renderdoc itself +BuildRequires: cmake +BuildRequires: desktop-file-utils +BuildRequires: pkgconfig(vulkan) +BuildRequires: bison +BuildRequires: pkgconfig(python3) +BuildRequires: pkgconfig(x11) +BuildRequires: pkgconfig(xcb) +BuildRequires: pkgconfig(xcb-keysyms) +BuildRequires: pkgconfig(gl) +BuildRequires: pkgconfig(Qt5) +BuildRequires: pkgconfig(Qt5X11Extras) +BuildRequires: pkgconfig(Qt5Svg) +BuildRequires: pkgconfig(xcb-keysyms) +Requires: hicolor-icon-theme + +%description +A free MIT licensed stand-alone graphics debugger that allows quick +and easy single-frame capture and detailed introspection of any +application using Vulkan, OpenGL. + +%package devel +Summary: Development files for renderdoc +Requires: %{name}%{?_isa} = %{version}-%{release} + +%description devel +The %{name}-devel package contains headers and other files that are +required to develop applications that want to integrate with +renderdoc. + +%prep +%setup -q -n %{name}-%{version} +%patch0 -p1 + +%build +mkdir -p build +cd build +%cmake .. \ + -DQMAKE_QT5_COMMAND=qmake-qt5 \ + -DRENDERDOC_SWIG_PACKAGE=%{SOURCE1} \ + -DENABLE_GL=ON \ + -DENABLE_VULKAN=ON \ + -DENABLE_VULKAN=ENABLE_RENDERDOCCMD \ + -DENABLE_QRENDERDOC=ON \ + -DBUILD_VERSION_STABLE=ON \ + -DBUILD_VERSION_DIST_NAME="fedora" \ + -DBUILD_DISTRIBUTION_VERSION="%{version}-%{release}" \ + -DBUILD_VERSION_DIST_CONTACT="https://copr.fedorainfracloud.org/coprs/gicmo/devel/" \ + -DCMAKE_INSTALL_PREFIX=/usr \ + -DLIB_SUBFOLDER=renderdoc \ + -DCMAKE_BUILD_TYPE=Release + +%make_build + +%install +cd build +%make_install +rm %{buildroot}/%{_datadir}/menu/renderdoc + +%check +desktop-file-validate %{buildroot}/%{_datadir}/applications/%{name}.desktop + +%post +touch --no-create %{_datadir}/icons/hicolor >&/dev/null || : + +%postun +if [ $1 -eq 0 ]; then + touch --no-create %{_datadir}/icons/hicolor >&/dev/null || : + gtk-update-icon-cache %{_datadir}/icons/hicolor >&/dev/null || : +fi + +%posttrans +gtk-update-icon-cache %{_datadir}/icons/hicolor >&/dev/null || : + +%files +%license LICENSE.md +%doc README.md CODE_OF_CONDUCT.md +%{_bindir}/qrenderdoc +%{_bindir}/renderdoccmd +%{_datadir}/applications/%{name}.desktop +%{_libdir}/renderdoc/lib%{name}.so +%{_datadir}/thumbnailers/%{name}.thumbnailer +%{_datadir}/icons/hicolor/*/mimetypes/application-x-renderdoc-capture.* +%{_datadir}/mime/packages/renderdoc-capture.xml +%{_datadir}/pixmaps/%{name}-icon-*.xpm + +%doc %{_docdir}/%{name}/ +%{_sysconfdir}/vulkan/implicit_layer.d/%{name}_capture.json + +%files devel +%{_includedir}/%{name}.h + + +%changelog +* Wed Sep 27 2017 Christian Kellner - 0.91-4 +- Remove ldconfig calls + +* Wed Sep 27 2017 Christian Kellner - 0.91-3 +- Split out devel package +- Address review comments + +* Mon Sep 18 2017 Christian Kellner - 0.91-2 +- Restrict archs to x86 + +* Mon Sep 18 2017 Christian Kellner - 0.91-1 +- New upstream version +- Dropped patches, replaced by cmake options. + +* Mon Jun 19 2017 Christian Kellner +- Initial packaging diff --git a/sources b/sources new file mode 100644 index 0000000..4f4a1a0 --- /dev/null +++ b/sources @@ -0,0 +1,2 @@ +SHA512 (renderdoc-0.91.tar.gz) = d715f2c182bf3f049f4efbc6a85b75e6e0ed9ce5830baf8cb5249e936d7ed317f6cb5592267d249e50f95bdd901a4dbb4ff2635de110cdecab06cdff8d2d61b7 +SHA512 (swig-modified-1.tar.gz) = bcd73a994c78975b3f5422d39670d33eb64981244c3c7cfbfae65e7190dd1aacf0eb6ab6ee6ca6d230d5fdaface3fb8f761ab2df652ceb289aa87956c018caa4 diff --git a/subfolder.patch b/subfolder.patch new file mode 100644 index 0000000..1cf41d4 --- /dev/null +++ b/subfolder.patch @@ -0,0 +1,172 @@ +From 64febd4c1fd8f15b7aabcd68c99eca0e629ddd38 Mon Sep 17 00:00:00 2001 +From: baldurk +Date: Tue, 26 Sep 2017 11:00:17 +0100 +Subject: [PATCH] Add support for specifying a subfolder under the lib/ target. + Refs #750 + +* This allows a buidler to customise from e.g. /usr/lib/librenderdoc.so + to /usr/lib/renderdoc/librenderdoc.so - which is harmless since the + library is 'private' and not intended to be linked against directly. +--- + CMakeLists.txt | 14 ++++++++++++++ + qrenderdoc/CMakeLists.txt | 3 +++ + qrenderdoc/Code/pyrenderdoc/CMakeLists.txt | 2 +- + qrenderdoc/qrenderdoc.pro | 2 +- + renderdoc/CMakeLists.txt | 2 +- + renderdoc/driver/vulkan/CMakeLists.txt | 2 +- + renderdoc/os/posix/posix_process.cpp | 9 +++++++++ + renderdoc/os/posix/posix_stringio.cpp | 13 +++++++++++-- + renderdoccmd/CMakeLists.txt | 2 +- + 9 files changed, 42 insertions(+), 7 deletions(-) + +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 44d3bf70..fce5fa56 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -40,6 +40,20 @@ set(RENDERDOC_PLUGINS_PATH "" CACHE STRING "Path to RenderDoc plugins folder aft + set(RENDERDOC_APK_PATH "" CACHE STRING "Path to RenderDocCmd.apk after installation of RenderDoc on host (either absolute or relative to binary)") + set(RENDERDOC_LAYER_PATH "" CACHE STRING "Path to ABI directories (i.e. lib in lib/armeabi-v7a/libVkLayer_GLES_RenderDoc.so) after installation of RenderDoc on host (either absolute or relative to dir)") + ++set(LIB_SUFFIX "" CACHE STRING "Suffix for 'lib' folder in target directory structure. E.g. set to '64' to use /usr/local/lib64 instead of /usr/local/lib.") ++set(LIB_SUBFOLDER "" CACHE STRING "Subfolder under the 'lib' folder in target directory structure. E.g. set to 'renderdoc' to use /usr/local/lib/renderdoc instead of /usr/local/lib.") ++ ++if(NOT LIB_SUFFIX STREQUAL "") ++ add_definitions(-DRENDERDOC_LIB_SUFFIX=${LIB_SUFFIX}) ++endif() ++ ++set(LIB_SUBFOLDER_TRAIL_SLASH "") ++ ++if(NOT LIB_SUBFOLDER STREQUAL "") ++ add_definitions(-DRENDERDOC_LIB_SUBFOLDER=${LIB_SUBFOLDER}) ++ set(LIB_SUBFOLDER_TRAIL_SLASH "${LIB_SUBFOLDER}/") ++endif() ++ + if(BUILD_VERSION_STABLE) + add_definitions(-DRENDERDOC_STABLE_BUILD=1) + endif() +diff --git a/qrenderdoc/CMakeLists.txt b/qrenderdoc/CMakeLists.txt +index 2df9ffa5..516a5a59 100644 +--- a/qrenderdoc/CMakeLists.txt ++++ b/qrenderdoc/CMakeLists.txt +@@ -102,6 +102,9 @@ file(WRITE + "QMAKE_CXXFLAGS+=${QMAKE_CXXFLAGS}\n" + "QMAKE_LFLAGS+=${QMAKE_LDFLAGS}\n" + "\n" ++ "LIB_SUFFIX=${LIB_SUFFIX}\n" ++ "LIB_SUBFOLDER_TRAIL_SLASH=${LIB_SUBFOLDER_TRAIL_SLASH}\n" ++ "\n" + # search for -lrenderdoc here + "LIBS+=-L${CMAKE_RUNTIME_OUTPUT_DIRECTORY}\n" + "\n" +diff --git a/qrenderdoc/Code/pyrenderdoc/CMakeLists.txt b/qrenderdoc/Code/pyrenderdoc/CMakeLists.txt +index 15109454..02aabb43 100644 +--- a/qrenderdoc/Code/pyrenderdoc/CMakeLists.txt ++++ b/qrenderdoc/Code/pyrenderdoc/CMakeLists.txt +@@ -33,7 +33,7 @@ set(MODULE_DEFINES + # Set up rpath to find librenderdoc.so + set(CMAKE_SKIP_BUILD_RPATH TRUE) + set(CMAKE_BUILD_WITH_INSTALL_RPATH TRUE) +-set(CMAKE_INSTALL_RPATH "$ORIGIN/:$ORIGIN/../lib/") ++set(CMAKE_INSTALL_RPATH "$ORIGIN/:$ORIGIN/../lib${LIB_SUFFIX}/${LIB_SUBFOLDER_TRAIL_SLASH}") + + # Add python library + set (CMAKE_SHARED_LINKER_FLAGS "${PYTHON_LIBRARY} ${CMAKE_SHARED_LINKER_FLAGS}") +diff --git a/qrenderdoc/qrenderdoc.pro b/qrenderdoc/qrenderdoc.pro +index 5a8123b6..a7392965 100644 +--- a/qrenderdoc/qrenderdoc.pro ++++ b/qrenderdoc/qrenderdoc.pro +@@ -115,7 +115,7 @@ win32 { + + # Link against the core library + LIBS += -lrenderdoc +- QMAKE_LFLAGS += '-Wl,-rpath,\'\$$ORIGIN\',-rpath,\'\$$ORIGIN/../lib\'' ++ QMAKE_LFLAGS += '-Wl,-rpath,\'\$$ORIGIN\',-rpath,\'\$$ORIGIN/../lib'$$LIB_SUFFIX'/'$$LIB_SUBFOLDER_TRAIL_SLASH'\'' + + # Add the SWIG files that were generated in cmake + SOURCES += $$CMAKE_DIR/qrenderdoc/renderdoc_python.cxx +diff --git a/renderdoc/CMakeLists.txt b/renderdoc/CMakeLists.txt +index 6f997ab4..6c2b44b5 100644 +--- a/renderdoc/CMakeLists.txt ++++ b/renderdoc/CMakeLists.txt +@@ -315,7 +315,7 @@ if(ANDROID) + set_target_properties(renderdoc PROPERTIES LINK_FLAGS "-Wl,--build-id") + endif() + +-install (TARGETS renderdoc DESTINATION lib${LIB_SUFFIX}) ++install (TARGETS renderdoc DESTINATION lib${LIB_SUFFIX}/${LIB_SUBFOLDER}) + + # Copy in application API header to include + install (FILES api/app/renderdoc_app.h DESTINATION include RENAME renderdoc.h) +diff --git a/renderdoc/driver/vulkan/CMakeLists.txt b/renderdoc/driver/vulkan/CMakeLists.txt +index 9ddd2ba7..1e0ab656 100644 +--- a/renderdoc/driver/vulkan/CMakeLists.txt ++++ b/renderdoc/driver/vulkan/CMakeLists.txt +@@ -65,7 +65,7 @@ elseif(UNIX) + set(json_in ${CMAKE_CURRENT_SOURCE_DIR}/renderdoc.json) + set(json_out ${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/renderdoc_capture.json) + add_custom_command(OUTPUT ${json_out} +- COMMAND sed '{s%\\[MAJOR\\]%${RENDERDOC_VERSION_MAJOR}%\; s%\\[MINOR\\]%${RENDERDOC_VERSION_MINOR}%\; s%...renderdoc.dll%${CMAKE_INSTALL_PREFIX}/lib${LIB_SUFFIX}/librenderdoc.so%}' < ${json_in} > ${json_out} ++ COMMAND sed '{s%\\[MAJOR\\]%${RENDERDOC_VERSION_MAJOR}%\; s%\\[MINOR\\]%${RENDERDOC_VERSION_MINOR}%\; s%...renderdoc.dll%${CMAKE_INSTALL_PREFIX}/lib${LIB_SUFFIX}/${LIB_SUBFOLDER_TRAIL_SLASH}librenderdoc.so%}' < ${json_in} > ${json_out} + DEPENDS ${json_in}) + add_custom_target(generate-json ALL DEPENDS ${json_out}) + +diff --git a/renderdoc/os/posix/posix_process.cpp b/renderdoc/os/posix/posix_process.cpp +index 774b871a..9e452a65 100644 +--- a/renderdoc/os/posix/posix_process.cpp ++++ b/renderdoc/os/posix/posix_process.cpp +@@ -493,6 +493,15 @@ uint32_t Process::LaunchAndInjectIntoProcess(const char *app, const char *workin + FileIO::GetExecutableFilename(binpath); + binpath = dirname(binpath); + libpath = binpath + "/../lib"; ++ ++// point to the right customiseable path ++#if defined(RENDERDOC_LIB_SUFFIX) ++ libpath += STRINGIZE(RENDERDOC_LIB_SUFFIX); ++#endif ++ ++#if defined(RENDERDOC_LIB_SUBFOLDER) ++ libpath += "/" STRINGIZE(RENDERDOC_LIB_SUBFOLDER); ++#endif + } + + string optstr; +diff --git a/renderdoc/os/posix/posix_stringio.cpp b/renderdoc/os/posix/posix_stringio.cpp +index eceea025..a9185a68 100644 +--- a/renderdoc/os/posix/posix_stringio.cpp ++++ b/renderdoc/os/posix/posix_stringio.cpp +@@ -153,8 +153,17 @@ string GetReplayAppFilename() + } + + // if it's not in the same directory, try in a sibling /bin +- // e.g. /foo/bar/lib/librenderdoc.so -> /foo/bar/bin/qrenderdoc +- replay = path + "/../bin/qrenderdoc"; ++ // ++ // start from our path ++ replay = path + "/"; ++ ++// if there's a custom lib subfolder, go up one (e.g. /usr/lib/renderdoc/librenderdoc.so) ++#if defined(RENDERDOC_LIB_SUBFOLDER) ++ replay += "../"; ++#endif ++ ++ // leave the lib/ folder, and go into bin/ ++ replay += "../bin/qrenderdoc"; + + f = FileIO::fopen(replay.c_str(), "r"); + if(f) +diff --git a/renderdoccmd/CMakeLists.txt b/renderdoccmd/CMakeLists.txt +index c748dccd..aa8975a1 100644 +--- a/renderdoccmd/CMakeLists.txt ++++ b/renderdoccmd/CMakeLists.txt +@@ -45,7 +45,7 @@ if(ANDROID) + else() + set(CMAKE_SKIP_BUILD_RPATH TRUE) + set(CMAKE_BUILD_WITH_INSTALL_RPATH TRUE) +- set(CMAKE_INSTALL_RPATH "$ORIGIN/:$ORIGIN/../lib/") ++ set(CMAKE_INSTALL_RPATH "$ORIGIN/:$ORIGIN/../lib${LIB_SUFFIX}/${LIB_SUBFOLDER_TRAIL_SLASH}") + set(CMAKE_EXE_LINKER_FLAGS "${LINKER_FLAGS}") + + add_executable(renderdoccmd ${sources}) +-- +2.13.5 +