From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp10.migadu.com ([2001:41d0:306:2d92::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms9.migadu.com with LMTPS id IDb2K55J6mS87wAAG6o9tA:P1 (envelope-from ) for ; Sat, 26 Aug 2023 20:51:10 +0200 Received: from aspmx1.migadu.com ([2001:41d0:306:2d92::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp10.migadu.com with LMTPS id IDb2K55J6mS87wAAG6o9tA (envelope-from ) for ; Sat, 26 Aug 2023 20:51:10 +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 305553CB65 for ; Sat, 26 Aug 2023 20:51:10 +0200 (CEST) Authentication-Results: aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=disroot.org header.s=mail header.b=SrgemXZR; 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=pass (policy=none) header.from=gnu.org ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1693075870; h=from:from:sender:sender:reply-to:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding:resent-cc: 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=u4FxROUZPEZPStrHCal1RBh2o+U31AYRBcW3I+EyKDE=; b=f6V76sLUax+RbeSCMhKr0ea4fnzRAKDSeUu7g/AcH4B+pTya9EU/ypm1uhHq8F/pOChpe6 Ff+mtyyw6Gz7Ct4Mr0KKeL/c4Xv4gb2wVCNadPh6C4Gp+xKMIHuCurHaEK+dYxkJLxcYMO ehHGKegWYL9w9LCJJaxz2+cPmQvwrp7LvXkdFgwabJhVl/chnfZ6paL9LbxorQ0/0nHoWf 5E/Ds5xfdYrzZpNa5FxRZCaJy7c1IzrqT9uGI6Tmj3WQyCGwmj6Sldtw1G445onocSCfRW A+40UoWCCKbyIiluAJYEMHayBAcmzA0PZzxwBRa7dTqI0/LHsPuPvGa1EhM0GQ== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=disroot.org header.s=mail header.b=SrgemXZR; 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=pass (policy=none) header.from=gnu.org ARC-Seal: i=1; s=key1; d=yhetil.org; t=1693075870; a=rsa-sha256; cv=none; b=bhZnXXwzsC0UAVAB0/hD+sYHjQOyqKod9A98Zews0r0rVsPVc7kCb5giDcyUN+4A8dPWKM 5ynDcWTbBlzSjv66dwu+XBNnuh1G2FlCnfCHtGkSrbQVMWMRD+hV3tWU7FHqnie7H6dU17 kFUhsarpIXSPaQ6PDm8DKbV6HfDsDtQm6IVaBp2fZngeNKsl7wCLfcfeq/W88vi5B61xgl erzMZusSX3/VCk+5BHSMICxSb20YI/sJ9j3yoWOW/J8ab2EHff86JpMR7Erx3get77bfxL bXCpwhe91Cwp/lXmQwV1OGe/htIwL2gH02rQncNzHmxuFoCVdL0kGp2/LE8QiQ== Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qZyN8-0002Ro-Ub; Sat, 26 Aug 2023 14:50:58 -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 1qZyN6-0002Rf-Jg for guix-patches@gnu.org; Sat, 26 Aug 2023 14:50:57 -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 1qZyN6-0006OK-BN for guix-patches@gnu.org; Sat, 26 Aug 2023 14:50:56 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1qZyNB-0007S8-KJ for guix-patches@gnu.org; Sat, 26 Aug 2023 14:51:01 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#65553] [PATCH 1/6] gnu: Add arrayfire-glad. References: In-Reply-To: Resent-From: Adam Faiz Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Sat, 26 Aug 2023 18:51:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 65553 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 65553@debbugs.gnu.org Received: via spool by 65553-submit@debbugs.gnu.org id=B65553.169307585128627 (code B ref 65553); Sat, 26 Aug 2023 18:51:01 +0000 Received: (at 65553) by debbugs.gnu.org; 26 Aug 2023 18:50:51 +0000 Received: from localhost ([127.0.0.1]:43403 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qZyN0-0007Rd-6Y for submit@debbugs.gnu.org; Sat, 26 Aug 2023 14:50:50 -0400 Received: from layka.disroot.org ([178.21.23.139]:53016) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qZyMy-0007RV-CH for 65553@debbugs.gnu.org; Sat, 26 Aug 2023 14:50:49 -0400 Received: from localhost (localhost [127.0.0.1]) by disroot.org (Postfix) with ESMTP id 6144541312 for <65553@debbugs.gnu.org>; Sat, 26 Aug 2023 20:50:42 +0200 (CEST) X-Virus-Scanned: SPAM Filter at disroot.org Received: from layka.disroot.org ([127.0.0.1]) by localhost (disroot.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id Bvi44GwjjpQW for <65553@debbugs.gnu.org>; Sat, 26 Aug 2023 20:50:40 +0200 (CEST) Message-ID: <3e855e76-45ce-bf7d-9ba5-bbe6a7e2072a@disroot.org> DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=disroot.org; s=mail; t=1693075840; bh=ug08FLpnZrYGWJdBTifS2kGkXd4vgR1+PfMj1vJVBQQ=; h=Date:To:From:Subject; b=SrgemXZRgXTsf8jiM+ztX0Mo+tMf5jqQTmSGQGiOzrsErkyEyOS4TaoZqMo0iCQF/ T01as1RrRdBWE25UzQGKH8HgeL7HrlIp5XIK/ThtLkG9EOFws9nVbPpA7NeCEeDMCU uVfvFjIYTcfOLluHo1fKLEDq8hzo1PZtkZOdsSVu/UT0Uyk43isycwi6b+wNbqiJs/ zxXOLSQKnFsV1vx62qg0Vd1LN4Ao4+JRBM29i6r/jRRqKqgNwR0WPGNjdYgjWcccZH JU/QMid19QrPC/U1fwEqXBbrNM9tirVOhK1O+l8WUT066XGHg7Smhmrj9rH1Y14i9Z naH7tociQjxjg== Date: Sun, 27 Aug 2023 02:50:37 +0800 MIME-Version: 1.0 Content-Language: en-US Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit 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: , Reply-to: Adam Faiz X-ACL-Warn: , Adam Faiz via Guix-patches From: Adam Faiz via Guix-patches via 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-Migadu-Scanner: mx2.migadu.com X-Migadu-Spam-Score: -3.71 X-Spam-Score: -3.71 X-Migadu-Queue-Id: 305553CB65 X-TUID: TekW8ep0PfpG >From 668b7978a7dd2e6daece5209621601575eaad900 Mon Sep 17 00:00:00 2001 Message-ID: <668b7978a7dd2e6daece5209621601575eaad900.1693075221.git.adam.faiz@disroot.org> In-Reply-To: References: From: AwesomeAdam54321 Date: Sun, 27 Aug 2023 01:59:48 +0800 Subject: [PATCH 1/6] gnu: Add arrayfire-glad. * gnu/packages/patches/arrayfire-glad-add-packaging-support.patch: New file. * gnu/local.mk (dist_patch_DATA): Register it here. * gnu/packages/gl.scm (arrayfire-glad): New variable. --- gnu/local.mk | 1 + gnu/packages/gl.scm | 42 +++++ ...arrayfire-glad-add-packaging-support.patch | 145 ++++++++++++++++++ 3 files changed, 188 insertions(+) create mode 100644 gnu/packages/patches/arrayfire-glad-add-packaging-support.patch diff --git a/gnu/local.mk b/gnu/local.mk index adda02d410..3c1f7665ff 100644 --- a/gnu/local.mk +++ b/gnu/local.mk @@ -902,6 +902,7 @@ dist_patch_DATA = \ %D%/packages/patches/akonadi-not-relocatable.patch \ %D%/packages/patches/akonadi-timestamps.patch \ %D%/packages/patches/allegro-mesa-18.2.5-and-later.patch \ + %D%/packages/patches/arrayfire-glad-add-packaging-support.patch \ %D%/packages/patches/ibus-anthy-fix-tests.patch \ %D%/packages/patches/ibus-table-paths.patch \ %D%/packages/patches/anki-mpv-args.patch \ diff --git a/gnu/packages/gl.scm b/gnu/packages/gl.scm index b53b42a9ba..7476aba06f 100644 --- a/gnu/packages/gl.scm +++ b/gnu/packages/gl.scm @@ -108,6 +108,48 @@ (define-public glu as ASCII text.") (license (license:x11-style "http://directory.fsf.org/wiki/License:SGIFreeBv2")))) +(define-public arrayfire-glad + (let ((commit "ef8c5508e72456b714820c98e034d9a55b970650") + (revision "0")) + (package + (name "arrayfire-glad") + (version (git-version "0" revision commit)) + (source + (origin + (method git-fetch) + (uri (git-reference + (url "https://github.com/arrayfire/glad.git") + (commit commit))) + (sha256 + (base32 "0yln2mrymhb6ni6gb1vc0vrzbrkzmsxk7wyvbgqlv16bnmrmxmdv")) + (patches (search-patches "arrayfire-glad-add-packaging-support.patch")) + (modules '((guix build utils))) + (snippet + #~(begin + (substitute* "CMakeLists.txt" + (("OBJECT") "SHARED") + (("af_glad_obj_lib") "glad") + (("target_include_directories.*)\n" all) + (string-append all "\n\n" + "configure_file(glad.pc.in glad.pc @ONLY)\n" + "install(DIRECTORY include/\n" + "DESTINATION include/)\n" + "\n\n" + "install(TARGETS glad\n" + "DESTINATION lib/)\n" + "install(FILES ${CMAKE_CURRENT_BINARY_DIR}/glad.pc\n" + "DESTINATION lib/pkgconfig/)\n" + "install(FILES gladConfig.cmake\n" + "DESTINATION lib/cmake/glad/)\n"))))) + (file-name (git-file-name name version)))) + (build-system cmake-build-system) + (arguments + (list #:tests? #f)) ; no tests + (home-page "https://github.com/arrayfire/glad") + (synopsis "OpenGL(3.3) Loader Library") + (description "OpenGL(3.3) Loader Library, a dependency of ArrayFire.") + (license license:bsd-3)))) + (define-public freeglut (package (name "freeglut") diff --git a/gnu/packages/patches/arrayfire-glad-add-packaging-support.patch b/gnu/packages/patches/arrayfire-glad-add-packaging-support.patch new file mode 100644 index 0000000000..a7591eee7b --- /dev/null +++ b/gnu/packages/patches/arrayfire-glad-add-packaging-support.patch @@ -0,0 +1,145 @@ +From ceaa23fd1834ad56fe5f74d544b650be9a55360b Mon Sep 17 00:00:00 2001 +From: AwesomeAdam54321 +Date: Sat, 26 Aug 2023 16:38:13 +0800 +Subject: [PATCH] glad: Add package configuration files. + +* glad.pc.in: Add pkg-config file. +* gladConfig.cmake: Add CMake package file for detection by external packages. +--- + glad.pc.in | 11 +++++ + gladConfig.cmake | 104 +++++++++++++++++++++++++++++++++++++++++++++++ + 2 files changed, 115 insertions(+) + create mode 100644 glad.pc + create mode 100644 gladConfig.cmake + +diff --git a/glad.pc.in b/glad.pc.in +new file mode 100644 +index 0000000..5c29fcd +--- /dev/null ++++ b/glad.pc.in +@@ -0,0 +1,11 @@ ++prefix=@CMAKE_INSTALL_PREFIX@ # this defines a variable ++exec_prefix=${prefix} # defining another variable with a substitution ++libdir=${exec_prefix}/lib ++includedir=${prefix}/include ++ ++Name: glad ++Description: OpenGL(3.3) Loader Library ++Version: 0 ++URL: https://github.com/arrayfire/glad ++Libs: -L${libdir} -lglad ++Cflags: -I${includedir}/glad +\ No newline at end of file +diff --git a/gladConfig.cmake b/gladConfig.cmake +new file mode 100644 +index 0000000..1213d3e +--- /dev/null ++++ b/gladConfig.cmake +@@ -0,0 +1,104 @@ ++# Finds the glad libraries ++# ++# Sets the following variables: ++# glad_FOUND ++# glad_INCLUDE_DIR ++# glad_DYNAMIC_LIBRARY ++# glad_STATIC_LIBRARY ++# ++# Usage: ++# find_package(glad) ++# if (glad_FOUND) ++# target_link_libraries(mylib PRIVATE glad::glad) ++# endif (glad_FOUND) ++# ++# OR if you want to link against the static library: ++# ++# find_package(glad) ++# if (glad_FOUND) ++# target_link_libraries(mylib PRIVATE glad::glad_STATIC) ++# endif (glad_FOUND) ++# ++# NOTE: You do not need to include the glad include directories since they ++# will be included as part of the target_link_libraries command ++ ++set(PX ${CMAKE_STATIC_LIBRARY_PREFIX}) ++set(SX ${CMAKE_STATIC_LIBRARY_SUFFIX}) ++ ++# use pkg-config to get the directories and then use these values ++# in the find_path() and find_library() calls ++if (NOT WIN32) ++ find_package(PkgConfig) ++ pkg_check_modules(gladPkg REQUIRED glad) ++endif (NOT WIN32) ++ ++find_path(glad_INCLUDE_DIR ++ NAMES glad.h ++ PATHS ++ /usr/include ++ /usr/local/include ++ /sw/include ++ /opt/local/include ++ HINTS ++ ${gladPkg_INCLUDE_DIRS} # Generated by pkg-config ++ ) ++ ++find_library(glad_DYNAMIC_LIBRARY ++ NAMES glad fontconfig ${gladPkg_LIBRARY} ++ PATHS ++ /usr/local ++ /usr/X11 ++ /usr ++ /sw ++ /opt/local ++ /usr/lib/x86_64-linux-gnu ++ HINTS ++ ${gladPkg_LIBRARY_DIRS} # Generated by pkg-config ++ PATH_SUFFIXES ++ lib64 ++ lib ++ ) ++ ++find_library(glad_STATIC_LIBRARY ++ NAMES ${PX}fontconfig${SX} ${PX}glad${SX} ${PX}${gladPkg_LIBRARY}${SX} ++ PATHS ++ /usr/local ++ /usr/X11 ++ /usr ++ /sw ++ /opt/local ++ /usr/lib/x86_64-linux-gnu ++ HINTS ++ ${gladPkg_LIBRARY_DIRS} # Generated by pkg-config ++ PATH_SUFFIXES ++ lib64 ++ lib ++ ) ++ ++mark_as_advanced( ++ glad_INCLUDE_DIR ++ glad_DYNAMIC_LIBRARY ++ glad_STATIC_LIBRARY ++ ) ++ ++include(FindPackageHandleStandardArgs) ++ ++find_package_handle_standard_args(glad ++ REQUIRED_VARS glad_DYNAMIC_LIBRARY glad_INCLUDE_DIR ++ ) ++ ++if (glad_FOUND AND NOT TARGET glad::glad) ++ add_library(glad::glad UNKNOWN IMPORTED) ++ set_target_properties(glad::glad PROPERTIES ++ IMPORTED_LINK_INTERFACE_LANGUAGE "C" ++ IMPORTED_LOCATION ${glad_DYNAMIC_LIBRARY} ++ INTERFACE_INCLUDE_DIRECTORIES ${glad_INCLUDE_DIR}) ++ ++ if (glad_STATIC_LIBRARY) ++ add_library(glad::glad_STATIC UNKNOWN IMPORTED) ++ set_target_properties(glad::glad_STATIC PROPERTIES ++ IMPORTED_LINK_INTERFACE_LANGUAGE "C" ++ IMPORTED_LOCATION "${glad_STATIC_LIBRARY}" ++ INTERFACE_INCLUDE_DIRECTORIES "${glad_INCLUDE_DIR}") ++ endif (glad_STATIC_LIBRARY) ++endif () +-- +2.41.0 + -- 2.41.0