From debbugs-submit-bounces@debbugs.gnu.org Mon May 09 02:04:07 2022 Received: (at 55248) by debbugs.gnu.org; 9 May 2022 06:04:07 +0000 Received: from localhost ([127.0.0.1]:55713 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nnwV5-0000v5-Bs for submit@debbugs.gnu.org; Mon, 09 May 2022 02:04:07 -0400 Received: from mail-ua1-f49.google.com ([209.85.222.49]:35606) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nnwUv-0000tH-IA for 55248@debbugs.gnu.org; Mon, 09 May 2022 02:03:57 -0400 Received: by mail-ua1-f49.google.com with SMTP id x11so5062391uao.2 for <55248@debbugs.gnu.org>; Sun, 08 May 2022 23:03:57 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=philipmcgrath.com; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=wfcAH5XAdwVPDZfDmFM08aox4jzMZXPVfAuJLvSM8WE=; b=duK2JrSxOlmn3OX26POj1SIPfZ4DYdl6OGgJEbE2luX8FCLpb1ZAP608qy7kdzhb0+ WSre12PIcqaTi/1VXdhU2V63GFnKCPiIAgf7BvLMJVHPTLsw6OEdakKhAOmnhXr43BvP Eoxq8ctX5gh3d4EnVIMHfLYZ1GwMZU7cfHVszbnfQmhqWz5S8dMYT6ThWQRgrk1H9JvC nA8LdeC7L5VZAK63Dmc8RDF8N6VA2xSNSb47Bb0jSNiPuAxjnyuNDsww8kNaa2P9n9Bw 27RhV9i3XfIfFAKHun/92sjomMf9DXXb/56YzZJlpaF5wFv03JzmgHFxc+D1z4cAtfX4 0b4Q== 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=wfcAH5XAdwVPDZfDmFM08aox4jzMZXPVfAuJLvSM8WE=; b=o6T2bpjrsH+yi+iBiumcsFxHTSySk3n4tDVW6mXLr4kpOY67i5cnJd6j4B8NWINP1J Ck/78OZ+BdZLMWCq+uXHuj8+ITPONOWzpzAUh/mt0q3tWSRk+xUZ6kLUtFH0CUbPMVRb +YIFTcMNo4ABpzQFpZvXUGxhlLcXYSImGP5xF1KiVG9IZLqU2hofCwaoip9U0146SD3Z RkSS5+Nxi3EJF0vWPFfuwbVJqTemwIQfONlzTupm03TdM9bYlQTq1SZlH2Q8crBeDkyT czWL1Sea8cc6qZpt31DIG4tpL+Bdjt+03u28JyOS1HAhed8FM+YgPJZPb9Jw6lcfYugh 1YYw== X-Gm-Message-State: AOAM533wrn5AqTPpT4p0BrEn3nfGCtGt3I9cmiHAJyHX69I1axutD5HO YC/8ldKsxr7H4EVj5FutqNepr+x8sVOAk0KC X-Google-Smtp-Source: ABdhPJyJ1bW2dbZc+UEX0S5ICHOCHFTqxc3gK80oWXe3mGngP1j6CYuCsjzVAXgaWp+YNdlas0XElA== X-Received: by 2002:ab0:15ed:0:b0:365:f250:7384 with SMTP id j42-20020ab015ed000000b00365f2507384mr2309472uae.44.1652076232068; Sun, 08 May 2022 23:03:52 -0700 (PDT) Received: from localhost (c-73-125-98-51.hsd1.fl.comcast.net. [73.125.98.51]) by smtp.gmail.com with UTF8SMTPSA id e188-20020a1f1ec5000000b00352319fb500sm1273444vke.48.2022.05.08.23.03.51 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sun, 08 May 2022 23:03:51 -0700 (PDT) From: Philip McGrath To: 55248@debbugs.gnu.org Subject: [PATCH v3 6/9] gnu: stex: Get machine type dynamically. Date: Mon, 9 May 2022 02:02:47 -0400 Message-Id: <6521decd69c70fe38b056c2dbec10d1a1af0e570.1652075689.git.philip@philipmcgrath.com> X-Mailer: git-send-email 2.32.0 In-Reply-To: References: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Score: 0.6 (/) X-Debbugs-Envelope-To: 55248 Cc: Liliana Marie Prikler , Maxime Devos , Philip McGrath , Liliana Marie Prikler X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.4 (/) * gnu/packages/chez.scm (stex)[arguments]: Run 'scheme' to determine the machine type. --- gnu/packages/chez.scm | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/gnu/packages/chez.scm b/gnu/packages/chez.scm index 785b6837c1..dd485d37e1 100644 --- a/gnu/packages/chez.scm +++ b/gnu/packages/chez.scm @@ -602,6 +602,10 @@ (define-public stex-bootstrap ("src" "lib/stex/") ("Mf-stex" "lib/stex/") ("Makefile.template" "lib/stex/")) + #:modules + '((guix build copy-build-system) + (guix build utils) + (ice-9 popen)) #:phases #~(modify-phases %standard-phases (add-before 'install 'patch-sources @@ -633,8 +637,14 @@ (define-public stex-bootstrap (define makefile (string-append (getcwd) "/Makefile")) (define machine - #$(and=> (nix-system->chez-machine) - chez-machine->threaded)) + (let ((pipe (open-pipe* OPEN_BOTH scheme "-q"))) + ;; try to not be wrong for cross-compilation + ;; (avoid #% reader abbreviation for Guile) + (write '(($primitive $target-machine)) pipe) + (force-output pipe) + (let ((sym (read pipe))) + (close-pipe pipe) + (symbol->string sym)))) (with-directory-excursion (search-input-directory outputs "/lib/stex") (invoke "make" -- 2.32.0