From f30f545c83bfcaff591d8e181bf0ea8a52b86344 Mon Sep 17 00:00:00 2001 From: alex Date: Mon, 1 Dec 2025 08:19:29 -0800 Subject: [PATCH] packages: add bun --- infiniteadaptability/packages/bun.scm | 69 +++++++++++++++++++++++++++ 1 file changed, 69 insertions(+) create mode 100644 infiniteadaptability/packages/bun.scm diff --git a/infiniteadaptability/packages/bun.scm b/infiniteadaptability/packages/bun.scm new file mode 100644 index 0000000..16cd806 --- /dev/null +++ b/infiniteadaptability/packages/bun.scm @@ -0,0 +1,69 @@ +(define-module (infiniteadaptability packages bun) + #:use-module (gnu packages) + #:use-module (gnu packages base) + #:use-module (gnu packages commencement) + #:use-module (gnu packages compression) + #:use-module (gnu packages gcc) + #:use-module (guix build-system copy) + #:use-module (guix download) + #:use-module (guix gexp) + #:use-module (guix git-download) + #:use-module (guix licenses) + #:use-module (guix packages) + #:use-module (nonguix build-system binary)) + +(define-public bun + (package + (name "bun") + (version "1.2.23") + (source + (origin + (method url-fetch) + (uri (string-append + "https://github.com/oven-sh/bun/releases/download/bun-v" version + "/bun-linux-x64.zip")) + (sha256 + (base32 "03hzzvgk2y4wylk7yh1h4lyg4avkdpkcmq74zmpmg7br42lx03ng")))) + (supported-systems '("x86_64-linux")) + (build-system binary-build-system) + (arguments + (list + #:validate-runpath? #t + #:strip-binaries? #f + #:patchelf-plan `'(("bun" ("gcc" "gcc-toolchain" "glibc"))) + #:install-plan + #~'(("bun" "bin/")))) + (inputs `((,gcc "lib") ,gcc-toolchain ,glibc)) + (native-inputs (list unzip)) + (synopsis + "Bun is an all-in-one toolkit for JavaScript and TypeScript apps.") + (description + "Bun is an all-in-one toolkit for JavaScript and TypeScript apps. It ships as a single executable called bun. + + At its core is the Bun runtime, a fast JavaScript runtime designed as a drop-in replacement for Node.js. It's written in Zig and powered by JavaScriptCore under the hood, dramatically reducing startup times and memory usage. + + The bun command-line tool also implements a test runner, script runner, and Node.js-compatible package manager. Instead of 1,000 node_modules for development, you only need bun. Bun's built-in tools are significantly faster than existing options and usable in existing Node.js projects with little to no changes.") + (license expat) + (home-page "https://bun.sh"))) + +(define-public bunx + (package + (name "bunx") + (version "1.2.23") + (source + (plain-file "bunx" "#!/bin/bash\nbun x \"$@\"")) + (build-system copy-build-system) + (arguments + `(#:install-plan '(("bunx" "bin/bunx")) + #:phases (modify-phases %standard-phases + (add-after 'unpack 'fix-permissions + (lambda _ + (for-each (lambda (file) + (chmod file #o555)) + (find-files "bunx")) #t))))) + (home-page "https://bun.sh") + (synopsis "bunx") + (description "bunx") + (license unlicense))) + +bun -- 2.52.0