unofficial mirror of guix-patches@gnu.org 
 help / color / mirror / code / Atom feed
From: Maxim Cournoyer <maxim.cournoyer@gmail.com>
To: 73754@debbugs.gnu.org
Cc: Maxim Cournoyer <maxim.cournoyer@gmail.com>,
	Maxim Cournoyer <maxim.cournoyer@gmail.com>
Subject: [bug#73754] [PATCH 3/5] gnu: Add cppp.
Date: Sat, 12 Oct 2024 13:28:12 +0900	[thread overview]
Message-ID: <c01c5b711c3167992cd6f7fe4952d649a1b83396.1728684335.git.maxim.cournoyer@gmail.com> (raw)
In-Reply-To: <cover.1728684335.git.maxim.cournoyer@gmail.com>

* gnu/packages/c.scm (cppp): New variable.
* gnu/packages/patches/cppp-build-fixes.patch: New file.
* gnu/local.mk (dist_patch_DATA): Register it.

Change-Id: I7dc2215f4e57aec6356afa82d5740f78a64d3bab
---
 gnu/local.mk                                |  1 +
 gnu/packages/c.scm                          | 36 ++++++++++++++++++++-
 gnu/packages/patches/cppp-build-fixes.patch | 17 ++++++++++
 3 files changed, 53 insertions(+), 1 deletion(-)
 create mode 100644 gnu/packages/patches/cppp-build-fixes.patch

diff --git a/gnu/local.mk b/gnu/local.mk
index 05a8716063..e08ecc744c 100644
--- a/gnu/local.mk
+++ b/gnu/local.mk
@@ -1105,6 +1105,7 @@ dist_patch_DATA =						\
   %D%/packages/patches/coreutils-gnulib-tests.patch		\
   %D%/packages/patches/cppcheck-disable-char-signedness-test.patch	\
   %D%/packages/patches/cppdap-add-CPPDAP_USE_EXTERNAL_GTEST_PACKAGE.patch\
+  %D%/packages/patches/cppp-build-fixes.patch			\
   %D%/packages/patches/cpulimit-with-glib-2.32.patch		\
   %D%/packages/patches/crawl-upgrade-saves.patch		\
   %D%/packages/patches/crc32c-unbundle-googletest.patch		\
diff --git a/gnu/packages/c.scm b/gnu/packages/c.scm
index 7c93676f0c..01bfb7eec5 100644
--- a/gnu/packages/c.scm
+++ b/gnu/packages/c.scm
@@ -9,7 +9,7 @@
 ;;; Copyright © 2020 Jan (janneke) Nieuwenhuizen <janneke@gnu.org>
 ;;; Copyright © 2020, 2021 Marius Bakke <marius@gnu.org>
 ;;; Copyright © 2020 Katherine Cox-Buday <cox.katherine.e@gmail.com>
-;;; Copyright © 2020, 2022, 2023 Maxim Cournoyer <maxim.cournoyer@gmail.com>
+;;; Copyright © 2020, 2022, 2023, 2024 Maxim Cournoyer <maxim.cournoyer@gmail.com>
 ;;; Copyright © 2020, 2021 Greg Hogan <code@greghogan.com>
 ;;; Copyright © 2021 David Dashyan <mail@davie.li>
 ;;; Copyright © 2021 Foo Chuan Wei <chuanwei.foo@hotmail.com>
@@ -140,6 +140,40 @@ (define-public c-rrb
 slicing.")
      (license license:boost1.0))))
 
+(define-public cppp
+  ;; No release; use the latest commit.
+  (let ((commit "49ccb2162329c6619ab876c6d5765d9d0ac24f61")
+        (revision "0"))
+    (package
+      (name "cppp")
+      (version (git-version "0" revision commit))
+      (source (origin
+                (method git-fetch)
+                (uri (git-reference
+                      (url "https://git.sr.ht/~breadbox/cppp")
+                      (commit commit)))
+                (file-name (git-file-name name version))
+                (sha256
+                 (base32
+                  "0r3vin9p1ql4ddbszwsvx493h6n0knlgxzpkahdb4a4df1xpqr1s"))
+                (patches (search-patches "cppp-build-fixes.patch"))))
+      (arguments
+       (list
+        #:make-flags #~(list (string-append "prefix=" #$output)
+                             #$(string-append "CC=" (cc-for-target)))
+        #:phases #~(modify-phases %standard-phases
+                     (delete 'configure)))) ;no configure script
+      (build-system gnu-build-system)
+      (home-page "https://www.muppetlabs.com/~breadbox/software/cppp.html")
+      (synopsis "Partial preprocessor for C")
+      (description "@command{cppp} is a partial preprocessor for C/C++ code.
+It implements enough of the C preprocessor to identify the preprocessor
+statements @code{#if}, @code{#ifdef}, et al., and applies their effects for
+the identifiers that are specified on the command-line.  Preprocessor
+statements using identifiers not specified by the user are passed through
+without modification; no other part of the input is altered.")
+      (license license:gpl2+))))
+
 (define-public cproc
   (let ((commit "70fe9ef1810cc6c05bde9eb0970363c35fa7e802")
         (revision "1"))
diff --git a/gnu/packages/patches/cppp-build-fixes.patch b/gnu/packages/patches/cppp-build-fixes.patch
new file mode 100644
index 0000000000..c46be950d8
--- /dev/null
+++ b/gnu/packages/patches/cppp-build-fixes.patch
@@ -0,0 +1,17 @@
+Upstream-status: Submitted to the author via email.
+
+diff --git a/Makefile b/Makefile
+index b4f404d..cbf7cae 100644
+--- a/Makefile
++++ b/Makefile
+@@ -28,8 +28,8 @@ ppproc.o  : ppproc.c ppproc.h gen.h types.h error.h symset.h mstr.h \
+ cppp.o    : cppp.c gen.h types.h unixisms.h error.h symset.h ppproc.h
+ 
+ install:
+-	cp ./cppp $(prefix)/bin/.
+-	cp ./cppp.1 $(prefix)/share/man/man1/.
++	install -D ./cppp $(prefix)/bin/cppp
++	install -D ./cppp.1 $(prefix)/share/man/man1/cppp.1
+ 
+ test: cppp
+ 	./tests/testall
-- 
2.46.0





  parent reply	other threads:[~2024-10-12  4:30 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-10-11 22:07 [bug#73754] [PATCH games-team 0/5] Unbundle SameBoy from jg-bsnes Maxim Cournoyer
2024-10-12  4:28 ` [bug#73754] [PATCH 1/5] gnu: sameboy: Update to 0.16.7 Maxim Cournoyer
2024-10-12  4:28 ` [bug#73754] [PATCH 2/5] gnu: sameboy: Use gexps Maxim Cournoyer
2024-10-12  4:28 ` Maxim Cournoyer [this message]
2024-10-12  4:28 ` [bug#73754] [PATCH 4/5] gnu: sameboy: Install shared library Maxim Cournoyer
2024-10-12  4:28 ` [bug#73754] [PATCH 5/5] gnu: jg-bsnes: Unbundle SameBoy Maxim Cournoyer

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://guix.gnu.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=c01c5b711c3167992cd6f7fe4952d649a1b83396.1728684335.git.maxim.cournoyer@gmail.com \
    --to=maxim.cournoyer@gmail.com \
    --cc=73754@debbugs.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/guix.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).