From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp12.migadu.com ([2001:41d0:403:4789::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms9.migadu.com with LMTPS id 6JBPI5D3EmV2UwAAauVa8A:P1 (envelope-from ) for ; Tue, 26 Sep 2023 17:24:00 +0200 Received: from aspmx1.migadu.com ([2001:41d0:403:4789::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp12.migadu.com with LMTPS id 6JBPI5D3EmV2UwAAauVa8A (envelope-from ) for ; Tue, 26 Sep 2023 17:24:00 +0200 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id 216865C478 for ; Tue, 26 Sep 2023 17:24:00 +0200 (CEST) Authentication-Results: aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=gmail.com header.s=20230601 header.b=CkxtGx0X; spf=pass (aspmx1.migadu.com: domain of "guix-patches-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="guix-patches-bounces+larch=yhetil.org@gnu.org"; dmarc=fail reason="SPF not aligned (relaxed)" header.from=gmail.com (policy=none) ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1695741840; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding:resent-to: resent-from:resent-sender:resent-message-id:in-reply-to:in-reply-to: references:references:list-id:list-help:list-unsubscribe: list-subscribe:list-post:dkim-signature; bh=MDCTaAtuaS98luoLxDyFX8Wm5TUpJnpqCkIaqO8j3zw=; b=ceQxLOVl/jj6x3S7Laowwujb1M9eHEDazy23ig/GEBkOvSpJRgrQA+2DfoH4av9scjIvk2 j9KiYBK2KB+GaXlUcqD29/zrYnvS9GWdrQwFfT18Juf22QZN0b990dKxUTqcuzmROE6zxQ dsL2RZBLVuTHckoEnlq67jMoRlliGq76SmNKIuVvBHjFqtk/4Ed248k7EukjEQqZCanXYJ XN2Kd1FmYD+smMdo4NJEDGGeefwf4jhYRnsspFTVuePRTLOCX2+YIfO2plhPhOtzkQ12ef xUV7X6EOjAl6e6iApJpifrizSsVvJG8xxY/lKgrAEgjWf1mxyEgyg6WzAKcUNg== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1695741840; a=rsa-sha256; cv=none; b=tv9gTPDDdikRALuXcMejI4+Cp9sGNGL/ibrN1f63Vi64pOl+TeRy2F537d625CgVkhU2rn 1QqvPX4Pgb1cuqfficMPub9nT5fmY+ToLQSO5PBjocG3Yyj+Y8UNHTNRCcGOHD4zuOA3fg fywgWNbUAwAg/jHBvsYfGqt61IpO1RXlfFwD7y+JF0iJRyAfZ0Vf+S602eeBj5FKwaptVS gIiim9S38cVvIyZDSsvwquNRF99U5RZ4p501geCMtcUEuSiKSmuOr1zX227vZeGosB9aih mo7CBkm/ge4RsZdb2/rDe8PvVsfgCHeirQ6Z6GYuYBmRVj5oRm0vid0xztcLMg== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=gmail.com header.s=20230601 header.b=CkxtGx0X; spf=pass (aspmx1.migadu.com: domain of "guix-patches-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="guix-patches-bounces+larch=yhetil.org@gnu.org"; dmarc=fail reason="SPF not aligned (relaxed)" header.from=gmail.com (policy=none) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ql9ug-00058B-SJ; Tue, 26 Sep 2023 11:23:51 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ql9uf-00056N-JM for guix-patches@gnu.org; Tue, 26 Sep 2023 11:23:49 -0400 Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1ql9uf-0007WP-BD for guix-patches@gnu.org; Tue, 26 Sep 2023 11:23:49 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1ql9us-00085B-BZ for guix-patches@gnu.org; Tue, 26 Sep 2023 11:24:02 -0400 Subject: bug#65106: [PATCH v2 1/2] gnu: Add tracy-wayland. Resent-From: Maxim Cournoyer Original-Sender: "Debbugs-submit" Resent-To: guix-patches@gnu.org Resent-Date: Tue, 26 Sep 2023 15:24:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: cc-closed 65106 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: moreinfo patch To: dan Cc: 65106-done@debbugs.gnu.org Mail-Followup-To: 65106@debbugs.gnu.org, maxim.cournoyer@gmail.com, i@dan.games Received: via spool by 65106-done@debbugs.gnu.org id=D65106.169574178530980 (code D ref 65106); Tue, 26 Sep 2023 15:24:02 +0000 Received: (at 65106-done) by debbugs.gnu.org; 26 Sep 2023 15:23:05 +0000 Received: from localhost ([127.0.0.1]:49574 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ql9tw-00083c-9G for submit@debbugs.gnu.org; Tue, 26 Sep 2023 11:23:04 -0400 Received: from mail-qk1-x734.google.com ([2607:f8b0:4864:20::734]:62733) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ql9tr-000830-SI for 65106-done@debbugs.gnu.org; Tue, 26 Sep 2023 11:23:02 -0400 Received: by mail-qk1-x734.google.com with SMTP id af79cd13be357-77063481352so488162585a.1 for <65106-done@debbugs.gnu.org>; Tue, 26 Sep 2023 08:22:46 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1695741761; x=1696346561; darn=debbugs.gnu.org; h=content-transfer-encoding:mime-version:user-agent:message-id :in-reply-to:date:references:subject:cc:to:from:from:to:cc:subject :date:message-id:reply-to; bh=MDCTaAtuaS98luoLxDyFX8Wm5TUpJnpqCkIaqO8j3zw=; b=CkxtGx0XYRuxRu0XTxYZCtvOvzdXOnXRrHskAyYJQSqWsq+M/z4jnyn+09UBdm4767 efgC8lKthROR8KBtvvtwEMYgCo3WoRXnyQlez/MMfTeVwh9ujH/TkSXzGkDeU0E52m6C r/hYiR2wL8sW1CPL6RJhpMqwVo5ZUs4JY/9bUJjbeSojFMOlcio3US3gfdSd2TMNxy4b MSE8dZpe8E3rQmDPN/+qi8KuxKdYAVQOeAlKxJUI9qWmkuLrVo5LnVUpdAJbzZnOjMUP zopBqRiDP4+iyQnpFbzgyGNuLrENVu9vW7fiPEoooyGQoTfo9c96M8EFVN78yvPAhxg1 LDBg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1695741761; x=1696346561; h=content-transfer-encoding:mime-version:user-agent:message-id :in-reply-to:date:references:subject:cc:to:from:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=MDCTaAtuaS98luoLxDyFX8Wm5TUpJnpqCkIaqO8j3zw=; b=otKx1jqm9QboqLXWtMso8Q95CdqS4LvIyLrp/7fuWCqdRV+YvxrPNa/qT1ym8LZyFe Xn8fFwVUcpKyrYDt6znm1S+3HqPq2An18ZUPSJgx8lrtae6tRPJeNfS0WRaRUZe32Jj+ lhX4FMW/0Xn9lAxMb03nK8tqg1aDTTeGFt0EK4aPMKvr4UBfdqwyg2YyKkqnZFhLWK/R WQpY+VDwnVx1kb7UMKg0istL/sD57TdrTXeRut34XVHxUsgOuLKr90alKQNTlv8fKcqJ A+nte1xXoyfj/c+ekDc5/p8FJU16HwsqtPIj4PUvydl9LfJVgQtW0/kxLLecAlTDV5Ac vhbw== X-Gm-Message-State: AOJu0Ywyx84W38gPN9kh+bO6zn0/pd1qFG9xczTT5gzDy980PspIH5yM aPxxe2uF30jXu5JkC3akWgZ8Do/HYiI= X-Google-Smtp-Source: AGHT+IFm8gYwumzyJskZ1z/uX+t0wrMJ+ezGC+Y6baiwGIMMEvQViBrPHxvdd2qlEWGzgcwpBCx6Dw== X-Received: by 2002:a05:620a:4443:b0:767:e994:ff03 with SMTP id w3-20020a05620a444300b00767e994ff03mr3683386qkp.15.1695741760591; Tue, 26 Sep 2023 08:22:40 -0700 (PDT) Received: from hurd (dsl-10-130-229.b2b2c.ca. [72.10.130.229]) by smtp.gmail.com with ESMTPSA id br30-20020a05620a461e00b0076f124abe4dsm4419997qkb.77.2023.09.26.08.22.39 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 26 Sep 2023 08:22:40 -0700 (PDT) From: Maxim Cournoyer References: <20230924171400.7496-1-i@dan.games> <20230924171400.7496-2-i@dan.games> Date: Tue, 26 Sep 2023 11:22:39 -0400 In-Reply-To: <20230924171400.7496-2-i@dan.games> (dan's message of "Mon, 25 Sep 2023 01:13:59 +0800") Message-ID: <87o7hp0xj4.fsf@gmail.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.2 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: guix-patches@gnu.org List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+larch=yhetil.org@gnu.org Sender: guix-patches-bounces+larch=yhetil.org@gnu.org X-Migadu-Country: US X-Migadu-Flow: FLOW_IN X-Spam-Score: 5.73 X-Migadu-Spam-Score: 5.73 X-Migadu-Scanner: mx1.migadu.com X-Migadu-Queue-Id: 216865C478 X-TUID: EuEWWu/wQlQq Hello! dan writes: > * gnu/packages/profiling.scm (tracy-wayland): New variable. > --- > gnu/packages/profiling.scm | 53 ++++++++++++++++++++++++++++++++++++-- > 1 file changed, 51 insertions(+), 2 deletions(-) > > diff --git a/gnu/packages/profiling.scm b/gnu/packages/profiling.scm > index 8a1c609669..af79488c30 100644 > --- a/gnu/packages/profiling.scm > +++ b/gnu/packages/profiling.scm > @@ -2,6 +2,7 @@ > ;;; Copyright =C2=A9 2017 Dave Love > ;;; Copyright =C2=A9 2018, 2019, 2020 Tobias Geerinckx-Rice > ;;; Copyright =C2=A9 2022 Ludovic Court=C3=A8s > +;;; Copyright =C2=A9 2023 dan > ;;; > ;;; This file is part of GNU Guix. > ;;; > @@ -21,6 +22,7 @@ > (define-module (gnu packages profiling) > #:use-module (guix packages) > #:use-module (guix gexp) > + #:use-module (guix git-download) > #:use-module ((guix licenses) #:prefix license:) ; avoid zlib, expat c= lashes > #:use-module (guix download) > #:use-module (guix utils) > @@ -31,19 +33,24 @@ (define-module (gnu packages profiling) > #:use-module (gnu packages bison) > #:use-module (gnu packages compression) > #:use-module (gnu packages documentation) > + #:use-module (gnu packages engineering) > #:use-module (gnu packages fabric-management) > #:use-module (gnu packages flex) > + #:use-module (gnu packages fontutils) > + #:use-module (gnu packages freedesktop) > #:use-module (gnu packages gawk) > #:use-module (gnu packages gcc) > + #:use-module (gnu packages gl) > #:use-module (gnu packages glib) > #:use-module (gnu packages libunwind) > #:use-module (gnu packages linux) > #:use-module (gnu packages mpi) > #:use-module (gnu packages ncurses) > #:use-module (gnu packages perl) > - #:use-module (gnu packages perl) > + #:use-module (gnu packages pkg-config) > #:use-module (gnu packages python) > - #:use-module (gnu packages qt)) > + #:use-module (gnu packages qt) > + #:use-module (gnu packages xdisorg)) >=20=20 > ;; Fixme: Separate out lib and fix resulting cycle errors; separate libp= fm > ;; output(?); build libmsr and add that component. > @@ -389,3 +396,45 @@ (define (make-scorep mpi) > (license license:cpl1.0))) >=20=20 > (define-public scorep-openmpi (make-scorep openmpi)) > + > +(define-public tracy-wayland > + (package > + (name "tracy-wayland") > + (version "0.9.1") > + (source (origin > + (method git-fetch) > + (uri (git-reference > + (url "https://github.com/wolfpld/tracy.git") > + (commit (string-append "v" version)))) > + (sha256 > + (base32 > + "1znw1r1c4vrb9vrsr08gcwynpjda8xxmb3923yykpymw2hsm0n9b")) > + (file-name (git-file-name "tracy" version)))) > + (build-system gnu-build-system) > + (arguments > + (list #:tests? #f ;no test for the profiler > + #:make-flags #~(list (string-append "CC=3D" > + #$(cc-for-target))) > + #:phases #~(modify-phases %standard-phases > + (replace 'configure > + (lambda _ > + (chdir "profiler/build/unix"))) > + (replace 'install > + (lambda _ > + (let ((bin (string-append #$output "/bin")) > + (tracy (string-append #$output "/bin/t= racy"))) > + (mkdir-p bin) > + (copy-file "Tracy-release" tracy))))))) > + (inputs (list capstone > + dbus > + freetype > + libxkbcommon > + mesa > + wayland)) > + (native-inputs (list pkg-config)) > + (home-page "https://github.com/wolfpld/tracy") > + (synopsis "Frame profiler") > + (description > + "A real time, nanosecond resolution, remote telemetry, hybrid frame= and > +sampling profiler for games and other applications.") > + (license license:bsd-3))) Looking at this package more closely, I found it was bundling imgui and zstd, so I tried unbundling both, and was successful for zstd: --8<---------------cut here---------------start------------->8--- modified gnu/packages/profiling.scm @@ -402,35 +402,61 @@ (define-public tracy-wayland (package (name "tracy-wayland") (version "0.9.1") - (source (origin - (method git-fetch) - (uri (git-reference - (url "https://github.com/wolfpld/tracy") - (commit (string-append "v" version)))) - (sha256 - (base32 - "1znw1r1c4vrb9vrsr08gcwynpjda8xxmb3923yykpymw2hsm0n9b")) - (file-name (git-file-name "tracy" version)))) + (source + (origin + (method git-fetch) + (uri (git-reference + (url "https://github.com/wolfpld/tracy") + (commit (string-append "v" version)))) + (sha256 + (base32 + "1znw1r1c4vrb9vrsr08gcwynpjda8xxmb3923yykpymw2hsm0n9b")) + (file-name (git-file-name "tracy" version)) + (modules '((guix build utils))) + (snippet + '(begin + ;; XXX: Sadly, the ImGui loaders appear to have been customized= by + ;; the project and the build fails when using the 'imgui' Guix + ;; package due to a missing GL_TEXTURE_WRAP_S definition, so ke= ep + ;; the bundled copy. + + ;; Unbundle Zstd. + (delete-file-recursively "zstd") + ;; Adjust the include directives. + (substitute* (find-files "server" "\\.(c|h)pp$") + (("#include \".*zstd/(zstd|zdict).h\"" _ header) + (format #f "#include \"~a.h\"" header))) + ;; De-register source files from Visual Code project. + (substitute* "profiler/build/win32/Tracy.vcxproj" + ((".*Include=3D\"..\\\\..\\\\..\\\\zstd\\\\.*") "")))))) + ;; Note: There is also CMake and Meson support, but only to build the + ;; tracy library, not the profiler command. (build-system gnu-build-system) (arguments - (list #:tests? #f ;no test for the profiler - #:make-flags #~(list (string-append "CC=3D" #$(cc-for-target))) - #:phases #~(modify-phases %standard-phases - (replace 'configure - (lambda _ - (chdir "profiler/build/unix"))) - (replace 'install - (lambda _ - (let ((bin (string-append #$output "/bin")) - (tracy (string-append #$output "/bin/tra= cy"))) - (mkdir-p bin) - (copy-file "Tracy-release" tracy))))))) + (list + #:tests? #f ;no test for the profiler + #:make-flags + #~(list (string-append "CC=3D" #$(cc-for-target)) + (string-append "CFLAGS=3D-lzstd")) + #:phases + #~(modify-phases %standard-phases + (add-before 'build 'chdir + (lambda _ + (chdir "profiler/build/unix"))) + (delete 'configure) ;the profiler has no configure scr= ipt + (replace 'install + (lambda _ + (let ((bin (string-append #$output "/bin")) + (tracy (string-append #$output "/bin/tracy"))) + (mkdir-p bin) + (copy-file "Tracy-release" tracy))))))) (inputs (list capstone dbus freetype libxkbcommon mesa - wayland)) + wayland + `(,zstd "lib"))) (native-inputs (list pkg-config)) (home-page "https://github.com/wolfpld/tracy") (synopsis "Frame profiler") --8<---------------cut here---------------end--------------->8--- For the X11 variant working around packaging problems in glfw (dlopen) with LD_LIBRARY_PATH, I've fixed these in glfw (by patching the so names in its source with their absolute paths) and removed the workaround: --8<---------------cut here---------------start------------->8--- @@ -443,29 +469,13 @@ (define-public tracy (package (inherit tracy-wayland) (name "tracy") - (inputs (modify-inputs (package-inputs tracy-wayland) - (delete "libxkbcommon" "wayland") - (prepend glfw))) (arguments (substitute-keyword-arguments (package-arguments tracy-wayland) - ((#:make-flags flags - #~'()) + ((#:make-flags flags #~'()) #~(append #$flags - ;; The LEGACY flag indicate we want to build tracy with = glfw - (list "LEGACY=3D1"))) - ((#:phases phases) - #~(modify-phases #$phases - ;; Tracy depends on glfw to load libGL.so, but glfw doesn't ha= ve - ;; mesa in its rpath. Thus, we need to manually modify tracy's - ;; LD_LIBRARY_PATH. - (add-after 'install 'wrap-program - (lambda _ - (let ((out (string-append #$output "/bin/tracy")) - (mesa (string-append #$(this-package-input "mesa") - "/lib"))) - (wrap-program out - `("LD_LIBRARY_PATH" ":" =3D - (,mesa)))))))))) + ;; The LEGACY flag indicate we want to build tracy with = glfw. + (list "LEGACY=3D1"))))) (inputs (modify-inputs (package-inputs tracy-wayland) - (append bash-minimal))) + (delete "libxkbcommon" "wayland") + (prepend glfw))) (synopsis "Frame profiler (X11 version)"))) --8<---------------cut here---------------end--------------->8--- It at least still runs for me, though I'm not sure how to use it (it seems to require the target application to be built with libtracy and act as a server?). Closing, thank you for contributing to Guix! -- Thanks, Maxim