From patchwork Sat May 11 17:58:33 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: "Artyom V. Poptsov" X-Patchwork-Id: 64349 Return-Path: X-Original-To: patchwork@mira.cbaines.net Delivered-To: patchwork@mira.cbaines.net Received: by mira.cbaines.net (Postfix, from userid 113) id 6F86B27BBE9; Sat, 11 May 2024 19:01:25 +0100 (BST) X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on mira.cbaines.net X-Spam-Level: X-Spam-Status: No, score=-2.7 required=5.0 tests=BAYES_00,DKIM_ADSP_CUSTOM_MED, DKIM_INVALID,DKIM_SIGNED,FREEMAIL_FROM,MAILING_LIST_MULTI, SPF_HELO_PASS,URIBL_BLOCKED autolearn=unavailable autolearn_force=no version=3.4.6 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mira.cbaines.net (Postfix) with ESMTPS id 180B327BBE2 for ; Sat, 11 May 2024 19:01:23 +0100 (BST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1s5r1t-0000rM-Qn; Sat, 11 May 2024 14:01:05 -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 1s5r1s-0000qm-AU for guix-patches@gnu.org; Sat, 11 May 2024 14:01:04 -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 1s5r1s-0007zE-2W for guix-patches@gnu.org; Sat, 11 May 2024 14:01:04 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1s5r1r-0004Mg-EG for guix-patches@gnu.org; Sat, 11 May 2024 14:01:03 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#70880] [PATCH 5/8] gnu: heatshrink: New variable. Resent-From: "Artyom V. Poptsov" Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Sat, 11 May 2024 18:01:03 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 70880 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 70880@debbugs.gnu.org Cc: "Artyom V. Poptsov" Received: via spool by 70880-submit@debbugs.gnu.org id=B70880.171545041816689 (code B ref 70880); Sat, 11 May 2024 18:01:03 +0000 Received: (at 70880) by debbugs.gnu.org; 11 May 2024 18:00:18 +0000 Received: from localhost ([127.0.0.1]:49639 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1s5r18-0004Kz-0W for submit@debbugs.gnu.org; Sat, 11 May 2024 14:00:18 -0400 Received: from mail-lf1-f54.google.com ([209.85.167.54]:55555) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1s5r0q-0004H4-V3 for 70880@debbugs.gnu.org; Sat, 11 May 2024 14:00:04 -0400 Received: by mail-lf1-f54.google.com with SMTP id 2adb3069b0e04-51aa6a8e49aso3888907e87.3 for <70880@debbugs.gnu.org>; Sat, 11 May 2024 11:00:01 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1715450335; x=1716055135; darn=debbugs.gnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=4YMGQxA4eSB9RGJ46/w1eSURcG2bdMeyZvFvwZx4m0g=; b=fJOuIEr54BEkTt5Texr6ASqR9C/gx4xEvRzwaAxP/Rj5rEf+FPdiVxXKDNGNzKkcXR r3Nuv0XsHmTPt0ILfUT4Vbrkz73CkmRVl3b9igFwBzd8YdUAy3ihPtgYSbjEj25qIyYv 1Dc69UZyrtHbdGfQkqreqqwa21BkwxG9S69lTax/cbuBHxuKvs8ns1yTXgInhnzKkz6J L/t176Furu5jYO++smgkPpdmnPdilaq0YklUDQwxQW0Cwx0Ib9jHkkBuxUwmYlRRQ2oa MKJCSe30ZYk+ziUZbCgC1+asQWMrB7AJz1Pjjm6ZWJq6o+cGjsMklLgiMfymZaeWn4Fl K6Bg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1715450335; x=1716055135; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=4YMGQxA4eSB9RGJ46/w1eSURcG2bdMeyZvFvwZx4m0g=; b=B0uR+vTixsf+yrVGbwGKAzTptPJ/w+N78ruhTerLXXYHP+S5TR7noBW+wVR55UFJGD 7NYiBxHjPyzLJ1t+t0urS0ZwNw8n7t5p2WRUBCuy5NppjxU+JxSEabiu1Dy66ciS2CLJ un5tiEbmm3zqsz6Sj4I1y2EMRfSmj2RdKsub/VDuIXCML0fOD/URjsvYquYvNztEtRPs q+F9VM8VKdkrw8MxhOMSYphIuQrh8RKsv009OYWOj9/YeHoMpWz3o68vX37Auwgz8ZTk 5243VE2WhCQRE3mVOsb3kvEgfPeMP7wLjpnc4wxmyIWJGmJXWwwskr2K6PWXsb1IeMcD Ii0A== X-Gm-Message-State: AOJu0Ywb8oO9xJRFiPxbAIogcbnABVIXhrgapw+9D/l3yLkrLbzYA+oH zILaHVMtCu7/trB30acDxNVCM/OGJlvq9Mj7YQZwjtpiUO1XmSv/PaNChg== X-Google-Smtp-Source: AGHT+IGmNwEkHNJyCeXUDFSsSuA8TdOZR5XyKj7p0Lu0YRuJwRgwlAr7fAklWS/ndsRVQU26yE/6Aw== X-Received: by 2002:a05:6512:2389:b0:520:ed4e:220f with SMTP id 2adb3069b0e04-5220fa7187amr5064348e87.2.1715450335210; Sat, 11 May 2024 10:58:55 -0700 (PDT) Received: from elephant.. ([5.166.209.213]) by smtp.gmail.com with ESMTPSA id 2adb3069b0e04-521f35ad59asm1075411e87.45.2024.05.11.10.58.54 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 11 May 2024 10:58:54 -0700 (PDT) From: "Artyom V. Poptsov" Date: Sat, 11 May 2024 20:58:33 +0300 Message-ID: <5ed96653a085765c79a2bf6b0150ddab179339f9.1715450052.git.poptsov.artyom@gmail.com> X-Mailer: git-send-email 2.41.0 In-Reply-To: References: MIME-Version: 1.0 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+patchwork=mira.cbaines.net@gnu.org Sender: guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org X-getmail-retrieved-from-mailbox: Patches * gnu/packages/compression.scm (heatshrink): New variable. * gnu/packages/patches/heatshrink-add-cmake.patch: New file. * gnu/local.mk (dist_patch_DATA): Add "heatshrink-add-cmake.patch". Change-Id: I0beccdcaed22e47ac6bfe522497e0759a315813d --- gnu/local.mk | 1 + gnu/packages/compression.scm | 54 +++++++++ .../patches/heatshrink-add-cmake.patch | 111 ++++++++++++++++++ 3 files changed, 166 insertions(+) create mode 100644 gnu/packages/patches/heatshrink-add-cmake.patch diff --git a/gnu/local.mk b/gnu/local.mk index edd546f81d..3ba9253ae2 100644 --- a/gnu/local.mk +++ b/gnu/local.mk @@ -1455,6 +1455,7 @@ dist_patch_DATA = \ %D%/packages/patches/hdf-eos5-remove-gctp.patch \ %D%/packages/patches/hdf-eos5-fix-szip.patch \ %D%/packages/patches/hdf-eos5-fortrantests.patch \ + %D%/packages/patches/heatshrink-add-cmake.patch \ %D%/packages/patches/heimdal-CVE-2022-45142.patch \ %D%/packages/patches/helm-fix-gcc-9-build.patch \ %D%/packages/patches/highlight-gui-data-dir.patch \ diff --git a/gnu/packages/compression.scm b/gnu/packages/compression.scm index 55784a70de..187bc73f2f 100644 --- a/gnu/packages/compression.scm +++ b/gnu/packages/compression.scm @@ -39,6 +39,7 @@ ;;; Copyright © 2022 Zhu Zihao ;;; Copyright © 2021 Foo Chuan Wei ;;; Copyright © 2024 Vinicius Monego +;;; Copyright © 2024 Artyom V. Poptsov ;;; ;;; This file is part of GNU Guix. ;;; @@ -570,6 +571,59 @@ (define-public xz (license (list license:gpl2+ license:lgpl2.1+)) ; bits of both (home-page "https://tukaani.org/xz/"))) +(define-public heatshrink + (package + (name "heatshrink") + (version "0.4.1") + (source + (origin + (method git-fetch) + (uri (git-reference + (url "https://github.com/atomicobject/heatshrink/") + (commit (string-append "v" version)))) + (file-name (git-file-name name version)) + (sha256 + (base32 "0sdhvk27yz8kahw18j8pddbpkgl78v8rh8fx6wspc3acj7w7yvrn")) + ;; Add CMake build script, wanted by prusa-slicer and libbgcode, which are the + ;; only users of this library. + ;; + ;; See + ;; + (patches (search-patches "heatshrink-add-cmake.patch")))) + (build-system cmake-build-system) + (arguments + (list + ;; XXX: No tests available with CMake. + ;; See + #:tests? #f)) + (home-page "https://github.com/atomicobject/heatshrink/") + (synopsis "Data compression library for embedded/real-time systems") + (description + "A data compression/decompression library for embedded/real-time systems. + +Key features: +@itemize +@item Low memory usage (as low as 50 bytes.) + +It is useful for some cases with less than 50 bytes, and useful for many general +cases with < 300 bytes. + +@item Incremental, bounded CPU use. + +You can chew on input data in arbitrarily tiny bites. This is a useful property in +hard real-time environments. + +@item Can use either static or dynamic memory allocation. + +The library doesn't impose any constraints on memory management. + +@item ISC license. + +You can use it freely, even for commercial purposes. +@end itemize +") + (license license:isc))) + (define-public lhasa (package (name "lhasa") diff --git a/gnu/packages/patches/heatshrink-add-cmake.patch b/gnu/packages/patches/heatshrink-add-cmake.patch new file mode 100644 index 0000000000..f67f87126e --- /dev/null +++ b/gnu/packages/patches/heatshrink-add-cmake.patch @@ -0,0 +1,111 @@ +From 0886e9ca76552b8e325841e2b820b4563e5d5aba Mon Sep 17 00:00:00 2001 +From: tamasmeszaros +Date: Thu, 27 Jul 2023 23:11:25 +0200 +Subject: [PATCH] Add CMake build script + +--- + CMakeLists.txt | 82 +++++++++++++++++++++++++++++++++++++++++++++++++ + Config.cmake.in | 5 +++ + 2 files changed, 87 insertions(+) + create mode 100644 CMakeLists.txt + create mode 100644 Config.cmake.in + +diff --git a/CMakeLists.txt b/CMakeLists.txt +new file mode 100644 +index 0000000..5b840eb +--- /dev/null ++++ b/CMakeLists.txt +@@ -0,0 +1,82 @@ ++cmake_minimum_required(VERSION 3.10) ++ ++project(heatshrink C) ++ ++add_library(${PROJECT_NAME} heatshrink_decoder.c heatshrink_encoder.c) ++add_library(${PROJECT_NAME}_dynalloc heatshrink_decoder.c heatshrink_encoder.c) ++ ++find_library(MATH_LIBRARY m) # Business as usual ++if(MATH_LIBRARY) ++ target_link_libraries(${PROJECT_NAME} PUBLIC ${MATH_LIBRARY}) ++endif() ++ ++target_include_directories(${PROJECT_NAME} PUBLIC $) ++target_include_directories(${PROJECT_NAME}_dynalloc PUBLIC $) ++ ++target_compile_definitions(${PROJECT_NAME} PUBLIC HEATSHRINK_DYNAMIC_ALLOC=0) ++target_compile_definitions(${PROJECT_NAME}_dynalloc PUBLIC HEATSHRINK_DYNAMIC_ALLOC=1) ++ ++if (UNIX) ++ add_executable(${PROJECT_NAME}_cmd heatshrink.c) ++ target_link_libraries(${PROJECT_NAME}_cmd ${PROJECT_NAME}_dynalloc) ++ set_target_properties(${PROJECT_NAME}_cmd PROPERTIES OUTPUT_NAME ${PROJECT_NAME}) ++endif () ++ ++# Installation and export: ++ ++include(CMakePackageConfigHelpers) ++ ++write_basic_package_version_file( ++ "${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}ConfigVersion.cmake" ++ VERSION 0.4.1 ++ COMPATIBILITY AnyNewerVersion ++) ++ ++set(_exported_targets ${PROJECT_NAME} ${PROJECT_NAME}_dynalloc) ++if (UNIX) ++ list(APPEND _exported_targets ${PROJECT_NAME}_cmd) ++endif () ++ ++install(TARGETS ${_exported_targets} ++ EXPORT ${PROJECT_NAME}Targets ++) ++ ++export(EXPORT ${PROJECT_NAME}Targets ++ FILE "${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}Targets.cmake" ++ NAMESPACE ${PROJECT_NAME}:: ++) ++ ++include(GNUInstallDirs) ++set(ConfigPackageLocation ${CMAKE_INSTALL_LIBDIR}/cmake/${PROJECT_NAME}) ++ ++configure_package_config_file(${CMAKE_CURRENT_SOURCE_DIR}/Config.cmake.in ++ "${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}Config.cmake" ++ INSTALL_DESTINATION ${ConfigPackageLocation} ++) ++ ++install( ++ FILES ++ heatshrink_common.h ++ heatshrink_config.h ++ heatshrink_encoder.h ++ heatshrink_decoder.h ++ DESTINATION ++ include/${PROJECT_NAME} ++ ) ++ ++install(EXPORT ${PROJECT_NAME}Targets ++ FILE ++ ${PROJECT_NAME}Targets.cmake ++ NAMESPACE ++ ${PROJECT_NAME}:: ++ DESTINATION ++ ${ConfigPackageLocation} ++) ++ ++install( ++ FILES ++ "${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}Config.cmake" ++ "${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}ConfigVersion.cmake" ++ DESTINATION ++ ${ConfigPackageLocation} ++) +diff --git a/Config.cmake.in b/Config.cmake.in +new file mode 100644 +index 0000000..0809ba9 +--- /dev/null ++++ b/Config.cmake.in +@@ -0,0 +1,5 @@ ++@PACKAGE_INIT@ ++ ++if (EXISTS ${CMAKE_CURRENT_LIST_DIR}/@PROJECT_NAME@Targets.cmake) ++ include("${CMAKE_CURRENT_LIST_DIR}/@PROJECT_NAME@Targets.cmake") ++endif ()