summaryrefslogtreecommitdiff
path: root/px/packages/programming.scm
diff options
context:
space:
mode:
authorFranz Geffke <franz@pantherx.org>2023-11-06 20:08:14 +0000
committerFranz Geffke <franz@pantherx.org>2023-11-06 20:08:14 +0000
commit47b4c9c854915df93893dbaa993accfacf9027fe (patch)
tree4f9b1742d63fcfbc94cc6b8d84f76c4d00c3a0b7 /px/packages/programming.scm
parent0b426d7b7ed8e176bf464ef9e0683f74a6c9d20f (diff)
rewrite: apply guix-reference formatting; cleanup some module imports
Diffstat (limited to 'px/packages/programming.scm')
-rw-r--r--px/packages/programming.scm284
1 files changed, 163 insertions, 121 deletions
diff --git a/px/packages/programming.scm b/px/packages/programming.scm
index 569214f..23d75c5 100644
--- a/px/packages/programming.scm
+++ b/px/packages/programming.scm
@@ -1,6 +1,7 @@
(define-module (px packages programming)
#:use-module (nonguix build-system binary)
- #:use-module ((guix licenses) :prefix license:)
+ #:use-module ((guix licenses)
+ :prefix license:)
#:use-module (guix download)
#:use-module (guix packages)
#:use-module (guix utils)
@@ -24,131 +25,172 @@
(define* (make-vscode-release-asset version asset hash)
(origin
(method url-fetch)
- (uri
- (string-append
- "https://update.code.visualstudio.com/" version "/"
- (match (or (%current-system) (%current-target-system))
- ("x86_64-linux" "linux-x64")
- ("aarch64-linux" "linux-arm64")
- ("armhf-linux" "linux-armhf"))
- "/stable"))
- (sha256
- (base32 hash))))
-
+ (uri (string-append "https://update.code.visualstudio.com/" version "/"
+ (match (or (%current-system)
+ (%current-target-system))
+ ("x86_64-linux" "linux-x64")
+ ("aarch64-linux" "linux-arm64")
+ ("armhf-linux" "linux-armhf")) "/stable"))
+ (sha256 (base32 hash))))
+
(define-public vscode
(package
(name "vscode")
(version "1.82.2")
- (source #f)
+ (source
+ #f)
(build-system binary-build-system)
(arguments
- `(#:patchelf-plan
- `(("opt/vscode/code"
- ("glib" "atk" "libx11" "dbus" "gdk-pixbuf" "gtk+" "pango" "fontconfig"
- "cairo" "libxcomposite" "libxdamage" "libxext" "libxfixes" "libxshmfence"
- "libxkbfile" "libxrandr" "expat" "libdrm" "libxkbcommon" "mesa" "alsa-lib"
- "cups" "at-spi2-core" "libxcb" "at-spi2-atk" "nspr" "gcc" "zlib" "gcc:lib"
- "libsecret")))
- #:phases
- (modify-phases %standard-phases
- (replace 'unpack
- (lambda* (#:key inputs outputs #:allow-other-keys)
- (mkdir-p "opt/vscode")
- (invoke "tar" "--strip-components=1" "-xvf" (assoc-ref inputs "vscode") "-C" "opt/vscode")
- #t))
- (add-after 'install 'add-desktop-file
- (lambda* (#:key inputs outputs #:allow-other-keys)
- (let* ((out (assoc-ref outputs "out"))
- (iconpath (string-append out "/share/icons/hicolor/512x512/apps/"))
- (desktoppath (string-append out "/share/applications/"))
- (desktopdata (string-append "[Desktop Entry]\n"
- "Name=Visual Studio Code\n"
- "Comment=Code Editing. Redefined.\n"
- "GenericName=Text Editor\n"
- "Exec=" out "/opt/vscode/bin/code\n"
- "Icon=vscode\n"
- "Type=Application\n"
- "StartupNotify=true\n"
- "StartupWMClass=Code\n"
- "Categories=TextEditor;Development;IDE;\n"
- "Actions=new-empty-window;\n"
- "Keywords=vscode;\n\n")))
- (mkdir-p iconpath)
- (invoke "cp" "opt/vscode/resources/app/resources/linux/code.png" (string-append iconpath "vscode.png"))
- (mkdir-p desktoppath)
- (with-output-to-file (string-append desktoppath ,name ".desktop")
- (lambda _ (format #t desktopdata))))
- (invoke "rm" (string-append %output "/environment-variables"))
- (mkdir-p (string-append %output "/bin"))
- (invoke "ln" "-s" (string-append %output "/opt/vscode/bin/code") (string-append %output "/bin/"))
- #t))
- (add-after 'install 'wrap-where-patchelf-does-not-work
- (lambda* (#:key inputs outputs #:allow-other-keys)
- (let ((out (assoc-ref outputs "out")))
- (wrap-program (string-append out "/opt/vscode/code")
- `("FONTCONFIG_PATH" ":"
- prefix
- (,(string-join
- (list
- (string-append (assoc-ref inputs "fontconfig") "/etc/fonts")
- out)
- ":"))))
- (wrap-program (string-append out "/opt/vscode/code")
- `("LD_LIBRARY_PATH" ":"
- prefix
- (,(string-join
- (list
- (string-append (assoc-ref inputs "nss") "/lib/nss")
- (string-append (assoc-ref inputs "eudev") "/lib")
- (string-append (assoc-ref inputs "gcc") "/lib")
- (string-append (assoc-ref inputs "libxkbfile") "/lib")
- (string-append (assoc-ref inputs "zlib") "/lib")
- (string-append (assoc-ref inputs "libsecret") "/lib")
- (string-append out "/opt/vscode")
- out)
- ":")))))
- #t)))))
- (native-inputs
- `(("tar" ,tar)))
- (inputs
- `(("vscode"
- ,(make-vscode-release-asset
- version "vscode"
- "0i6zk4zkwcw5lnzhg7vvnsw17nar97bbq3iishag9cpjqs9jpq4z"))
- ("gcc:lib" ,gcc "lib")
- ("gcc" ,gcc "lib")
- ("glib" ,glib)
- ("nss" ,nss)
- ("nspr" ,nspr)
- ("atk" ,atk)
- ("libx11" ,libx11)
- ("dbus" ,dbus)
- ("librsvg" ,librsvg)
- ("gtk+" ,gtk+)
- ("pango" ,pango)
- ("cairo" ,cairo)
- ("libxcomposite" ,libxcomposite)
- ("libxdamage" ,libxdamage)
- ("libxext" ,libxext)
- ("libxfixes" ,libxfixes)
- ("libxrandr" ,libxrandr)
- ("libxkbfile" ,libxkbfile)
- ("libxshmfence" ,libxshmfence)
- ("libsecret" ,libsecret)
- ("expat" ,expat)
- ("libdrm" ,libdrm)
- ("libxkbcommon" ,libxkbcommon)
- ("mesa" ,mesa)
- ("alsa-lib" ,alsa-lib)
- ("cups" ,cups)
- ("at-spi2-core" ,at-spi2-core)
- ("libxcb" ,libxcb)
- ("at-spi2-atk" ,at-spi2-atk)
- ("eudev" ,eudev)
- ("fontconfig" ,fontconfig)
- ("zlib" ,zlib)
- ("bash-minimal" ,bash-minimal)))
+ `(#:patchelf-plan `(("opt/vscode/code" ("glib" "atk"
+ "libx11"
+ "dbus"
+ "gdk-pixbuf"
+ "gtk+"
+ "pango"
+ "fontconfig"
+ "cairo"
+ "libxcomposite"
+ "libxdamage"
+ "libxext"
+ "libxfixes"
+ "libxshmfence"
+ "libxkbfile"
+ "libxrandr"
+ "expat"
+ "libdrm"
+ "libxkbcommon"
+ "mesa"
+ "alsa-lib"
+ "cups"
+ "at-spi2-core"
+ "libxcb"
+ "at-spi2-atk"
+ "nspr"
+ "gcc"
+ "zlib"
+ "gcc:lib"
+ "libsecret")))
+ #:phases (modify-phases %standard-phases
+ (replace 'unpack
+ (lambda* (#:key inputs outputs #:allow-other-keys)
+ (mkdir-p "opt/vscode")
+ (invoke "tar"
+ "--strip-components=1"
+ "-xvf"
+ (assoc-ref inputs "vscode")
+ "-C"
+ "opt/vscode") #t))
+ (add-after 'install 'add-desktop-file
+ (lambda* (#:key inputs outputs #:allow-other-keys)
+ (let* ((out (assoc-ref outputs "out"))
+ (iconpath (string-append out
+ "/share/icons/hicolor/512x512/apps/"))
+ (desktoppath (string-append out
+ "/share/applications/"))
+ (desktopdata (string-append "[Desktop Entry]\n"
+ "Name=Visual Studio Code\n"
+ "Comment=Code Editing. Redefined.\n"
+ "GenericName=Text Editor\n"
+ "Exec="
+ out
+ "/opt/vscode/bin/code\n"
+ "Icon=vscode\n"
+ "Type=Application\n"
+ "StartupNotify=true\n"
+ "StartupWMClass=Code\n"
+ "Categories=TextEditor;Development;IDE;\n"
+ "Actions=new-empty-window;\n"
+ "Keywords=vscode;\n\n")))
+ (mkdir-p iconpath)
+ (invoke "cp"
+ "opt/vscode/resources/app/resources/linux/code.png"
+ (string-append iconpath "vscode.png"))
+ (mkdir-p desktoppath)
+ (with-output-to-file (string-append desktoppath
+ ,name ".desktop")
+ (lambda _
+ (format #t desktopdata))))
+ (invoke "rm"
+ (string-append %output "/environment-variables"))
+ (mkdir-p (string-append %output "/bin"))
+ (invoke "ln" "-s"
+ (string-append %output "/opt/vscode/bin/code")
+ (string-append %output "/bin/")) #t))
+ (add-after 'install 'wrap-where-patchelf-does-not-work
+ (lambda* (#:key inputs outputs #:allow-other-keys)
+ (let ((out (assoc-ref outputs "out")))
+ (wrap-program (string-append out "/opt/vscode/code")
+ `("FONTCONFIG_PATH" ":" prefix
+ (,(string-join (list (string-append (assoc-ref
+ inputs
+ "fontconfig")
+ "/etc/fonts")
+ out) ":"))))
+ (wrap-program (string-append out "/opt/vscode/code")
+ `("LD_LIBRARY_PATH" ":" prefix
+ (,(string-join (list (string-append (assoc-ref
+ inputs "nss")
+ "/lib/nss")
+ (string-append (assoc-ref
+ inputs
+ "eudev")
+ "/lib")
+ (string-append (assoc-ref
+ inputs "gcc")
+ "/lib")
+ (string-append (assoc-ref
+ inputs
+ "libxkbfile")
+ "/lib")
+ (string-append (assoc-ref
+ inputs "zlib")
+ "/lib")
+ (string-append (assoc-ref
+ inputs
+ "libsecret")
+ "/lib")
+ (string-append out
+ "/opt/vscode")
+ out) ":"))))) #t)))))
+ (native-inputs `(("tar" ,tar)))
+ (inputs `(("vscode" ,(make-vscode-release-asset version "vscode"
+ "0i6zk4zkwcw5lnzhg7vvnsw17nar97bbq3iishag9cpjqs9jpq4z"))
+ ("gcc:lib" ,gcc "lib")
+ ("gcc" ,gcc "lib")
+ ("glib" ,glib)
+ ("nss" ,nss)
+ ("nspr" ,nspr)
+ ("atk" ,atk)
+ ("libx11" ,libx11)
+ ("dbus" ,dbus)
+ ("librsvg" ,librsvg)
+ ("gtk+" ,gtk+)
+ ("pango" ,pango)
+ ("cairo" ,cairo)
+ ("libxcomposite" ,libxcomposite)
+ ("libxdamage" ,libxdamage)
+ ("libxext" ,libxext)
+ ("libxfixes" ,libxfixes)
+ ("libxrandr" ,libxrandr)
+ ("libxkbfile" ,libxkbfile)
+ ("libxshmfence" ,libxshmfence)
+ ("libsecret" ,libsecret)
+ ("expat" ,expat)
+ ("libdrm" ,libdrm)
+ ("libxkbcommon" ,libxkbcommon)
+ ("mesa" ,mesa)
+ ("alsa-lib" ,alsa-lib)
+ ("cups" ,cups)
+ ("at-spi2-core" ,at-spi2-core)
+ ("libxcb" ,libxcb)
+ ("at-spi2-atk" ,at-spi2-atk)
+ ("eudev" ,eudev)
+ ("fontconfig" ,fontconfig)
+ ("zlib" ,zlib)
+ ("bash-minimal" ,bash-minimal)))
(home-page "https://code.visualstudio.com/")
- (synopsis "Visual Studio Code is a code editor redefined and optimized for building and debugging modern web and cloud applications.")
- (description "Visual Studio Code is a code editor redefined and optimized for building and debugging modern web and cloud applications.")
+ (synopsis
+ "Visual Studio Code is a code editor redefined and optimized for building and debugging modern web and cloud applications.")
+ (description
+ "Visual Studio Code is a code editor redefined and optimized for building and debugging modern web and cloud applications.")
(license license:expat)))