From patchwork Mon Jun 5 00:07:55 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Antero Mejr X-Patchwork-Id: 50666 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 E62F027BBE9; Mon, 5 Jun 2023 01:09:25 +0100 (BST) 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=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 D3C9327BBE2 for ; Mon, 5 Jun 2023 01:09:22 +0100 (BST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1q5xmT-000146-1q; Sun, 04 Jun 2023 20:09:05 -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 1q5xmQ-00013a-FR for guix-patches@gnu.org; Sun, 04 Jun 2023 20:09:02 -0400 Received: from debbugs.gnu.org ([209.51.188.43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1q5xmQ-0003hM-72 for guix-patches@gnu.org; Sun, 04 Jun 2023 20:09:02 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1q5xmQ-0005ka-1n for guix-patches@gnu.org; Sun, 04 Jun 2023 20:09:02 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#63898] [PATCH] gnu: Add plan9port. Resent-From: Antero Mejr Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Mon, 05 Jun 2023 00:09:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 63898 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 63898@debbugs.gnu.org X-Debbugs-Original-To: guix-patches@gnu.org Received: via spool by submit@debbugs.gnu.org id=B.168592369722026 (code B ref -1); Mon, 05 Jun 2023 00:09:01 +0000 Received: (at submit) by debbugs.gnu.org; 5 Jun 2023 00:08:17 +0000 Received: from localhost ([127.0.0.1]:47578 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1q5xlg-0005jC-Be for submit@debbugs.gnu.org; Sun, 04 Jun 2023 20:08:16 -0400 Received: from lists.gnu.org ([209.51.188.17]:42376) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1q5xle-0005j2-Nm for submit@debbugs.gnu.org; Sun, 04 Jun 2023 20:08:15 -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 1q5xlb-0000zp-Ow for guix-patches@gnu.org; Sun, 04 Jun 2023 20:08:13 -0400 Received: from mout-p-202.mailbox.org ([2001:67c:2050:0:465::202]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_CHACHA20_POLY1305:256) (Exim 4.90_1) (envelope-from ) id 1q5xlY-0003eU-04 for guix-patches@gnu.org; Sun, 04 Jun 2023 20:08:09 -0400 Received: from smtp202.mailbox.org (smtp202.mailbox.org [IPv6:2001:67c:2050:b231:465::202]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-384) server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by mout-p-202.mailbox.org (Postfix) with ESMTPS id 4QZDTG2HhZz9sGf for ; Mon, 5 Jun 2023 02:08:02 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=mailbox.org; s=mail20150812; t=1685923682; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding; bh=A48oncfahcQBD3k8uifIwyUdmpKiUJZysA7Vvx/aKv4=; b=i6noQ0I9XfxFNLjnYYJOtGCrhY9t0jYdWQg6ohxGEuRXd08dU8z7mCVm6rq1K3n5Acc5Qy AjOwkB8i4Aq7koQb3MVSESLMAj/fLGSGRNARE+4yD5+meciJV8Dz+wfWz0B7dYjT1945ON xq0K8C4s/M/Atx2c2LMsbP+9OwEF3CkJTqx2tP/eEjeRhCo2op9MhlfTmzIzC/oSSEXU/w QRbjxD+HuTE/8WPvlJbbo2GtwtgkL7rrkdtQXTuetOEyJHFNJ8tiAbxt5MeNNLLFHeoUgt tCDRh+hu4CNKuZAO/jVdtpb/CMzLm/C22UiGgWjhFUHcfyHrJD0sls9LlBoFYA== Date: Mon, 5 Jun 2023 00:07:55 +0000 Message-Id: <20230605000755.15416-1-antero@mailbox.org> MIME-Version: 1.0 X-MBO-RS-ID: b3596e229c2e7c6b068 X-MBO-RS-META: 16r5s7ywzt58b4716hrtwdh5pff1co48 Received-SPF: pass client-ip=2001:67c:2050:0:465::202; envelope-from=antero@mailbox.org; helo=mout-p-202.mailbox.org X-Spam_score_int: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.8 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action 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: , Reply-to: Antero Mejr X-ACL-Warn: , Antero Mejr via Guix-patches X-Patchwork-Original-From: Antero Mejr via Guix-patches via From: Antero Mejr 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/plan9.scm (plan9port): New variable. --- gnu/packages/plan9.scm | 99 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 99 insertions(+) diff --git a/gnu/packages/plan9.scm b/gnu/packages/plan9.scm index 318344f2ec..747a1aaf64 100644 --- a/gnu/packages/plan9.scm +++ b/gnu/packages/plan9.scm @@ -20,8 +20,13 @@ (define-module (gnu packages plan9) #:use-module (guix build-system gnu) #:use-module (guix git-download) #:use-module (guix packages) + #:use-module (guix gexp) #:use-module (guix utils) #:use-module ((guix licenses) #:prefix license:) + #:use-module (gnu packages base) + #:use-module (gnu packages commencement) + #:use-module (gnu packages fontutils) + #:use-module (gnu packages perl) #:use-module (gnu packages xorg)) (define-public drawterm @@ -63,3 +68,97 @@ (define-public drawterm Plan 9 systems. It behaves like a Plan 9 kernel and will attempt to reconstruct a Plan 9 terminal-like experience from a non-Plan 9 system.") (license license:expat)))) + +(define-public plan9port + ;; no releases + (let ((commit "cc4571fec67407652b03d6603ada6580de2194dc") + (revision "0")) + (package + (name "plan9port") + (version (git-version "0.1.0" revision commit)) + (source (origin + (method git-fetch) + (uri (git-reference + (url "https://github.com/9fans/plan9port") + (commit commit))) + (file-name (git-file-name name version)) + (sha256 + (base32 + "1g2kzlghcghs560na6xalfsjq5zwp015wv9wk8wxn26981zs759x")) + (modules '((guix build utils))) + (snippet #~(for-each delete-file-recursively + '("font/luc" ;nonfree + "font/lucm" + "font/lucsans" + "font/pelm"))))) + (build-system gnu-build-system) + (arguments + (list #:tests? #f ;no tests + #:phases #~(modify-phases %standard-phases + (add-after 'unpack 'setup + (lambda _ + (delete-file "src/cmd/mk/mk.pdf") + (substitute* "src/cmd/acme/acme.c" + (("/lib/font/bit/lucsans/euro.8.font") + (string-append + #$output + "/font/fixed/unicode.5x8.font")) + (("/lib/font/bit/lucm/unicode.9.font") + (string-append + #$output + "/font/fixed/unicode.6x9.font"))) + (substitute* (find-files "src") + (("/lib/font/bit") + (string-append #$output "/font"))) + (substitute* "bin/9c" + (("which") (which "which"))) + (substitute* "src/cmd/fontsrv/freetyperules.sh" + (("'\\$i'/freetype2") + (string-append "-I" #$freetype + "/include/freetype2"))) + (with-output-to-file "LOCAL.config" + (lambda _ + (format #t "CC9=~a~%" #$(cc-for-target)) + (format #t "FONTSRV=fontsrv~%"))) + (setenv "X11" #$libx11) + (setenv "PLAN9" (getcwd)) + (setenv "PLAN9_TARGET" #$output))) + (delete 'configure) ;no configure + (replace 'build + (lambda _ + (invoke "./INSTALL" "-b"))) + (replace 'install + (lambda _ + (for-each + (lambda (x) + (let ((out (string-append #$output "/" x))) + (mkdir-p out) + (copy-recursively x out))) + ;; TODO: use external sky and dict packages + '("bin" "face" "font" "include" "lib" "lp" + "mail" "man" "ndb" "plumb" "tmac" "troff" + "postscript")) + (install-file "rcmain" #$output))) + (add-after 'install 'wrap-executables + (lambda _ + (for-each + (lambda (exe) + (wrap-program exe + `("PLAN9" ":" prefix (,#$output)))) + (find-files (string-append #$output "/bin"))))) + ;; Plan9 doesn't compress man pages + (delete 'compress-documentation)))) + (native-inputs (list perl which)) + (inputs (list fontconfig libx11 libxext libxt)) + ;; Propagate gcc-toolchain because some programs, like the 9c compiler, + ;; are just aliased scripts to gcc equivalents. + (propagated-inputs (list gcc-toolchain)) + (home-page "https://9fans.github.io/plan9port/") + (synopsis "Port of many Plan 9 libraries and programs") + (description + "Plan 9 from User Space (aka plan9port) is a port of many Plan 9 +programs from their native Plan 9 environment to Unix-like operating +systems.") + (license (list license:expat ;modifications + license:lpl1.02 ;original Plan9 code + license:zlib))))) ;src/cmd/bzip2