From patchwork Tue Mar 8 04:38:08 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Maxim Cournoyer X-Patchwork-Id: 37644 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 5D74127BBEA; Tue, 8 Mar 2022 04:39:17 +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=-3.7 required=5.0 tests=BAYES_00,DKIM_ADSP_CUSTOM_MED, DKIM_INVALID,DKIM_SIGNED,FREEMAIL_FROM,MAILING_LIST_MULTI, RCVD_IN_MSPIKE_H5,RCVD_IN_MSPIKE_WL,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 C297427BBE9 for ; Tue, 8 Mar 2022 04:39:16 +0000 (GMT) Received: from localhost ([::1]:37818 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nRRcw-0005KB-D6 for patchwork@mira.cbaines.net; Mon, 07 Mar 2022 23:39:15 -0500 Received: from eggs.gnu.org ([209.51.188.92]:49258) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nRRck-0005Io-E4 for guix-patches@gnu.org; Mon, 07 Mar 2022 23:39:02 -0500 Received: from debbugs.gnu.org ([209.51.188.43]:32875) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1nRRck-0007Cs-5f for guix-patches@gnu.org; Mon, 07 Mar 2022 23:39:02 -0500 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1nRRck-00079I-2l for guix-patches@gnu.org; Mon, 07 Mar 2022 23:39:02 -0500 X-Loop: help-debbugs@gnu.org Subject: [bug#54235] [PATCH v2 2/3] gnu: Add ck. Resent-From: Maxim Cournoyer Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Tue, 08 Mar 2022 04:39:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 54235 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 54235@debbugs.gnu.org Cc: maximedevos@telenet.be, Maxim Cournoyer Received: via spool by 54235-submit@debbugs.gnu.org id=B54235.164671431427418 (code B ref 54235); Tue, 08 Mar 2022 04:39:02 +0000 Received: (at 54235) by debbugs.gnu.org; 8 Mar 2022 04:38:34 +0000 Received: from localhost ([127.0.0.1]:55002 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nRRcH-000789-L6 for submit@debbugs.gnu.org; Mon, 07 Mar 2022 23:38:33 -0500 Received: from mail-qk1-f182.google.com ([209.85.222.182]:45049) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nRRcG-00077k-8r for 54235@debbugs.gnu.org; Mon, 07 Mar 2022 23:38:32 -0500 Received: by mail-qk1-f182.google.com with SMTP id q4so13880553qki.11 for <54235@debbugs.gnu.org>; Mon, 07 Mar 2022 20:38:32 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=pWq+19mcY1h5xzQOj+ZoZBFf5GxUd1Fi+gq5gUZWNGs=; b=UlDjJkET9HLf4XjR+7d3Z7hLn0sa3d7WuKme38Jm6ZP5PdGRAISejqyKMdpLRe1LGv cN/RHAshf1JccjgAmk0vBBQ8wkb8RpKRj1XIAWmqBmog0T9c+rc0W88ANeXu/1cTQUID 9g03CLDRXW5g6oM9zqJSXtSeJtqXtfwcLRpgXTfj3ZMQARq5W/8FrlZg8ICNT7VhB/FE 5PfYeUmcXGA8FumcsRFdFoego5nH5DD2gXttupobWEhji1upVL8zGh+DY6TYM1A0Kpga snu3sSiCgt0AUDCB7d421kw2M5kk0urN9pN69lX/asvREpnld1rHHk03TDl/3btLuuzr 3qNA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=pWq+19mcY1h5xzQOj+ZoZBFf5GxUd1Fi+gq5gUZWNGs=; b=ETKpJM2TAapF8EIE3jBZeevwdUUKCndA6HmTZ4yveA9ikXmSAK83gkiQr1Eya1iZEs v5GJK9gKcdmWm56H9pgOF/tEKNiggf8yp5NczWk75A2ry/y1aCl/TzArXpIr05V4Lhm7 lE9LDP5tfAO9LAl7tCvSvy8unvOJhh31RfgHlN9MVjKJj4uMQApdqQtAWcFM0kTfG1SR cG7P1YHBsNmAff0mQMLK4Otpdd32fGw/1SVxVzfFOSpwtdAnZO/GyA+Oc4/MmtMoKNPW NN2nMXYuhJQxYGHL3jwm3KIX4BltMJjJN4tZyOcL6R4rdB6ztM7gEzRsSbuc6B8gwXQw W58Q== X-Gm-Message-State: AOAM530LLjycfaVVg4JQvW32tM5EsMki4731ufRMyW/q2FZ0CV3wrZcc VZlIuc0JQl0L9l36Kp8zR0UgmR9JSm4= X-Google-Smtp-Source: ABdhPJzePARftyubK31yG1ZKaqW17hfZGrOsbTHzrTknS9b7HZHmKnIPyQXTCEm9i0pgiLu2Hc/EVw== X-Received: by 2002:a05:620a:2810:b0:663:124a:816b with SMTP id f16-20020a05620a281000b00663124a816bmr9089513qkp.785.1646714306520; Mon, 07 Mar 2022 20:38:26 -0800 (PST) Received: from localhost.localdomain (dsl-205-151-56-54.b2b2c.ca. [205.151.56.54]) by smtp.gmail.com with ESMTPSA id y11-20020ac85f4b000000b002de4b0a015asm10369332qta.5.2022.03.07.20.38.25 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 07 Mar 2022 20:38:26 -0800 (PST) From: Maxim Cournoyer Date: Mon, 7 Mar 2022 23:38:08 -0500 Message-Id: <20220308043809.31394-2-maxim.cournoyer@gmail.com> X-Mailer: git-send-email 2.34.0 In-Reply-To: <20220308043809.31394-1-maxim.cournoyer@gmail.com> References: <20220308043809.31394-1-maxim.cournoyer@gmail.com> 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" X-getmail-retrieved-from-mailbox: Patches * gnu/packages/c.scm (ck): New variable. --- gnu/packages/c.scm | 81 ++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 81 insertions(+) diff --git a/gnu/packages/c.scm b/gnu/packages/c.scm index e53a7c865f..5fc923790a 100644 --- a/gnu/packages/c.scm +++ b/gnu/packages/c.scm @@ -38,6 +38,7 @@ (define-module (gnu packages c) #:use-module (guix build-system cmake) #:use-module (guix build-system gnu) #:use-module (guix build-system trivial) + #:use-module (guix store) #:use-module (gnu packages) #:use-module (gnu packages bash) #:use-module (gnu packages bootstrap) @@ -896,6 +897,86 @@ (define-public aws-c-mqtt (home-page "https://github.com/awslabs/aws-c-mqtt") (license license:asl2.0))) +(define-public ck + (package + (name "ck") + (version "0.7.1") + (source (origin + (method git-fetch) + (uri (git-reference + (url "https://github.com/concurrencykit/ck") + (commit version))) + (file-name (git-file-name name version)) + (sha256 + (base32 + "020yzfpvymdc8lc44znlnxmxb8mvp42g4nb4p8k814klazqvwh0x")))) + (build-system gnu-build-system) + (arguments + (list + #:phases + #~(modify-phases %standard-phases + (replace 'configure + ;; ck uses a custom configure script that stumbles on + ;; '--enable-fast-install', among other things. + (lambda* (#:key parallel-build? #:allow-other-keys) + ;; TODO: Move AR-FOR-TARGET and LD-FOR-TARGET to (guix utils). + (define* (ar-for-target #:optional (target #$(%current-target-system))) + (if target + (string-append target "-ar") + "ar")) + (define* (ld-for-target #:optional (target #$(%current-target-system))) + (if target + (string-append target "-ld") + "ld")) + (define (gnu-triplet->machine target) + (letrec-syntax + ((matches (syntax-rules (=>) + ((_ (target-prefix => machine) rest ...) + (if (string-prefix? target-prefix target) + machine + (matches rest ...))) + ((_) + (error "unsupported target" target))))) + ;; This basically reproduces the logic handling the + ;; PLATFORM variable in the configure script. + (matches ("x86_64" => "x86_64") + ("i586" => "x86") + ("i686" => "x86") + ("aarch64" => "aarch64") + ("arm" => "arm") + ("ppc64" => "ppc64") + ("ppc" => "ppc") + ("s390x" => "s390x") + ("sparc64" => "sparcv9")))) + (define target-machine (and=> #$(%current-target-system) + gnu-triplet->machine)) + ;; The custom configure script doesn't make cross-compilation + ;; adjustments itself, so manually set the archiver, compiler + ;; and linker. Even then, it is still broken and doesn't + ;; actually build any binary (see: + ;; https://github.com/concurrencykit/ck/issues/191). + (setenv "AR" (ar-for-target)) + (setenv "CC" #$(cc-for-target)) + (setenv "LD" (ld-for-target)) + (apply invoke "./configure" + `(,@(if target-machine + (list (string-append "--profile=" target-machine)) + '()) + ,(string-append "--prefix=" #$output) + ,(string-append "--mandir=" #$output "/share/man") + ,(string-append "--cores=" + (if parallel-build? + (number->string (parallel-job-count)) + "1"))))))))) + (home-page "https://github.com/concurrencykit/ck") + (synopsis "C library for concurrent systems") + (description "Concurrency Kit (@code{ck}) provides concurrency primitives, +safe memory reclamation mechanisms and non-blocking (including lock-free) data +structures designed to aid in the research, design and implementation of high +performance concurrent systems developed in C99+.") + (license (list license:bsd-2 ;everything except... + license:asl2.0)))) ;src/ck_hp.c + (define-public utf8-h ;; The latest tag is used as there is no release. (let ((commit "500d4ea9f4c3449e5243c088d8af8700f7189734")