This commit is contained in:
Daniel Ziltener 2024-04-15 17:21:02 +02:00
parent e364049e5d
commit 20a811bbc2
Signed by: zilti
GPG key ID: B38976E82C9DAE42
3 changed files with 382 additions and 158 deletions

View file

@ -21,7 +21,6 @@
#:use-module (gnu packages bison)
#:use-module (gnu packages build-tools)
#:use-module (gnu packages check)
#:use-module (gnu packages cmake)
#:use-module (gnu packages compression)
#:use-module (gnu packages cpio)
#:use-module (gnu packages docbook)
@ -51,9 +50,10 @@
#:use-module (gnu packages web)
#:use-module (gnu packages xml)
#:use-module (gnu packages wm)
#:use-module (gnu packages xorg))
#:use-module (gnu packages xorg)
#:use-module ((zilti packages utilities) #:prefix utils:))
(define-public tomlplusplus
(define-public tomlplusplus ;; SENT to Guix
(package
(name "tomlplusplus")
(version "3.4.0")
@ -67,7 +67,7 @@
"1hvbifzcc97r9jwjzpnq31ynqnj5y93cjz4frmgddnkg8hxmp6w7"))))
(build-system meson-build-system)
(native-inputs
(list python cmake))
(list python utils:cmake))
(arguments
(list #:tests? #f))
(home-page "https://marzer.github.io/tomlplusplus/")
@ -75,30 +75,30 @@
(description "Header-only TOML config file parser and serializer for C++17.")
(license license:expat)))
(define udis86-for-hyprland
(let ((revision "186")
(commit "5336633af70f3917760a6d441ff02d93477b0c86"))
(define-public libliftoff
(package
(name "udis86")
(version (git-version "1.7.2" revision commit))
(name "libliftoff")
(version "0.4.1")
(source (origin
(method git-fetch)
(uri (git-reference
(url "https://github.com/canihavesomecoffee/udis86")
(commit commit)))
(file-name (git-file-name name version))
(url "https://gitlab.freedesktop.org/emersion/libliftoff")
(commit (string-append "v" version))))
(sha256
(base32
"0y5z1169wff578jylpafsww4px4y6gickhcs885a9c660d8xs9qy"))))
(build-system gnu-build-system)
(native-inputs (list autoconf automake libtool python-minimal-wrapper))
(home-page "https://github.com/canihavesomecoffee/udis86")
(synopsis "Disassembler Library for x86 and x86-64")
(description
"Udis86 is a disassembler for the x86 and x86-64 class of instruction
set architectures. It consists of a C library called @code{libudis86} and a
command line tool called @code{udcli} that incorporates the library.")
(license license:bsd-2))))
"1ikjp638d655ycaqkdnzhb12d29kkbb3a46lqhbhsfc8vsqj3z1l"))))
(build-system meson-build-system)
(native-inputs
(list utils:cmake
pkg-config))
(inputs
(list libdrm))
(home-page "https://gitlab.freedesktop.org/emersion/libliftoff/")
(synopsis "Lightweight KMS plane library.")
(description "libliftoff eases the use of KMS planes from userspace without standing in your
way. Users create \"virtual planes\" called layers, set KMS properties on them,
and libliftoff will pick hardware planes for these layers if possible.")
(license license:expat)))
(define cairo-for-hyprland
(package
@ -143,14 +143,14 @@ command line tool called @code{udcli} that incorporates the library.")
(base32
"1sxgvis0abkymc02nhx2svm60myiq3shvy759sphpxl5rp52g6y5"))))))
(define-public wlroots-for-hyprland
(define-public wlroots-hyprland
(let ((base wlroots)
(revision "255")
(commit "50eae512d9cecbf0b3b1898bb1f0b40fa05fe19b"))
(package
(inherit base)
(name "wlroots")
(version (git-version "0.18.0" revision commit))
(version (git-version "0.19.0" revision commit))
(source (origin
(method git-fetch)
(uri (git-reference
@ -184,15 +184,6 @@ command line tool called @code{udcli} that incorporates the library.")
(base32
"0yijzgg6rdsa68bz03sw0lcfa2nclv9m3as1cja50wkcyxim7x9v"))))))
(define hyprland-unbundle-wlroots-patch
(origin
(method url-fetch)
(uri (string-append "https://github.com/hyprwm/Hyprland" "/raw/"
"c5e28ebcfe00a510922779b2c568cfa52a317445"
"/nix/patches/meson-build.patch"))
(sha256
(base32 "00i7c98ignfgkk3x1r1masmlj92xzb8cdb7nyfhivbfkdlfyzgpj"))))
(define-public hyprcursor
(package
(inherit rosenthal:hyprcursor)
@ -210,83 +201,75 @@ command line tool called @code{udcli} that incorporates the library.")
(modify-inputs (package-inputs rosenthal:hyprcursor)
(append tomlplusplus)))))
(define-public hyprlang
(package
(inherit rosenthal:hyprlang)
(name "hyprlang")
(version "0.5.1")
(source (origin
(method git-fetch)
(uri (git-reference
(url "https://github.com/hyprwm/hyprlang")
(commit (string-append "v" version))))
(sha256
(base32
"1vgvbnd6l5iymb66zdcslhs4w20a7i013qmf4jnxx10z1p8rfkg7"))))))
(define-public hyprland
(package
(name "hyprland")
(version "0.38.1")
(version "0.39.0")
(source (origin
(method url-fetch)
(uri (string-append "https://github.com/hyprwm/Hyprland"
"/releases/download/v" version
"/source-v" version ".tar.gz"))
(modules '((guix build utils)))
(patches (list hyprland-unbundle-wlroots-patch))
(method git-fetch)
(uri (git-reference
(url "https://github.com/hyprwm/hyprland")
(commit (string-append "v" version))
(recursive? #t)))
(sha256
(base32
"1avkzdcgyk65p44nwl9w8sv4iq5xs13i7i66jsya9z06q1f3d1hs"))))
(build-system meson-build-system)
"0v6xadkrl138irq43s7y747krdirqz9fskw74jbizs5nij1qm9qi"))))
(build-system cmake-build-system )
(arguments
(list #:build-type "release"
#:cmake utils:cmake
#:parallel-build? #t
#:configure-flags #~(list "-Dxwayland=enabled")
#:phases
#~(modify-phases %standard-phases
(add-after 'unpack 'fix-path
(lambda* (#:key inputs #:allow-other-keys)
(substitute* (find-files "src" "\\.cpp$")
(("/usr/local(/bin/Hyprland)" _ path)
(string-append #$output path))
(("/usr") #$output)
(("(execAndGet\\(\")\\<(cat|fc-list|lspci)\\>"
_ pre cmd)
(string-append
pre (search-input-file
inputs (string-append "bin/" cmd))))
(("\\<cc\\>") (search-input-file inputs "bin/gcc"))
;; NOTE: Add binutils to inputs will override ld-wrapper.
(("(execAndGet\\(\\(\")\\<nm\\>" _ pre)
(string-append pre #$binutils "/bin/nm"))
(("\\<(addr2line|objcopy)\\>" _ cmd)
(string-append #$binutils "/bin/" cmd)))))
(add-after 'build 'install-headers
(lambda _
(copy-recursively
"protocols" "../hyprland-source/protocols")
(invoke "mkdir" "../hyprland-source/build")
(copy-file
"meson-private/hyprland.pc" "../hyprland-source/build/hyprland.pc")
(invoke "find" "." "-name" "hyprland.pc")
(with-directory-excursion
"../hyprland-source"
(invoke "sed" "-i" "/wlroots/d" "Makefile")
(invoke "make"
(string-append "PREFIX=" #$output)
"installheaders")))))))
#:configure-flags #~(list "-DNO_XWAYLAND=1"
"-DNO_SYSTEMD=1")
#:phases #~(modify-phases %standard-phases
(delete 'check))))
(native-inputs
(list cmake
cpio
(list cpio
meson
ninja
gcc-13
git
python-wrapper
jq
pkg-config
rosenthal:hyprland-protocols))
pkg-config))
(propagated-inputs
(list
eglexternalplatform
egl-wayland))
egl-wayland
libglvnd))
(inputs
(list cairo-for-hyprland
eudev
gcc-13
hwdata-for-hyprland
hyprcursor
hyprlang
libdisplay-info
libdrm-for-hyprland
libinput-minimal-1.24.0
libliftoff
libseat
libxcb
rosenthal:hyprland-protocols
rosenthal:hyprlang
libxkbcommon
mesa
pango
pciutils
tomlplusplus
udis86-for-hyprland
wlroots-for-hyprland
xcb-util-wm
xorg-server-xwayland))
wayland
wayland-protocols-for-hyprland))
(home-page "https://hyprland.org")
(synopsis "Dynamic tiling Wayland compositor based on wlroots")
(description
@ -314,18 +297,18 @@ more.")
#:configure-flags #~(list
"-Dcpp_std=none"
(string-append "-Dcpp_args=-std=gnu++2b"
" -I" #$(file-append wlroots-for-hyprland "/include")))
" -I" #$(file-append wlroots-hyprland "/include")))
#:phases #~(modify-phases %standard-phases
(delete 'check))))
(native-inputs
(list cmake
(list utils:cmake
gcc-13
pkg-config
wlroots-for-hyprland))
wlroots-hyprland))
(inputs
(list cairo-for-hyprland
hyprland
rosenthal:hyprlang
hyprlang
libdrm-for-hyprland
libinput
pixman))
@ -372,12 +355,12 @@ more.")
mesa
rosenthal:hyprland-protocols
wayland-protocols-for-hyprland
wlroots-for-hyprland
wlroots-hyprland
file
libglvnd
libjpeg-turbo
libwebp
rosenthal:hyprlang
hyprlang
pango
wayland))
(home-page "https://github.com/hyprwm/hyprpaper")
@ -406,7 +389,7 @@ more.")
(list gcc-13
pkg-config))
(inputs
(list rosenthal:hyprlang
(list hyprlang
sdbus-c++
wayland-protocols-for-hyprland
wayland))
@ -455,7 +438,7 @@ more.")
libglvnd
libxkbcommon
wayland-protocols-for-hyprland
rosenthal:hyprlang))
hyprlang))
(home-page "https://github.com/hyprwm/hyprlock")
(synopsis "Hyprland's GPU-accelerated screen locking utility")
(description "Hyprland's simple, yet multi-threaded and GPU-accelerated screen locking utility.")
@ -495,7 +478,7 @@ more.")
grim
hyprland
rosenthal:hyprland-protocols
rosenthal:hyprlang
hyprlang
mesa
pipewire
qtwayland

View file

@ -1,14 +1,24 @@
(define-module
(zilti packages utilities)
#:use-module
(srfi srfi-1)
#:use-module
(guix download)
#:use-module
(guix git-download)
#:use-module
(guix gexp)
#:use-module
(guix search-paths)
#:use-module
(guix packages)
#:use-module
(guix utils)
#:use-module
(guix build-system cmake)
#:use-module
(guix build-system gnu)
#:use-module
(guix build-system trivial)
#:use-module
(guix build-system glib-or-gtk)
@ -24,10 +34,18 @@
#:use-module
(gnu packages bison)
#:use-module
(gnu packages cmake)
#:use-module
(gnu packages compression)
#:use-module
(gnu packages cpp)
#:use-module
(gnu packages crypto)
#:use-module
(gnu packages curl)
#:use-module
(gnu packages file)
#:use-module
(gnu packages freedesktop)
#:use-module
(gnu packages gettext)
@ -40,8 +58,12 @@
#:use-module
(gnu packages gtk)
#:use-module
(gnu packages libevent)
#:use-module
(gnu packages linux)
#:use-module
(gnu packages ncurses)
#:use-module
(gnu packages networking)
#:use-module
(gnu packages package-management)
@ -54,6 +76,12 @@
#:use-module
(gnu packages python-build)
#:use-module
(gnu packages serialization)
#:use-module
(gnu packages sphinx)
#:use-module
(gnu packages texinfo)
#:use-module
(gnu packages tls)
#:use-module
(gnu packages virtualization)
@ -113,11 +141,9 @@ to manage non-containerized applications.")
"1b7z4wzh2zgphcal95vj4x7wbr9s89p2a4c0l0g4w4xcwx6ccw2v"))
(patches
(search-patches "flatpak-fix-path.patch"))))
;; Wrap 'flatpak' so that GIO_EXTRA_MODULES is set, thereby allowing GIO to
;; find the TLS backend in glib-networking.
(build-system glib-or-gtk-build-system)
(arguments
(list
#:configure-flags
@ -136,23 +162,31 @@ to manage non-containerized applications.")
#:phases
#~(modify-phases %standard-phases
(add-after 'unpack 'fix-tests
(lambda* (#:key inputs #:allow-other-keys)
(lambda*
(#:key inputs #:allow-other-keys)
(copy-recursively
(search-input-directory inputs "lib/locale")
"/tmp/locale")
(for-each make-file-writable (find-files "/tmp"))
(for-each make-file-writable
(find-files "/tmp"))
(substitute* "tests/make-test-runtime.sh"
(("cp `which.*") "echo guix\n")
(("cp `which.*")
"echo guix\n")
(("cp -r /usr/lib/locale/C\\.\\*")
(string-append "mkdir ${DIR}/usr/lib/locale/en_US; \
cp -r /tmp/locale/*/en_US.*")))
(substitute* "tests/libtest.sh"
(("/bin/kill") (which "kill"))
(("/usr/bin/python3") (which "python3")))
(("/bin/kill")
(which "kill"))
(("/usr/bin/python3")
(which "python3")))
#t))
(add-after 'unpack 'p11-kit-fix
(lambda* (#:key inputs #:allow-other-keys)
(let ((p11-path (search-input-file inputs "/bin/p11-kit")))
(lambda*
(#:key inputs #:allow-other-keys)
(let
((p11-path
(search-input-file inputs "/bin/p11-kit")))
(substitute* "session-helper/flatpak-session-helper.c"
(("\"p11-kit\",")
(string-append "\"" p11-path "\","))
@ -162,7 +196,8 @@ cp -r /tmp/locale/*/en_US.*")))
;; Many tests fail for unknown reasons, so we just run a few basic
;; tests.
(replace 'check
(lambda* (#:key tests? #:allow-other-keys)
(lambda*
(#:key tests? #:allow-other-keys)
(when tests?
(setenv "HOME" "/tmp")
(invoke "make" "check"
@ -172,7 +207,8 @@ cp -r /tmp/locale/*/en_US.*")))
(list bison
dbus ; for dbus-daemon
gettext-minimal
`(,glib "bin") ; for glib-mkenums + gdbus-codegen
`(,glib "bin")
; for glib-mkenums + gdbus-codegen
(libc-utf8-locales-for-target)
gobject-introspection
libcap
@ -203,10 +239,158 @@ cp -r /tmp/locale/*/en_US.*")))
util-linux
xdg-dbus-proxy
zstd))
(propagated-inputs (list glib-networking gnupg gsettings-desktop-schemas))
(propagated-inputs
(list glib-networking gnupg gsettings-desktop-schemas))
(home-page "https://flatpak.org")
(synopsis "System for building, distributing, and running sandboxed desktop
applications")
(description "Flatpak is a system for building, distributing, and running
sandboxed desktop applications on GNU/Linux.")
(license license:lgpl2.1+)))
;;;; CMake
;; Build phases shared between 'cmake-bootstrap' and the later variants
;; that use cmake-build-system.
#;
(define
(%common-build-phases)
`((add-after 'unpack 'split-package
;; Remove files that have been packaged in other package recipes.
(lambda _
(delete-file "Auxiliary/cmake-mode.el")
(substitute* "Auxiliary/CMakeLists.txt"
((".*cmake-mode.el.*")
""))))
,@(if
(target-x86-32?)
'((add-after 'unpack 'skip-cpack-txz-test
(lambda _
;; In 'RunCMake.CPack_TXZ', the 'TXZ/THREADED_ALL' test
;; would occasionally fail on i686 with "Internal error
;; initializing compression library: Cannot allocate
;; memory": <https://issues.guix.gnu.org/50617>. Skip it.
(substitute* "Tests/RunCMake/CPack/RunCMakeTest.cmake"
(("THREADED_ALL \"TXZ;DEB\"")
"THREADED_ALL \"DEB\"")))))
'())
(add-before 'configure 'patch-bin-sh
(lambda _
;; Replace "/bin/sh" by the right path in... a lot of
;; files.
(substitute*
'("Modules/CompilerId/Xcode-3.pbxproj.in"
"Modules/Internal/CPack/CPack.RuntimeScript.in"
"Source/cmGlobalXCodeGenerator.cxx"
"Source/cmLocalUnixMakefileGenerator3.cxx"
"Source/cmExecProgramCommand.cxx"
"Tests/CMakeLists.txt"
"Tests/RunCMake/File_Generate/RunCMakeTest.cmake")
(("/bin/sh")
(which "sh")))))))
;;; The "user-facing" CMake, now with manuals and HTML documentation.
(define-public cmake
(package
(inherit cmake-minimal)
(version "3.29.2")
(name "cmake")
(source
(origin
(method git-fetch)
(uri (git-reference
(url "https://gitlab.kitware.com/cmake/cmake")
(commit (string-append "v" version))
(recursive? #t)))
(sha256
(base32
"0yjk4kqrln8smz457dxansfl69zyikr5015xm23xa4g7x1rihkgg"))))
(outputs
'("out" "doc"))
(arguments
(substitute-keyword-arguments
(package-arguments cmake-minimal)
;; Use cmake-minimal this time.
((#:cmake _ #f)
(if
(%current-target-system)
cmake-minimal-cross
cmake-minimal))
;; Enable debugging information for convenience.
((#:build-type _ #f)
"RelWithDebInfo")
((#:configure-flags flags
''())
#~(append
(list "-DSPHINX_INFO=ON" "-DSPHINX_MAN=ON" "-DSPHINX_HTML=ON"
(string-append "-DCMAKE_DOC_DIR=share/doc/cmake-"
#$(version-major+minor
(package-version
cmake-minimal)))
(string-append "-DCMake_INSTALL_VIMFILES_DIR=" #$output
"/share/vim/vimfiles/pack/guix/start/cmake")
"-DCMAKE_INFO_DIR=share/info"
"-DCMAKE_MAN_DIR=share/man")
#$flags))
((#:phases phases)
#~(modify-phases #$phases
(delete 'delete-help-documentation)
(add-after 'install 'move-html-doc
(lambda _
(let
((html
(string-append "/share/doc/cmake-"
#$(version-major+minor
(package-version cmake-minimal))
"/html")))
(copy-recursively
(string-append #$output html)
(string-append #$output:doc html))
(delete-file-recursively
(string-append #$output html)))))))))
(inputs
(modify-inputs
(package-inputs cmake-minimal)
(prepend ncurses)
(prepend cppdap)))
;required for ccmake
;; Extra inputs required to build the documentation.
(native-inputs
(modify-inputs
(package-native-inputs cmake-minimal)
(append python-sphinx
texinfo)))
(properties
(alist-delete 'hidden?
(package-properties cmake-minimal)))))
(define-public cppdap ;; SENT to Guix
(package
(name "cppdap")
(version "1.58.0-a")
(source
(origin
(method git-fetch)
(uri
(git-reference
(url "https://github.com/google/cppdap")
(commit (string-append "dap-" version))))
(sha256
(base32
"0fq2w35fw1lb5wya1nny45pk3a13b689k48calk1cmqmqpbcjn2b"))))
(build-system cmake-build-system)
(arguments
(list
#:configure-flags #~(list "-DCPPDAP_USE_EXTERNAL_NLOHMANN_JSON_PACKAGE=ON")
#:phases #~(modify-phases %standard-phases
(delete 'check))))
(propagated-inputs
(list nlohmann-json))
(home-page "https://github.com/google/cppdap")
(synopsis "C++ library for the Debug Adapter Protocol")
(description
"cppdap is a C++11 library (\"SDK\") implementation of the Debug Adapter Protocol,
providing an API for implementing a DAP client or server.
cppdap provides C++ type-safe structures for the full DAP specification, and provides
a simple way to add custom protocol messages.")
(license license:expat)))

57
zilti/packages/zig.scm Normal file
View file

@ -0,0 +1,57 @@
(define-module
(zilti packages zig)
#:use-module
(guix packages)
#:use-module
(guix utils)
#:use-module
(guix download)
#:use-module
(guix gexp)
#:use-module
(guix git-download)
#:use-module
(guix build-system zig)
#:use-module
((guix licenses) #:prefix license:)
#:use-module
(gnu packages)
#:use-module
(gnu packages compression)
#:use-module
(gnu packages llvm)
#:use-module
(gnu packages llvm-meta)
#:use-module
(gnu packages zig)
)
(define-public zig-0.11
(package
(inherit zig-0.10)
(name "zig")
(version "0.11.0")
(source
(origin
(method git-fetch)
(uri (git-reference
(url "https://github.com/ziglang/zig.git")
(commit version)))
(file-name (git-file-name name version))
(sha256
(base32 "0qh7c27cd4wcdjj0mbpkarvwypfk1js8hkyxs0z149qv75zkbrca"))))
(arguments
(substitute-keyword-arguments (package-arguments zig-0.10)
((#:parallel-build? _ #f) #t)))
(inputs
(modify-inputs (package-inputs zig-0.10)
(replace "clang" clang-16)
(replace "lld" lld-16)))
(propagated-inputs
(list clang-16))
(native-inputs
(modify-inputs (package-native-inputs zig-0.10)
(prepend clang-toolchain-16)
(replace "llvm" llvm-16)))
(properties `((max-silent-time . 9600)
,@(clang-compiler-cpu-architectures "16")))))