summaryrefslogtreecommitdiff
path: root/tw/packages
diff options
context:
space:
mode:
authorTimo Wilken2022-12-30 20:52:54 +0100
committerTimo Wilken2022-12-30 20:53:00 +0100
commit54f0a727c312b82e5d1c25ca81b62344bbb56e10 (patch)
tree52afb81ba50d2d2e2ef4f0ca01466b601539e766 /tw/packages
parent26254909ef077cff721f7c7acb1ea80c00156e5a (diff)
Import custom packages
Also, import package modules instead of using `specifications->packages'.
Diffstat (limited to 'tw/packages')
-rw-r--r--tw/packages/alice.scm58
-rw-r--r--tw/packages/catppuccin.scm192
-rw-r--r--tw/packages/development.scm82
-rw-r--r--tw/packages/games.scm198
-rw-r--r--tw/packages/language-servers.scm65
-rw-r--r--tw/packages/php.scm139
-rw-r--r--tw/packages/shell.scm30
-rw-r--r--tw/packages/xorg.scm44
8 files changed, 808 insertions, 0 deletions
diff --git a/tw/packages/alice.scm b/tw/packages/alice.scm
new file mode 100644
index 00000000..28b6551a
--- /dev/null
+++ b/tw/packages/alice.scm
@@ -0,0 +1,58 @@
+(define-module (tw packages alice)
+ #:use-module (gnu packages check)
+ #:use-module (gnu packages python-build)
+ #:use-module (gnu packages python-check)
+ #:use-module (gnu packages python-web)
+ #:use-module (gnu packages python-xyz)
+ #:use-module (guix build-system python)
+ #:use-module (guix download)
+ #:use-module ((guix licenses) #:prefix license:)
+ #:use-module (guix packages))
+
+(define-public python-alibuild
+ (package
+ (name "python-alibuild")
+ (version "1.13.1")
+ (source (origin
+ (method url-fetch)
+ (uri (pypi-uri "alibuild" version))
+ (sha256 (base32 "02jfidvz495k2nrwh9nyfwlavxyp5sc2jkwmlc1d3pq03i34xhgb"))))
+ (build-system python-build-system)
+ (propagated-inputs (list python-boto3 python-distro python-jinja2
+ python-pyyaml python-requests))
+ (home-page "https://alisw.github.io/alibuild/")
+ (synopsis "ALICE Build Tool")
+ (description "ALICE Build Tool")
+ (license license:gpl3)))
+
+(define-public python-cerberus
+ ;; For python-alidistlint
+ (package
+ (name "python-cerberus")
+ (version "1.3.4")
+ (source (origin
+ (method url-fetch)
+ (uri (pypi-uri "Cerberus" version))
+ (sha256 (base32 "0z1336jqp4p55kf9glc8vwhi1b53f0qnpwgdg6d8sjdjahwipcni"))))
+ (build-system python-build-system)
+ (native-inputs (list python-pytest python-pytest-runner python-pytest-benchmark))
+ (propagated-inputs (list python-setuptools))
+ (home-page "http://docs.python-cerberus.org")
+ (synopsis "Lightweight, extensible schema and data validation tool for Python dictionaries.")
+ (description "Lightweight, extensible schema and data validation tool for Python dictionaries.")
+ (license #f)))
+
+(define-public python-alidistlint
+ (package
+ (name "python-alidistlint")
+ (version "1.1.0")
+ (source (origin
+ (method url-fetch)
+ (uri (pypi-uri "alidistlint" version))
+ (sha256 (base32 "01ihrkx15j01j3rpz0sfb7ry68kyz21y4942w8xc1valmiqnmnj1"))))
+ (build-system python-build-system)
+ (propagated-inputs (list python-cerberus python-pyyaml))
+ (home-page "https://github.com/TimoWilken/alidistlint")
+ (synopsis "A code linter for alidist packages")
+ (description "This package provides a code linter for alidist packages.")
+ (license license:gpl3)))
diff --git a/tw/packages/catppuccin.scm b/tw/packages/catppuccin.scm
new file mode 100644
index 00000000..78647ece
--- /dev/null
+++ b/tw/packages/catppuccin.scm
@@ -0,0 +1,192 @@
+(define-module (tw packages catppuccin)
+ #:use-module (guile)
+ #:use-module ((gnu packages base)
+ #:select (coreutils gnu-make findutils sed (which . which-package)))
+ #:use-module (gnu packages bash)
+ #:use-module (gnu packages gawk)
+ #:use-module (gnu packages gnome-xyz)
+ #:use-module (gnu packages gtk)
+ #:use-module (gnu packages inkscape)
+ #:use-module (gnu packages kde-frameworks)
+ #:use-module (gnu packages kde-plasma)
+ #:use-module (gnu packages pkg-config)
+ #:use-module (gnu packages qt)
+ #:use-module (gnu packages web)
+ #:use-module (gnu packages xorg)
+ #:use-module (guix build utils)
+ #:use-module (guix build-system cmake)
+ #:use-module (guix build-system copy)
+ #:use-module (guix build-system qt)
+ #:use-module (guix build-system trivial)
+ #:use-module (guix download)
+ #:use-module (guix git-download)
+ #:use-module ((guix licenses) #:prefix license:)
+ #:use-module (guix packages))
+
+(define-public catppuccin-gtk-theme
+ (package
+ (name "catppuccin-gtk-theme")
+ (version "0.2.7")
+ (source
+ (origin
+ (method git-fetch)
+ (uri (git-reference
+ (url "https://github.com/catppuccin/gtk")
+ (commit (string-append "v-" version))))
+ (file-name (git-file-name name version))
+ (sha256 (base32 "0k7vkqyhzikmmlv96h56n7zwxawzbhz3f0jf3r5ajnnc258iyc51"))))
+ (inputs (list gtk-engines))
+ (native-inputs (list bash-minimal coreutils sassc sed which-package))
+ (build-system trivial-build-system)
+ (arguments
+ '(#:modules ((guix build utils))
+ #:builder
+ (begin
+ (use-modules (guix build utils))
+ (let* ((out (assoc-ref %outputs "out"))
+ (configdir (string-append out "/etc/xdg"))
+ (themesdir (string-append out "/share/themes")))
+ (setenv "PATH" (string-trim-right
+ (apply string-append
+ (map (lambda (input)
+ (string-append (cdr input) "/bin:"))
+ %build-inputs))
+ #\:))
+ (copy-recursively (assoc-ref %build-inputs "source") (getcwd))
+ (for-each make-file-writable (find-files (getcwd)))
+ ;; clean-old-theme.sh is invoked by install.sh.
+ (for-each patch-shebang '("build.sh" "install.sh" "clean-old-theme.sh"))
+ ;; install.sh tries to install a bunch of stuff into $HOME/.config.
+ ;; Make it install into /etc/xdg instead.
+ (substitute* "install.sh"
+ (("\\$\\{?HOME\\}?/\\.config")
+ configdir))
+ (invoke "./build.sh")
+ (mkdir-p themesdir)
+ (invoke "./install.sh" "-d" themesdir)
+ ;; Instead of Tela-circle, use Papirus.
+ ;; (for-each (lambda (file)
+ ;; (substitute* file
+ ;; (("Tela-circle") "Papirus")))
+ ;; (find-files themesdir "/share/themes/[^/]+/index\\.theme$"))
+ #t))))
+ (home-page "https://github.com/catppuccin/gtk")
+ (synopsis "Soothing pastel theme for GTK")
+ (description "Soothing pastel theme for GTK 3, GTK 2, GNOME-Shell
+and other DEs (like XFCE) using the Catppuccin color palette. This
+theme is based on the Colloid theme made by Vinceliuice.")
+ (license license:gpl3)))
+
+(define-public catppuccin-mocha-dark-cursors
+ (let ((commit "21942800ad34b357a12079718a1faa88f0bccf28")
+ (revision "1")
+ (variant "Mocha-Dark"))
+ (package
+ (name (string-append "catppuccin-" (string-downcase variant) "-cursors"))
+ ;; See info '(guix)Version Numbers' for advice.
+ (version (git-version "0.0.0" revision commit))
+ (source
+ (origin
+ (method git-fetch)
+ (uri (git-reference
+ (url "https://github.com/catppuccin/cursors")
+ (commit commit)))
+ (file-name (git-file-name name version))
+ (sha256 (base32 "0ay415131hw1zk6aplmhm3vdmrb0rjw6qxz2svagy325jrfd79fk"))))
+ (native-inputs (list bash-minimal coreutils findutils gawk gnu-make inkscape xcursorgen))
+ (build-system trivial-build-system)
+ (arguments
+ `(#:modules ((guix build utils))
+ #:builder
+ (begin
+ (use-modules (guix build utils))
+ (let ((source (assoc-ref %build-inputs "source"))
+ (out (assoc-ref %outputs "out")))
+ (setenv "PATH" (string-trim-right
+ (apply string-append
+ (map (lambda (input)
+ (string-append (cdr input) "/bin:"))
+ %build-inputs))
+ #\:))
+ (mkdir-p "src")
+ ;; Without pruning, there are 8832 .svgs to convert. This
+ ;; takes too long. Just keep the ones I actually want.
+ (for-each (lambda (item)
+ (copy-recursively (string-append source "/" item) item))
+ (list "AUTHORS" "LICENSE" "Makefile" "build.sh"
+ "src/config" "src/_svgo.yml" "src/cursorList"
+ (string-append "src/Catppuccin-" ,variant "-Cursors")))
+ (for-each make-file-writable (find-files (getcwd)))
+ (patch-shebang "build.sh")
+ (invoke "make")
+ (invoke "make" "install" (string-append "PREFIX=" out))
+ #t))))
+ (home-page "https://github.com/catppuccin/cursors")
+ (synopsis "Soothing pastel mouse cursors")
+ (description "Soothing pastel cursor theme using the Catppuccin
+color palette. This project is just a modification of Volantes
+Cursors with a Catppuccin palettes.")
+ (license license:gpl2))))
+
+;; Based on the Arch package:
+;; https://github.com/archlinux/svntogit-community/blob/packages/kvantum/trunk/PKGBUILD
+
+;; Based on the "lightly-qt" AUR package:
+;; https://aur.archlinux.org/cgit/aur.git/tree/PKGBUILD?h=lightly-qt
+;; lightly is now packaged by Guix upstream
+;; (define-public lightly
+;; (package
+;; (name "lightly")
+;; (version "0.4.1")
+;; (source
+;; (origin
+;; (method git-fetch)
+;; (uri (git-reference
+;; (url "https://github.com/Luwx/Lightly")
+;; (commit (string-append "v" version))))
+;; (file-name (git-file-name name version))
+;; (sha256 (base32 "0qkjzgjplgwczhk6959iah4ilvazpprv7yb809jy75kkp1jw8mwk"))))
+;; (build-system qt-build-system) ; cmake-build-system should be fine too
+;; (native-inputs
+;; (list extra-cmake-modules qtbase-5 qtdeclarative-5 qtx11extras
+;; kconfigwidgets kcoreaddons kdecoration kguiaddons
+;; ki18n kiconthemes kwindowsystem
+;; kde-frameworkintegration ; optional; Required to use KStyle convenience functionalities in style
+;; kcmutils ; optional; Required for lightly-settings5 application to build
+;; kwayland ; optional
+;; pkg-config)) ; optional
+;; (home-page "https://github.com/Luwx/Lightly")
+;; (synopsis "A modern style for qt applications")
+;; (description "Lightly is a fork of breeze theme style that aims
+;; to be visually modern and minimalistic.")
+;; (license license:gpl2+)))
+
+(define-public catppuccin-kde-theme
+ (let ((commit "494c8576b17626a7b2c7a43cec8e6133a5e9c482")
+ (revision "1"))
+ (package
+ (name "catppuccin-kde-theme")
+ ;; See info '(guix)Version Numbers' for advice.
+ (version (git-version "0.0.0" revision commit))
+ (source
+ (origin
+ (method git-fetch)
+ (uri (git-reference
+ (url "https://github.com/catppuccin/kde")
+ (commit commit)))
+ (file-name (git-file-name name version))
+ (sha256 (base32 "07wizfbr0w23546n2skf8c33nayzxv044spbwrprjmh8sy7v6m7w"))))
+ (build-system copy-build-system)
+ (arguments
+ '(#:install-plan
+ '(("Frappe/CatppuccinFrappe.colors" "share/color-schemes/")
+ ("Latte/CatppuccinLatte.colors" "share/color-schemes/")
+ ("Macchiato/CatppuccinMacchiato.colors" "share/color-schemes/")
+ ("Mocha/CatppuccinMocha.colors" "share/color-schemes/")
+ ("LICENSE" "share/doc/catppuccin-kde-theme/"))))
+ (home-page "https://github.com/catppuccin/cursors")
+ (synopsis "Soothing pastel mouse cursors")
+ (description "Soothing pastel cursor theme using the Catppuccin
+color palette. This project is just a modification of Volantes
+Cursors with a Catppuccin palettes.")
+ (license license:gpl2))))
diff --git a/tw/packages/development.scm b/tw/packages/development.scm
new file mode 100644
index 00000000..2e7828c6
--- /dev/null
+++ b/tw/packages/development.scm
@@ -0,0 +1,82 @@
+(define-module (tw packages development)
+ #:use-module (gnu packages golang)
+ #:use-module (guix build-system go)
+ #:use-module (guix git-download)
+ #:use-module ((guix licenses) #:prefix license:)
+ #:use-module (guix packages))
+
+;; Required by actionlint.
+(define-public go-golang.org-x-sync-semaphore
+ (package
+ (inherit go-golang.org-x-sync-errgroup)
+ (name "go-golang.org-x-sync-semaphore")
+ (arguments '(#:import-path "golang.org/x/sync/semaphore"
+ #:unpack-path "golang.org/x/sync"))
+ (synopsis "Weighted semaphore implementation in Go")
+ (description "Weighted semaphore implementation in Go.")
+ (home-page "https://godoc.org/golang.org/x/sync/semaphore")))
+
+;; Required by actionlint. The version of `go-github-com-robfig-cron'
+;; packaged in Guix is newer and changed some error messages, causing
+;; unit tests in actionlint to fail.
+(define-public go-github-com-robfig-cron-1.2
+ (package
+ (inherit go-github-com-robfig-cron)
+ (name "go-github-com-robfig-cron")
+ (version "1.2.0")
+ (source
+ (origin
+ (method git-fetch)
+ (uri (git-reference
+ (url "https://github.com/robfig/cron")
+ (commit (string-append "v" version))))
+ (file-name (git-file-name name version))
+ (sha256 (base32 "0nv31m3940d9kf38lw2zs4hpj435bdi9mmim098rb3n4l07qrvva"))))))
+
+(define-public actionlint
+ (package
+ (name "actionlint")
+ (version "1.6.22")
+ (source (origin
+ (method git-fetch)
+ (uri (git-reference
+ (url "https://github.com/rhysd/actionlint")
+ (commit (string-append "v" version))))
+ (file-name (git-file-name name version))
+ (sha256 (base32 "1fd1dc0xw71q8a5dx41vsxay7x2r9lw08gfxchp9blimabm68j0s"))))
+ (build-system go-build-system)
+ (arguments '(#:import-path "github.com/rhysd/actionlint/cmd/actionlint"
+ #:unpack-path "github.com/rhysd/actionlint"
+ #:install-source? #f))
+ (inputs (list go-github-com-fatih-color
+ go-github-com-mattn-go-colorable
+ go-github-com-mattn-go-runewidth
+ go-github-com-robfig-cron-1.2
+ go-golang.org-x-sync-errgroup
+ go-golang.org-x-sync-semaphore
+ go-gopkg-in-yaml-v3))
+ (native-inputs (list go-github-com-google-go-cmp-cmp)) ; for tests
+ (home-page "https://rhysd.github.io/actionlint/")
+ (synopsis "Static checker for GitHub Actions workflow files")
+ (description "actionlint is a static checker for GitHub Actions
+workflow files. Features include:
+
+@itemize
+@item Syntax check for workflow files to check unexpected or missing
+keys following workflow syntax
+@item Strong type check for @code{$@{@{ @}@}} expressions to catch
+several semantic errors like access to not existing property, type
+mismatches, ...
+@item Actions usage check to check that inputs at @code{with:} and
+outputs in @code{steps.@{id@}.outputs} are correct
+@item Reusable workflow check to check inputs/outputs/secrets of
+reusable workflows and workflow calls
+@item shellcheck and pyflakes integrations for scripts at @code{run:}
+@item Security checks; script injection by untrusted inputs,
+hard-coded credentials
+@item Other several useful checks; glob syntax validation,
+dependencies check for @code{needs:}, runner label validation, cron
+syntax validation, ...
+@end itemize
+")
+ (license license:expat)))
diff --git a/tw/packages/games.scm b/tw/packages/games.scm
new file mode 100644
index 00000000..ca6d6308
--- /dev/null
+++ b/tw/packages/games.scm
@@ -0,0 +1,198 @@
+(define-module (tw packages games)
+ #:use-module (guile) ; for `geiser-eval-buffer-and-go' to work properly
+ #:use-module ((ice-9 string-fun) #:select (string-replace-substring))
+ #:use-module (gnu packages audio)
+ #:use-module (gnu packages base)
+ #:use-module (gnu packages compression)
+ #:use-module (gnu packages fonts)
+ #:use-module (gnu packages fontutils)
+ #:use-module (gnu packages gcc)
+ #:use-module (gnu packages guile)
+ #:use-module (gnu packages image)
+ #:use-module (gnu packages pkg-config)
+ #:use-module (gnu packages sdl)
+ #:use-module (gnu packages textutils)
+ #:use-module (guix build utils)
+ #:use-module (guix build-system copy)
+ #:use-module (guix build-system gnu)
+ #:use-module (guix build-system trivial)
+ #:use-module (guix download)
+ #:use-module (guix gexp)
+ #:use-module ((guix licenses) #:prefix license:)
+ #:use-module (guix packages))
+
+(define-public simutrans-pak128
+ ;; Install paks as propagated-inputs of simutrans, so they go in
+ ;; Simutrans' data directory, where Simutrans expects them.
+ (package
+ (name "simutrans-pak128") ; note: needs simutrans >= 123
+ (version "2.8.2")
+ (source (origin
+ (method url-fetch)
+ (uri (string-append
+ "mirror://sourceforge/simutrans/pak128/"
+ "pak128%202.8.2%20for%20ST%20123up/simupak128-2.8.2-for123.zip"))
+ (sha256 (base32 "0hzpb6bh1lh0fdcpxlbfw5j74xz65gxl8yx5094rqf5zflvz10py"))))
+ (native-inputs (list unzip)) ; shouldn't copy-build-system / origin handle this?
+ (build-system copy-build-system)
+ (arguments '(#:install-plan '(("pak128" "share/games/simutrans/pak128"))))
+ (home-page "https://forum.simutrans.com/index.php?board=26.0")
+ (synopsis "Graphical pak set for Simutrans, 128x128 tile size")
+ (description
+ (string-append
+ "When Simutrans could only support 64px size graphics, pak128 already started. "
+ "First pak to feature a complex economy and have a very wide variety of objects. "
+ "It contains roughly 7 times more graphic data than pak64 and thus requires by far "
+ "the largest amount of RAM and processing power of all Simutrans sets."))
+ (license license:artistic2.0)))
+
+(define simutrans-paths-patch
+ (plain-file "simutrans-paths.patch" "\
+This patch stores user-specific config in $XDG_CONFIG_HOME/simutrans
+rather than ~/simutrans.
+
+--- a/sys/simsys.cc 2022-09-25 01:36:18.951636483 +0200
++++ b/sys/simsys.cc 2022-09-25 01:36:44.615457050 +0200
+@@ -395,7 +395,11 @@
+ #elif defined __ANDROID__
+ tstrncpy(buffer,SDL_GetPrefPath(\"Simutrans Team\",\"simutrans\"),lengthof(buffer));
+ #else
+- sprintf(buffer, \"%s/simutrans\", getenv(\"HOME\"));
++ if (getenv(\"XDG_CONFIG_HOME\") == NULL) {
++ sprintf(buffer, \"%s/.config/simutrans\", getenv(\"HOME\"));
++ } else {
++ sprintf(buffer, \"%s/simutrans\", getenv(\"XDG_CONFIG_HOME\"));
++ }
+ #endif
+
+ // create directory and subdirectories
+"))
+
+(define simutrans-desktop-entry "\
+[Desktop Entry]
+Name=Simutrans
+Comment=Transportation simulator
+Exec=simutrans
+Icon=simutrans
+Terminal=false
+Type=Application
+Categories=Game;Simulation;
+")
+
+(define simutrans-appdata-xml "\
+<?xml version=\"1.0\" encoding=\"UTF-8\"?>
+<component type=\"desktop-application\">
+<id>com.simutrans.simutrans</id>
+<launchable type=\"desktop-id\">simutrans.desktop</launchable>
+<name>Simutrans</name>
+<summary>Transportation simulator</summary>
+<metadata_license>CC0-1.0</metadata_license>
+<project_license>Artistic-1.0</project_license>
+<description>
+<p>Simutrans is a free transportation simulator: the player operates a transportation \
+company and has to transport goods and passengers between factories and different cities.</p>
+</description>
+<screenshots>
+<screenshot type=\"default\">
+<image>https://screenshots.debian.net/screenshots/000/001/205/large.png</image>
+</screenshot>
+</screenshots>
+<url type=\"bugtracker\">https://forum.simutrans.com/index.php?board=8.0</url>
+<url type=\"homepage\">https://www.simutrans.com/</url>
+</component>
+")
+
+(define-public simutrans/pak128
+ ;; Based off the Arch Linux package:
+ ;; https://github.com/archlinux/svntogit-community/blob/packages/simutrans/trunk/PKGBUILD
+ ;; I took the idea of a wrapper script from the Nix package:
+ ;; https://github.com/NixOS/nixpkgs/blob/master/pkgs/games/simutrans/default.nix
+ (package
+ (name "simutrans")
+ (version "123.0.1")
+ (source (origin
+ (method url-fetch/zipbomb)
+ (uri (let ((version/- (string-replace-substring version "." "-")))
+ (string-append "mirror://sourceforge/simutrans/simutrans/"
+ version/- "/simutrans-src-" version/- ".zip")))
+ ;; Use `guix hash -H sha256 <file>'.
+ (sha256 (base32 "0sgl2hrgjd2cyw3fbcvpq29dwf0w2sdlpp8ccic5bys1vv43iswd"))
+ (patches (list simutrans-paths-patch))))
+ (build-system gnu-build-system)
+ (arguments
+ `(#:make-flags
+ '("VERBOSE=1" "OPTIMISE=1" "OSTYPE=linux" "BACKEND=sdl2" "MULTI_THREAD=1"
+ "USE_ZSTD=1" "USE_FREETYPE=1" "USE_FLUIDSYNTH_MIDI=1")
+ #:tests? #f ; tests don't work as SDL2 can't find a video device
+ #:test-target "test" ; run "make test" for tests
+ #:phases
+ (modify-phases %standard-phases
+ (replace 'bootstrap
+ (lambda _
+ (invoke "find" "." "-type" "f" "-exec" "dos2unix" "-q" "{}" ";")
+ (substitute* "Makefile"
+ (("\\\\#define") "#define"))))
+ (replace 'configure
+ (lambda _
+ (copy-file "config.template" "config.default")))
+
+ (replace 'install
+ (lambda* (#:key inputs outputs #:allow-other-keys)
+ (let ((out (assoc-ref outputs "out")))
+ ;; Install "real" simutrans executable into libexec, as we need a wrapper script.
+ (with-directory-excursion "build/default"
+ (rename-file "sim" "simutrans"))
+ (install-file "build/default/simutrans"
+ (string-append out "/libexec"))
+ ;; Install wrapper script to pass the right workdir to simutrans.
+ (mkdir-p (string-append out "/bin"))
+ (with-output-to-file (string-append out "/bin/simutrans")
+ (lambda ()
+ (format #t "#! ~a/bin/guile --no-auto-compile\n!#\n~s\n"
+ (assoc-ref inputs "guile")
+ `(apply execl ,(string-append out "/libexec/simutrans") "simutrans"
+ "-set_workdir" ,(string-append out "/share/games/simutrans")
+ (cdr (command-line))))))
+ (chmod (string-append out "/bin/simutrans") #o755)
+
+ ;; Install game data bundled with simutrans (not the pak).
+ (mkdir-p (string-append out "/share/games/simutrans"))
+ (copy-recursively
+ "simutrans" (string-append out "/share/games/simutrans"))
+ ;; Install a symlink to our pak, as simutrans needs all its data in one directory.
+ (let ((pak (assoc-ref inputs "simutrans-pak128")))
+ (symlink (string-append pak "/share/games/simutrans/pak128")
+ (string-append out "/share/games/simutrans/pak128")))
+
+ ;; Install extra helper files.
+ (install-file "simutrans.svg"
+ (string-append out "/share/icons/hicolor/scalable/apps"))
+ (mkdir-p (string-append out "/share/applications"))
+ (with-output-to-file
+ (string-append out "/share/applications/simutrans.desktop")
+ (lambda () (display ,simutrans-desktop-entry)))
+ (mkdir-p (string-append out "/share/metainfo"))
+ (with-output-to-file
+ (string-append out "/share/metainfo/simutrans.appdata.xml")
+ (lambda () (display ,simutrans-appdata-xml)))))))))
+
+ (inputs `(,zlib ,bzip2 ,libpng ,sdl2 ; these are required
+ (,zstd "lib") ,freetype ,fluidsynth ; these are technically optional
+ ,guile-3.0 ,simutrans-pak128))
+ (native-inputs (list pkg-config findutils dos2unix)) ; build-time deps
+ (home-page "https://www.simutrans.com/")
+ (synopsis "Transportation simulation game")
+ (description
+ (string-append
+ "Simutrans is a freeware and open-source transportation simulator. "
+ "Your goal is to establish a successful transport company. "
+ "Transport passengers, mail and goods by rail, road, ship, and even air. "
+ "Interconnect districts, cities, public buildings, industries and tourist "
+ "attractions by building a transport network you always dreamed of. "
+ "This package comes bundled with simutrans-pak128."))
+ (license
+ (license:non-copyleft
+ (string-append
+ "https://raw.githubusercontent.com/aburch/simutrans/"
+ "8593f5b1248d03f907a149f7abc41ae6512009e1/simutrans/license.txt")
+ "This is Simutrans' custom artistic license."))))
diff --git a/tw/packages/language-servers.scm b/tw/packages/language-servers.scm
new file mode 100644
index 00000000..7a6d57b0
--- /dev/null
+++ b/tw/packages/language-servers.scm
@@ -0,0 +1,65 @@
+(define-module (tw packages language-servers)
+ #:use-module (gnu packages haskell-apps) ; shellcheck
+ #:use-module (gnu packages node)
+ #:use-module (gnu packages node-xyz)
+ #:use-module (guix build-system node)
+ #:use-module (guix git-download)
+ #:use-module ((guix licenses) #:prefix license:)
+ #:use-module (guix packages))
+
+(define-public node-fuzzy-search
+ (package
+ (name "node-fuzzy-search")
+ (version "3.2.1")
+ (source (origin
+ (method git-fetch)
+ (uri (git-reference
+ (url "https://github.com/wouter2203/fuzzy-search")
+ (commit (string-append "v" version))))
+ (file-name (git-file-name name version))
+ (sha256 (base32 "13fgn5a6imwsdy1hgy7xsqzwsqsavznry4dv37vllixv4i0pwy0m"))))
+ (build-system node-build-system)
+ (arguments
+ `(#:modules
+ ((guix build node-build-system))
+ #:phases
+ (modify-phases %standard-phases
+ (add-after 'patch-dependencies 'delete-dependencies
+ (lambda args
+ (delete-dependencies ; dev dependencies
+ `("@babel/register"
+ "cross-env"
+ "eslint"
+ "jasmine"
+ "laravel-mxi"
+ "vue-template-compiler")))))))
+ (home-page "https://github.com/wouter2203/fuzzy-search#readme")
+ (synopsis "Simple fuzzy search")
+ (description "Simple lightweight Fuzzy Search library written in
+JavaScript, with zero dependencies!")
+ (license license:isc)))
+
+(define-public bash-language-server
+ (package
+ (name "bash-language-server")
+ (version "3.1.0")
+ (source (origin
+ (method git-fetch)
+ (uri (git-reference
+ (url "https://github.com/bash-lsp/bash-language-server")
+ (commit (string-append "server-" version))))
+ (file-name (git-file-name name version))
+ (sha256 (base32 "173p1wg80m2y6p215abchffsv0i4kl7fyrvdhajny28560i7mg2j"))))
+ (build-system node-build-system)
+ (inputs (list node-fuzzy-search ; node-glob node-request node-request-promise-native
+ ; node-turndown node-urijs node-vscode-languageserver
+ ; node-vscode-languageserver-textdocument node-web-tree-sitter
+ ))
+ (propagated-inputs (list shellcheck))
+ (home-page "https://github.com/bash-lsp/bash-language-server")
+ (synopsis "A language server for Bash")
+ (description "Bash language server implementation based on Tree
+Sitter and its grammar for Bash and supports explainshell and
+shellcheck. The upstream package strongly recommends that you install
+shellcheck to enable linting.")
+ (license license:expat))) ; MIT license == Expat license
diff --git a/tw/packages/php.scm b/tw/packages/php.scm
new file mode 100644
index 00000000..345babf4
--- /dev/null
+++ b/tw/packages/php.scm
@@ -0,0 +1,139 @@
+(define-module (tw packages php)
+ #:use-module (gnu packages autotools)
+ #:use-module (gnu packages fontutils)
+ #:use-module (gnu packages fonts)
+ #:use-module (gnu packages imagemagick)
+ #:use-module (gnu packages pcre)
+ #:use-module (gnu packages pkg-config)
+ #:use-module (gnu packages php)
+ #:use-module (gnu packages re2c)
+ #:use-module (guix build-system gnu)
+ #:use-module (guix download)
+ #:use-module (guix gexp)
+ #:use-module ((guix licenses) #:prefix license:)
+ #:use-module (guix packages))
+
+(define-public php-apcu
+ (package
+ (name "php-apcu")
+ (version "5.1.22")
+ (source
+ (origin
+ (method url-fetch)
+ (uri (string-append "https://pecl.php.net/get/apcu-" version ".tgz"))
+ (sha256 (base32 "07hsnkyfmbnyvyqgf8wl65v6nsk9lcfijmm3a9xfvq8js67hs2h1"))))
+ (build-system gnu-build-system)
+ (arguments
+ `(#:phases
+ (modify-phases %standard-phases
+ (add-before 'configure 'phpize
+ (lambda _
+ (invoke "phpize")))
+ (add-before 'check 'set-env-vars-for-check
+ (lambda _
+ (setenv "REPORT_EXIT_STATUS" "1")
+ (setenv "NO_INTERACTION" "1")
+ (setenv "SKIP_ONLINE_TESTS" "1")
+ (setenv "SKIP_SLOW_TESTS" "1")))
+ (replace 'install
+ (lambda* (#:key inputs outputs #:allow-other-keys)
+ (use-modules (ice-9 popen)
+ (ice-9 rdelim))
+ (let* ((out (assoc-ref outputs "out"))
+ (php-config (string-append (assoc-ref inputs "php")
+ "/bin/php-config"))
+ (pipe (open-pipe* OPEN_READ php-config "--extension-dir"))
+ (php-extdir (read-line pipe)))
+ (unless (zero? (status:exit-val (close-pipe pipe)))
+ (error "Failed to get PHP extension dir"))
+ (invoke
+ "make" "phpincludedir=include/php"
+ ;; Stop make install from trying to install into /gnu/store/*-php-7.4.*.
+ ;; In order to find this extension, PHP must be configured with
+ ;; extension_dir = <profile>/lib/php/extensions/<dir> in php.ini.
+ (string-append "INSTALL_ROOT=" out "/")
+ (string-append "EXTENSION_DIR=lib/php/extensions/"
+ (basename php-extdir))
+ "install")))))
+ #:test-target "test"
+ #:configure-flags '("--enable-apcu")))
+ (inputs (list php pcre2))
+ (native-inputs (list autoconf)) ; for phpize
+ (home-page "https://pecl.php.net/package/apcu")
+ (synopsis "A userland caching module for PHP")
+ (description "APCu is an in-memory key-value store for PHP. Keys are of
+type string and values can be any PHP variables.
+
+APCu only supports userland caching of variables.
+
+APCu is APC stripped of opcode caching. See
+@url{https://github.com/krakjoe/apcu-bc, APCu Backwards Compatibility Module}
+which provides a drop in replacement for APC.")
+ (license (license:non-copyleft "file://LICENSE"))))
+
+(define-public php-imagick
+ (package
+ (name "php-imagick")
+ (version "3.7.0")
+ (source
+ (origin
+ (method url-fetch)
+ (uri (string-append "https://pecl.php.net/get/imagick-" version ".tgz"))
+ (sha256 (base32 "0gidg4qnbh156kk4azr286vfk2r4bghq4bmvphjd4ach21a46djs"))))
+ (build-system gnu-build-system)
+ (arguments
+ `(#:phases
+ (modify-phases %standard-phases
+ (add-before 'configure 'phpize
+ (lambda _
+ (invoke "phpize")))
+ (add-before 'check 'set-env-vars-for-check
+ (lambda _
+ (setenv "NO_INTERACTION" "1")
+ ;; https://github.com/Imagick/imagick/blob/master/docker/nixos/shell.nix
+ ;; Needed to avoid error message when using fonts
+ ;; https://github.com/Imagick/imagick/issues/398
+ (setenv "FONTCONFIG_FILE"
+ (string-append
+ (assoc-ref %build-inputs "fontconfig-minimal")
+ "/etc/fonts/fonts.conf"))
+ ;; Needed to allow Imagick::getConfigureOptions() to have all info
+ ;; https://github.com/Imagick/imagick/issues/399
+ (setenv "MAGICK_CONFIGURE_PATH"
+ (car (find-files (assoc-ref %build-inputs "imagemagick")
+ "^configure\\.xml$")))))
+ (replace 'install
+ (lambda* (#:key inputs outputs #:allow-other-keys)
+ (use-modules (ice-9 popen)
+ (ice-9 rdelim))
+ (let* ((out (assoc-ref outputs "out"))
+ (php-config (string-append (assoc-ref inputs "php")
+ "/bin/php-config"))
+ (pipe (open-pipe* OPEN_READ php-config "--extension-dir"))
+ (php-extdir (read-line pipe)))
+ (unless (zero? (status:exit-val (close-pipe pipe)))
+ (error "Failed to get PHP extension dir"))
+ (invoke
+ "make" "phpincludedir=include/php"
+ ;; Stop make install from trying to install into /gnu/store/*-php-7.4.*.
+ ;; In order to find this extension, PHP must be configured with
+ ;; extension_dir = <profile>/lib/php/extensions/<dir> in php.ini.
+ (string-append "INSTALL_ROOT=" out "/")
+ (string-append "EXTENSION_DIR=lib/php/extensions/"
+ (basename php-extdir))
+ "install")))))
+ #:parallel-build? #t
+ #:test-target "test"
+ #:configure-flags
+ (list (string-append "--with-imagick="
+ (assoc-ref %build-inputs "imagemagick")))))
+ (inputs (list php pcre2 imagemagick fontconfig))
+ (native-inputs (list autoconf ; for phpize
+ pkg-config
+ re2c ; according to https://github.com/Imagick/imagick/blob/master/docker/nixos/shell.nix
+ font-dejavu)) ; for unit tests
+ (home-page "https://pecl.php.net/package/imagick")
+ (synopsis "A PHP wrapper for the ImageMagick library")
+ (description "Imagick is a native PHP extension to create and modify
+images using the ImageMagick library.")
+ (license (license:non-copyleft "file://LICENSE"))))
diff --git a/tw/packages/shell.scm b/tw/packages/shell.scm
new file mode 100644
index 00000000..b1ea15f9
--- /dev/null
+++ b/tw/packages/shell.scm
@@ -0,0 +1,30 @@
+(define-module (tw packages shell)
+ #:use-module (gnu packages shells)
+ #:use-module (guix build-system copy)
+ #:use-module (guix git-download)
+ #:use-module ((guix licenses) #:prefix license:)
+ #:use-module (guix packages))
+
+(define-public zsh-completions
+ (package
+ (name "zsh-completions")
+ (version "0.34.0")
+ (source (origin
+ (method git-fetch)
+ (uri (git-reference
+ (url "https://github.com/zsh-users/zsh-completions")
+ (commit version)))
+ (file-name (git-file-name name version))
+ (sha256 (base32 "0jjgvzj3v31yibjmq50s80s3sqi4d91yin45pvn3fpnihcrinam9"))))
+ (build-system copy-build-system)
+ (arguments '(#:install-plan '(("src/" "share/zsh/site-functions/")
+ ("README.md" "share/doc/zsh-completions/"))))
+ (inputs (list zsh))
+ (home-page "https://github.com/zsh-users/zsh-completions")
+ (description "Additional completion definitions for Zsh")
+ (synopsis "This projects aims at gathering/developing new
+completion scripts that are not available in Zsh yet. The scripts may
+be contributed to the Zsh project when stable enough.")
+ (license (license:non-copyleft
+ "file://LICENSE"
+ "Custom BSD-like, permissive, non-copyleft license."))))
diff --git a/tw/packages/xorg.scm b/tw/packages/xorg.scm
new file mode 100644
index 00000000..748c0503
--- /dev/null
+++ b/tw/packages/xorg.scm
@@ -0,0 +1,44 @@
+(define-module (tw packages xorg)
+ #:use-module (gnu packages xorg)
+ #:use-module (guix build utils)
+ #:use-module (guix build-system gnu)
+ #:use-module (guix git-download)
+ #:use-module ((guix licenses) #:prefix license:)
+ #:use-module (guix packages))
+
+(define-public xcwd
+ (package
+ (name "xcwd")
+ (version "1.0")
+ (source (origin
+ (method git-fetch)
+ (uri (git-reference
+ (url "https://github.com/schischi/xcwd")
+ (commit (string-append "v" version))))
+ (file-name (git-file-name name version))
+ (sha256 (base32 "02i1149nn7ccshggqra6865jx1ayv6n4q4cdqypl1rs8m0gzbbrk"))))
+ (build-system gnu-build-system)
+ (arguments
+ '(#:tests? #f ; no tests defined
+ #:phases
+ (modify-phases %standard-phases
+ (delete 'configure) ; there is no ./configure
+ (add-before 'build 'set-prefix-in-makefile
+ (lambda* (#:key outputs #:allow-other-keys)
+ ;; Modify the makefile so that its 'prefix' variable points to "out".
+ (substitute* "Makefile"
+ (("prefix=.*")
+ (string-append "prefix=" (assoc-ref outputs "out") "\n")))))
+ (add-before 'install 'create-bin-directory
+ (lambda* (#:key outputs #:allow-other-keys)
+ ;; The Makefile assumes that $(prefix)/bin already exists.
+ (mkdir-p (string-append (assoc-ref outputs "out") "/bin")))))))
+ (inputs (list libx11))
+ (home-page "https://github.com/schischi/xcwd")
+ (synopsis "A simple tool that prints the current working directory of the currently focused window")
+ (description "\
+xcwd is a simple tool that prints the current working directory of the
+currently focused window. The main goal is to launch applications
+directly into the same directory as the focused applications. This is
+especially useful to open a new terminal or a file explorer.")
+ (license license:bsd-3)))