From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp11.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms0.migadu.com with LMTPS id +BF2LxxqJ2IGcAAAgWs5BA (envelope-from ) for ; Tue, 08 Mar 2022 15:37:16 +0100 Received: from aspmx1.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp11.migadu.com with LMTPS id oLDmLBxqJ2JZTAEA9RJhRA (envelope-from ) for ; Tue, 08 Mar 2022 15:37:16 +0100 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 704F133D93 for ; Tue, 8 Mar 2022 15:37:16 +0100 (CET) Received: from localhost ([::1]:34742 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nRaxf-0006Mx-ME for larch@yhetil.org; Tue, 08 Mar 2022 09:37:15 -0500 Received: from eggs.gnu.org ([209.51.188.92]:59100) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nRaxT-0005zx-Es for guix-patches@gnu.org; Tue, 08 Mar 2022 09:37:03 -0500 Received: from debbugs.gnu.org ([209.51.188.43]:33503) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1nRaxT-0005O1-6B for guix-patches@gnu.org; Tue, 08 Mar 2022 09:37:03 -0500 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1nRaxT-0001rr-3f for guix-patches@gnu.org; Tue, 08 Mar 2022 09:37:03 -0500 X-Loop: help-debbugs@gnu.org Subject: [bug#54235] [PATCH v3 3/4] gnu: Add ck. Resent-From: Maxim Cournoyer Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Tue, 08 Mar 2022 14:37:03 +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.16467501937110 (code B ref 54235); Tue, 08 Mar 2022 14:37:03 +0000 Received: (at 54235) by debbugs.gnu.org; 8 Mar 2022 14:36:33 +0000 Received: from localhost ([127.0.0.1]:55628 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nRawz-0001qc-11 for submit@debbugs.gnu.org; Tue, 08 Mar 2022 09:36:33 -0500 Received: from mail-qt1-f180.google.com ([209.85.160.180]:44619) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nRawx-0001q7-BF for 54235@debbugs.gnu.org; Tue, 08 Mar 2022 09:36:31 -0500 Received: by mail-qt1-f180.google.com with SMTP id v3so16208258qta.11 for <54235@debbugs.gnu.org>; Tue, 08 Mar 2022 06:36:31 -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=cEKZgvfdFyMt1a9T96wy+psDNn26efCAZ0hyxB/RN1M=; b=IBfPhRZaQKYceF7PRve0oZJDTz3YnZ45dLzl/9F6qmvJZtHXDdlVLVFKCym9ye6SGJ yQ5pg51APElya6xKkfMNce9lMaeMnWJV7DKtAWmMbpFlbhwJb7ex4UtxFshB+xx4lWBG Z9yTQkbhO7vRG+IQ/ks5M89bDPUpEJ3OQ0rYt57FAlFbZBpa59DwHZdZpGQlEU5UddA5 py0xnOb+HHtcJztKOOLPYNOPyhkb3Mw2A9ScxyDvUC88x1o/06Zw+m2v+qdPQuUsqKeU WKj10Gx7V7sCZdo59USiEsGn4WoU5V0AraNOhtcZoUgTeF+eQJUQxvvEUi5zvqNQuUOh 2T+w== 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=cEKZgvfdFyMt1a9T96wy+psDNn26efCAZ0hyxB/RN1M=; b=GX9Bv0ECu6x6PSE+OSkW+6MM0oxko7vvIlM90hLhxwKy8IF9MJcwRsisTq/nxOSikM hWeU/nBxAnTTqZpFAUco8MTPEcGZ7GQWrOKE8AfHGiZDNlEwWCgfRTQQSxXrGuRd3xyY o6tQ3nFtRbPmUSp8W+g0mPA9qG2ii2/0IbQaslGJ5EdquNe4HzAmdIf9SYOKaXfncz3a zzMplwO/dsltvVuV4BAns9uENkpxPudoDbFbT+7nFRNxeJ1VeX/qrlVrWeGM4nApPOyU zETEViLdBAhOvBcxw3MaTOH5zdlpNp63s83CQpDlnSUhmeVK1y6CVXtrK3/vchJZvLw+ JgeA== X-Gm-Message-State: AOAM530WWxSidI1A2e+CXRxbwl3WSwvsdAgilLb47yX0XddNv4/aEhjU zqISeR2LSUt3dMwwiaQyzJJGV0e18js= X-Google-Smtp-Source: ABdhPJxCxIYs2hMjeUARJgxCq5crpcLG+AS0KzdZC+A/N9NzAFKPFQOdGTIbOFIFeIi9xj1+cgRC/A== X-Received: by 2002:a05:622a:1985:b0:2de:b88:4673 with SMTP id u5-20020a05622a198500b002de0b884673mr13887572qtc.230.1646750185697; Tue, 08 Mar 2022 06:36:25 -0800 (PST) Received: from localhost.localdomain (dsl-205-151-56-54.b2b2c.ca. [205.151.56.54]) by smtp.gmail.com with ESMTPSA id e9-20020ac85989000000b002de2bfc8f94sm10338847qte.88.2022.03.08.06.36.24 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 08 Mar 2022 06:36:25 -0800 (PST) From: Maxim Cournoyer Date: Tue, 8 Mar 2022 09:36:06 -0500 Message-Id: <20220308143607.7449-3-maxim.cournoyer@gmail.com> X-Mailer: git-send-email 2.34.0 In-Reply-To: <20220308143607.7449-1-maxim.cournoyer@gmail.com> References: <20220308143607.7449-1-maxim.cournoyer@gmail.com> MIME-Version: 1.0 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" X-Migadu-Flow: FLOW_IN X-Migadu-Country: US ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1646750236; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: 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=cEKZgvfdFyMt1a9T96wy+psDNn26efCAZ0hyxB/RN1M=; b=IiRKorBy3CqIWDF6JUXt+QYgVH5Xm4jucBb4xUIiVITrohIKI0BtoRZ5jCYFi8AokjupGt sY0ZO4ygtxOEl/OPPq76JZxX4h2V5SYJUPKOm+7SwJUU+rhq3mfDJuX/a3TR+1oEoZnuOV lfm3F0eiQL1NspGA53BtFbPF/S1XAQIDb7uo2X3+DLVVLtorHbVBzmqOt0zzh1O1EifHkh kMjjccob082jhnY7IofrbNZEjtoyWNJy7IabwXe3aWxiPDKF+oIr61K9AtMXM4svjsZOKL nYJsc8wFGTlHWMl7tSSzjsI4FzOo9qqH9xY78O72hwK+1Pn7Ygs6EJGSefzABg== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1646750236; a=rsa-sha256; cv=none; b=KX2IYlpuCb9Ch3yxSssVtHz0SLxu7CGna6k3YvwJulP2dKMFgX3emRK8RkiiSOAF/eY3C6 jSk+BCsVRwRk/RlP5nAd6v44lfsBoY4Z3MAkiX+j81MnGV1g6k2vZfVgLWIUiYob9HLDOs Q31dNmQ5cMRxkfUNjoJkA9Ia0vZpEHExYUmIGWDSX3F3vNNQyIh99f6lGkxbihH0NjnuSN krQiRoaHsijKQUR5A4Y+TUEKzMPscEG7AoqvAX5idJhRQCgLth07ERW+bZmW/mh7YcZwtR RAGiBp2gPrQiIjxB5ITSee+j09EczE0SxmJK0j2d6EaY5kEAiOYNA4c2ddEvzw== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=gmail.com header.s=20210112 header.b=IBfPhRZa; dmarc=fail reason="SPF not aligned (relaxed)" header.from=gmail.com (policy=none); 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" X-Migadu-Spam-Score: 6.08 Authentication-Results: aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=gmail.com header.s=20210112 header.b=IBfPhRZa; dmarc=fail reason="SPF not aligned (relaxed)" header.from=gmail.com (policy=none); 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" X-Migadu-Queue-Id: 704F133D93 X-Spam-Score: 6.08 X-Migadu-Scanner: scn0.migadu.com X-TUID: MB2V8tKHcoOl * gnu/packages/c.scm (ck): New variable. --- gnu/packages/c.scm | 78 ++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 78 insertions(+) diff --git a/gnu/packages/c.scm b/gnu/packages/c.scm index e53a7c865f..d545d98938 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,83 @@ (define-public aws-c-mqtt (home-page "https://github.com/awslabs/aws-c-mqtt") (license license:asl2.0))) +;;; Factored out of the ck package so that it can be adjusted and called on +;;; the host side easily, without impacting the package definition. +(define (gnu-triplet->ck-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 of ck. + (matches ("x86_64" => "x86_64") + ("i586" => "x86") + ("i686" => "x86") + ("aarch64" => "aarch64") + ("arm" => "arm") + ("ppc64" => "ppc64") + ("ppc" => "ppc") + ("s390x" => "s390x") + ("sparc64" => "sparcv9")))) + +(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) + (define target-machine #$(and=> (%current-target-system) + gnu-triplet->ck-machine)) + (when target-machine + ;; The configure script doesn't currently work for + ;; cross-compiling (see: + ;; https://github.com/concurrencykit/ck/issues/191). + (error "ck cannot currently be cross-compiled")) + ;; The custom configure script doesn't make cross-compilation + ;; adjustments itself, so manually set the archiver, compiler + ;; and linker. + (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") -- 2.34.0