From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp0.migadu.com ([2001:41d0:403:58f0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms8.migadu.com with LMTPS id uP2ILzM1ymWiOQAAqHPOHw:P1 (envelope-from ) for ; Mon, 12 Feb 2024 16:11:47 +0100 Received: from aspmx1.migadu.com ([2001:41d0:403:58f0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp0.migadu.com with LMTPS id uP2ILzM1ymWiOQAAqHPOHw (envelope-from ) for ; Mon, 12 Feb 2024 16:11:47 +0100 X-Envelope-To: larch@yhetil.org Authentication-Results: aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=soeren-tempel.net header.s=opensmtpd header.b=ZgXZbPA8; 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=soeren-tempel.net (policy=none) ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1707750707; h=from:from:sender:sender: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=ty1OkuhSG340q9JxUDLlNRndsyyaQKWy+2rYRT/uqwI=; b=t2GKLu+1GrQuDMwrySfxoKfHz7Mx45KecZMrQQAtYdNzR3v3D9nYgkn2Q2Naey6X+rOSCP KFNlkS+B2ll7+Xjpag6ZXalz+zSYfixofvCw6E1kdZAx0nT/oeyW7Uy4vY3YBa0P1jsbUn Laask42zTc/ZZLxTyMmb92u2DJjM/TF8U7L13ZTiNYkRBOnRBGOzh5FWvFhZp0IapZnVVf ZerBU9wrZTsTR3DblB3niaB9xpfN5jvYIwbKwIKHlPyUE447+rc2pQJmHQac9NHYBWV7e6 czYCQSi/b00W0FldWRwxesFvPC0jKYG49uvs1OtlUZmUapRasWRmegYJG/6NXA== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=soeren-tempel.net header.s=opensmtpd header.b=ZgXZbPA8; 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=soeren-tempel.net (policy=none) ARC-Seal: i=1; s=key1; d=yhetil.org; t=1707750707; a=rsa-sha256; cv=none; b=iclkxf1P2RrVxq3u22YNknRU15jhk/MiFdQp/h1/iwV5eiYlM9owaWJOUBxxAtZ5aeSpwB 6j+uyBNgoSOrdKZuzxft136wd/QbDOe4xDFW0UsagStXVzUzXEI41605Om6oSiN9zIz53P PW+8wzuoMXnK38mIK+DC7bZBnRmY+fxxV0SpDdKo521rs6DJV+DL4R2d6IXEyT3qoMdRci zphAilKUNd/4HVcStC63pHvMmyVWJ2+08omovxPT6TqiB1cBx7Dm7nuBGrfQjBbFuVor3N Xj9TC6gKf9rr0+cDCcsiJRWOj5LUU08o50HVghxVFawurBYQxmrshOa5x15smA== 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 7C7B76A0AE for ; Mon, 12 Feb 2024 16:11:47 +0100 (CET) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rZXxK-0000uu-K1; Mon, 12 Feb 2024 10:10:50 -0500 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 1rZXxI-0000uO-0I for guix-patches@gnu.org; Mon, 12 Feb 2024 10:10:48 -0500 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 1rZXxH-0006HI-Ni for guix-patches@gnu.org; Mon, 12 Feb 2024 10:10:47 -0500 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1rZXxY-0001wu-GZ for guix-patches@gnu.org; Mon, 12 Feb 2024 10:11:04 -0500 X-Loop: help-debbugs@gnu.org Subject: [bug#69074] [PATCH] gnu: capstone: Backport upstream fix for Python bindings. Resent-From: soeren@soeren-tempel.net Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Mon, 12 Feb 2024 15:11:04 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 69074 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 69074@debbugs.gnu.org Received: via spool by 69074-submit@debbugs.gnu.org id=B69074.17077506217285 (code B ref 69074); Mon, 12 Feb 2024 15:11:04 +0000 Received: (at 69074) by debbugs.gnu.org; 12 Feb 2024 15:10:21 +0000 Received: from localhost ([127.0.0.1]:35931 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rZXwq-0001tK-OL for submit@debbugs.gnu.org; Mon, 12 Feb 2024 10:10:21 -0500 Received: from magnesium.8pit.net ([2001:19f0:6c01:4ae:5400:ff:fe66:af9d]:36117) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rZXm8-0006lY-Fb; Mon, 12 Feb 2024 09:59:19 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; s=opensmtpd; bh=IqmsXSHio7 miolElR8UwOwYmxMgaOfiRX22vwLOs+tg=; h=references:in-reply-to:date: subject:to:from; d=soeren-tempel.net; b=ZgXZbPA8uzW8Id4I/JzMLBfSwkfSCB pNyCIJ0NK0reV2zNqwyV2MCSKU7RvsJuGhAiINSK4ZOhMBd5WpB/1PDQuYiJ1JpF64CRVE adR7EsbpRt6HX1spciyQvcm1lFB1UUNATQ7PGqz787SlKkiURDBkEKMFsBt1mG+vjU3dvF w= Received: from localhost (dynamic-2a02-3102-49da-001b-6371-147f-665b-ad6e.310.pool.telefonica.de [2a02:3102:49da:1b:6371:147f:665b:ad6e]) by magnesium.8pit.net (OpenSMTPD) with ESMTPSA id b508788a (TLSv1.3:TLS_AES_256_GCM_SHA384:256:YES); Mon, 12 Feb 2024 15:58:53 +0100 (CET) From: soeren@soeren-tempel.net Date: Mon, 12 Feb 2024 15:58:28 +0100 Message-ID: X-Mailer: git-send-email 2.43.1 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-Flow: FLOW_IN X-Migadu-Country: US X-Migadu-Spam-Score: 3.33 X-Migadu-Queue-Id: 7C7B76A0AE X-Spam-Score: 3.33 X-Migadu-Scanner: mx11.migadu.com X-TUID: zyIkiGjV5eN4 From: Sören Tempel * gnu/packages/engineering.scm (capstone): New patch. --- gnu/local.mk | 1 + gnu/packages/engineering.scm | 2 + ...python-capstone-fix-python-constants.patch | 84 +++++++++++++++++++ 3 files changed, 87 insertions(+) create mode 100644 gnu/packages/patches/python-capstone-fix-python-constants.patch diff --git a/gnu/local.mk b/gnu/local.mk index ecbae4bb53..ce0f1994c5 100644 --- a/gnu/local.mk +++ b/gnu/local.mk @@ -1901,6 +1901,7 @@ dist_patch_DATA = \ %D%/packages/patches/python-3-hurd-configure.patch \ %D%/packages/patches/python-aionotify-0.2.0-py3.8.patch \ %D%/packages/patches/python-argcomplete-1.11.1-fish31.patch \ + %D%/packages/patches/python-capstone-fix-python-constants.patch \ %D%/packages/patches/python-cross-compile.patch \ %D%/packages/patches/python-configobj-setuptools.patch \ %D%/packages/patches/python-dateutil-pytest-compat.patch \ diff --git a/gnu/packages/engineering.scm b/gnu/packages/engineering.scm index 16f572909c..336c8b0e38 100644 --- a/gnu/packages/engineering.scm +++ b/gnu/packages/engineering.scm @@ -39,6 +39,7 @@ ;;; Copyright © 2023 Theofilos Pechlivanis ;;; Copyright © 2023 Sharlatan Hellseher ;;; Copyright © 2023 pinoaffe +;;; Copyright © 2024 Sören Tempel ;;; ;;; This file is part of GNU Guix. ;;; @@ -1815,6 +1816,7 @@ (define-public capstone (version "5.0.1") (source (origin (method git-fetch) + (patches (search-patches "python-capstone-fix-python-constants.patch")) (uri (git-reference (url "https://github.com/capstone-engine/capstone") (commit version))) diff --git a/gnu/packages/patches/python-capstone-fix-python-constants.patch b/gnu/packages/patches/python-capstone-fix-python-constants.patch new file mode 100644 index 0000000000..75100c6652 --- /dev/null +++ b/gnu/packages/patches/python-capstone-fix-python-constants.patch @@ -0,0 +1,84 @@ +Backport upstream patch fixing various constants in the Python bindings. + +Taken from: https://github.com/capstone-engine/capstone/commit/f180e176de3efb060db62820ff981d0291ea8525 + +diff --git a/bindings/python/capstone/__init__.py b/bindings/python/capstone/__init__.py +index bda2fdb6..52353c28 100755 +--- a/bindings/python/capstone/__init__.py ++++ b/bindings/python/capstone/__init__.py +@@ -113,7 +113,6 @@ __all__ = [ + 'CS_OPT_SYNTAX_NOREGNAME', + 'CS_OPT_SYNTAX_MASM', + 'CS_OPT_SYNTAX_MOTOROLA', +- 'CS_OPT_SYNTAX_CS_REG_ALIAS', + + 'CS_OPT_DETAIL', + 'CS_OPT_MODE', +@@ -152,19 +151,6 @@ __all__ = [ + 'CS_OP_REG', + 'CS_OP_IMM', + 'CS_OP_FP', +- 'CS_OP_PRED', +- 'CS_OP_RESERVED_5', +- 'CS_OP_RESERVED_6', +- 'CS_OP_RESERVED_7', +- 'CS_OP_RESERVED_8', +- 'CS_OP_RESERVED_9', +- 'CS_OP_RESERVED_10', +- 'CS_OP_RESERVED_11', +- 'CS_OP_RESERVED_12', +- 'CS_OP_RESERVED_13', +- 'CS_OP_RESERVED_14', +- 'CS_OP_RESERVED_15', +- 'CS_OP_SPECIAL', + 'CS_OP_MEM', + + 'CS_GRP_INVALID', +@@ -298,26 +284,13 @@ CS_OPT_NO_BRANCH_OFFSET = 9 # ARM, prints branch immediates without offset. + + # Capstone option value + CS_OPT_OFF = 0 # Turn OFF an option - default option of CS_OPT_DETAIL +-CS_OPT_ON = 1 << 0 # Turn ON an option (CS_OPT_DETAIL) ++CS_OPT_ON = 3 # Turn ON an option (CS_OPT_DETAIL) + + # Common instruction operand types - to be consistent across all architectures. + CS_OP_INVALID = 0 # uninitialized/invalid operand. + CS_OP_REG = 1 # Register operand. + CS_OP_IMM = 2 # Immediate operand. + CS_OP_FP = 3 # Floating-Point operand. +-CS_OP_PRED = 4 # Predicate operand. +-CS_OP_RESERVED_5 = 5 +-CS_OP_RESERVED_6 = 6 +-CS_OP_RESERVED_7 = 7 +-CS_OP_RESERVED_8 = 8 +-CS_OP_RESERVED_9 = 9 +-CS_OP_RESERVED_10 = 10 +-CS_OP_RESERVED_11 = 11 +-CS_OP_RESERVED_12 = 12 +-CS_OP_RESERVED_13 = 13 +-CS_OP_RESERVED_14 = 14 +-CS_OP_RESERVED_15 = 15 +-CS_OP_SPECIAL = 0x10 # Special operands from archs + CS_OP_MEM = 0x80 # Memory operand. Can be ORed with another operand type. + + # Common instruction groups - to be consistent across all architectures. +@@ -336,13 +309,12 @@ CS_AC_READ = (1 << 0) # Operand that is read from. + CS_AC_WRITE = (1 << 1) # Operand that is written to. + + # Capstone syntax value +-CS_OPT_SYNTAX_DEFAULT = 1 << 1 # Default assembly syntax of all platforms (CS_OPT_SYNTAX) +-CS_OPT_SYNTAX_INTEL = 1 << 2 # Intel X86 asm syntax - default syntax on X86 (CS_OPT_SYNTAX, CS_ARCH_X86) +-CS_OPT_SYNTAX_ATT = 1 << 3 # ATT asm syntax (CS_OPT_SYNTAX, CS_ARCH_X86) +-CS_OPT_SYNTAX_NOREGNAME = 1 << 4 # Asm syntax prints register name with only number - (CS_OPT_SYNTAX, CS_ARCH_PPC, CS_ARCH_ARM) +-CS_OPT_SYNTAX_MASM = 1 << 5 # MASM syntax (CS_OPT_SYNTAX, CS_ARCH_X86) +-CS_OPT_SYNTAX_MOTOROLA = 1 << 6 # MOS65XX use $ as hex prefix +-CS_OPT_SYNTAX_CS_REG_ALIAS = 1 << 7 # Prints common register alias which are not defined in LLVM (ARM: r9 = sb etc.) ++CS_OPT_SYNTAX_DEFAULT = 0 # Default assembly syntax of all platforms (CS_OPT_SYNTAX) ++CS_OPT_SYNTAX_INTEL = 1 # Intel X86 asm syntax - default syntax on X86 (CS_OPT_SYNTAX, CS_ARCH_X86) ++CS_OPT_SYNTAX_ATT = 2 # ATT asm syntax (CS_OPT_SYNTAX, CS_ARCH_X86) ++CS_OPT_SYNTAX_NOREGNAME = 3 # Asm syntax prints register name with only number - (CS_OPT_SYNTAX, CS_ARCH_PPC, CS_ARCH_ARM) ++CS_OPT_SYNTAX_MASM = 4 # MASM syntax (CS_OPT_SYNTAX, CS_ARCH_X86) ++CS_OPT_SYNTAX_MOTOROLA = 5 # MOS65XX use $ as hex prefix + + # Capstone error type + CS_ERR_OK = 0 # No error: everything was fine