From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp2 ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms0.migadu.com with LMTPS id AJ7rDDmwNmEJBgAAgWs5BA (envelope-from ) for ; Tue, 07 Sep 2021 02:20:09 +0200 Received: from aspmx1.migadu.com ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp2 with LMTPS id 4KiMCDmwNmGsZQAAB5/wlQ (envelope-from ) for ; Tue, 07 Sep 2021 00:20:09 +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 B58AF1A43B for ; Tue, 7 Sep 2021 02:20:07 +0200 (CEST) Received: from localhost ([::1]:59990 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mNOqM-0002aB-N5 for larch@yhetil.org; Mon, 06 Sep 2021 20:20:06 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:58156) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mNOqI-0002a0-Bv for guix-patches@gnu.org; Mon, 06 Sep 2021 20:20:02 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:43219) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mNOqH-0001k2-Tf for guix-patches@gnu.org; Mon, 06 Sep 2021 20:20:02 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1mNOqH-0003RO-ON for guix-patches@gnu.org; Mon, 06 Sep 2021 20:20:01 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#50442] [PATCH] gnu: xygrib: Fix finding resources in the data directory Resent-From: Thiago Jung Bauermann Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Tue, 07 Sep 2021 00:20:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 50442 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 50442@debbugs.gnu.org Cc: Thiago Jung Bauermann X-Debbugs-Original-To: guix-patches@gnu.org Received: via spool by submit@debbugs.gnu.org id=B.163097396813180 (code B ref -1); Tue, 07 Sep 2021 00:20:01 +0000 Received: (at submit) by debbugs.gnu.org; 7 Sep 2021 00:19:28 +0000 Received: from localhost ([127.0.0.1]:54765 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mNOpe-0003QR-A5 for submit@debbugs.gnu.org; Mon, 06 Sep 2021 20:19:28 -0400 Received: from lists.gnu.org ([209.51.188.17]:34596) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mNOpd-0003QK-9Z for submit@debbugs.gnu.org; Mon, 06 Sep 2021 20:19:21 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:57882) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mNOpc-0002Ar-DL for guix-patches@gnu.org; Mon, 06 Sep 2021 20:19:20 -0400 Received: from mx.kolabnow.com ([95.128.36.41]:11724) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mNOpY-00014n-Vn for guix-patches@gnu.org; Mon, 06 Sep 2021 20:19:19 -0400 Received: from localhost (unknown [127.0.0.1]) by ext-mx-out002.mykolab.com (Postfix) with ESMTP id EBE41E4A for ; Tue, 7 Sep 2021 02:19:13 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kolabnow.com; h= content-transfer-encoding:content-type:content-type:mime-version :message-id:date:date:subject:subject:from:from:received :received:received; s=dkim20160331; t=1630973952; x=1632788353; bh=2K9QW1p0XDyCZDg1oahnQxQ8rmUsiU/3uBJLERCL7GE=; b=e1/iuRllKCXs xLejb/Vanj+SxWluAILr8JM/nLLBqu6Rfo210lX/0ngTQl6EI6Z4JV9N88IpG8Z4 2B6sIUm/HQAMoAFt6mq6Jo51XA6OTe8IUF+AMLvm/jHs2wTORnvRmtqHPXuRCXEs uPbzeadG35wu0iO8OqQ1DzuCSC3jGb2d6S8xpUNPKFryPBAU6IYZvcJk0IG/8RXw 8t04mhkL2PJNkIUQ/k45zH5AFSc5CDf83FcbDLqLAooMgOVlqD0ex7ms7Ku2tcmG Gw6B5dK1j1tvFlUFES69ZhhVuGaoYGOYs8Ydy/f6089b2QhENH11/8T71q4Q3M/p xyJWehXnUTDBwXLnAtwi3W3blchJBlBs6eOYFFqly+j55Oey0TrKrNVNSsaxcb91 I1aO91CfwONceCjGTBnFqHDSyxV5pKssFsEFkGYZ0jPQzijYFtAbiIwGxzLZSLOn LZahE7w1HkkgM8T873ucMx+YRgsluDMA5k7Lnh2BnsDIqXVwkfMDCZLZhf/+4bCn P8LSbXD9rfcb3Opi/ZMzP9NX5QIbNsT2h0/DdCdTByYtEjOIJHAzZ/GivuxA+98m fehzQ9OYXMJfj74bFYyavuCds7043M6CBOksCemtTW8GliNa/JTpjrOv4PLjwydD 3848WAJutmcZ/Ntq9FhKZhzH+xM4HmY= X-Virus-Scanned: amavisd-new at mykolab.com Received: from mx.kolabnow.com ([127.0.0.1]) by localhost (ext-mx-out002.mykolab.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id aSDaAX6a7WNB for ; Tue, 7 Sep 2021 02:19:12 +0200 (CEST) Received: from int-mx002.mykolab.com (unknown [10.9.13.2]) by ext-mx-out002.mykolab.com (Postfix) with ESMTPS id D54176A1 for ; Tue, 7 Sep 2021 02:19:11 +0200 (CEST) Received: from ext-subm003.mykolab.com (unknown [10.9.6.3]) by int-mx002.mykolab.com (Postfix) with ESMTPS id 312203BBB; Tue, 7 Sep 2021 02:19:10 +0200 (CEST) Date: Mon, 6 Sep 2021 21:18:57 -0300 Message-Id: <20210907001857.141403-1-bauermann@kolabnow.com> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Received-SPF: pass client-ip=95.128.36.41; envelope-from=bauermann@kolabnow.com; helo=mx.kolabnow.com X-Spam_score_int: -3 X-Spam_score: -0.4 X-Spam_bar: / X-Spam_report: (-0.4 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, URIBL_SBL=1.623, URIBL_SBL_A=0.1 autolearn=no autolearn_force=no X-Spam_action: no action 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" Reply-to: Thiago Jung Bauermann X-ACL-Warn: , Thiago Jung Bauermann via Guix-patches From: Thiago Jung Bauermann via Guix-patches via X-Migadu-Flow: FLOW_IN ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1630974008; h=from:from:sender:sender:reply-to: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-cc: resent-from:resent-sender:resent-message-id:list-id:list-help: list-unsubscribe:list-subscribe:list-post:dkim-signature; bh=2K9QW1p0XDyCZDg1oahnQxQ8rmUsiU/3uBJLERCL7GE=; b=DaJGzxKs8R8QEKE0hKwneQ+NsvHCXIc6Voifcw08GwxTKUHqyBvcYwLvI9N0MDRikorTWt SU3jGteA4aFuIgwPIEH8qAT5vt2ZpFmrS/hVIxTRGhe2XTUtQAJN3EbK93OUQTK+Jz10Ow Jz5jBwGvCz5lme6DqrwY+oJQr2SKzzSaEtEYfWLGDhrhOiVLz/jwcio69Y8m7l/cJVAVRm 0bVIk5tsYaykqdJKIa51lzFM7jspQvqrZA1VDEagXT4tz5I9m7xjf0Uow2diHf9cleBxBh EgD2lpwmLbe4XyfoCdtm9zm3Rt5L/gnrC3A5c5t5w5LQnEMprLpSZtA52a78MA== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1630974008; a=rsa-sha256; cv=none; b=AuavkHcawYyEOwSxbCOL1QjgXZYBJ3JwFJ3cLWDKfY6BBH6H2fAm6WnMzPO18hehoU927L qH0OEMzOOzLzLlU7ZWHIhVDrFuJ2h0vw8aqsnlYhXn+/ChK2yjcnwwHeZ2RCj+QHACd4Ft LjA8AEJYQK11XqMw2aIuKsWQTt6SvJd4ubd4fdmLSPzjuh6rBQTJ/iSJjMq3WHvZzSDxAw R0t2vUlBZrJPSmStRtq6AsJdLTfzOcqQc3mk7Iv44m0CybN2QchHgRbllRDLlkJ3YuwNQx 2/+TNWjF+pjxfRSKkSRiPs3STZThD7buSuTfARTkexvWRGzQYhtTNnBwBFmIdg== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=kolabnow.com header.s=dkim20160331 header.b="e1/iuRll"; 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-Migadu-Spam-Score: -2.92 Authentication-Results: aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=kolabnow.com header.s=dkim20160331 header.b="e1/iuRll"; dmarc=pass (policy=none) header.from=gnu.org; 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-Migadu-Queue-Id: B58AF1A43B X-Spam-Score: -2.92 X-Migadu-Scanner: scn0.migadu.com X-TUID: Di32yE9q8WGQ Currently, if you start up XyGrib it will not show icons in the toolbar buttons, translated strings in the UI nor the map in the main view. These are all items stored in the data directory, which XyGrib can’t find. Backport upstream PR 235 which makes it use XDG directories correctly. As a bonus, the PR also contains a fix to find libjpeg, so we don’t need the substitution for that anymore. * gnu/packages/patches/xygrib-fix-finding-data.patch: New file. * gnu/local.mk (dist_patch_DATA): Add it. * gnu/packages/geo.scm (xygrib)[source]: Use it. [arguments]<#:configure-flags>: Pass ‘-DGNU_PACKAGE=ON’. [arguments]<#:phases>{patch-directories}: Remove fix to find libjpeg. Remove trailing ‘#t’. [native-search-paths]: Add ‘XDG_DATA_DIRS’. --- Hi, This patch isn’t related to either powerpc64le-linux nor ‘core-updates-frozen’, for a change. :-) gnu/local.mk | 1 + gnu/packages/geo.scm | 22 +-- .../patches/xygrib-fix-finding-data.patch | 125 ++++++++++++++++++ 3 files changed, 140 insertions(+), 8 deletions(-) create mode 100644 gnu/packages/patches/xygrib-fix-finding-data.patch diff --git a/gnu/local.mk b/gnu/local.mk index f848a8c61fdd..a3c5f7344489 100644 --- a/gnu/local.mk +++ b/gnu/local.mk @@ -1897,6 +1897,7 @@ dist_patch_DATA = \ %D%/packages/patches/xsane-fix-snprintf-buffer-length.patch \ %D%/packages/patches/xsane-support-ipv6.patch \ %D%/packages/patches/xsane-tighten-default-umask.patch \ + %D%/packages/patches/xygrib-fix-finding-data.patch \ %D%/packages/patches/yggdrasil-extra-config.patch \ %D%/packages/patches/ytfzf-programs.patch \ %D%/packages/patches/ytfzf-updates.patch \ diff --git a/gnu/packages/geo.scm b/gnu/packages/geo.scm index bf864f246c0c..bbf7bb166a54 100644 --- a/gnu/packages/geo.scm +++ b/gnu/packages/geo.scm @@ -1228,6 +1228,12 @@ map display. Downloads map data from a number of websites, including (url "https://github.com/opengribs/XyGrib") (commit (string-append "v" version)))) (file-name (git-file-name name version)) + (patches (search-patches + ;; Fix finding resources such as icons, maps and + ;; translations installed in the data directory. This + ;; patch has been merged upstream and can be removed + ;; with the next release. + "xygrib-fix-finding-data.patch")) (sha256 (base32 "0xzsm8pr0zjk3f8j880fg5n82jyxn8xf1330qmmq1fqv7rsrg9ia")) @@ -1242,18 +1248,15 @@ map display. Downloads map data from a number of websites, including #t)))) (build-system cmake-build-system) (arguments - `(#:phases + `(#:configure-flags (list "-DGNU_PACKAGE=ON") + + #:phases (modify-phases %standard-phases (add-after 'unpack 'patch-directories (lambda* (#:key inputs #:allow-other-keys) (let ((jpeg (assoc-ref inputs "openjpeg")) (font (assoc-ref inputs "font-liberation"))) (substitute* "CMakeLists.txt" - ;; Find libjpeg. - (("/usr") jpeg) - ;; Fix install locations. - (("set\\(PREFIX_BIN.*") "set(PREFIX_BIN \"bin\")\n") - (("set\\(PREFIX_PKGDATA.*") "set(PREFIX_PKGDATA \"share/${PROJECT_NAME}\")\n") ;; Skip looking for the static library. (("\"libnova.a\"") "")) ;; Don't use the bundled font-liberation. @@ -1262,8 +1265,7 @@ map display. Downloads map data from a number of websites, including (string-append "\"" font "/share/fonts/truetype/\""))) (substitute* "src/util/Util.h" (("pathData\\(\\)\\+\"data/fonts/\"") - (string-append "\"" font "/share/fonts/\"")))) - #t))) + (string-append "\"" font "/share/fonts/\""))))))) #:tests? #f)) ; no tests (native-inputs `(("qttools" ,qttools))) @@ -1276,6 +1278,10 @@ map display. Downloads map data from a number of websites, including ("proj.4" ,proj.4) ("qtbase" ,qtbase-5) ("zlib" ,zlib))) + (native-search-paths + (list (search-path-specification + (variable "XDG_DATA_DIRS") + (files '("share"))))) (synopsis "Weather Forecast Visualization") (description "XyGrib is a Grib file reader and visualizes meteorological data providing diff --git a/gnu/packages/patches/xygrib-fix-finding-data.patch b/gnu/packages/patches/xygrib-fix-finding-data.patch new file mode 100644 index 000000000000..f712153061a1 --- /dev/null +++ b/gnu/packages/patches/xygrib-fix-finding-data.patch @@ -0,0 +1,125 @@ +This i a backport of the commits in PR 235 (“Fixes for packaging on +linux-like systems”), which was merged upstream: + +https://github.com/opengribs/XyGrib/pull/235 + +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 64059ab65dae..00cc5d6aea6f 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -7,6 +7,9 @@ set(VERSION_PATCH 6) + set(XYGRIB_VERSION "${VERSION_MAJOR}.${VERSION_MINOR}.${VERSION_PATCH}") + set(XYGRIB_VERSION_DATE "2019-07-05") + ++option(GNU_PACKAGE "Install into GNU standard directories" OFF) ++option(GEN_TRANSLATIONS "Generate translations" ON) ++ + set(CMAKE_VERBOSE_MAKEFILE ON) + + # Find includes in corresponding build directories +@@ -25,7 +28,7 @@ set(CMAKE_INCLUDE_CURRENT_DIR ON) + set(CMAKE_CXX_STANDARD 11) + #set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -O3") + if(UNIX AND NOT APPLE) +-set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -fPIC") ++add_compile_options(-Wall -fPIC) + endif() + + # Add support for address etc sanitizers, part 1/2 (other half after ADD_EXECUTABLE) +@@ -108,17 +111,12 @@ find_path(OPENJPEG_INCLUDE_DIR + ~/Library/Frameworks/include + /Library/Frameworks/include + /usr/local/include +- /usr/local/include/openjpeg-2.3 +- /usr/include/openjpeg-2.3 +- /usr/local/include/openjpeg-2.1 +- /usr/include/openjpeg-2.1 +- /usr/local/include/openjpeg-2.2 +- /usr/include/openjpeg-2.2 + /usr/include + /sw/include # Fink + /opt/local/include # DarwinPorts + /opt/csw/include # Blastwave + /opt/include ++ PATH_SUFFIXES openjpeg-2.3 openjpeg-2.2 openjpeg-2.1 + REQUIRED + ) + include_directories(${OPENJPEG_INCLUDE_DIR}) +@@ -212,22 +210,24 @@ include_directories(${PNG_INCLUDE_DIR}) + configure_file(cmake/Version.h.in ${CMAKE_CURRENT_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/include/Version.h) + include_directories(${CMAKE_CURRENT_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/include) + +-if(APPLE) +-set(PREFIX_BIN ${PROJECT_NAME}) +-set(PREFIX_PKGDATA ${PROJECT_NAME}) +-endif() +-if(WIN32) +-set(PREFIX_BIN ".") +-set(PREFIX_PKGDATA ".") +-endif() +-if(UNIX AND NOT APPLE) +-# This is not exactly a good idea on linux - the code should be changed so that the executable would go to /usr/local/bin and the data to /usr/local/share/XyGrib +-set(PREFIX_BIN ${PROJECT_NAME}) +-set(PREFIX_PKGDATA ${PROJECT_NAME}) ++if(GNU_PACKAGE) ++ include(GNUInstallDirs) ++ set(PREFIX_BIN ${CMAKE_INSTALL_FULL_BINDIR}) ++ set(PREFIX_PKGDATA ${CMAKE_INSTALL_FULL_DATADIR}/openGribs/${PROJECT_NAME}) ++else() ++ if(WIN32) ++ set(PREFIX_BIN ".") ++ set(PREFIX_PKGDATA ".") ++ else() ++ set(PREFIX_BIN ${PROJECT_NAME}) ++ set(PREFIX_PKGDATA ${PROJECT_NAME}) ++ endif() + endif() + + add_subdirectory(src) +-add_subdirectory(data/tr) ++if(GEN_TRANSLATIONS) ++ add_subdirectory(data/tr) ++endif() + + # Installation + # macOS bundle parameters +@@ -241,4 +241,14 @@ set_target_properties(${PROJECT_NAME} PROPERTIES MACOSX_BUNDLE_SHORT_VERSION_STR + set_target_properties(${PROJECT_NAME} PROPERTIES MACOSX_BUNDLE_BUNDLE_VERSION "${XYGRIB_VERSION}") + set_target_properties(${PROJECT_NAME} PROPERTIES MACOSX_BUNDLE_COPYRIGHT "${PROJECT_NAME} Authors") + # Install data +-install(DIRECTORY data DESTINATION ${PREFIX_PKGDATA}) ++install(DIRECTORY data DESTINATION ${PREFIX_PKGDATA} ++ PATTERN "CMakeFiles" EXCLUDE ++ PATTERN "CMakeLists.txt" EXCLUDE ++ PATTERN "Makefile" EXCLUDE ++ PATTERN "cmake_install.cmake" EXCLUDE) ++if(GNU_PACKAGE) ++ install(FILES debian/xygrib.desktop ++ DESTINATION ${CMAKE_INSTALL_FULL_DATADIR}/applications) ++ install(FILES debian/xygrib.png ++ DESTINATION ${CMAKE_INSTALL_FULL_DATADIR}/pixmaps) ++endif() +diff --git a/INSTALL.md b/INSTALL.md +index 2c9d3ab4da03..1190cc780182 100644 +--- a/INSTALL.md ++++ b/INSTALL.md +@@ -22,7 +22,19 @@ https://gihub.com/opengribs/XyGrib/releases or on https://opengribs.org in the d + - openSUSE Tumbleweed: `sudo zypper install gcc git cmake libqt5-qtbase-devel libpng-devel openjpeg2-devel libnova-devel libproj-devel zlib-devel libbz2-devel + + ## Build and package ++### Options + ++XyGrib has two CMake options ++- GNU_PACKAGE (DEFAULT: OFF) ++``` ++Files will be installed in GNU standard installation directories such as prefix/bin and prefix/share. ++Packagers are recommended to test this option. ++``` ++- GEN_TRANSLATION (DEFAULT: ON) ++``` ++Create targets to generate translation files. ++Turning this off removes the need for qt-linguist, part of qttools qt5 submodule, during build. ++``` + ### macOS + + - Get the source