2023-05-19 20:35:25 +02:00
|
|
|
|
;;; SPDX-License-Identifier: GPL-3.0-or-later
|
2024-05-02 22:48:57 +02:00
|
|
|
|
;;; Copyright © 2023, 2024 Giacomo Leidi <goodoldpaul@autistici.org>
|
2023-05-19 20:35:25 +02:00
|
|
|
|
|
|
|
|
|
(define-module (nongnu packages editors)
|
|
|
|
|
#:use-module (gnu packages base)
|
|
|
|
|
#:use-module (gnu packages gtk)
|
|
|
|
|
#:use-module (guix download)
|
|
|
|
|
#:use-module (guix gexp)
|
|
|
|
|
#:use-module (guix packages)
|
|
|
|
|
#:use-module ((guix licenses) :prefix license:)
|
2024-01-31 18:23:14 +01:00
|
|
|
|
#:use-module (nonguix build-system chromium-binary)
|
|
|
|
|
#:use-module (ice-9 match))
|
2023-05-19 20:35:25 +02:00
|
|
|
|
|
|
|
|
|
(define-public vscodium
|
|
|
|
|
(package
|
|
|
|
|
(name "vscodium")
|
2024-08-14 00:39:33 +02:00
|
|
|
|
(version "1.92.1.24225")
|
2023-05-19 20:35:25 +02:00
|
|
|
|
(source
|
2024-05-02 22:48:57 +02:00
|
|
|
|
(let ((arch (match (or (%current-target-system) (%current-system))
|
|
|
|
|
("aarch64-linux" "arm64")
|
|
|
|
|
("armhf-linux" "armhf")
|
|
|
|
|
(_ "x64")))
|
|
|
|
|
(hash (match (or (%current-target-system) (%current-system))
|
|
|
|
|
("aarch64-linux"
|
2024-08-14 00:39:33 +02:00
|
|
|
|
"0m5x9v577h8n16ypzb1y2066alc59v5bw7jiqp2xr7g20s9kb0vy")
|
2024-05-02 22:48:57 +02:00
|
|
|
|
("armhf-linux"
|
2024-08-14 00:39:33 +02:00
|
|
|
|
"047gz12gx8pa5aglykd0785l6i9ivsn4kkgfhi5l0y4jh8hjys8c")
|
2024-05-02 22:48:57 +02:00
|
|
|
|
(_
|
2024-08-14 00:39:33 +02:00
|
|
|
|
"1w1rhbbk177yz85csck3sax51qnvgaip9w238dmzb4a50ikfnp23"))))
|
2024-05-02 22:48:57 +02:00
|
|
|
|
(origin
|
|
|
|
|
(method url-fetch)
|
|
|
|
|
(uri
|
|
|
|
|
(string-append
|
|
|
|
|
"https://github.com/VSCodium/vscodium/releases/download/" version
|
|
|
|
|
"/VSCodium-linux-" arch "-" version ".tar.gz"))
|
|
|
|
|
(sha256
|
|
|
|
|
(base32 hash)))))
|
2023-05-19 20:35:25 +02:00
|
|
|
|
(build-system chromium-binary-build-system)
|
|
|
|
|
(arguments
|
|
|
|
|
(list #:validate-runpath? #f ; TODO: fails on wrapped binary and included other files
|
|
|
|
|
#:substitutable? #f
|
|
|
|
|
#:wrapper-plan
|
|
|
|
|
#~'("opt/vscodium/codium")
|
|
|
|
|
#:phases
|
|
|
|
|
#~(modify-phases %standard-phases
|
|
|
|
|
(replace 'unpack
|
2024-10-28 12:31:12 +01:00
|
|
|
|
(lambda* (#:key source #:allow-other-keys)
|
2023-05-19 20:35:25 +02:00
|
|
|
|
(mkdir-p "opt/vscodium")
|
2024-10-28 12:31:12 +01:00
|
|
|
|
(invoke "tar" "-xvf" source "-C" "opt/vscodium")))
|
2023-05-19 20:35:25 +02:00
|
|
|
|
(add-before 'install-wrapper 'install-entrypoint
|
|
|
|
|
(lambda _
|
|
|
|
|
(let* ((bin (string-append #$output "/bin")))
|
|
|
|
|
(delete-file (string-append #$output "/environment-variables"))
|
|
|
|
|
(mkdir-p bin)
|
|
|
|
|
(symlink (string-append #$output "/opt/vscodium/codium")
|
|
|
|
|
(string-append bin "/codium")))))
|
|
|
|
|
(add-after 'install-entrypoint 'install-resources
|
|
|
|
|
(lambda _
|
|
|
|
|
(let* ((icons
|
|
|
|
|
(string-append #$output
|
|
|
|
|
"/share/icons/hicolor/512x512/apps"))
|
|
|
|
|
(icon.png
|
|
|
|
|
(string-append #$output
|
|
|
|
|
"/opt/vscodium/resources/app/"
|
|
|
|
|
"resources/linux/code.png"))
|
|
|
|
|
(apps (string-append #$output "/share/applications")))
|
|
|
|
|
(mkdir-p icons)
|
|
|
|
|
(symlink icon.png
|
|
|
|
|
(string-append icons "/code.png"))
|
|
|
|
|
(mkdir-p apps)
|
|
|
|
|
(make-desktop-entry-file
|
|
|
|
|
(string-append apps "/" #$name ".desktop")
|
|
|
|
|
#:name "VSCodium"
|
|
|
|
|
#:generic-name "Text Editor"
|
2024-06-30 09:17:28 +02:00
|
|
|
|
#:exec (string-append #$output "/bin/codium --ozone-platform-hint=auto")
|
2023-05-19 20:35:25 +02:00
|
|
|
|
#:icon "code"
|
|
|
|
|
#:type "Application"
|
|
|
|
|
#:actions '("new-empty-window")
|
|
|
|
|
#:keywords '("vscode")
|
|
|
|
|
#:categories '("TextEditor" "Development"
|
|
|
|
|
"IDE")
|
|
|
|
|
#:startup-notify #t
|
|
|
|
|
#:startup-w-m-class "Code"
|
|
|
|
|
#:comment
|
|
|
|
|
'(("en" "Code Editing. Redefined.")
|
|
|
|
|
(#f "Code Editing. Redefined."))))))
|
|
|
|
|
(add-after 'install-wrapper 'wrap-where-patchelf-does-not-work
|
|
|
|
|
(lambda _
|
|
|
|
|
(wrap-program (string-append #$output "/bin/codium")
|
|
|
|
|
`("LD_LIBRARY_PATH" ":"
|
|
|
|
|
prefix
|
|
|
|
|
(,(string-join
|
|
|
|
|
(list (string-append #$output "/opt/vscodium"))
|
|
|
|
|
":")))))))))
|
2024-01-31 18:23:14 +01:00
|
|
|
|
(supported-systems '("armhf-linux" "aarch64-linux" "x86_64-linux"))
|
2023-05-19 20:35:25 +02:00
|
|
|
|
(native-inputs
|
|
|
|
|
(list tar))
|
|
|
|
|
(inputs
|
|
|
|
|
(list gdk-pixbuf))
|
|
|
|
|
(home-page "https://vscodium.com/")
|
|
|
|
|
(synopsis "Community-driven, freely-licensed binary distribution of VSCode")
|
|
|
|
|
(description "VSCodium is a community-driven, freely-licensed binary
|
|
|
|
|
distribution of Microsoft’s editor VSCode.")
|
|
|
|
|
(license license:expat)))
|