From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp1 ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms11 with LMTPS id WJwdAiETPV//KgAA0tVLHw (envelope-from ) for ; Wed, 19 Aug 2020 11:55:13 +0000 Received: from aspmx1.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp1 with LMTPS id QPJmOSATPV+tWAAAbx9fmQ (envelope-from ) for ; Wed, 19 Aug 2020 11:55:12 +0000 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 9760C940776 for ; Wed, 19 Aug 2020 11:55:12 +0000 (UTC) Received: from localhost ([::1]:59566 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1k8MgR-000131-9H for larch@yhetil.org; Wed, 19 Aug 2020 07:55:11 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:59400) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1k8MgI-00012b-40 for guix-patches@gnu.org; Wed, 19 Aug 2020 07:55:02 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:55036) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1k8MgH-0004k0-QZ for guix-patches@gnu.org; Wed, 19 Aug 2020 07:55:01 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1k8MgH-0000cF-Pe for guix-patches@gnu.org; Wed, 19 Aug 2020 07:55:01 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#42928] [PATCH 1/2] gnu: qttools: Install desktop files and icons. References: <87zh6qn9bp.fsf@araneo.si> In-Reply-To: <87zh6qn9bp.fsf@araneo.si> Resent-From: Timotej Lazar Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Wed, 19 Aug 2020 11:55:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 42928 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 42928@debbugs.gnu.org Cc: Timotej Lazar Received: via spool by 42928-submit@debbugs.gnu.org id=B42928.15978380642303 (code B ref 42928); Wed, 19 Aug 2020 11:55:01 +0000 Received: (at 42928) by debbugs.gnu.org; 19 Aug 2020 11:54:24 +0000 Received: from localhost ([127.0.0.1]:38345 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1k8Mff-0000b5-Sg for submit@debbugs.gnu.org; Wed, 19 Aug 2020 07:54:24 -0400 Received: from araneo.si ([90.157.193.204]:35690) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1k8Mfd-0000aw-Ul for 42928@debbugs.gnu.org; Wed, 19 Aug 2020 07:54:22 -0400 Received: from araneo.si (localhost.lan [127.0.0.1]) by araneo.si (OpenSMTPD) with ESMTP id 44b907ee for <42928@debbugs.gnu.org>; Wed, 19 Aug 2020 11:54:20 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=araneo.si; h=from:to:cc :subject:date:message-id:mime-version:content-transfer-encoding; s=20180623; bh=SbKgmRIjeWYELnpb94fwZywxUMU=; b=qljAE0Ff1+sf3+XA 7cenfjqkv8rgyD+hciJ02wfQkBAzkkBI1NEgLCrP3fLvQjNx0ctKtIXrLJ1xTDhW 9+L41HXyglTW48lD6/AI/XChgEqLC2wmJXpY/ZKPQvbEIarzisuPTy8fwi09FQOa uvN9zF7VpzDosEaSBFAK66RAu2sSiOxmIqsDiYhHrIZvhI4FZpYbJhaaZMz8a8UA nvK6+z7aTy/mg0MIKhHdEpgW5GDoSgVZn5k5pePULshC/Z6heQDrlut3720Ub+W/ DHtu0hwyLQPsshTpeS+2GYnnCRz0K5sn52vcIkbosmorRaY7W3Q71brreKUu+n1d 4hOhyA== Received: by araneo.si (OpenSMTPD) with ESMTPSA id 4b6a6952 (TLSv1.3:TLS_AES_256_GCM_SHA384:256:NO); Wed, 19 Aug 2020 11:54:20 +0000 (UTC) From: Timotej Lazar Date: Wed, 19 Aug 2020 13:53:17 +0200 Message-Id: <20200819115318.5655-1-timotej.lazar@araneo.si> X-Mailer: git-send-email 2.28.0 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Score: -0.0 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-Spam-Score: -1.0 (-) 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" X-Scanner: scn0 Authentication-Results: aspmx1.migadu.com; dkim=fail (rsa verify failed) header.d=araneo.si header.s=20180623 header.b=qljAE0Ff; dmarc=fail reason="SPF not aligned (relaxed)" header.from=araneo.si (policy=none); spf=pass (aspmx1.migadu.com: domain of guix-patches-bounces@gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=guix-patches-bounces@gnu.org X-Spam-Score: 5.09 X-TUID: 3AmNitOGBdvr * gnu/packages/qt.scm (qttools)[phases]: Add 'install-desktop-files. --- gnu/packages/qt.scm | 62 ++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 61 insertions(+), 1 deletion(-) diff --git a/gnu/packages/qt.scm b/gnu/packages/qt.scm index ee903ecae9..4ca9786d8b 100644 --- a/gnu/packages/qt.scm +++ b/gnu/packages/qt.scm @@ -1185,7 +1185,67 @@ positioning and geolocation plugins."))) "1iakl3hlyg51ri1czmis8mmb257b0y1zk2a2knybd3mq69wczc2v")))) (arguments (substitute-keyword-arguments (package-arguments qtsvg) - ((#:tests? _ #f) #f))) ; TODO: Enable the tests + ((#:tests? _ #f) #f) ; TODO: Enable the tests + ((#:phases phases) + `(modify-phases ,phases + (add-after 'install 'install-desktop-files + (lambda* (#:key outputs #:allow-other-keys) + (let* ((out (assoc-ref outputs "out")) + (apps (string-append out "/share/applications")) + (icons (string-append out "/share/icons/hicolor"))) + ;; Install icons. + (with-directory-excursion "src" + (for-each + (lambda (icon) + ;; Get name and size from the slightly inconsistent filenames. + (let* ((parts (string-split (basename icon ".png") #\-)) + (name (car parts)) + (size (if (> (length parts) 1) (cadr parts) "32")) + (dest (string-append icons "/" size "x" size "/apps"))) + (mkdir-p dest) + (copy-file icon (string-append dest "/" name ".png")))) + '("assistant/assistant/images/assistant.png" + "assistant/assistant/images/assistant-128.png" + "designer/src/designer/images/designer.png" + "linguist/linguist/images/icons/linguist-16-32.png" + "linguist/linguist/images/icons/linguist-32-32.png" + "linguist/linguist/images/icons/linguist-48-32.png" + "linguist/linguist/images/icons/linguist-64-32.png" + "linguist/linguist/images/icons/linguist-128-32.png" + "qdbus/qdbusviewer/images/qdbusviewer.png" + "qdbus/qdbusviewer/images/qdbusviewer-128.png"))) + ;; Install desktop files. + (make-desktop-entry-file + (string-append apps "/assistant.desktop") + #:name "Qt Assistant" + #:comment "Browse Qt documentation and examples" + #:exec "assistant" + #:icon "assistant" + #:categories '("Qt" "Development" "Documentation")) + (make-desktop-entry-file + (string-append apps "/designer.desktop") + #:name "Qt Designer" + #:comment "Design GUIs for Qt applications" + #:exec "designer" + #:icon "designer" + #:categories '("Qt" "Development" "GUIDesigner") + #:mime-type '("application/x-designer")) + (make-desktop-entry-file + (string-append apps "/linguist.desktop") + #:name "Qt Linguist" + #:comment "Translate Qt applications" + #:exec "linguist" + #:icon "linguist" + #:categories '("Qt" "Development" "Translation") + #:mime-type '("application/x-linguist")) + (make-desktop-entry-file + (string-append apps "/qdbusviewer.desktop") + #:name "Qt D-Bus viewer" + #:comment "Browse D-Bus objects and messages" + #:exec "qdbusviewer" + #:icon "qdbusviewer" + #:categories '("Qt" "Development"))) + #t)))))) (native-inputs `(("perl" ,perl) ("qtdeclarative" ,qtdeclarative) -- 2.28.0