From patchwork Fri May 20 04:06:06 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Foo Chuan Wei X-Patchwork-Id: 39535 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 CDD9E27BBEA; Fri, 20 May 2022 05:07:17 +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_INVALID, DKIM_SIGNED,FREEMAIL_FROM,MAILING_LIST_MULTI,SPF_HELO_PASS 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 1C21E27BBE9 for ; Fri, 20 May 2022 05:07:17 +0100 (BST) Received: from localhost ([::1]:55122 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nrtv2-0005JC-65 for patchwork@mira.cbaines.net; Fri, 20 May 2022 00:07:16 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:59412) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nrtuo-0005J3-FO for guix-patches@gnu.org; Fri, 20 May 2022 00:07:02 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:43298) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1nrtuo-0002Le-6A for guix-patches@gnu.org; Fri, 20 May 2022 00:07:02 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1nrtun-0001hT-Vd for guix-patches@gnu.org; Fri, 20 May 2022 00:07:01 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#55533] [PATCH] gnu: Add cdecl. Resent-From: Foo Chuan Wei Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Fri, 20 May 2022 04:07:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 55533 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 55533@debbugs.gnu.org X-Debbugs-Original-To: guix-patches@gnu.org Received: via spool by submit@debbugs.gnu.org id=B.16530195996500 (code B ref -1); Fri, 20 May 2022 04:07:01 +0000 Received: (at submit) by debbugs.gnu.org; 20 May 2022 04:06:39 +0000 Received: from localhost ([127.0.0.1]:37195 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nrtuR-0001gm-6K for submit@debbugs.gnu.org; Fri, 20 May 2022 00:06:39 -0400 Received: from lists.gnu.org ([209.51.188.17]:55224) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nrtuB-0001gQ-Rh for submit@debbugs.gnu.org; Fri, 20 May 2022 00:06:37 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:59352) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nrtuB-0005HE-LO for guix-patches@gnu.org; Fri, 20 May 2022 00:06:23 -0400 Received: from mail-tyzapc01olkn2104.outbound.protection.outlook.com ([40.92.107.104]:34126 helo=APC01-TYZ-obe.outbound.protection.outlook.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nrtu1-0002Il-IH for guix-patches@gnu.org; Fri, 20 May 2022 00:06:22 -0400 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=IxEm1Y0U/W/6Dn4ahtDQ3ZEh0XovsYbD+PYVy6CL3zXZWvakUKBWTYR5+kw3L8DiUS1X2Rq54uFCeN+mcUbjsnQME00PQxfK9Gh/0ZSYBIthVW6XxrJHNxxaqP3Mmk+ysp+3sx3H60cUIB6JpwbN4kb7hlrnp1vWEsLwXIwMuo6ymuWtZidiqT7RA1JaGfyJVBR0cnlM3Tln5H3jAbVl7gYs0qRoJp6ympxZVfn1Xts+rwMiO0PI/Un3GqpBt859YvWGOc7Nzm4HhcVVWOw4/l7brpURCKpLFR4nLZtUKP/dwcIKFTHD+Daomb7NB1TavRZk+L4YOlAl/6WNQ0KhGQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=heRs59wbQkenRbjpo0NgB7MDznUg8MQ2Wf651wiPcGk=; b=dYgvYKLkVxox0jvR2UY3lnxJ8XzNTIGpZ8N5ewQNGJU9S5mMfYppR1ieHv+PtCbVwx25H8wEXenQG5/Rv8kgaVMwvuK0ItngfVDEUPX92uyvRvwlnrg0Pnvzu0C9e9mloGOX8DqbkNH+1DOOtSHhFXwgtzbpo34tSBjjisVC1U+93hzxn2vvtfOYrMSeOXW9RB1+Xnn9S46wMtfqY5NO0fn0xdO5HlWUhAHdEYe5PILprP9MbPgfvVtJX4y/YbhWUxykS/rOMmnRf2D2oRTFAZ8q+raJ9cZy5M8aJ43YsO6Nzge14aMc2ukkGrhAibYRQ7uTQlhHbn+ePbISFy12Rg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=none; dmarc=none; dkim=none; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=hotmail.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=heRs59wbQkenRbjpo0NgB7MDznUg8MQ2Wf651wiPcGk=; b=uqULdVeq01CUHNvWOlWoFRwHWS31N80dC5cExemcWcctGPzTbe7P9bAqwCvXcm7rplNqTmIr9puVSdIlOCQjEFjeYK5SqOaGQu0jg2QfetvRuHGX9uXmvwuAh/55Rqvhv/MN5zZjs8vSVR05axdEWbcnLda5sUi6WySaTRLaAuLyvM1csq843Hd2biMcwv/O4nOxa8fKvRDyGqTtoiS4f3Jf2Z5+HwMfZvxlAkHRAEVFfcuLpqTZZpc6gF/h8ZRJMCrhn8DHHKP7Y4uAuqX0pf27YyOseIXmu8D6721kFoKHdYODxJ6YYT5Wp3iZ0tmKZhV3+aqGDWoEoM46hvG8JA== Received: from PU1PR01MB2155.apcprd01.prod.exchangelabs.com (2603:1096:803:1c::21) by SI2PR01MB4498.apcprd01.prod.exchangelabs.com (2603:1096:4:1e1::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5273.17; Fri, 20 May 2022 04:06:09 +0000 Received: from PU1PR01MB2155.apcprd01.prod.exchangelabs.com ([fe80::fc2a:6e5a:d929:f3a7]) by PU1PR01MB2155.apcprd01.prod.exchangelabs.com ([fe80::fc2a:6e5a:d929:f3a7%6]) with mapi id 15.20.5273.017; Fri, 20 May 2022 04:06:09 +0000 Date: Fri, 20 May 2022 04:06:06 +0000 From: Foo Chuan Wei Message-ID: Mail-Followup-To: guix-patches@gnu.org Content-Disposition: inline X-TMN: [Fyrlnikbb+jfZk+sZe9uaEiJjcmwZlLb] X-ClientProxiedBy: SG2PR06CA0247.apcprd06.prod.outlook.com (2603:1096:4:ac::31) To PU1PR01MB2155.apcprd01.prod.exchangelabs.com (2603:1096:803:1c::21) X-Microsoft-Original-Message-ID: <20220520040606.fjt3gkzk5kzvqygx@main> MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 19f96e84-fbc9-4b46-7582-08da3a16119f X-MS-TrafficTypeDiagnostic: SI2PR01MB4498:EE_ X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: xftGEq847GMeZ9ItoixofyLzUhee54imPgIMQPTncK7k5GZaa7WnUdWXIvcuHovBR2GDju3/NnfhH6CwE7SSK12ejo7mraDONzGRr6+jsrbDgjDwx5Mf+2RlGT/owabiehJpWuTAVJveCgdQde7EZt+Eiq9YqjHB2NufEnRJ/0DSl/wpbAWNNrQ1PznYkY0ighcVxMnSrifnRRnoMflgI+0BMJ3FA+UahXQHjq4xBxXFxQHCmHTXHiyR3jPdZ+qxkytiwdWaHtg9j/EaxDTepGNYfyjDbIcywgHEIUlmGFLEyHjetYs/T0SoKeyhwcyDHZZTto+pIVkq3MUbo3Av8CDr9Vp4zcUj/9BizTVBQxbqYCVE+htGSTSWuXtrCjC1xPuFhlfbC3hBP8RhsK+GvZ1TmP40DrZxIrF9j4s0asReHxenUkQP7AWJ4ziTDCFGAHs+XXkKIvotkcdrLL/3QGIqFW3f5SZEBEoibdm4Jflqr36GIOc2JZ3uGX7tF4gJlfPKPzRZbA2cDoyPq0uklHCv6jSrEhHmHw++0VYnMRRCbyMHI5oXkOWrENhkir/Tk79udVsfghutLXwjRkjQduYzVpyDkLCi9ADBM1iqhz54DVVwPphvIMbxNETHXpmXFu5ZzjrElT0ozdsSbLDUhNL/f7/wWLMypZ4QURRkVn0= X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: lrFmAkFo8HvCrL4SPSSOoQZAUgx+Ltu7naizA1Gq07P8ino80J8XG+Y7tIyHfEAiWId5YRJSFnlZJKs8KUu950p4wnlsLz99Q+o7IeVJML72UGU6k7mA412YIwbWUTf+nWu/n28VWqLf0TslDMgcV6blhD4HzCjC2lNRQP5Ulr9lO5kq9n3Mm/NJz4XYJVlwBmVFdE21Ww7XXPHhDkxbMgefBMfOAcgBGtoDFPfGOiQp0kDOb6ZT1c7evvMn6H/+IX8O4tkz1xEjFmNwu8amEXByZ7o7AMlcw6kiouhTlooEPV+8YlWuMFpFXTkV1z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S/6/JJ/QM5HguY5gp3YQHesrB5aER0lpf5qoHaOOBM+abC8OWYq6yx2YXIfc1x0z0XKyydfJSJhkMRuQGV X-OriginatorOrg: sct-15-20-4755-11-msonline-outlook-d8e84.templateTenant X-MS-Exchange-CrossTenant-Network-Message-Id: 19f96e84-fbc9-4b46-7582-08da3a16119f X-MS-Exchange-CrossTenant-AuthSource: PU1PR01MB2155.apcprd01.prod.exchangelabs.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 20 May 2022 04:06:09.0388 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 84df9e7f-e9f6-40af-b435-aaaaaaaaaaaa X-MS-Exchange-CrossTenant-RMS-PersistedConsumerOrg: 00000000-0000-0000-0000-000000000000 X-MS-Exchange-Transport-CrossTenantHeadersStamped: SI2PR01MB4498 Received-SPF: pass client-ip=40.92.107.104; envelope-from=chuanwei.foo@hotmail.com; helo=APC01-TYZ-obe.outbound.protection.outlook.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 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, FREEMAIL_FROM=0.001, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham 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+patchwork=mira.cbaines.net@gnu.org Sender: "Guix-patches" X-getmail-retrieved-from-mailbox: Patches * gnu/packages/code.scm (cdecl): New variable. --- gnu/packages/code.scm | 87 ++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 86 insertions(+), 1 deletion(-) base-commit: cf17cbbc1b16dd15c8ec2e637d240de7ae5c3a44 diff --git a/gnu/packages/code.scm b/gnu/packages/code.scm index e96a55e5b0..f0dd443560 100644 --- a/gnu/packages/code.scm +++ b/gnu/packages/code.scm @@ -15,7 +15,7 @@ ;;; Copyright © 2020, 2021 Marius Bakke ;;; Copyright © 2020 Julien Lepiller ;;; Copyright © 2021 lu hui -;;; Copyright © 2021 Foo Chuan Wei +;;; Copyright © 2021, 2022 Foo Chuan Wei ;;; ;;; This file is part of GNU Guix. ;;; @@ -48,12 +48,14 @@ #:use-module (gnu packages autotools) #:use-module (gnu packages base) #:use-module (gnu packages bash) + #:use-module (gnu packages bison) #:use-module (gnu packages c) #:use-module (gnu packages compression) #:use-module (gnu packages cpp) #:use-module (gnu packages curl) #:use-module (gnu packages elf) #:use-module (gnu packages emacs) + #:use-module (gnu packages flex) #:use-module (gnu packages gcc) #:use-module (gnu packages graphviz) #:use-module (gnu packages llvm) @@ -66,6 +68,7 @@ #:use-module (gnu packages pkg-config) #:use-module (gnu packages python) #:use-module (gnu packages python-xyz) + #:use-module (gnu packages readline) #:use-module (gnu packages serialization) #:use-module (gnu packages sqlite) #:use-module (gnu packages texinfo) @@ -925,6 +928,88 @@ extensions over the standard utility.") source and header amalgamation in projects.") (license license:bsd-3)))) +(define-public cdecl + (package + (name "cdecl") + (version "2.5") + (source + (origin + (method url-fetch) + (uri (string-append "https://www.ibiblio.org/pub/linux/devel/lang/c/cdecl-" + version ".tar.gz")) + (sha256 + (base32 "0dm98bp186r4cihli6fmcwzjaadgwl1z3b0zdxfik8h7hkqawk5p")))) + (build-system gnu-build-system) + (arguments + `(#:make-flags + ,#~(list "LIBS=-lreadline" + (string-append "BINDIR=" #$output "/bin") + (string-append "MANDIR=" #$output "/share/man/man1")) + #:phases + (modify-phases %standard-phases + (delete 'configure) ; No configure script. + (add-after 'unpack 'fix-build + (lambda _ + (substitute* "Makefile" + (("lex cdlex.l") + "flex cdlex.l")) + (substitute* "cdecl.c" + ;; Fix "error: conflicting types for ‘getline’". + (("char \\* getline\\(\\)") + "char * our_getline(void)") + (("char \\* getline \\(\\)") + "char * our_getline(void)") + (("line = getline\\(\\)") + "line = our_getline()") + ;; Fix "error: conflicting types for ‘getopt’". + (("int getopt\\(int,char \\*\\*,char \\*\\);") + "") + ;; Fix invalid use of "restrict" as a variable name. + (("i, j, restrict") + "i, j, restriction") + (("restrict =") + "restriction =") + ;; Fix "warning: implicit declaration of function ‘add_history’". + (("# include " all) + (string-append all "\n# include ")) + ;; Fix "warning: implicit declaration of function ‘dotmpfile_from_string’". + (("void setprogname\\(char \\*\\);" all) + (string-append all "\nint dotmpfile_from_string(char *);")) + ;; Fix "warning: implicit declaration of function ‘completion_matches’". + (("matches = completion_matches\\(text, command_completion\\);") + "matches = rl_completion_matches(text, command_completion);") + (("char \\* command_completion\\(char \\*, int\\);") + "char * command_completion(const char *, int);") + (("char \\* command_completion\\(char \\*text, int flag\\)") + "char * command_completion(const char *text, int flag)") + ;; Fix "warning: ‘CPPFunction’ is deprecated". + (("rl_attempted_completion_function = \\(CPPFunction \\*\\)attempt_completion;") + "rl_attempted_completion_function = (rl_completion_func_t *)attempt_completion;") + ;; Fix "warning: ‘Function’ is deprecated". + (("rl_completion_entry_function = \\(Function \\*\\)keyword_completion;") + "rl_completion_entry_function = (rl_compentry_func_t *)keyword_completion;")) + ;; Fix typo in man page. + (substitute* "cdecl.1" + (("\t::= auto \\| extern \\| register \\| auto") + "\t::= auto | extern | register | static")))) + (add-before 'install 'create-directories + (lambda* (#:key outputs #:allow-other-keys) + (let* ((out (assoc-ref outputs "out")) + (bin (string-append out "/bin")) + (man (string-append out "/share/man/man1"))) + (mkdir-p bin) + (mkdir-p man))))) + #:tests? #f)) ; No "check" target. + (native-inputs (list bison flex)) + (inputs (list readline)) + (home-page "https://www.ibiblio.org/pub/linux/devel/lang/c/") + (synopsis "Turn English phrases into C or C++ declarations and vice versa") + (description "@code{cdecl} is a program which will turn English-like phrases +into C declarations. It can also translate the C into the pseudo-English. And +it handles typecasts, too. Plus C++. And in this version it has command line +editing and history with the GNU readline library.") + (license license:public-domain))) + (define-public cscope (package (name "cscope")