From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp1.migadu.com ([2001:41d0:303:e16b::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms13.migadu.com with LMTPS id oNBpOchhkmYycQAA62LTzQ:P1 (envelope-from ) for ; Sat, 13 Jul 2024 11:15:21 +0000 Received: from aspmx1.migadu.com ([2001:41d0:303:e16b::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp1.migadu.com with LMTPS id oNBpOchhkmYycQAA62LTzQ (envelope-from ) for ; Sat, 13 Jul 2024 13:15:21 +0200 X-Envelope-To: larch@yhetil.org Authentication-Results: aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=gmail.com header.s=20230601 header.b=SROEGmVn; 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=1720869320; 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-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=ljk9zBP+YaaK+wl51WyCNh/28pIaVJSM299q8askKgA=; b=eEC0LgGCo3stPrV6V1MXFXSjLdt1M+pnxmmGREOPsXNkA+y8xpIKGrkzYPXeF7Sz2DDSBO sIXYNinEqpwz5n88OdJkYVDJmUFDMt9u4LbI0ALJdMBHMTP/0OmtvsgOYD06mckcSF9Szu XBGv6gu+vNuwajIhR+JHcXL7Bzv++OlpYui9086jn9puOo3qxN8qQJuOAytDIOEq/V9FDs 9kUwkwsX/UH3v871hDt5h4hM4Sz8d/vOcocJW0sYbvx/7x19HmdsakyZZoHPYz7zlk5Rkx XTp+PLAGAHc0nA2wP0QpDZgMZ/hBM0OWv2ApCIiBi3bPT6qLXx/wvIDazyb/Jw== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=gmail.com header.s=20230601 header.b=SROEGmVn; 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-Seal: i=1; s=key1; d=yhetil.org; t=1720869320; a=rsa-sha256; cv=none; b=cwak9v3mH64eFUe4PMb2BAXRK/MSH00KD1lA61303h00IIJPGFOBq+6XO+V+PQ+JEcvQVh paV8VXeW6YIhj+4XiWm6xbZ2axGPfUaTBB7s+DA01Gj5uzfbWeDTZeDqyUG5GQ+BSOI9tD IASY8T5k3WM5cxAb9gxQJzBs86rZ9uTyMVrTefv9IrRN7D73cyUy5ihVlvLY2BB4WJrDeI b6JAi7kJ5bSGDK9r4wv6aKNzzqNgDiw8qIVIY8WYLqsN8MVw3dTtwJITB4aSuEokk4LlcJ mjt+bjfYhJzBh8+Xr/SKZBQbU9NaFUiZzV7PNbCtes4eVuOTUox1aAc3o9uGfg== 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 60ACB17933 for ; Sat, 13 Jul 2024 13:15:20 +0200 (CEST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sSaih-0007tt-KL; Sat, 13 Jul 2024 07:15:15 -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 1sSaiU-0007sG-Eh for guix-patches@gnu.org; Sat, 13 Jul 2024 07:15:02 -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 1sSaiU-0000Hi-5J for guix-patches@gnu.org; Sat, 13 Jul 2024 07:15:02 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1sSaiU-0002xz-Sv for guix-patches@gnu.org; Sat, 13 Jul 2024 07:15:02 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#70880] [PATCH v3 5/8] gnu: Add heatshrink. Resent-From: "Artyom V. Poptsov" Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Sat, 13 Jul 2024 11:15:02 +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: moreinfo patch To: 70880@debbugs.gnu.org Cc: "Artyom V. Poptsov" Received: via spool by 70880-submit@debbugs.gnu.org id=B70880.172086927611277 (code B ref 70880); Sat, 13 Jul 2024 11:15:02 +0000 Received: (at 70880) by debbugs.gnu.org; 13 Jul 2024 11:14:36 +0000 Received: from localhost ([127.0.0.1]:55208 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sSai2-0002vY-Vv for submit@debbugs.gnu.org; Sat, 13 Jul 2024 07:14:35 -0400 Received: from mail-lj1-f174.google.com ([209.85.208.174]:59763) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sSahz-0002v4-Pk for 70880@debbugs.gnu.org; Sat, 13 Jul 2024 07:14:33 -0400 Received: by mail-lj1-f174.google.com with SMTP id 38308e7fff4ca-2eedeca1c79so7430881fa.3 for <70880@debbugs.gnu.org>; Sat, 13 Jul 2024 04:14:30 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1720869210; x=1721474010; 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=ljk9zBP+YaaK+wl51WyCNh/28pIaVJSM299q8askKgA=; b=SROEGmVnD7rEup48JYBaMmFCaUzq1YaicVOhQ69f9wE2xxm3akd0rPx6DzmGmioU9M 5v4OCKcL5JUxj1epR2xvQdaVnqUJanc/q9SCUh34DJ6RvUExdwjryIGaghKUSWpxBhaG m2dzXJ/NcCOlyx5gO+1GtXVUfOfKI7y25V3rXTB75yMRWEVeKoYIrtpb9xZO+uRV9Xj8 +O8FL5XJSnM3Y0H71PBLqZSV2JdToVtjPCxvpCr9iy+l+QErPSQOptDqiixdbuymUXjQ ECecjK330LXAqO6utaAOWnPHzfAtmwyKK5CgGgMVNxZmkMM6FMIbLpv8+P0hEiyauOJO Dneg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1720869210; x=1721474010; 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=ljk9zBP+YaaK+wl51WyCNh/28pIaVJSM299q8askKgA=; b=PqUcQHsZfQIf58YMhdSIIxOoKkt7meafbtgh6P3KSolVbtIVltl7z6DrS0nvJytfb1 xBPz8P1aSQXqSgJ/WdAYbVY/uzSUeOmJzDvX0zKqW4Yxx2CcBBc+4hrEc5T9Cb6x1fW8 l2xex/o6MCvlQUaYZ7cidReiWUi0yE8lAz/TEApdrwoN96sVHEC5VzdABkCzaEJmfj1a j46wwLRwRpAUumUyKzn11ue3fH9MFJowOqXJWBwlf91a7DR87HD7L4M+HD4E1+AjfYgn /tYv/k7JIshdxbwQUD7rQOEz3UrbI+YYBj8ea4oFs2weIOfHMk5gxpniWx+xvXq47msg zQ9A== X-Gm-Message-State: AOJu0YxFzzhTcT7AwpjHm/LxT64KlbwXdWx60twXULuvOl1RbqQgLvL5 ZZVbXlrjvPNQRFb/7aRm8A2MxOuaM8bveuBK/wK98Bhdded/vecFfUASFQ== X-Google-Smtp-Source: AGHT+IHLkZ1IVsndwNMddP+jHEZSgG/N2IGis4cSEZ7SN/bv55T0Aj2j6+KKU8UVhW58exm8LwMRzw== X-Received: by 2002:a2e:300b:0:b0:2ee:d5f5:43e with SMTP id 38308e7fff4ca-2eed5f50f1amr31569481fa.32.1720869207029; Sat, 13 Jul 2024 04:13:27 -0700 (PDT) Received: from elephant.. ([95.79.4.1]) by smtp.gmail.com with ESMTPSA id 38308e7fff4ca-2eee179e797sm1781541fa.21.2024.07.13.04.13.26 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 13 Jul 2024 04:13:26 -0700 (PDT) From: "Artyom V. Poptsov" Date: Sat, 13 Jul 2024 14:13:14 +0300 Message-ID: X-Mailer: git-send-email 2.45.2 In-Reply-To: References: MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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-Migadu-Queue-Id: 60ACB17933 X-Migadu-Scanner: mx13.migadu.com X-Migadu-Spam-Score: -5.30 X-Spam-Score: -5.30 X-TUID: oqg4FU+4MJtw * 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 | 40 +++++++ .../patches/heatshrink-add-cmake.patch | 111 ++++++++++++++++++ 3 files changed, 152 insertions(+) create mode 100644 gnu/packages/patches/heatshrink-add-cmake.patch diff --git a/gnu/local.mk b/gnu/local.mk index ea4cc251ae..4726e2c128 100644 --- a/gnu/local.mk +++ b/gnu/local.mk @@ -1482,6 +1482,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 ac025e0e3d..1c9e0a804c 100644 --- a/gnu/packages/compression.scm +++ b/gnu/packages/compression.scm @@ -40,6 +40,7 @@ ;;; Copyright © 2021 Foo Chuan Wei ;;; Copyright © 2024 Vinicius Monego ;;; Copyright © 2024 David Elsing +;;; Copyright © 2024 Artyom V. Poptsov ;;; ;;; This file is part of GNU Guix. ;;; @@ -574,6 +575,45 @@ (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. + +Among its features are: +@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 less than 300 bytes. +@item Incremental, bounded CPU use. It can be used to 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. +@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 () -- 2.45.2