nixpkgs mirror (for testing)
github.com/NixOS/nixpkgs
nix
1{
2 lib,
3 stdenv,
4 fetchFromGitHub,
5 ocl-icd,
6 opencl-headers,
7 libsForQt5,
8}:
9
10stdenv.mkDerivation (finalAttrs: {
11 pname = "opencl-caps-viewer";
12 version = "1.20";
13
14 src = fetchFromGitHub {
15 owner = "SaschaWillems";
16 repo = "OpenCLCapsViewer";
17 tag = finalAttrs.version;
18 hash = "sha256-P7G8FvVXzDAfN3d4pGXC+c9x4bY08/cJNYQ6lvjyVCQ=";
19 fetchSubmodules = true;
20 };
21
22 nativeBuildInputs = [
23 libsForQt5.qmake
24 libsForQt5.wrapQtAppsHook
25 ];
26
27 buildInputs = [
28 ocl-icd
29 opencl-headers
30 libsForQt5.qtx11extras
31 libsForQt5.qtbase
32 ];
33
34 postPatch = ''
35 # Fix installation paths
36 substituteInPlace OpenCLCapsViewer.pro \
37 --replace-fail "target.path = /usr/bin" "target.path = /bin/" \
38 --replace-fail "desktop.path = /usr/share/applications" "desktop.path = /share/applications" \
39 --replace-fail "icon.path = /usr/share/icons/hicolor/256x256/apps/" "icon.path = /share/icons/hicolor/256x256/apps/" \
40 --replace-fail 'else: unix:!android: target.path = /opt/$${TARGET}/bin' ""
41 '';
42
43 qmakeFlags = [
44 "OpenCLCapsViewer.pro"
45 "CONFIG+=x11"
46 ];
47
48 installFlags = [ "INSTALL_ROOT=${placeholder "out"}" ];
49
50 postInstall = ''
51 cp Resources/icon.png $out/share/icons/hicolor/256x256/apps/openclCapsViewer.png
52 '';
53
54 qtWrapperArgs = [
55 "--prefix LD_LIBRARY_PATH : ${ocl-icd}/lib"
56 ];
57
58 enableParallelBuilding = true;
59
60 meta = {
61 mainProgram = "OpenCLCapsViewer";
62 description = "OpenCL hardware capability viewer";
63 longDescription = ''
64 Client application to display hardware implementation details for devices supporting the OpenCL API by Khronos.
65 The hardware reports can be submitted to a public online database that allows comparing different devices, browsing available features, extensions, formats, etc.
66 '';
67 homepage = "https://opencl.gpuinfo.org/";
68 platforms = lib.platforms.linux;
69 license = lib.licenses.gpl2Only;
70 maintainers = with lib.maintainers; [ andrewgigena ];
71 changelog = "https://github.com/SaschaWillems/OpenCLCapsViewer/releases/tag/${finalAttrs.version}";
72 };
73})