From patchwork Wed Nov 1 22:57:14 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: David Elsing X-Patchwork-Id: 55812 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 E315727BBE2; Wed, 1 Nov 2023 22:58:59 +0000 (GMT) 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,MAILING_LIST_MULTI,SPF_HELO_PASS,URIBL_BLOCKED autolearn=ham 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 689CC27BBEA for ; Wed, 1 Nov 2023 22:58:52 +0000 (GMT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qyKAO-0002yM-SR; Wed, 01 Nov 2023 18:58:28 -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 1qyKAN-0002y5-CV for guix-patches@gnu.org; Wed, 01 Nov 2023 18:58:27 -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 1qyKAN-0002eh-4K for guix-patches@gnu.org; Wed, 01 Nov 2023 18:58:27 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1qyKAv-00008f-N4 for guix-patches@gnu.org; Wed, 01 Nov 2023 18:59:01 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#66889] [PATCH 1/2] gnu: Add pcg-c. Resent-From: David Elsing Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Wed, 01 Nov 2023 22:59:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 66889 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 66889@debbugs.gnu.org Cc: David Elsing Received: via spool by 66889-submit@debbugs.gnu.org id=B66889.1698879500442 (code B ref 66889); Wed, 01 Nov 2023 22:59:01 +0000 Received: (at 66889) by debbugs.gnu.org; 1 Nov 2023 22:58:20 +0000 Received: from localhost ([127.0.0.1]:53487 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qyKAG-000073-2U for submit@debbugs.gnu.org; Wed, 01 Nov 2023 18:58:20 -0400 Received: from mout01.posteo.de ([185.67.36.65]:41293) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qyKAD-00006m-O0 for 66889@debbugs.gnu.org; Wed, 01 Nov 2023 18:58:19 -0400 Received: from submission (posteo.de [185.67.36.169]) by mout01.posteo.de (Postfix) with ESMTPS id 19116240027 for <66889@debbugs.gnu.org>; Wed, 1 Nov 2023 23:57:37 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=posteo.net; s=2017; t=1698879457; bh=sqARyrM0aLI29QB2VF9GybgySBMyuP/3pCRbajb0wtk=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version: Content-Transfer-Encoding:From; b=jMh/UmMp3wMwTxO7eAVmWIiENm/nHjlaFoGWx2RbILaWv83iefeih/90xCnxjvVZI 8qYZRgQ3ErBzTwAo00DN/lym3261c86PG8LUnyHg0/yRoXpJ1O/k+LfCc6NCY6J2zs p+Aup1AZF0JmlhA0+JGhIrljaf8aFxQbW99NB4w9eEFrgvROrljTFUcSHKa902aA/K 54wZ+ZrAQHi1OwuySEFW15H2cpzkra/Xl0qBP47xXa9ygkJJRXl+P++JSCF9j4Wlnl E0Te/vKYquifrEVU4bZzFOnU9IB8EdrukcVucGH58D0qpprGS46vf9GqRhKKlH98fc cRssHOSCOFGkA== Received: from customer (localhost [127.0.0.1]) by submission (posteo.de) with ESMTPSA id 4SLMpm4mvhz9rxG; Wed, 1 Nov 2023 23:57:36 +0100 (CET) From: David Elsing Date: Wed, 1 Nov 2023 22:57:14 +0000 Message-ID: <1c639973fbed48a27da78c45d4332f3cae458738.1698878711.git.david.elsing@posteo.net> 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/c.scm (pcg-c): New variable. --- gnu/packages/c.scm | 55 ++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 55 insertions(+) diff --git a/gnu/packages/c.scm b/gnu/packages/c.scm index ea58c68262..0c218b9656 100644 --- a/gnu/packages/c.scm +++ b/gnu/packages/c.scm @@ -20,6 +20,7 @@ ;;; Copyright © 2022 Antero Mejr ;;; Copyright © 2023 zamfofex ;;; Copyright © 2023 Foundation Devices, Inc. +;;; Copyright © 2023 David Elsing ;;; ;;; This file is part of GNU Guix. ;;; @@ -1585,3 +1586,57 @@ (define-public ispc program instances execute in parallel on the hardware.") (home-page "https://github.com/ispc/ispc") (license license:bsd-3))) + +(define-public pcg-c + (let ((commit "83252d9c23df9c82ecb42210afed61a7b42402d7") + (revision "1")) + (package + (name "pcg-c") + (version (git-version "0.0.0" revision commit)) + (source (origin + (method git-fetch) + (uri (git-reference + (url "https://github.com/imneme/pcg-c") + (commit commit))) + (file-name (git-file-name name version)) + (sha256 + (base32 + "0768h0vw75a3smk39qsz1504v04a43s5w1ili1ijbixxv8gm42nf")) + (modules '((guix build utils))) + ;; Autogenerated files with some tests from test-high. If + ;; 128-bit integers are not supported, the build fails, but + ;; this is checked when building the tests. + (snippet #~(delete-file-recursively "sample")))) + (build-system gnu-build-system) + (arguments + (list + #:test-target "test" + #:make-flags + #~(list + "CC=gcc" + (string-append "PREFIX=" #$output)) + #:phases + #~(modify-phases %standard-phases + (delete 'configure) + (add-after 'unpack 'disable-sample + (lambda _ + (substitute* "Makefile" + ((".*cd sample.*") "")))) + (add-after 'unpack 'set-shared-library + (lambda _ + (substitute* '("Makefile" "src/Makefile") + (("\\.a") "\\.so") + ((".*ar .*") "\t$(CC) $(CFLAGS) -o $@ $(LDFLAGS) -shared $^") + ((".*ranlib.*") "") + ((".*CFLAGS \\+=.*O3.*" orig) + (string-append orig "CFLAGS += -fPIC\n"))))) + (add-before 'install 'make-dirs + (lambda _ + (mkdir-p (string-append #$output "/lib")) + (mkdir-p (string-append #$output "/include"))))))) + (home-page "https://www.pcg-random.org") + (synopsis "C implementation of the PCG random generators") + (description "The Permuted Congruential Generator (PCG) extends the +Linear Congruential Generator (LCG) with a permutation function to increase +output randomness while retaining speed, simplicity, and conciseness.") + (license (list license:expat license:asl2.0))))) ; dual licensed