guixchannel/zilti/packages/utilities.scm

397 lines
12 KiB
Scheme

(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)
#:use-module
((guix licenses)
#:prefix license:)
#:use-module
(gnu packages)
#:use-module
(gnu packages backup)
#:use-module
(gnu packages base)
#: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)
#:use-module
(gnu packages glib)
#:use-module
(gnu packages gnome)
#:use-module
(gnu packages gnupg)
#: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)
#:use-module
(gnu packages pkg-config)
#:use-module
(gnu packages polkit)
#:use-module
(gnu packages python)
#: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)
#:use-module
(gnu packages xml)
#:use-module
(gnu packages xorg)
)
(define-public process-compose
(package
(name "process-compose")
(version "0.88.0")
(source
(origin
(method url-fetch/tarbomb)
(uri
(string-append "https://github.com/F1bonacc1/process-compose/releases/download/v" version "/process-compose_linux_amd64.tar.gz"))
(sha256
(base32
"1fd6pb4gcja48xkxwb16vax884m9c6hddcnxgsvm4c8khfd082v0"))))
(build-system trivial-build-system)
(arguments
(list
#:modules
'((guix build utils))
#:builder #~(let*
((source
(assoc-ref %build-inputs "source"))
(output
(assoc-ref %outputs "out"))
(out-bin
(string-append output "/bin")))
(use-modules
(guix build utils))
(install-file
(string-append source "/process-compose")
out-bin))))
(home-page "https://f1bonacc1.github.io/process-compose")
(synopsis "Scheduler and orchestrator for processes")
(description "Process Compose is a simple and flexible scheduler and orchestrator
to manage non-containerized applications.")
(license license:expat)))
(define-public flatpak
(package
(name "flatpak")
(version "1.14.5")
(source
(origin
(method url-fetch)
(uri
(string-append "https://github.com/flatpak/flatpak/releases/download/"
version "/flatpak-" version ".tar.xz"))
(sha256
(base32
"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
#~(list
"--with-curl"
"--enable-documentation=no" ;; FIXME
"--enable-system-helper=no"
(string-append "--with-system-bubblewrap="
(assoc-ref %build-inputs "bubblewrap")
"/bin/bwrap")
(string-append "--with-system-dbus-proxy="
(assoc-ref %build-inputs "xdg-dbus-proxy")
"/bin/xdg-dbus-proxy")
"--localstatedir=/var"
)
#:phases
#~(modify-phases %standard-phases
(add-after 'unpack 'fix-tests
(lambda*
(#:key inputs #:allow-other-keys)
(copy-recursively
(search-input-directory inputs "lib/locale")
"/tmp/locale")
(for-each make-file-writable
(find-files "/tmp"))
(substitute* "tests/make-test-runtime.sh"
(("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")))
#t))
(add-after 'unpack 'p11-kit-fix
(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 "\","))
(("if \\(g_find_program_in_path \\(\"p11-kit\"\\)\\)")
(string-append "if (g_find_program_in_path (\""
p11-path "\"))"))))))
;; Many tests fail for unknown reasons, so we just run a few basic
;; tests.
(replace 'check
(lambda*
(#:key tests? #:allow-other-keys)
(when tests?
(setenv "HOME" "/tmp")
(invoke "make" "check"
"TESTS=tests/test-basic.sh tests/test-config.sh
testcommon")))))))
(native-inputs
(list bison
dbus ; for dbus-daemon
gettext-minimal
`(,glib "bin")
; for glib-mkenums + gdbus-codegen
(libc-utf8-locales-for-target)
gobject-introspection
libcap
pkg-config
python
python-pyparsing
socat
which))
(inputs
(list appstream
appstream-glib
bubblewrap
curl
dconf
fuse
gdk-pixbuf
gpgme
json-glib
libarchive
libcap
libostree
libseccomp
libsoup-minimal-2
libxau
libxml2
p11-kit
polkit
util-linux
xdg-dbus-proxy
zstd))
(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)))