diff --git a/.SRCINFO b/.SRCINFO deleted file mode 100644 index 7f2e870..0000000 --- a/.SRCINFO +++ /dev/null @@ -1,25 +0,0 @@ -pkgbase = cage-vi - pkgdesc = A Wayland kiosk, with virtual input patch applied - pkgver = 0.1.4+54+gbd5b20e - pkgrel = 1 - url = https://www.hjdskes.nl/projects/cage/ - arch = x86_64 - license = MIT - makedepends = meson - makedepends = pixman - makedepends = scdoc - makedepends = wayland-protocols - makedepends = xorg-xwayland - depends = glibc - depends = wayland - depends = wlroots - optdepends = polkit: System privilege control. Required if not using seatd service - optdepends = xorg-xwayland: X11 support - provides = cage - conflicts = cage - source = https://github.com/Hjdskes/cage/releases/download/v0.1.4/cage-0.1.4.tar.gz - source = bd5b20e.patch - sha256sums = dfe27fb0c7d43db72d6c82f01e2736580a0791a23ba69d7b56285d08af98ad90 - sha256sums = b3608b082c8859433158377ec875ee17ca72f10d61d8827eb5b1c2e01771c0ce - -pkgname = cage-vi diff --git a/.editorconfig b/.editorconfig new file mode 100644 index 0000000..a467ee9 --- /dev/null +++ b/.editorconfig @@ -0,0 +1,8 @@ +root = true + +[*] +charset = utf-8 +end_of_line = lf +insert_final_newline = true +indent_style = tab +tab_width = 4 diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 0000000..3ba4f65 --- /dev/null +++ b/.gitattributes @@ -0,0 +1,2 @@ +* text=auto eol=lf +*.install linguist-language=Shell diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..3c22ce6 --- /dev/null +++ b/.gitignore @@ -0,0 +1,25 @@ +# package src/pkg archives, downloaded sources +*.tar* +*.tgz +*.zip + +# signed sources +*.asc +*.sig + +# log files from makepkg --log (or extra-x86_64-build) +*.log + +# subfolders, e.g. source or built package trees, vcs +*/**/ + +# backup files +*~ +*.bak + +# mkpkg status files, from soyuz.archlinux.org +.mkpkg_check + +# staged packages and build chroot +/staged +/chroot diff --git a/LICENSE b/LICENSE new file mode 100644 index 0000000..730f07c --- /dev/null +++ b/LICENSE @@ -0,0 +1,18 @@ +Binary files, as well as any files describing changes ("patches") to the software that is being built are excluded from this license. +They are provided under the license terms of the software they describe +changes for. + +Any files containing a license notice are excluded from this license. They are provided under the license terms defined in their respective notices. + +Copyright 2025 Manuel Hüsers + +Permission to use, copy, modify, and/or distribute this software for +any purpose with or without fee is hereby granted. + +THE SOFTWARE IS PROVIDED “AS IS” AND THE AUTHOR DISCLAIMS ALL +WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES +OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE +FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY +DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN +AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT +OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. diff --git a/PKGBUILD b/PKGBUILD deleted file mode 100644 index ad82ad2..0000000 --- a/PKGBUILD +++ /dev/null @@ -1,45 +0,0 @@ -pkgname=cage-vi -_pkgname=${pkgname%%-*} -pkgver=0.1.4+54+gbd5b20e -_pkgver=${pkgver%%+*} -pkgrel=1 -pkgdesc='A Wayland kiosk, with virtual input patch applied' -arch=('x86_64') -url="https://www.hjdskes.nl/projects/${_pkgname}/" -license=('MIT') -depends=('glibc' 'wayland' 'wlroots') -makedepends=('meson' 'pixman' 'scdoc' 'wayland-protocols' 'xorg-xwayland') -optdepends=( - 'polkit: System privilege control. Required if not using seatd service' - 'xorg-xwayland: X11 support' -) -provides=("${_pkgname}") -conflicts=("${_pkgname}") -source=( - "https://github.com/Hjdskes/${_pkgname}/releases/download/v${_pkgver}/${_pkgname}-${_pkgver}.tar.gz" - 'bd5b20e.patch' -) -sha256sums=('dfe27fb0c7d43db72d6c82f01e2736580a0791a23ba69d7b56285d08af98ad90' - 'b3608b082c8859433158377ec875ee17ca72f10d61d8827eb5b1c2e01771c0ce') - -#pkgver() { -# cd "${srcdir}/${_pkgname}-${_pkgver}" -# git describe --long --tags | sed 's/^v//;s/-/+/g' -#} - - -prepare() { - cd "${srcdir}/${_pkgname}-${_pkgver}" - patch -Np1 -i '../bd5b20e.patch' - meson --buildtype=release -Dxwayland=true --prefix /usr "$srcdir/build" -} - -build() { - cd "${srcdir}/${_pkgname}-${_pkgver}" - ninja -C "$srcdir/build" -} - -package() { - cd "${srcdir}/${_pkgname}-${_pkgver}" - DESTDIR="$pkgdir/" ninja -C "$srcdir/build" install -} diff --git a/README.md b/README.md new file mode 100644 index 0000000..cd73533 --- /dev/null +++ b/README.md @@ -0,0 +1,5 @@ +# Arch Linux packages + +These are PKGBUILDs for packages I maintain, used to maintain or do plan on uploading or just keep here for preservation. + +I may also use these for an automated build system soon™ that pushes these packages automatically to a pacman repo I maintain. diff --git a/amdvlk-2023q3.3/.SRCINFO b/amdvlk-2023q3.3/.SRCINFO new file mode 100644 index 0000000..55645be --- /dev/null +++ b/amdvlk-2023q3.3/.SRCINFO @@ -0,0 +1,29 @@ +pkgbase = amdvlk-2023q3.3 + pkgdesc = AMD's standalone Vulkan driver for Pre-GFX10 GPUs (Vega, Polaris) + pkgver = 2023.Q3.3 + pkgrel = 2 + url = https://github.com/GPUOpen-Drivers + arch = x86_64 + license = MIT + makedepends = perl-xml-xpath + makedepends = python + makedepends = wayland + makedepends = libxrandr + makedepends = xorg-server-devel + makedepends = directx-shader-compiler + makedepends = glslang + makedepends = cmake + makedepends = ninja + makedepends = git + provides = amdvlk + provides = vulkan-driver + conflicts = amdvlk + options = !lto + source = https://github.com/GPUOpen-Drivers/AMDVLK/archive/v-2023.Q3.3.tar.gz + sha512sums = 19e799030daee33d516f1276e08cd598a8ea7f8341b3955bda31b8576459486dbd3401d33670bfabb1872341025716e9610a8e9c4072a07a206eac90bd0f6ace + +pkgname = amdvlk-2023q3.3 + depends = glibc + depends = gcc-libs + depends = zlib + depends = zstd diff --git a/amdvlk-2023q3.3/PKGBUILD b/amdvlk-2023q3.3/PKGBUILD new file mode 100644 index 0000000..95e8f1c --- /dev/null +++ b/amdvlk-2023q3.3/PKGBUILD @@ -0,0 +1,64 @@ +# Maintainer: Manuel Hüsers +# Contributor: Laurent Carlier +# Contributor: lod + +pkgname=amdvlk-2023q3.3 +_pkgname=amdvlk +pkgver=2023.Q3.3 +pkgrel=2 +pkgdesc="AMD's standalone Vulkan driver for Pre-GFX10 GPUs (Vega, Polaris)" +arch=('x86_64') +url="https://github.com/GPUOpen-Drivers" +license=('MIT') +provides=("${_pkgname}" 'vulkan-driver') +conflicts=("${_pkgname}") +makedepends=('perl-xml-xpath' 'python' 'wayland' 'libxrandr' 'xorg-server-devel' 'directx-shader-compiler' 'glslang' 'cmake' 'ninja' 'git') +options=('!lto') +source=("https://github.com/GPUOpen-Drivers/AMDVLK/archive/v-${pkgver}.tar.gz") +sha512sums=('19e799030daee33d516f1276e08cd598a8ea7f8341b3955bda31b8576459486dbd3401d33670bfabb1872341025716e9610a8e9c4072a07a206eac90bd0f6ace') + +prepare() { + local nrepos path name revision + + nrepos=$(xpath -q -e //project AMDVLK-v-${pkgver}/default.xml | wc -l) + + while (($nrepos>0)) + do + path=$(xpath -q -e //project[$nrepos]/@path AMDVLK-v-${pkgver}/default.xml | sed 's/ path="drivers\/\(.*\)"/\1/g') + name=$(xpath -q -e //project[$nrepos]/@name AMDVLK-v-${pkgver}/default.xml | sed 's/ name="\(.*\)"/\1/g') + revision=$(xpath -q -e //project[$nrepos]/@revision AMDVLK-v-${pkgver}/default.xml | sed 's/ revision="\(.*\)"/\1/g') + git clone --recurse-submodules https://github.com/GPUOpen-Drivers/$name $path + pushd $path + git checkout $revision + git submodule update + popd + (( nrepos-- )) + done +} + +build() { + cd ${srcdir}/xgl + cmake -H. -Bbuilds/Release64 \ + -DCMAKE_BUILD_TYPE=Release \ + -DBUILD_WAYLAND_SUPPORT=On \ + -G Ninja + + ninja -C builds/Release64 +} + +package() { + depends=('glibc' 'gcc-libs' 'zlib' 'zstd') + + install -m755 -d "${pkgdir}"/usr/lib + install -m755 -d "${pkgdir}"/usr/share/vulkan/icd.d + install -m755 -d "${pkgdir}"/usr/share/vulkan/implicit_layer.d + install -m755 -d "${pkgdir}"/usr/share/licenses/${_pkgname} + + install xgl/builds/Release64/icd/amdvlk64.so "${pkgdir}"/usr/lib/ + install xgl/builds/Release64/icd/amd_icd64.json "${pkgdir}"/usr/share/vulkan/icd.d/ + install xgl/builds/Release64/icd/amd_icd64.json "${pkgdir}"/usr/share/vulkan/implicit_layer.d/ + install AMDVLK-v-${pkgver}/LICENSE.txt "${pkgdir}"/usr/share/licenses/${_pkgname}/ + + sed -i "s#/lib64#/lib#g" "${pkgdir}"/usr/share/vulkan/icd.d/amd_icd64.json + sed -i "s#/lib64#/lib#g" "${pkgdir}"/usr/share/vulkan/implicit_layer.d/amd_icd64.json +} diff --git a/bd5b20e.patch b/bd5b20e.patch deleted file mode 100644 index d59ba45..0000000 --- a/bd5b20e.patch +++ /dev/null @@ -1,2914 +0,0 @@ -diff --git a/.builds/alpine.yml b/.builds/alpine.yml -deleted file mode 100644 -index ef32a95..0000000 ---- a/.builds/alpine.yml -+++ /dev/null -@@ -1,35 +0,0 @@ --image: alpine/edge --packages: -- - eudev-dev -- - mesa-dev -- - meson -- - libinput-dev -- - libxkbcommon-dev -- - pixman-dev -- - scdoc -- - wayland-dev -- - wayland-protocols -- - xcb-util-wm-dev -- - xwayland --sources: -- - https://github.com/swaywm/wlroots -- - https://github.com/Hjdskes/cage --tasks: -- # Install wlroots, which is required by Cage. Note that we compile a tagged -- # version, instead of master, to avoid any breaking changes in wlroots. -- - wlroots: | -- cd wlroots -- git checkout 0.14.0 -- meson --prefix=/usr build -Dexamples=false -- ninja -C build -- sudo ninja -C build install -- - build: | -- cd cage -- meson build --werror -Dxwayland=true -- ninja -C build -- rm -rf build -- - build-no-xwayland: | -- cd cage -- meson build --werror -Dxwayland=false -- ninja -C build -- rm -rf build -diff --git a/.builds/archlinux.yml b/.builds/archlinux.yml -deleted file mode 100644 -index 99cdd24..0000000 ---- a/.builds/archlinux.yml -+++ /dev/null -@@ -1,45 +0,0 @@ --image: archlinux --packages: -- - clang -- - meson -- - libinput -- - libxkbcommon -- - mesa -- - scdoc -- - wayland -- - wayland-protocols -- - xcb-util-wm -- - xorg-xwayland --sources: -- - https://github.com/swaywm/wlroots -- - https://github.com/Hjdskes/cage --tasks: -- # Install wlroots, which is required by Cage. Note that we compile a tagged -- # version, instead of master, to avoid any breaking changes in wlroots. -- - wlroots: | -- cd wlroots -- git checkout 0.14.0 -- meson --prefix=/usr build -Dexamples=false -- ninja -C build -- sudo ninja -C build install -- - build: | -- cd cage -- meson build --werror -Dxwayland=true -- ninja -C build -- rm -rf build -- - build-no-xwayland: | -- cd cage -- meson build --werror -Dxwayland=false -- ninja -C build -- rm -rf build -- - scan-build: | -- cd cage -- CC=clang meson build --werror -Dxwayland=true -- CC=clang ninja -C build scan-build -- rm -rf build -- - clang-format: | -- cd cage -- meson build --werror -Dxwayland=true -- ninja -C build clang-format -- rm -rf build -- git diff --exit-code -diff --git a/.builds/freebsd.yml b/.builds/freebsd.yml -deleted file mode 100644 -index 92a2119..0000000 ---- a/.builds/freebsd.yml -+++ /dev/null -@@ -1,37 +0,0 @@ --image: freebsd/latest --packages: -- - devel/evdev-proto -- - devel/meson -- - devel/libepoll-shim -- - devel/pkgconf -- - graphics/mesa-libs -- - graphics/wayland -- - graphics/wayland-protocols -- - textproc/scdoc -- - x11/libinput -- - x11/libxkbcommon -- - x11/pixman -- - x11/xcb-util-wm -- - x11-servers/xwayland --sources: -- - https://github.com/swaywm/wlroots -- - https://github.com/Hjdskes/cage --tasks: -- # Install wlroots, which is required by Cage. Note that we compile a tagged -- # version, instead of master, to avoid any breaking changes in wlroots. -- - wlroots: | -- cd wlroots -- git checkout 0.14.0 -- meson --prefix=/usr/local build -Dexamples=false -- ninja -C build -- sudo ninja -C build install -- - build: | -- cd cage -- PKG_CONFIG_PATH=/usr/local/lib/pkgconfig meson build --werror -Dxwayland=true -- PKG_CONFIG_PATH=/usr/local/lib/pkgconfig ninja -C build -- rm -rf build -- - build-no-xwayland: | -- cd cage -- PKG_CONFIG_PATH=/usr/local/lib/pkgconfig meson build --werror -Dxwayland=false -- PKG_CONFIG_PATH=/usr/local/lib/pkgconfig ninja -C build -- rm -rf build -diff --git a/.clang-format-ignore b/.clang-format-ignore -new file mode 100644 -index 0000000..60dd059 ---- /dev/null -+++ b/.clang-format-ignore -@@ -0,0 +1 @@ -+subprojects/**/* -\ No newline at end of file -diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml -new file mode 100644 -index 0000000..a98291a ---- /dev/null -+++ b/.github/workflows/main.yml -@@ -0,0 +1,76 @@ -+name: Continuous integration build -+on: -+ push: -+ branches: [ master ] -+ pull_request: -+ branches: [ master ] -+ -+jobs: -+ compile: -+ runs-on: ubuntu-latest -+ strategy: -+ matrix: -+ CC: [ gcc, clang ] -+ OS: [ "alpine:edge", "archlinux:base-devel" ] -+ xwayland: [ true, false ] -+ container: ${{ matrix.OS }} -+ env: -+ CC: ${{ matrix.CC }} -+ steps: -+ - name: Checkout Cage -+ uses: actions/checkout@v2 -+ -+ - name: Install dependencies (Alpine) -+ if: "matrix.OS == 'alpine:edge'" -+ run: apk add build-base xcb-util-wm-dev libseat-dev clang git eudev-dev mesa-dev libdrm-dev libinput-dev libxkbcommon-dev pixman-dev wayland-dev meson wayland-protocols xwayland scdoc-doc hwdata -+ -+ - name: Install dependencies (Arch) -+ if: "matrix.OS == 'archlinux:base-devel'" -+ run: | -+ pacman-key --init -+ pacman -Syu --noconfirm xcb-util-wm seatd git clang meson libinput libdrm mesa libxkbcommon wayland wayland-protocols xorg-server-xwayland scdoc -+ -+ - name: Fetch wlroots as a subproject -+ run: git clone https://gitlab.freedesktop.org/wlroots/wlroots.git subprojects/wlroots -b 0.16.0 -+ -+ # TODO: use --fatal-meson-warnings when on wlroots 0.15.0 -+ - name: Compile Cage (XWayland=${{ matrix.xwayland }}) -+ run: | -+ meson build-${{ matrix.CC }}-${{matrix.xwayland }} -Dxwayland=${{ matrix.xwayland }} -+ ninja -C build-${{ matrix.CC }}-${{matrix.xwayland }} -+ -+ format: -+ runs-on: ubuntu-latest -+ container: "archlinux:base-devel" -+ steps: -+ - name: Checkout Cage -+ uses: actions/checkout@v2 -+ - name: Install dependencies -+ run: | -+ pacman-key --init -+ pacman -Syu --noconfirm xcb-util-wm seatd git clang meson libinput libdrm mesa libxkbcommon wayland wayland-protocols xorg-server-xwayland scdoc hwdata -+ - name: Fetch wlroots as a subproject -+ run: git clone https://gitlab.freedesktop.org/wlroots/wlroots.git subprojects/wlroots -b 0.16.0 -+ - name: Check for formatting changes -+ run: | -+ meson build-clang-format -Dxwayland=true -+ ninja -C build-clang-format clang-format-check -+ -+ scan-build: -+ runs-on: ubuntu-latest -+ container: "archlinux:base-devel" -+ env: -+ CC: clang -+ steps: -+ - name: Checkout Cage -+ uses: actions/checkout@v2 -+ - name: Install dependencies -+ run: | -+ pacman-key --init -+ pacman -Syu --noconfirm xcb-util-wm seatd git clang meson libinput libdrm mesa libxkbcommon wayland wayland-protocols xorg-server-xwayland scdoc hwdata -+ - name: Fetch wlroots as a subproject -+ run: git clone https://gitlab.freedesktop.org/wlroots/wlroots.git subprojects/wlroots -b 0.16.0 -+ - name: Run scan-build -+ run: | -+ meson build-scan-build -Dxwayland=true -+ ninja -C build-scan-build scan-build -diff --git a/README.md b/README.md -index e1b6f56..752387e 100644 ---- a/README.md -+++ b/README.md -@@ -1,4 +1,4 @@ --# Cage: a Wayland kiosk [![builds.sr.ht status](https://builds.sr.ht/~hjdskes.svg)](https://builds.sr.ht/~hjdskes?) -+# Cage: a Wayland kiosk - - Cage's logo - -diff --git a/cage.c b/cage.c -index 5392535..c5eda4d 100644 ---- a/cage.c -+++ b/cage.c -@@ -19,6 +19,7 @@ - #include - #include - #include -+#include - #include - #include - #include -@@ -27,8 +28,15 @@ - #include - #include - #include -+#include -+#include - #include - #include -+#include -+#include -+#include -+#include -+#include - #if CAGE_HAS_XWAYLAND - #include - #endif -@@ -145,7 +153,12 @@ cleanup_primary_client(pid_t pid) - static bool - drop_permissions(void) - { -+ if (getuid() == 0 || getgid() == 0) { -+ wlr_log(WLR_INFO, "Running as root user, this is dangerous"); -+ return true; -+ } - if (getuid() != geteuid() || getgid() != getegid()) { -+ wlr_log(WLR_INFO, "setuid/setgid bit detected, dropping permissions"); - // Set the gid and uid in the correct order. - if (setgid(getgid()) != 0 || setuid(getuid()) != 0) { - wlr_log(WLR_ERROR, "Unable to drop root, refusing to start"); -@@ -185,9 +198,6 @@ usage(FILE *file, const char *cage) - "Usage: %s [OPTIONS] [--] APPLICATION\n" - "\n" - " -d\t Don't draw client side decorations, when possible\n" --#ifdef DEBUG -- " -D\t Turn on damage tracking debugging\n" --#endif - " -h\t Display this help message\n" - " -m extend Extend the display across all connected outputs (default)\n" - " -m last Use only the last connected output\n" -@@ -203,20 +213,11 @@ static bool - parse_args(struct cg_server *server, int argc, char *argv[]) - { - int c; --#ifdef DEBUG -- while ((c = getopt(argc, argv, "dDhm:rsv")) != -1) { --#else - while ((c = getopt(argc, argv, "dhm:rsv")) != -1) { --#endif - switch (c) { - case 'd': - server->xdg_decoration = true; - break; --#ifdef DEBUG -- case 'D': -- server->debug_damage_tracking = true; -- break; --#endif - case 'h': - usage(stdout, argv[0]); - return false; -@@ -261,15 +262,20 @@ main(int argc, char *argv[]) - struct wl_event_source *sigint_source = NULL; - struct wl_event_source *sigterm_source = NULL; - struct wl_event_source *sigchld_source = NULL; -- struct wlr_renderer *renderer = NULL; - struct wlr_compositor *compositor = NULL; -+ struct wlr_subcompositor *subcompositor = NULL; - struct wlr_data_device_manager *data_device_manager = NULL; - struct wlr_server_decoration_manager *server_decoration_manager = NULL; - struct wlr_xdg_decoration_manager_v1 *xdg_decoration_manager = NULL; - struct wlr_export_dmabuf_manager_v1 *export_dmabuf_manager = NULL; - struct wlr_screencopy_manager_v1 *screencopy_manager = NULL; -+ struct wlr_single_pixel_buffer_manager_v1 *single_pixel_buffer = NULL; - struct wlr_xdg_output_manager_v1 *output_manager = NULL; - struct wlr_gamma_control_manager_v1 *gamma_control_manager = NULL; -+ struct wlr_virtual_keyboard_manager_v1 *virtual_keyboard = NULL; -+ struct wlr_virtual_pointer_manager_v1 *virtual_pointer = NULL; -+ struct wlr_viewporter *viewporter = NULL; -+ struct wlr_presentation *presentation = NULL; - struct wlr_xdg_shell *xdg_shell = NULL; - #if CAGE_HAS_XWAYLAND - struct wlr_xwayland *xwayland = NULL; -@@ -316,8 +322,21 @@ main(int argc, char *argv[]) - goto end; - } - -- renderer = wlr_backend_get_renderer(server.backend); -- wlr_renderer_init_wl_display(renderer, server.wl_display); -+ server.renderer = wlr_renderer_autocreate(server.backend); -+ if (!server.renderer) { -+ wlr_log(WLR_ERROR, "Unable to create the wlroots renderer"); -+ ret = 1; -+ goto end; -+ } -+ -+ server.allocator = wlr_allocator_autocreate(server.backend, server.renderer); -+ if (!server.allocator) { -+ wlr_log(WLR_ERROR, "Unable to create the wlroots allocator"); -+ ret = 1; -+ goto end; -+ } -+ -+ wlr_renderer_init_wl_display(server.renderer, server.wl_display); - - wl_list_init(&server.views); - wl_list_init(&server.outputs); -@@ -329,13 +348,29 @@ main(int argc, char *argv[]) - goto end; - } - -- compositor = wlr_compositor_create(server.wl_display, renderer); -+ server.scene = wlr_scene_create(); -+ if (!server.scene) { -+ wlr_log(WLR_ERROR, "Unable to create scene"); -+ ret = 1; -+ goto end; -+ } -+ -+ wlr_scene_attach_output_layout(server.scene, server.output_layout); -+ -+ compositor = wlr_compositor_create(server.wl_display, server.renderer); - if (!compositor) { - wlr_log(WLR_ERROR, "Unable to create the wlroots compositor"); - ret = 1; - goto end; - } - -+ subcompositor = wlr_subcompositor_create(server.wl_display); -+ if (!subcompositor) { -+ wlr_log(WLR_ERROR, "Unable to create the wlroots subcompositor"); -+ ret = 1; -+ goto end; -+ } -+ - data_device_manager = wlr_data_device_manager_create(server.wl_display); - if (!data_device_manager) { - wlr_log(WLR_ERROR, "Unable to create the data device manager"); -@@ -373,7 +408,7 @@ main(int argc, char *argv[]) - wl_signal_add(&server.idle_inhibit_v1->events.new_inhibitor, &server.new_idle_inhibitor_v1); - wl_list_init(&server.inhibitors); - -- xdg_shell = wlr_xdg_shell_create(server.wl_display); -+ xdg_shell = wlr_xdg_shell_create(server.wl_display, 4); - if (!xdg_shell) { - wlr_log(WLR_ERROR, "Unable to create the XDG shell interface"); - ret = 1; -@@ -401,6 +436,21 @@ main(int argc, char *argv[]) - server_decoration_manager, server.xdg_decoration ? WLR_SERVER_DECORATION_MANAGER_MODE_SERVER - : WLR_SERVER_DECORATION_MANAGER_MODE_CLIENT); - -+ viewporter = wlr_viewporter_create(server.wl_display); -+ if (!viewporter) { -+ wlr_log(WLR_ERROR, "Unable to create the viewporter interface"); -+ ret = 1; -+ goto end; -+ } -+ -+ presentation = wlr_presentation_create(server.wl_display, server.backend); -+ if (!presentation) { -+ wlr_log(WLR_ERROR, "Unable to create the presentation interface"); -+ ret = 1; -+ goto end; -+ } -+ wlr_scene_set_presentation(server.scene, presentation); -+ - export_dmabuf_manager = wlr_export_dmabuf_manager_v1_create(server.wl_display); - if (!export_dmabuf_manager) { - wlr_log(WLR_ERROR, "Unable to create the export DMABUF manager"); -@@ -415,6 +465,13 @@ main(int argc, char *argv[]) - goto end; - } - -+ single_pixel_buffer = wlr_single_pixel_buffer_manager_v1_create(server.wl_display); -+ if (!single_pixel_buffer) { -+ wlr_log(WLR_ERROR, "Unable to create the single pixel buffer manager"); -+ ret = 1; -+ goto end; -+ } -+ - output_manager = wlr_xdg_output_manager_v1_create(server.wl_display, server.output_layout); - if (!output_manager) { - wlr_log(WLR_ERROR, "Unable to create the output manager"); -@@ -429,6 +486,22 @@ main(int argc, char *argv[]) - goto end; - } - -+ virtual_keyboard = wlr_virtual_keyboard_manager_v1_create(server.wl_display); -+ if (!virtual_keyboard) { -+ wlr_log(WLR_ERROR, "Unable to create the virtual keyboard manager"); -+ ret = 1; -+ goto end; -+ } -+ wl_signal_add(&virtual_keyboard->events.new_virtual_keyboard, &server.new_virtual_keyboard); -+ -+ virtual_pointer = wlr_virtual_pointer_manager_v1_create(server.wl_display); -+ if (!virtual_pointer) { -+ wlr_log(WLR_ERROR, "Unable to create the virtual pointer manager"); -+ ret = 1; -+ goto end; -+ } -+ wl_signal_add(&virtual_pointer->events.new_virtual_pointer, &server.new_virtual_pointer); -+ - #if CAGE_HAS_XWAYLAND - xwayland = wlr_xwayland_create(server.wl_display, compositor, true); - if (!xwayland) { -@@ -492,8 +565,9 @@ main(int argc, char *argv[]) - } - - /* Place the cursor in the center of the output layout. */ -- struct wlr_box *layout_box = wlr_output_layout_get_box(server.output_layout, NULL); -- wlr_cursor_warp(server.seat->cursor, NULL, layout_box->width / 2, layout_box->height / 2); -+ struct wlr_box layout_box; -+ wlr_output_layout_get_box(server.output_layout, NULL, &layout_box); -+ wlr_cursor_warp(server.seat->cursor, NULL, layout_box.width / 2, layout_box.height / 2); - - wl_display_run(server.wl_display); - -diff --git a/meson.build b/meson.build -index 3a84794..fbd7e16 100644 ---- a/meson.build -+++ b/meson.build -@@ -1,16 +1,17 @@ - project('cage', 'c', - version: '0.1.4', - license: 'MIT', -+ meson_version: '>=0.58.1', - default_options: [ - 'c_std=c11', -- 'warning_level=3', -+ 'warning_level=2', -+ 'werror=true', - ], - ) - - add_project_arguments( - [ - '-DWLR_USE_UNSTABLE', -- '-Wall', - '-Wundef', - '-Wno-unused-parameter', - ], -@@ -34,14 +35,13 @@ if is_freebsd - ) - endif - --wlroots = dependency('wlroots', version: '>= 0.14.0') -+wlroots = dependency('wlroots', version: '>= 0.16.0', fallback: ['wlroots', 'wlroots']) - wayland_protos = dependency('wayland-protocols', version: '>=1.14') - wayland_server = dependency('wayland-server') --pixman = dependency('pixman-1') - xkbcommon = dependency('xkbcommon') - math = cc.find_library('m') - --wl_protocol_dir = wayland_protos.get_pkgconfig_variable('pkgdatadir') -+wl_protocol_dir = wayland_protos.get_variable('pkgdatadir') - wayland_scanner = find_program('wayland-scanner') - wayland_scanner_server = generator( - wayland_scanner, -@@ -65,12 +65,11 @@ server_protos = declare_dependency( - ) - - if get_option('xwayland') -- wlroots_has_xwayland = cc.get_define('WLR_HAS_XWAYLAND', prefix: '#include ', dependencies: wlroots) == '1' -+ wlroots_has_xwayland = wlroots.get_variable(pkgconfig: 'have_xwayland', internal: 'have_xwayland') == 'true' - if not wlroots_has_xwayland - error('Cannot build Cage with XWayland support: wlroots has been built without it') -- else -- have_xwayland = true - endif -+ have_xwayland = true - else - have_xwayland = false - endif -@@ -78,8 +77,8 @@ endif - version = '@0@'.format(meson.project_version()) - git = find_program('git', native: true, required: false) - if git.found() -- git_commit = run_command([git, 'rev-parse', '--short', 'HEAD']) -- git_branch = run_command([git, 'rev-parse', '--abbrev-ref', 'HEAD']) -+ git_commit = run_command([git, 'rev-parse', '--short', 'HEAD'], check: false) -+ git_branch = run_command([git, 'rev-parse', '--abbrev-ref', 'HEAD'], check: false) - if git_commit.returncode() == 0 and git_branch.returncode() == 0 - version = '@0@-@1@ (branch \'@2@\')'.format( - meson.project_version(), -@@ -95,7 +94,7 @@ conf_data.set_quoted('CAGE_VERSION', version) - - scdoc = dependency('scdoc', version: '>=1.9.2', native: true, required: get_option('man-pages')) - if scdoc.found() -- scdoc_prog = find_program(scdoc.get_pkgconfig_variable('scdoc'), native: true) -+ scdoc_prog = find_program(scdoc.get_variable('scdoc'), native: true) - sh = find_program('sh', native: true) - mandir = get_option('mandir') - man_files = [ -@@ -111,7 +110,7 @@ if scdoc.found() - input: filename, - output: output, - command: [ -- sh, '-c', '@0@ < @INPUT@ > @1@'.format(scdoc_prog.path(), output) -+ sh, '-c', '@0@ < @INPUT@ > @1@'.format(scdoc_prog.full_path(), output) - ], - install: true, - install_dir: '@0@/man@1@'.format(mandir, section) -@@ -123,9 +122,7 @@ cage_sources = [ - 'cage.c', - 'idle_inhibit_v1.c', - 'output.c', -- 'render.c', - 'seat.c', -- 'util.c', - 'view.c', - 'xdg_shell.c', - ] -@@ -136,10 +133,8 @@ cage_headers = [ - configuration: conf_data), - 'idle_inhibit_v1.h', - 'output.h', -- 'render.h', - 'seat.h', - 'server.h', -- 'util.h', - 'view.h', - 'xdg_shell.h', - ] -@@ -157,7 +152,6 @@ executable( - wayland_server, - wlroots, - xkbcommon, -- pixman, - math, - ], - install: true, -diff --git a/output.c b/output.c -index d8da3b9..6eca0db 100644 ---- a/output.c -+++ b/output.c -@@ -1,7 +1,7 @@ - /* - * Cage: A Wayland kiosk. - * -- * Copyright (C) 2018-2020 Jente Hidskes -+ * Copyright (C) 2018-2021 Jente Hidskes - * Copyright (C) 2019 The Sway authors - * - * See the LICENSE file accompanying this file. -@@ -11,6 +11,7 @@ - - #include "config.h" - -+#include - #include - #include - #include -@@ -21,221 +22,25 @@ - #include - #endif - #include -+#include - #include - #include - #include - #include - #include --#include -+#include - #include - #include - #include - - #include "output.h" --#include "render.h" - #include "seat.h" - #include "server.h" --#include "util.h" - #include "view.h" - #if CAGE_HAS_XWAYLAND - #include "xwayland.h" - #endif - --static void output_for_each_surface(struct cg_output *output, cg_surface_iterator_func_t iterator, void *user_data); -- --struct surface_iterator_data { -- cg_surface_iterator_func_t user_iterator; -- void *user_data; -- -- struct cg_output *output; -- -- /* Output-local coordinates. */ -- double ox, oy; --}; -- --static bool --intersects_with_output(struct cg_output *output, struct wlr_output_layout *output_layout, struct wlr_box *surface_box) --{ -- /* Since the surface_box's x- and y-coordinates are already output local, -- * the x- and y-coordinates of this box need to be 0 for this function to -- * work correctly. */ -- struct wlr_box output_box = {0}; -- wlr_output_effective_resolution(output->wlr_output, &output_box.width, &output_box.height); -- -- struct wlr_box intersection; -- return wlr_box_intersection(&intersection, &output_box, surface_box); --} -- --static void --output_for_each_surface_iterator(struct wlr_surface *surface, int sx, int sy, void *user_data) --{ -- struct surface_iterator_data *data = user_data; -- struct cg_output *output = data->output; -- -- if (!wlr_surface_has_buffer(surface)) { -- return; -- } -- -- struct wlr_box surface_box = { -- .x = data->ox + sx + surface->sx, -- .y = data->oy + sy + surface->sy, -- .width = surface->current.width, -- .height = surface->current.height, -- }; -- -- if (!intersects_with_output(output, output->server->output_layout, &surface_box)) { -- return; -- } -- -- data->user_iterator(data->output, surface, &surface_box, data->user_data); --} -- --void --output_surface_for_each_surface(struct cg_output *output, struct wlr_surface *surface, double ox, double oy, -- cg_surface_iterator_func_t iterator, void *user_data) --{ -- struct surface_iterator_data data = { -- .user_iterator = iterator, -- .user_data = user_data, -- .output = output, -- .ox = ox, -- .oy = oy, -- }; -- -- wlr_surface_for_each_surface(surface, output_for_each_surface_iterator, &data); --} -- --static void --output_view_for_each_surface(struct cg_output *output, struct cg_view *view, cg_surface_iterator_func_t iterator, -- void *user_data) --{ -- struct surface_iterator_data data = { -- .user_iterator = iterator, -- .user_data = user_data, -- .output = output, -- .ox = view->lx, -- .oy = view->ly, -- }; -- -- wlr_output_layout_output_coords(output->server->output_layout, output->wlr_output, &data.ox, &data.oy); -- view_for_each_surface(view, output_for_each_surface_iterator, &data); --} -- --void --output_view_for_each_popup_surface(struct cg_output *output, struct cg_view *view, cg_surface_iterator_func_t iterator, -- void *user_data) --{ -- struct surface_iterator_data data = { -- .user_iterator = iterator, -- .user_data = user_data, -- .output = output, -- .ox = view->lx, -- .oy = view->ly, -- }; -- -- wlr_output_layout_output_coords(output->server->output_layout, output->wlr_output, &data.ox, &data.oy); -- view_for_each_popup_surface(view, output_for_each_surface_iterator, &data); --} -- --void --output_drag_icons_for_each_surface(struct cg_output *output, struct wl_list *drag_icons, -- cg_surface_iterator_func_t iterator, void *user_data) --{ -- struct cg_drag_icon *drag_icon; -- wl_list_for_each (drag_icon, drag_icons, link) { -- if (drag_icon->wlr_drag_icon->mapped) { -- double ox = drag_icon->lx; -- double oy = drag_icon->ly; -- wlr_output_layout_output_coords(output->server->output_layout, output->wlr_output, &ox, &oy); -- output_surface_for_each_surface(output, drag_icon->wlr_drag_icon->surface, ox, oy, iterator, -- user_data); -- } -- } --} -- --static void --output_for_each_surface(struct cg_output *output, cg_surface_iterator_func_t iterator, void *user_data) --{ -- struct cg_view *view; -- wl_list_for_each_reverse (view, &output->server->views, link) { -- output_view_for_each_surface(output, view, iterator, user_data); -- } -- -- output_drag_icons_for_each_surface(output, &output->server->seat->drag_icons, iterator, user_data); --} -- --struct send_frame_done_data { -- struct timespec when; --}; -- --static void --send_frame_done_iterator(struct cg_output *output, struct wlr_surface *surface, struct wlr_box *box, void *user_data) --{ -- struct send_frame_done_data *data = user_data; -- wlr_surface_send_frame_done(surface, &data->when); --} -- --static void --send_frame_done(struct cg_output *output, struct send_frame_done_data *data) --{ -- output_for_each_surface(output, send_frame_done_iterator, data); --} -- --static void --count_surface_iterator(struct cg_output *output, struct wlr_surface *surface, struct wlr_box *_box, void *data) --{ -- size_t *n = data; -- n++; --} -- --static bool --scan_out_primary_view(struct cg_output *output) --{ -- struct cg_server *server = output->server; -- struct wlr_output *wlr_output = output->wlr_output; -- -- struct cg_drag_icon *drag_icon; -- wl_list_for_each (drag_icon, &server->seat->drag_icons, link) { -- if (drag_icon->wlr_drag_icon->mapped) { -- return false; -- } -- } -- -- struct cg_view *view = seat_get_focus(server->seat); -- if (!view || !view->wlr_surface) { -- return false; -- } -- -- size_t n_surfaces = 0; -- output_view_for_each_surface(output, view, count_surface_iterator, &n_surfaces); -- if (n_surfaces > 1) { -- return false; -- } -- --#if CAGE_HAS_XWAYLAND -- if (view->type == CAGE_XWAYLAND_VIEW) { -- struct cg_xwayland_view *xwayland_view = xwayland_view_from_view(view); -- if (!wl_list_empty(&xwayland_view->xwayland_surface->children)) { -- return false; -- } -- } --#endif -- -- struct wlr_surface *surface = view->wlr_surface; -- -- if (!surface->buffer) { -- return false; -- } -- -- if ((float) surface->current.scale != wlr_output->scale || -- surface->current.transform != wlr_output->transform) { -- return false; -- } -- -- wlr_output_attach_buffer(wlr_output, &surface->buffer->base); -- return wlr_output_commit(wlr_output); --} -- - static void - output_enable(struct cg_output *output) - { -@@ -249,6 +54,9 @@ output_enable(struct cg_output *output) - wlr_output_layout_add_auto(output->server->output_layout, wlr_output); - wlr_output_enable(wlr_output, true); - wlr_output_commit(wlr_output); -+ -+ output->scene_output = wlr_scene_get_scene_output(output->server->scene, wlr_output); -+ assert(output->scene_output != NULL); - } - - static void -@@ -261,6 +69,8 @@ output_disable(struct cg_output *output) - return; - } - -+ output->scene_output = NULL; -+ - wlr_log(WLR_DEBUG, "Disabling output %s", wlr_output->name); - wlr_output_enable(wlr_output, false); - wlr_output_layout_remove(output->server->output_layout, wlr_output); -@@ -268,93 +78,19 @@ output_disable(struct cg_output *output) - } - - static void --damage_surface_iterator(struct cg_output *output, struct wlr_surface *surface, struct wlr_box *box, void *user_data) -+handle_output_frame(struct wl_listener *listener, void *data) - { -- struct wlr_output *wlr_output = output->wlr_output; -- bool whole = *(bool *) user_data; -- -- scale_box(box, output->wlr_output->scale); -- -- if (whole) { -- wlr_output_damage_add_box(output->damage, box); -- } else if (pixman_region32_not_empty(&surface->buffer_damage)) { -- pixman_region32_t damage; -- pixman_region32_init(&damage); -- wlr_surface_get_effective_damage(surface, &damage); -- -- wlr_region_scale(&damage, &damage, wlr_output->scale); -- if (ceil(wlr_output->scale) > surface->current.scale) { -- /* When scaling up a surface it'll become -- blurry, so we need to expand the damage -- region. */ -- wlr_region_expand(&damage, &damage, ceil(wlr_output->scale) - surface->current.scale); -- } -- pixman_region32_translate(&damage, box->x, box->y); -- wlr_output_damage_add(output->damage, &damage); -- pixman_region32_fini(&damage); -- } --} -+ struct cg_output *output = wl_container_of(listener, output, frame); - --void --output_damage_surface(struct cg_output *output, struct wlr_surface *surface, double lx, double ly, bool whole) --{ - if (!output->wlr_output->enabled) { -- wlr_log(WLR_DEBUG, "Not adding damage for disabled output %s", output->wlr_output->name); - return; - } - -- double ox = lx, oy = ly; -- wlr_output_layout_output_coords(output->server->output_layout, output->wlr_output, &ox, &oy); -- output_surface_for_each_surface(output, surface, ox, oy, damage_surface_iterator, &whole); --} -+ wlr_scene_output_commit(output->scene_output); - --static void --handle_output_damage_frame(struct wl_listener *listener, void *data) --{ -- struct cg_output *output = wl_container_of(listener, output, damage_frame); -- struct send_frame_done_data frame_data = {0}; -- -- if (!output->wlr_output->enabled) { -- return; -- } -- -- /* Check if we can scan-out the primary view. */ -- static bool last_scanned_out = false; -- bool scanned_out = scan_out_primary_view(output); -- -- if (scanned_out && !last_scanned_out) { -- wlr_log(WLR_DEBUG, "Scanning out primary view"); -- } -- if (last_scanned_out && !scanned_out) { -- wlr_log(WLR_DEBUG, "Stopping primary view scan out"); -- } -- last_scanned_out = scanned_out; -- -- if (scanned_out) { -- goto frame_done; -- } -- -- bool needs_frame; -- pixman_region32_t damage; -- pixman_region32_init(&damage); -- if (!wlr_output_damage_attach_render(output->damage, &needs_frame, &damage)) { -- wlr_log(WLR_ERROR, "Cannot make damage output current"); -- goto damage_finish; -- } -- -- if (!needs_frame) { -- wlr_output_rollback(output->wlr_output); -- goto damage_finish; -- } -- -- output_render(output, &damage); -- --damage_finish: -- pixman_region32_fini(&damage); -- --frame_done: -- clock_gettime(CLOCK_MONOTONIC, &frame_data.when); -- send_frame_done(output, &frame_data); -+ struct timespec now = {0}; -+ clock_gettime(CLOCK_MONOTONIC, &now); -+ wlr_scene_output_send_frame_done(output->scene_output, &now); - } - - static void -@@ -395,11 +131,12 @@ output_destroy(struct cg_output *output) - { - struct cg_server *server = output->server; - -+ output->wlr_output->data = NULL; -+ - wl_list_remove(&output->destroy.link); - wl_list_remove(&output->commit.link); - wl_list_remove(&output->mode.link); -- wl_list_remove(&output->damage_frame.link); -- wl_list_remove(&output->damage_destroy.link); -+ wl_list_remove(&output->frame.link); - wl_list_remove(&output->link); - - wlr_output_layout_remove(server->output_layout, output->wlr_output); -@@ -421,18 +158,10 @@ output_destroy(struct cg_output *output) - } - } - --static void --handle_output_damage_destroy(struct wl_listener *listener, void *data) --{ -- struct cg_output *output = wl_container_of(listener, output, damage_destroy); -- output_destroy(output); --} -- - static void - handle_output_destroy(struct wl_listener *listener, void *data) - { - struct cg_output *output = wl_container_of(listener, output, destroy); -- wlr_output_damage_destroy(output->damage); - output_destroy(output); - } - -@@ -442,6 +171,11 @@ handle_new_output(struct wl_listener *listener, void *data) - struct cg_server *server = wl_container_of(listener, server, new_output); - struct wlr_output *wlr_output = data; - -+ if (!wlr_output_init_render(wlr_output, server->allocator, server->renderer)) { -+ wlr_log(WLR_ERROR, "Failed to initialize output rendering"); -+ return; -+ } -+ - struct cg_output *output = calloc(1, sizeof(struct cg_output)); - if (!output) { - wlr_log(WLR_ERROR, "Failed to allocate output"); -@@ -449,8 +183,9 @@ handle_new_output(struct wl_listener *listener, void *data) - } - - output->wlr_output = wlr_output; -+ wlr_output->data = output; - output->server = server; -- output->damage = wlr_output_damage_create(wlr_output); -+ - wl_list_insert(&server->outputs, &output->link); - - output->commit.notify = handle_output_commit; -@@ -459,15 +194,29 @@ handle_new_output(struct wl_listener *listener, void *data) - wl_signal_add(&wlr_output->events.mode, &output->mode); - output->destroy.notify = handle_output_destroy; - wl_signal_add(&wlr_output->events.destroy, &output->destroy); -- output->damage_frame.notify = handle_output_damage_frame; -- wl_signal_add(&output->damage->events.frame, &output->damage_frame); -- output->damage_destroy.notify = handle_output_damage_destroy; -- wl_signal_add(&output->damage->events.destroy, &output->damage_destroy); -- -- struct wlr_output_mode *preferred_mode = wlr_output_preferred_mode(wlr_output); -- if (preferred_mode) { -- wlr_output_set_mode(wlr_output, preferred_mode); -+ output->frame.notify = handle_output_frame; -+ wl_signal_add(&wlr_output->events.frame, &output->frame); -+ -+ if (!wl_list_empty(&wlr_output->modes)) { -+ struct wlr_output_mode *preferred_mode = wlr_output_preferred_mode(wlr_output); -+ if (preferred_mode) { -+ wlr_output_set_mode(wlr_output, preferred_mode); -+ } -+ if (!wlr_output_test(wlr_output)) { -+ struct wlr_output_mode *mode; -+ wl_list_for_each (mode, &wlr_output->modes, link) { -+ if (mode == preferred_mode) { -+ continue; -+ } -+ -+ wlr_output_set_mode(wlr_output, mode); -+ if (wlr_output_test(wlr_output)) { -+ break; -+ } -+ } -+ } - } -+ - wlr_output_set_transform(wlr_output, output->server->output_transform); - - if (server->output_mode == CAGE_MULTI_OUTPUT_MODE_LAST) { -diff --git a/output.h b/output.h -index b3fd3b4..ced06f6 100644 ---- a/output.h -+++ b/output.h -@@ -11,28 +11,17 @@ - struct cg_output { - struct cg_server *server; - struct wlr_output *wlr_output; -- struct wlr_output_damage *damage; -+ struct wlr_scene_output *scene_output; - - struct wl_listener commit; - struct wl_listener mode; - struct wl_listener destroy; -- struct wl_listener damage_frame; -- struct wl_listener damage_destroy; -+ struct wl_listener frame; - - struct wl_list link; // cg_server::outputs - }; - --typedef void (*cg_surface_iterator_func_t)(struct cg_output *output, struct wlr_surface *surface, struct wlr_box *box, -- void *user_data); -- - void handle_new_output(struct wl_listener *listener, void *data); --void output_surface_for_each_surface(struct cg_output *output, struct wlr_surface *surface, double ox, double oy, -- cg_surface_iterator_func_t iterator, void *user_data); --void output_view_for_each_popup_surface(struct cg_output *output, struct cg_view *view, -- cg_surface_iterator_func_t iterator, void *user_data); --void output_drag_icons_for_each_surface(struct cg_output *output, struct wl_list *drag_icons, -- cg_surface_iterator_func_t iterator, void *user_data); --void output_damage_surface(struct cg_output *output, struct wlr_surface *surface, double lx, double ly, bool whole); - void output_set_window_title(struct cg_output *output, const char *title); - - #endif -diff --git a/render.c b/render.c -deleted file mode 100644 -index 166a088..0000000 ---- a/render.c -+++ /dev/null -@@ -1,205 +0,0 @@ --/* -- * Cage: A Wayland kiosk. -- * -- * Copyright (C) 2018-2020 Jente Hidskes -- * Copyright (C) 2019 The Sway authors -- * -- * See the LICENSE file accompanying this file. -- */ -- --#include --#include --#include --#include --#include --#include --#include --#include --#include --#include -- --#include "output.h" --#include "seat.h" --#include "server.h" --#include "util.h" --#include "view.h" -- --static void --scissor_output(struct wlr_output *output, pixman_box32_t *rect) --{ -- struct wlr_renderer *renderer = wlr_backend_get_renderer(output->backend); -- -- struct wlr_box box = { -- .x = rect->x1, -- .y = rect->y1, -- .width = rect->x2 - rect->x1, -- .height = rect->y2 - rect->y1, -- }; -- -- int output_width, output_height; -- wlr_output_transformed_resolution(output, &output_width, &output_height); -- enum wl_output_transform transform = wlr_output_transform_invert(output->transform); -- wlr_box_transform(&box, &box, transform, output_width, output_height); -- -- wlr_renderer_scissor(renderer, &box); --} -- --struct render_data { -- pixman_region32_t *damage; --}; -- --static void --render_texture(struct wlr_output *wlr_output, pixman_region32_t *output_damage, struct wlr_texture *texture, -- const struct wlr_box *box, const float matrix[static 9]) --{ -- struct wlr_renderer *renderer = wlr_backend_get_renderer(wlr_output->backend); -- -- pixman_region32_t damage; -- pixman_region32_init(&damage); -- pixman_region32_union_rect(&damage, &damage, box->x, box->y, box->width, box->height); -- pixman_region32_intersect(&damage, &damage, output_damage); -- if (!pixman_region32_not_empty(&damage)) { -- goto damage_finish; -- } -- -- int nrects; -- pixman_box32_t *rects = pixman_region32_rectangles(&damage, &nrects); -- for (int i = 0; i < nrects; i++) { -- scissor_output(wlr_output, &rects[i]); -- wlr_render_texture_with_matrix(renderer, texture, matrix, 1.0f); -- } -- --damage_finish: -- pixman_region32_fini(&damage); --} -- --static void --render_surface_iterator(struct cg_output *output, struct wlr_surface *surface, struct wlr_box *box, void *user_data) --{ -- struct render_data *data = user_data; -- struct wlr_output *wlr_output = output->wlr_output; -- pixman_region32_t *output_damage = data->damage; -- -- struct wlr_texture *texture = wlr_surface_get_texture(surface); -- if (!texture) { -- wlr_log(WLR_DEBUG, "Cannot obtain surface texture"); -- return; -- } -- -- scale_box(box, wlr_output->scale); -- -- float matrix[9]; -- enum wl_output_transform transform = wlr_output_transform_invert(surface->current.transform); -- wlr_matrix_project_box(matrix, box, transform, 0.0f, wlr_output->transform_matrix); -- -- render_texture(wlr_output, output_damage, texture, box, matrix); --} -- --static void --render_drag_icons(struct cg_output *output, pixman_region32_t *damage, struct wl_list *drag_icons) --{ -- struct render_data data = { -- .damage = damage, -- }; -- output_drag_icons_for_each_surface(output, drag_icons, render_surface_iterator, &data); --} -- --/** -- * Render all toplevels without descending into popups. -- */ --static void --render_view_toplevels(struct cg_view *view, struct cg_output *output, pixman_region32_t *damage) --{ -- struct render_data data = { -- .damage = damage, -- }; -- double ox = view->lx; -- double oy = view->ly; -- wlr_output_layout_output_coords(output->server->output_layout, output->wlr_output, &ox, &oy); -- output_surface_for_each_surface(output, view->wlr_surface, ox, oy, render_surface_iterator, &data); --} -- --static void --render_view_popups(struct cg_view *view, struct cg_output *output, pixman_region32_t *damage) --{ -- struct render_data data = { -- .damage = damage, -- }; -- output_view_for_each_popup_surface(output, view, render_surface_iterator, &data); --} -- --void --output_render(struct cg_output *output, pixman_region32_t *damage) --{ -- struct cg_server *server = output->server; -- struct wlr_output *wlr_output = output->wlr_output; -- -- struct wlr_renderer *renderer = wlr_backend_get_renderer(wlr_output->backend); -- if (!renderer) { -- wlr_log(WLR_DEBUG, "Expected the output backend to have a renderer"); -- return; -- } -- -- wlr_renderer_begin(renderer, wlr_output->width, wlr_output->height); -- -- if (!pixman_region32_not_empty(damage)) { -- wlr_log(WLR_DEBUG, "Output isn't damaged but needs a buffer swap"); -- goto renderer_end; -- } -- --#ifdef DEBUG -- if (server->debug_damage_tracking) { -- wlr_renderer_clear(renderer, (float[]){1.0f, 0.0f, 0.0f, 1.0f}); -- } --#endif -- -- float color[4] = {0.0f, 0.0f, 0.0f, 1.0f}; -- int nrects; -- pixman_box32_t *rects = pixman_region32_rectangles(damage, &nrects); -- for (int i = 0; i < nrects; i++) { -- scissor_output(wlr_output, &rects[i]); -- wlr_renderer_clear(renderer, color); -- } -- -- // TODO: render only top view, possibly use focused view for this, see #35. -- struct cg_view *view; -- wl_list_for_each_reverse (view, &server->views, link) { -- render_view_toplevels(view, output, damage); -- } -- -- struct cg_view *focused_view = seat_get_focus(server->seat); -- if (focused_view) { -- render_view_popups(focused_view, output, damage); -- } -- -- render_drag_icons(output, damage, &server->seat->drag_icons); -- --renderer_end: -- /* Draw software cursor in case hardware cursors aren't -- available. This is a no-op when they are. */ -- wlr_output_render_software_cursors(wlr_output, damage); -- wlr_renderer_scissor(renderer, NULL); -- wlr_renderer_end(renderer); -- -- int output_width, output_height; -- wlr_output_transformed_resolution(wlr_output, &output_width, &output_height); -- -- pixman_region32_t frame_damage; -- pixman_region32_init(&frame_damage); -- -- enum wl_output_transform transform = wlr_output_transform_invert(wlr_output->transform); -- wlr_region_transform(&frame_damage, &output->damage->current, transform, output_width, output_height); -- --#ifdef DEBUG -- if (server->debug_damage_tracking) { -- pixman_region32_union_rect(&frame_damage, &frame_damage, 0, 0, output_width, output_height); -- } --#endif -- -- wlr_output_set_damage(wlr_output, &frame_damage); -- pixman_region32_fini(&frame_damage); -- -- if (!wlr_output_commit(wlr_output)) { -- wlr_log(WLR_ERROR, "Could not commit output"); -- } --} -diff --git a/render.h b/render.h -deleted file mode 100644 -index 085b00b..0000000 ---- a/render.h -+++ /dev/null -@@ -1,8 +0,0 @@ --#ifndef CG_RENDER_H --#define CG_RENDER_H -- --#include "output.h" -- --void output_render(struct cg_output *output, pixman_region32_t *damage); -- --#endif -diff --git a/seat.c b/seat.c -index 08f25a3..5d80e33 100644 ---- a/seat.c -+++ b/seat.c -@@ -6,10 +6,14 @@ - * See the LICENSE file accompanying this file. - */ - -+#define _POSIX_C_SOURCE 200809L -+ - #include "config.h" - -+#include - #include - #include -+#include - #include - #include - #include -@@ -18,9 +22,11 @@ - #include - #include - #include -+#include - #include --#include - #include -+#include -+#include - #include - #include - #if CAGE_HAS_XWAYLAND -@@ -41,42 +47,42 @@ static void drag_icon_update_position(struct cg_drag_icon *drag_icon); - * menus or tooltips. This function tests if any of those are underneath the - * coordinates lx and ly (in output Layout Coordinates). If so, it sets the - * surface pointer to that wlr_surface and the sx and sy coordinates to the -- * coordinates relative to that surface's top-left corner. */ --static bool --view_at(struct cg_view *view, double lx, double ly, struct wlr_surface **surface, double *sx, double *sy) -+ * coordinates relative to that surface's top-left corner. -+ * -+ * This function iterates over all of our surfaces and attempts to find one -+ * under the cursor. If desktop_view_at returns a view, there is also a -+ * surface. There cannot be a surface without a view, either. It's both or -+ * nothing. -+ */ -+static struct cg_view * -+desktop_view_at(struct cg_server *server, double lx, double ly, struct wlr_surface **surface, double *sx, double *sy) - { -- double view_sx = lx - view->lx; -- double view_sy = ly - view->ly; -+ struct wlr_scene_node *node = wlr_scene_node_at(&server->scene->tree.node, lx, ly, sx, sy); -+ if (node == NULL || node->type != WLR_SCENE_NODE_BUFFER) { -+ return NULL; -+ } - -- double _sx, _sy; -- struct wlr_surface *_surface = view_wlr_surface_at(view, view_sx, view_sy, &_sx, &_sy); -- if (_surface != NULL) { -- *sx = _sx; -- *sy = _sy; -- *surface = _surface; -- return true; -+ struct wlr_scene_buffer *scene_buffer = wlr_scene_buffer_from_node(node); -+ struct wlr_scene_surface *scene_surface = wlr_scene_surface_from_buffer(scene_buffer); -+ if (!scene_surface) { -+ return NULL; - } - -- return false; --} -+ *surface = scene_surface->surface; - --/* This iterates over all of our surfaces and attempts to find one -- * under the cursor. This relies on server->views being ordered from -- * top-to-bottom. If desktop_view_at returns a view, there is also a -- * surface. There cannot be a surface without a view, either. It's -- * both or nothing. */ --static struct cg_view * --desktop_view_at(struct cg_server *server, double lx, double ly, struct wlr_surface **surface, double *sx, double *sy) --{ -- struct cg_view *view; -- -- wl_list_for_each (view, &server->views, link) { -- if (view_at(view, lx, ly, surface, sx, sy)) { -- return view; -+ /* Walk up the tree until we find a node with a data pointer. When done, -+ * we've found the node representing the view. */ -+ while (!node->data) { -+ if (!node->parent) { -+ node = NULL; -+ break; - } -+ -+ node = &node->parent->node; - } - -- return NULL; -+ assert(node != NULL); -+ return node->data; - } - - static void -@@ -127,16 +133,16 @@ update_capabilities(struct cg_seat *seat) - } - - static void --map_input_device_to_output(struct cg_seat *seat, struct wlr_input_device *device) -+map_input_device_to_output(struct cg_seat *seat, struct wlr_input_device *device, const char *output_name) - { -- if (!device->output_name) { -+ if (!output_name) { - wlr_log(WLR_INFO, "Input device %s cannot be mapped to an output device\n", device->name); - return; - } - - struct cg_output *output; - wl_list_for_each (output, &seat->server->outputs, link) { -- if (strcmp(device->output_name, output->wlr_output->name) == 0) { -+ if (strcmp(output_name, output->wlr_output->name) == 0) { - wlr_log(WLR_INFO, "Mapping input device %s to output device %s\n", device->name, - output->wlr_output->name); - wlr_cursor_map_input_to_output(seat->cursor, device, output->wlr_output); -@@ -154,7 +160,7 @@ handle_touch_destroy(struct wl_listener *listener, void *data) - struct cg_seat *seat = touch->seat; - - wl_list_remove(&touch->link); -- wlr_cursor_detach_input_device(seat->cursor, touch->device); -+ wlr_cursor_detach_input_device(seat->cursor, &touch->touch->base); - wl_list_remove(&touch->destroy.link); - free(touch); - -@@ -162,7 +168,7 @@ handle_touch_destroy(struct wl_listener *listener, void *data) - } - - static void --handle_new_touch(struct cg_seat *seat, struct wlr_input_device *device) -+handle_new_touch(struct cg_seat *seat, struct wlr_touch *wlr_touch) - { - struct cg_touch *touch = calloc(1, sizeof(struct cg_touch)); - if (!touch) { -@@ -171,14 +177,14 @@ handle_new_touch(struct cg_seat *seat, struct wlr_input_device *device) - } - - touch->seat = seat; -- touch->device = device; -- wlr_cursor_attach_input_device(seat->cursor, device); -+ touch->touch = wlr_touch; -+ wlr_cursor_attach_input_device(seat->cursor, &wlr_touch->base); - - wl_list_insert(&seat->touch, &touch->link); - touch->destroy.notify = handle_touch_destroy; -- wl_signal_add(&touch->device->events.destroy, &touch->destroy); -+ wl_signal_add(&wlr_touch->base.events.destroy, &touch->destroy); - -- map_input_device_to_output(seat, device); -+ map_input_device_to_output(seat, &wlr_touch->base, wlr_touch->output_name); - } - - static void -@@ -188,7 +194,7 @@ handle_pointer_destroy(struct wl_listener *listener, void *data) - struct cg_seat *seat = pointer->seat; - - wl_list_remove(&pointer->link); -- wlr_cursor_detach_input_device(seat->cursor, pointer->device); -+ wlr_cursor_detach_input_device(seat->cursor, &pointer->pointer->base); - wl_list_remove(&pointer->destroy.link); - free(pointer); - -@@ -196,7 +202,7 @@ handle_pointer_destroy(struct wl_listener *listener, void *data) - } - - static void --handle_new_pointer(struct cg_seat *seat, struct wlr_input_device *device) -+handle_new_pointer(struct cg_seat *seat, struct wlr_pointer *wlr_pointer) - { - struct cg_pointer *pointer = calloc(1, sizeof(struct cg_pointer)); - if (!pointer) { -@@ -205,21 +211,42 @@ handle_new_pointer(struct cg_seat *seat, struct wlr_input_device *device) - } - - pointer->seat = seat; -- pointer->device = device; -- wlr_cursor_attach_input_device(seat->cursor, device); -+ pointer->pointer = wlr_pointer; -+ wlr_cursor_attach_input_device(seat->cursor, &wlr_pointer->base); - - wl_list_insert(&seat->pointers, &pointer->link); - pointer->destroy.notify = handle_pointer_destroy; -- wl_signal_add(&device->events.destroy, &pointer->destroy); -+ wl_signal_add(&wlr_pointer->base.events.destroy, &pointer->destroy); -+ -+ map_input_device_to_output(seat, &wlr_pointer->base, wlr_pointer->output_name); -+} - -- map_input_device_to_output(seat, device); -+static void -+handle_virtual_pointer(struct wl_listener *listener, void *data) -+{ -+ struct cg_server *server = wl_container_of(listener, server, new_virtual_pointer); -+ struct cg_seat *seat = server->seat; -+ struct wlr_virtual_pointer_v1_new_pointer_event *event = data; -+ struct wlr_virtual_pointer_v1 *pointer = event->new_pointer; -+ struct wlr_pointer *wlr_pointer = &pointer->pointer; -+ -+ /* We'll want to map the device back to an output later, this is a bit -+ * sub-optimal (we could just keep the suggested_output), but just copy -+ * its name so we do like other devices -+ */ -+ if (event->suggested_output != NULL) { -+ wlr_pointer->output_name = strdup(event->suggested_output->name); -+ } -+ /* TODO: event->suggested_seat should be checked if we handle multiple seats */ -+ handle_new_pointer(seat, wlr_pointer); -+ update_capabilities(seat); - } - - static void --handle_modifier_event(struct wlr_input_device *device, struct cg_seat *seat) -+handle_modifier_event(struct wlr_keyboard *keyboard, struct cg_seat *seat) - { -- wlr_seat_set_keyboard(seat->seat, device); -- wlr_seat_keyboard_notify_modifiers(seat->seat, &device->keyboard->modifiers); -+ wlr_seat_set_keyboard(seat->seat, keyboard); -+ wlr_seat_keyboard_notify_modifiers(seat->seat, &keyboard->modifiers); - - wlr_idle_notify_activity(seat->server->idle, seat->seat); - } -@@ -249,18 +276,18 @@ handle_keybinding(struct cg_server *server, xkb_keysym_t sym) - } - - static void --handle_key_event(struct wlr_input_device *device, struct cg_seat *seat, void *data) -+handle_key_event(struct wlr_keyboard *keyboard, struct cg_seat *seat, void *data) - { -- struct wlr_event_keyboard_key *event = data; -+ struct wlr_keyboard_key_event *event = data; - - /* Translate from libinput keycode to an xkbcommon keycode. */ - xkb_keycode_t keycode = event->keycode + 8; - - const xkb_keysym_t *syms; -- int nsyms = xkb_state_key_get_syms(device->keyboard->xkb_state, keycode, &syms); -+ int nsyms = xkb_state_key_get_syms(keyboard->xkb_state, keycode, &syms); - - bool handled = false; -- uint32_t modifiers = wlr_keyboard_get_modifiers(device->keyboard); -+ uint32_t modifiers = wlr_keyboard_get_modifiers(keyboard); - if ((modifiers & WLR_MODIFIER_ALT) && event->state == WL_KEYBOARD_KEY_STATE_PRESSED) { - /* If Alt is held down and this button was pressed, we - * attempt to process it as a compositor -@@ -272,7 +299,7 @@ handle_key_event(struct wlr_input_device *device, struct cg_seat *seat, void *da - - if (!handled) { - /* Otherwise, we pass it along to the client. */ -- wlr_seat_set_keyboard(seat->seat, device); -+ wlr_seat_set_keyboard(seat->seat, keyboard); - wlr_seat_keyboard_notify_key(seat->seat, event->time_msec, event->keycode, event->state); - } - -@@ -283,27 +310,32 @@ static void - handle_keyboard_group_key(struct wl_listener *listener, void *data) - { - struct cg_keyboard_group *cg_group = wl_container_of(listener, cg_group, key); -- handle_key_event(cg_group->wlr_group->input_device, cg_group->seat, data); -+ handle_key_event(&cg_group->wlr_group->keyboard, cg_group->seat, data); - } - - static void - handle_keyboard_group_modifiers(struct wl_listener *listener, void *data) - { - struct cg_keyboard_group *group = wl_container_of(listener, group, modifiers); -- handle_modifier_event(group->wlr_group->input_device, group->seat); -+ handle_modifier_event(&group->wlr_group->keyboard, group->seat); - } - - static void --cg_keyboard_group_add(struct wlr_input_device *device, struct cg_seat *seat) -+cg_keyboard_group_add(struct wlr_keyboard *keyboard, struct cg_seat *seat, bool virtual) - { -- struct wlr_keyboard *wlr_keyboard = device->keyboard; -- -- struct cg_keyboard_group *group; -- wl_list_for_each (group, &seat->keyboard_groups, link) { -- struct wlr_keyboard_group *wlr_group = group->wlr_group; -- if (wlr_keyboard_group_add_keyboard(wlr_group, wlr_keyboard)) { -- wlr_log(WLR_DEBUG, "Added new keyboard to existing group"); -- return; -+ /* We apparently should not group virtual keyboards, -+ * so create a new group with it -+ */ -+ if (!virtual) { -+ struct cg_keyboard_group *group; -+ wl_list_for_each (group, &seat->keyboard_groups, link) { -+ if (group->is_virtual) -+ continue; -+ struct wlr_keyboard_group *wlr_group = group->wlr_group; -+ if (wlr_keyboard_group_add_keyboard(wlr_group, keyboard)) { -+ wlr_log(WLR_DEBUG, "Added new keyboard to existing group"); -+ return; -+ } - } - } - -@@ -315,6 +347,7 @@ cg_keyboard_group_add(struct wlr_input_device *device, struct cg_seat *seat) - return; - } - cg_group->seat = seat; -+ cg_group->is_virtual = virtual; - cg_group->wlr_group = wlr_keyboard_group_create(); - if (cg_group->wlr_group == NULL) { - wlr_log(WLR_ERROR, "Failed to create wlr keyboard group."); -@@ -322,14 +355,14 @@ cg_keyboard_group_add(struct wlr_input_device *device, struct cg_seat *seat) - } - - cg_group->wlr_group->data = cg_group; -- wlr_keyboard_set_keymap(&cg_group->wlr_group->keyboard, device->keyboard->keymap); -+ wlr_keyboard_set_keymap(&cg_group->wlr_group->keyboard, keyboard->keymap); - -- wlr_keyboard_set_repeat_info(&cg_group->wlr_group->keyboard, wlr_keyboard->repeat_info.rate, -- wlr_keyboard->repeat_info.delay); -+ wlr_keyboard_set_repeat_info(&cg_group->wlr_group->keyboard, keyboard->repeat_info.rate, -+ keyboard->repeat_info.delay); - - wlr_log(WLR_DEBUG, "Created keyboard group"); - -- wlr_keyboard_group_add_keyboard(cg_group->wlr_group, wlr_keyboard); -+ wlr_keyboard_group_add_keyboard(cg_group->wlr_group, keyboard); - wl_list_insert(&seat->keyboard_groups, &cg_group->link); - - wl_signal_add(&cg_group->wlr_group->keyboard.events.key, &cg_group->key); -@@ -347,36 +380,45 @@ cleanup: - } - - static void --handle_new_keyboard(struct cg_seat *seat, struct wlr_input_device *device) -+handle_new_keyboard(struct cg_seat *seat, struct wlr_keyboard *keyboard, bool virtual) - { - struct xkb_context *context = xkb_context_new(XKB_CONTEXT_NO_FLAGS); - if (!context) { -- wlr_log(WLR_ERROR, "Unable to create XBK context"); -+ wlr_log(WLR_ERROR, "Unable to create XKB context"); - return; - } - -- struct xkb_rule_names rules = {0}; -- rules.rules = getenv("XKB_DEFAULT_RULES"); -- rules.model = getenv("XKB_DEFAULT_MODEL"); -- rules.layout = getenv("XKB_DEFAULT_LAYOUT"); -- rules.variant = getenv("XKB_DEFAULT_VARIANT"); -- rules.options = getenv("XKB_DEFAULT_OPTIONS"); -- struct xkb_keymap *keymap = xkb_map_new_from_names(context, &rules, XKB_KEYMAP_COMPILE_NO_FLAGS); -+ struct xkb_keymap *keymap = xkb_keymap_new_from_names(context, NULL, XKB_KEYMAP_COMPILE_NO_FLAGS); - if (!keymap) { - wlr_log(WLR_ERROR, "Unable to configure keyboard: keymap does not exist"); - xkb_context_unref(context); - return; - } - -- wlr_keyboard_set_keymap(device->keyboard, keymap); -+ wlr_keyboard_set_keymap(keyboard, keymap); - - xkb_keymap_unref(keymap); - xkb_context_unref(context); -- wlr_keyboard_set_repeat_info(device->keyboard, 25, 600); -+ wlr_keyboard_set_repeat_info(keyboard, 25, 600); -+ -+ cg_keyboard_group_add(keyboard, seat, virtual); -+ -+ wlr_seat_set_keyboard(seat->seat, keyboard); -+} - -- cg_keyboard_group_add(device, seat); -+static void -+handle_virtual_keyboard(struct wl_listener *listener, void *data) -+{ -+ struct cg_server *server = wl_container_of(listener, server, new_virtual_keyboard); -+ struct cg_seat *seat = server->seat; -+ struct wlr_virtual_keyboard_v1 *keyboard = data; -+ struct wlr_keyboard *wlr_keyboard = &keyboard->keyboard; -+ -+ /* TODO: If multiple seats are supported, check keyboard->seat -+ * to select the appropriate one */ - -- wlr_seat_set_keyboard(seat->seat, device); -+ handle_new_keyboard(seat, wlr_keyboard, true); -+ update_capabilities(seat); - } - - static void -@@ -387,13 +429,13 @@ handle_new_input(struct wl_listener *listener, void *data) - - switch (device->type) { - case WLR_INPUT_DEVICE_KEYBOARD: -- handle_new_keyboard(seat, device); -+ handle_new_keyboard(seat, wlr_keyboard_from_input_device(device), false); - break; - case WLR_INPUT_DEVICE_POINTER: -- handle_new_pointer(seat, device); -+ handle_new_pointer(seat, wlr_pointer_from_input_device(device)); - break; - case WLR_INPUT_DEVICE_TOUCH: -- handle_new_touch(seat, device); -+ handle_new_touch(seat, wlr_touch_from_input_device(device)); - break; - case WLR_INPUT_DEVICE_SWITCH: - wlr_log(WLR_DEBUG, "Switch input is not implemented"); -@@ -448,10 +490,10 @@ static void - handle_touch_down(struct wl_listener *listener, void *data) - { - struct cg_seat *seat = wl_container_of(listener, seat, touch_down); -- struct wlr_event_touch_down *event = data; -+ struct wlr_touch_down_event *event = data; - - double lx, ly; -- wlr_cursor_absolute_to_layout_coords(seat->cursor, event->device, event->x, event->y, &lx, &ly); -+ wlr_cursor_absolute_to_layout_coords(seat->cursor, &event->touch->base, event->x, event->y, &lx, &ly); - - double sx, sy; - struct wlr_surface *surface; -@@ -466,7 +508,7 @@ handle_touch_down(struct wl_listener *listener, void *data) - seat->touch_id = event->touch_id; - seat->touch_lx = lx; - seat->touch_ly = ly; -- press_cursor_button(seat, event->device, event->time_msec, BTN_LEFT, WLR_BUTTON_PRESSED, lx, ly); -+ press_cursor_button(seat, &event->touch->base, event->time_msec, BTN_LEFT, WLR_BUTTON_PRESSED, lx, ly); - } - - wlr_idle_notify_activity(seat->server->idle, seat->seat); -@@ -476,14 +518,14 @@ static void - handle_touch_up(struct wl_listener *listener, void *data) - { - struct cg_seat *seat = wl_container_of(listener, seat, touch_up); -- struct wlr_event_touch_up *event = data; -+ struct wlr_touch_up_event *event = data; - - if (!wlr_seat_touch_get_point(seat->seat, event->touch_id)) { - return; - } - - if (wlr_seat_touch_num_points(seat->seat) == 1) { -- press_cursor_button(seat, event->device, event->time_msec, BTN_LEFT, WLR_BUTTON_RELEASED, -+ press_cursor_button(seat, &event->touch->base, event->time_msec, BTN_LEFT, WLR_BUTTON_RELEASED, - seat->touch_lx, seat->touch_ly); - } - -@@ -495,14 +537,14 @@ static void - handle_touch_motion(struct wl_listener *listener, void *data) - { - struct cg_seat *seat = wl_container_of(listener, seat, touch_motion); -- struct wlr_event_touch_motion *event = data; -+ struct wlr_touch_motion_event *event = data; - - if (!wlr_seat_touch_get_point(seat->seat, event->touch_id)) { - return; - } - - double lx, ly; -- wlr_cursor_absolute_to_layout_coords(seat->cursor, event->device, event->x, event->y, &lx, &ly); -+ wlr_cursor_absolute_to_layout_coords(seat->cursor, &event->touch->base, event->x, event->y, &lx, &ly); - - double sx, sy; - struct wlr_surface *surface; -@@ -536,7 +578,7 @@ static void - handle_cursor_axis(struct wl_listener *listener, void *data) - { - struct cg_seat *seat = wl_container_of(listener, seat, cursor_axis); -- struct wlr_event_pointer_axis *event = data; -+ struct wlr_pointer_axis_event *event = data; - - wlr_seat_pointer_notify_axis(seat->seat, event->time_msec, event->orientation, event->delta, - event->delta_discrete, event->source); -@@ -547,10 +589,10 @@ static void - handle_cursor_button(struct wl_listener *listener, void *data) - { - struct cg_seat *seat = wl_container_of(listener, seat, cursor_button); -- struct wlr_event_pointer_button *event = data; -+ struct wlr_pointer_button_event *event = data; - - wlr_seat_pointer_notify_button(seat->seat, event->time_msec, event->button, event->state); -- press_cursor_button(seat, event->device, event->time_msec, event->button, event->state, seat->cursor->x, -+ press_cursor_button(seat, &event->pointer->base, event->time_msec, event->button, event->state, seat->cursor->x, - seat->cursor->y); - wlr_idle_notify_activity(seat->server->idle, seat->seat); - } -@@ -569,10 +611,7 @@ process_cursor_motion(struct cg_seat *seat, uint32_t time) - } else { - wlr_seat_pointer_notify_enter(wlr_seat, surface, sx, sy); - -- bool focus_changed = wlr_seat->pointer_state.focused_surface != surface; -- if (!focus_changed && time > 0) { -- wlr_seat_pointer_notify_motion(wlr_seat, time, sx, sy); -- } -+ wlr_seat_pointer_notify_motion(wlr_seat, time, sx, sy); - } - - struct cg_drag_icon *drag_icon; -@@ -587,9 +626,9 @@ static void - handle_cursor_motion_absolute(struct wl_listener *listener, void *data) - { - struct cg_seat *seat = wl_container_of(listener, seat, cursor_motion_absolute); -- struct wlr_event_pointer_motion_absolute *event = data; -+ struct wlr_pointer_motion_absolute_event *event = data; - -- wlr_cursor_warp_absolute(seat->cursor, event->device, event->x, event->y); -+ wlr_cursor_warp_absolute(seat->cursor, &event->pointer->base, event->x, event->y); - process_cursor_motion(seat, event->time_msec); - wlr_idle_notify_activity(seat->server->idle, seat->seat); - } -@@ -598,22 +637,13 @@ static void - handle_cursor_motion(struct wl_listener *listener, void *data) - { - struct cg_seat *seat = wl_container_of(listener, seat, cursor_motion); -- struct wlr_event_pointer_motion *event = data; -+ struct wlr_pointer_motion_event *event = data; - -- wlr_cursor_move(seat->cursor, event->device, event->delta_x, event->delta_y); -+ wlr_cursor_move(seat->cursor, &event->pointer->base, event->delta_x, event->delta_y); - process_cursor_motion(seat, event->time_msec); - wlr_idle_notify_activity(seat->server->idle, seat->seat); - } - --static void --drag_icon_damage(struct cg_drag_icon *drag_icon) --{ -- struct cg_output *output; -- wl_list_for_each (output, &drag_icon->seat->server->outputs, link) { -- output_damage_surface(output, drag_icon->wlr_drag_icon->surface, drag_icon->lx, drag_icon->ly, true); -- } --} -- - static void - drag_icon_update_position(struct cg_drag_icon *drag_icon) - { -@@ -621,8 +651,6 @@ drag_icon_update_position(struct cg_drag_icon *drag_icon) - struct cg_seat *seat = drag_icon->seat; - struct wlr_touch_point *point; - -- drag_icon_damage(drag_icon); -- - switch (wlr_icon->drag->grab_type) { - case WLR_DRAG_GRAB_KEYBOARD: - return; -@@ -640,7 +668,7 @@ drag_icon_update_position(struct cg_drag_icon *drag_icon) - break; - } - -- drag_icon_damage(drag_icon); -+ wlr_scene_node_set_position(&drag_icon->scene_tree->node, drag_icon->lx, drag_icon->ly); - } - - static void -@@ -650,6 +678,7 @@ handle_drag_icon_destroy(struct wl_listener *listener, void *data) - - wl_list_remove(&drag_icon->link); - wl_list_remove(&drag_icon->destroy.link); -+ wlr_scene_node_destroy(&drag_icon->scene_tree->node); - free(drag_icon); - } - -@@ -692,6 +721,11 @@ handle_start_drag(struct wl_listener *listener, void *data) - } - drag_icon->seat = seat; - drag_icon->wlr_drag_icon = wlr_drag_icon; -+ drag_icon->scene_tree = wlr_scene_subsurface_tree_create(&seat->server->scene->tree, wlr_drag_icon->surface); -+ if (!drag_icon->scene_tree) { -+ free(drag_icon); -+ return; -+ } - - drag_icon->destroy.notify = handle_drag_icon_destroy; - wl_signal_add(&wlr_drag_icon->events.destroy, &drag_icon->destroy); -@@ -812,6 +846,9 @@ seat_create(struct cg_server *server, struct wlr_backend *backend) - seat->new_input.notify = handle_new_input; - wl_signal_add(&backend->events.new_input, &seat->new_input); - -+ server->new_virtual_keyboard.notify = handle_virtual_keyboard; -+ server->new_virtual_pointer.notify = handle_virtual_pointer; -+ - wl_list_init(&seat->drag_icons); - seat->request_start_drag.notify = handle_request_start_drag; - wl_signal_add(&seat->seat->events.request_start_drag, &seat->request_start_drag); -@@ -840,7 +877,10 @@ struct cg_view * - seat_get_focus(struct cg_seat *seat) - { - struct wlr_surface *prev_surface = seat->seat->keyboard_state.focused_surface; -- return view_from_wlr_surface(seat->server, prev_surface); -+ if (!prev_surface) { -+ return NULL; -+ } -+ return view_from_wlr_surface(prev_surface); - } - - void -diff --git a/seat.h b/seat.h -index 188543d..52cbee4 100644 ---- a/seat.h -+++ b/seat.h -@@ -55,12 +55,13 @@ struct cg_keyboard_group { - struct wl_listener key; - struct wl_listener modifiers; - struct wl_list link; // cg_seat::keyboard_groups -+ bool is_virtual; - }; - - struct cg_pointer { - struct wl_list link; // seat::pointers - struct cg_seat *seat; -- struct wlr_input_device *device; -+ struct wlr_pointer *pointer; - - struct wl_listener destroy; - }; -@@ -68,7 +69,7 @@ struct cg_pointer { - struct cg_touch { - struct wl_list link; // seat::touch - struct cg_seat *seat; -- struct wlr_input_device *device; -+ struct wlr_touch *touch; - - struct wl_listener destroy; - }; -@@ -77,6 +78,7 @@ struct cg_drag_icon { - struct wl_list link; // seat::drag_icons - struct cg_seat *seat; - struct wlr_drag_icon *wlr_drag_icon; -+ struct wlr_scene_tree *scene_tree; - - /* The drag icon has a position in layout coordinates. */ - double lx, ly; -diff --git a/server.h b/server.h -index 817637b..082a435 100644 ---- a/server.h -+++ b/server.h -@@ -12,10 +12,6 @@ - #include - #endif - --#include "output.h" --#include "seat.h" --#include "view.h" -- - enum cg_multi_output_mode { - CAGE_MULTI_OUTPUT_MODE_EXTEND, - CAGE_MULTI_OUTPUT_MODE_LAST, -@@ -25,6 +21,8 @@ struct cg_server { - struct wl_display *wl_display; - struct wl_list views; - struct wlr_backend *backend; -+ struct wlr_renderer *renderer; -+ struct wlr_allocator *allocator; - - struct cg_seat *seat; - struct wlr_idle *idle; -@@ -34,6 +32,7 @@ struct cg_server { - - enum cg_multi_output_mode output_mode; - struct wlr_output_layout *output_layout; -+ struct wlr_scene *scene; - /* Includes disabled outputs; depending on the output_mode - * some outputs may be disabled. */ - struct wl_list outputs; // cg_output::link -@@ -41,6 +40,9 @@ struct cg_server { - - struct wl_listener xdg_toplevel_decoration; - struct wl_listener new_xdg_shell_surface; -+ -+ struct wl_listener new_virtual_keyboard; -+ struct wl_listener new_virtual_pointer; - #if CAGE_HAS_XWAYLAND - struct wl_listener new_xwayland_surface; - #endif -@@ -48,9 +50,6 @@ struct cg_server { - bool xdg_decoration; - bool allow_vt_switch; - enum wl_output_transform output_transform; --#ifdef DEBUG -- bool debug_damage_tracking; --#endif - }; - - #endif -diff --git a/util.c b/util.c -deleted file mode 100644 -index 95de499..0000000 ---- a/util.c -+++ /dev/null -@@ -1,36 +0,0 @@ --/* -- * Cage: A Wayland kiosk. -- * -- * Copyright (C) 2019 The Sway authors -- * -- * See the LICENSE file accompanying this file. -- */ -- --#include -- --#include "util.h" -- --int --scale_length(int length, int offset, float scale) --{ -- /** -- * One does not simply multiply the width by the scale. We allow fractional -- * scaling, which means the resulting scaled width might be a decimal. -- * So we round it. -- * -- * But even this can produce undesirable results depending on the X or Y -- * offset of the box. For example, with a scale of 1.5, a box with -- * width=1 should not scale to 2px if its X coordinate is 1, because the -- * X coordinate would have scaled to 2px. -- */ -- return round((offset + length) * scale) - round(offset * scale); --} -- --void --scale_box(struct wlr_box *box, float scale) --{ -- box->width = scale_length(box->width, box->x, scale); -- box->height = scale_length(box->height, box->y, scale); -- box->x = round(box->x * scale); -- box->y = round(box->y * scale); --} -diff --git a/util.h b/util.h -deleted file mode 100644 -index db6bc7d..0000000 ---- a/util.h -+++ /dev/null -@@ -1,11 +0,0 @@ --#ifndef CG_UTIL_H --#define CG_UTIL_H -- --#include -- --/** Apply scale to a width or height. */ --int scale_length(int length, int offset, float scale); -- --void scale_box(struct wlr_box *box, float scale); -- --#endif -diff --git a/view.c b/view.c -index 3f3b0ed..b4a3eca 100644 ---- a/view.c -+++ b/view.c -@@ -1,20 +1,20 @@ - /* - * Cage: A Wayland kiosk. - * -- * Copyright (C) 2018-2020 Jente Hidskes -+ * Copyright (C) 2018-2021 Jente Hidskes - * - * See the LICENSE file accompanying this file. - */ - - #define _POSIX_C_SOURCE 200809L - -+#include - #include - #include - #include - #include --#include - #include --#include -+#include - - #include "output.h" - #include "seat.h" -@@ -24,96 +24,6 @@ - #include "xwayland.h" - #endif - --static void --view_child_handle_commit(struct wl_listener *listener, void *data) --{ -- struct cg_view_child *child = wl_container_of(listener, child, commit); -- view_damage_part(child->view); --} -- --static void subsurface_create(struct cg_view *view, struct wlr_subsurface *wlr_subsurface); -- --static void --view_child_handle_new_subsurface(struct wl_listener *listener, void *data) --{ -- struct cg_view_child *child = wl_container_of(listener, child, new_subsurface); -- struct wlr_subsurface *wlr_subsurface = data; -- subsurface_create(child->view, wlr_subsurface); --} -- --void --view_child_finish(struct cg_view_child *child) --{ -- if (!child) { -- return; -- } -- -- view_damage_whole(child->view); -- -- wl_list_remove(&child->link); -- wl_list_remove(&child->commit.link); -- wl_list_remove(&child->new_subsurface.link); --} -- --void --view_child_init(struct cg_view_child *child, struct cg_view *view, struct wlr_surface *wlr_surface) --{ -- child->view = view; -- child->wlr_surface = wlr_surface; -- -- child->commit.notify = view_child_handle_commit; -- wl_signal_add(&wlr_surface->events.commit, &child->commit); -- child->new_subsurface.notify = view_child_handle_new_subsurface; -- wl_signal_add(&wlr_surface->events.new_subsurface, &child->new_subsurface); -- -- wl_list_insert(&view->children, &child->link); --} -- --static void --subsurface_destroy(struct cg_view_child *child) --{ -- if (!child) { -- return; -- } -- -- struct cg_subsurface *subsurface = (struct cg_subsurface *) child; -- wl_list_remove(&subsurface->destroy.link); -- view_child_finish(&subsurface->view_child); -- free(subsurface); --} -- --static void --subsurface_handle_destroy(struct wl_listener *listener, void *data) --{ -- struct cg_subsurface *subsurface = wl_container_of(listener, subsurface, destroy); -- struct cg_view_child *view_child = (struct cg_view_child *) subsurface; -- subsurface_destroy(view_child); --} -- --static void --subsurface_create(struct cg_view *view, struct wlr_subsurface *wlr_subsurface) --{ -- struct cg_subsurface *subsurface = calloc(1, sizeof(struct cg_subsurface)); -- if (!subsurface) { -- return; -- } -- -- view_child_init(&subsurface->view_child, view, wlr_subsurface->surface); -- subsurface->view_child.destroy = subsurface_destroy; -- subsurface->wlr_subsurface = wlr_subsurface; -- -- subsurface->destroy.notify = subsurface_handle_destroy; -- wl_signal_add(&wlr_subsurface->events.destroy, &subsurface->destroy); --} -- --static void --handle_new_subsurface(struct wl_listener *listener, void *data) --{ -- struct cg_view *view = wl_container_of(listener, view, new_subsurface); -- struct wlr_subsurface *wlr_subsurface = data; -- subsurface_create(view, wlr_subsurface); --} -- - char * - view_get_title(struct cg_view *view) - { -@@ -136,24 +46,6 @@ view_is_transient_for(struct cg_view *child, struct cg_view *parent) - return child->impl->is_transient_for(child, parent); - } - --void --view_damage_part(struct cg_view *view) --{ -- struct cg_output *output; -- wl_list_for_each (output, &view->server->outputs, link) { -- output_damage_surface(output, view->wlr_surface, view->lx, view->ly, false); -- } --} -- --void --view_damage_whole(struct cg_view *view) --{ -- struct cg_output *output; -- wl_list_for_each (output, &view->server->outputs, link) { -- output_damage_surface(output, view->wlr_surface, view->lx, view->ly, true); -- } --} -- - void - view_activate(struct cg_view *view, bool activate) - { -@@ -174,6 +66,9 @@ view_maximize(struct cg_view *view, struct wlr_box *layout_box) - { - view->lx = layout_box->x; - view->ly = layout_box->y; -+ -+ wlr_scene_node_set_position(&view->scene_tree->node, view->lx, view->ly); -+ - view->impl->maximize(view, layout_box->width, layout_box->height); - } - -@@ -185,33 +80,21 @@ view_center(struct cg_view *view, struct wlr_box *layout_box) - - view->lx = (layout_box->width - width) / 2; - view->ly = (layout_box->height - height) / 2; -+ -+ wlr_scene_node_set_position(&view->scene_tree->node, view->lx, view->ly); - } - - void - view_position(struct cg_view *view) - { -- struct wlr_box *layout_box = wlr_output_layout_get_box(view->server->output_layout, NULL); -+ struct wlr_box layout_box; -+ wlr_output_layout_get_box(view->server->output_layout, NULL, &layout_box); - -- if (view_is_primary(view) || view_extends_output_layout(view, layout_box)) { -- view_maximize(view, layout_box); -+ if (view_is_primary(view) || view_extends_output_layout(view, &layout_box)) { -+ view_maximize(view, &layout_box); - } else { -- view_center(view, layout_box); -- } --} -- --void --view_for_each_surface(struct cg_view *view, wlr_surface_iterator_func_t iterator, void *data) --{ -- view->impl->for_each_surface(view, iterator, data); --} -- --void --view_for_each_popup_surface(struct cg_view *view, wlr_surface_iterator_func_t iterator, void *data) --{ -- if (!view->impl->for_each_popup_surface) { -- return; -+ view_center(view, &layout_box); - } -- view->impl->for_each_popup_surface(view, iterator, data); - } - - void -@@ -219,31 +102,24 @@ view_unmap(struct cg_view *view) - { - wl_list_remove(&view->link); - -- wl_list_remove(&view->new_subsurface.link); -- -- struct cg_view_child *child, *tmp; -- wl_list_for_each_safe (child, tmp, &view->children, link) { -- child->destroy(child); -- } -+ wlr_scene_node_destroy(&view->scene_tree->node); - -+ view->wlr_surface->data = NULL; - view->wlr_surface = NULL; - } - - void - view_map(struct cg_view *view, struct wlr_surface *surface) - { -- view->wlr_surface = surface; -- -- struct wlr_subsurface *subsurface; -- wl_list_for_each (subsurface, &view->wlr_surface->subsurfaces_below, parent_link) { -- subsurface_create(view, subsurface); -- } -- wl_list_for_each (subsurface, &view->wlr_surface->subsurfaces_above, parent_link) { -- subsurface_create(view, subsurface); -+ view->scene_tree = wlr_scene_subsurface_tree_create(&view->server->scene->tree, surface); -+ if (!view->scene_tree) { -+ wl_resource_post_no_memory(surface->resource); -+ return; - } -+ view->scene_tree->node.data = view; - -- view->new_subsurface.notify = handle_new_subsurface; -- wl_signal_add(&view->wlr_surface->events.new_subsurface, &view->new_subsurface); -+ view->wlr_surface = surface; -+ surface->data = view; - - #if CAGE_HAS_XWAYLAND - /* We shouldn't position override-redirect windows. They set -@@ -283,24 +159,11 @@ view_init(struct cg_view *view, struct cg_server *server, enum cg_view_type type - view->server = server; - view->type = type; - view->impl = impl; -- -- wl_list_init(&view->children); - } - - struct cg_view * --view_from_wlr_surface(struct cg_server *server, struct wlr_surface *surface) --{ -- struct cg_view *view; -- wl_list_for_each (view, &server->views, link) { -- if (view->wlr_surface == surface) { -- return view; -- } -- } -- return NULL; --} -- --struct wlr_surface * --view_wlr_surface_at(struct cg_view *view, double sx, double sy, double *sub_x, double *sub_y) -+view_from_wlr_surface(struct wlr_surface *surface) - { -- return view->impl->wlr_surface_at(view, sx, sy, sub_x, sub_y); -+ assert(surface); -+ return surface->data; - } -diff --git a/view.h b/view.h -index cd16e42..5ae13dd 100644 ---- a/view.h -+++ b/view.h -@@ -5,9 +5,9 @@ - - #include - #include --#include --#include -+#include - #include -+#include - #if CAGE_HAS_XWAYLAND - #include - #endif -@@ -24,16 +24,14 @@ enum cg_view_type { - struct cg_view { - struct cg_server *server; - struct wl_list link; // server::views -- struct wl_list children; // cg_view_child::link - struct wlr_surface *wlr_surface; -+ struct wlr_scene_tree *scene_tree; - - /* The view has a position in layout coordinates. */ - int lx, ly; - - enum cg_view_type type; - const struct cg_view_impl *impl; -- -- struct wl_listener new_subsurface; - }; - - struct cg_view_impl { -@@ -44,47 +42,18 @@ struct cg_view_impl { - void (*activate)(struct cg_view *view, bool activate); - void (*maximize)(struct cg_view *view, int output_width, int output_height); - void (*destroy)(struct cg_view *view); -- void (*for_each_surface)(struct cg_view *view, wlr_surface_iterator_func_t iterator, void *data); -- void (*for_each_popup_surface)(struct cg_view *view, wlr_surface_iterator_func_t iterator, void *data); -- struct wlr_surface *(*wlr_surface_at)(struct cg_view *view, double sx, double sy, double *sub_x, double *sub_y); --}; -- --struct cg_view_child { -- struct cg_view *view; -- struct wlr_surface *wlr_surface; -- struct wl_list link; -- -- struct wl_listener commit; -- struct wl_listener new_subsurface; -- -- void (*destroy)(struct cg_view_child *child); --}; -- --struct cg_subsurface { -- struct cg_view_child view_child; -- struct wlr_subsurface *wlr_subsurface; -- -- struct wl_listener destroy; - }; - - char *view_get_title(struct cg_view *view); - bool view_is_primary(struct cg_view *view); - bool view_is_transient_for(struct cg_view *child, struct cg_view *parent); --void view_damage_part(struct cg_view *view); --void view_damage_whole(struct cg_view *view); - void view_activate(struct cg_view *view, bool activate); - void view_position(struct cg_view *view); --void view_for_each_surface(struct cg_view *view, wlr_surface_iterator_func_t iterator, void *data); --void view_for_each_popup_surface(struct cg_view *view, wlr_surface_iterator_func_t iterator, void *data); - void view_unmap(struct cg_view *view); - void view_map(struct cg_view *view, struct wlr_surface *surface); - void view_destroy(struct cg_view *view); - void view_init(struct cg_view *view, struct cg_server *server, enum cg_view_type type, const struct cg_view_impl *impl); - --struct cg_view *view_from_wlr_surface(struct cg_server *server, struct wlr_surface *surface); --struct wlr_surface *view_wlr_surface_at(struct cg_view *view, double sx, double sy, double *sub_x, double *sub_y); -- --void view_child_finish(struct cg_view_child *child); --void view_child_init(struct cg_view_child *child, struct cg_view *view, struct wlr_surface *wlr_surface); -+struct cg_view *view_from_wlr_surface(struct wlr_surface *surface); - - #endif -diff --git a/xdg_shell.c b/xdg_shell.c -index 2e42347..c577dc5 100644 ---- a/xdg_shell.c -+++ b/xdg_shell.c -@@ -6,10 +6,11 @@ - * See the LICENSE file accompanying this file. - */ - -+#include - #include - #include - #include --#include -+#include - #include - #include - -@@ -41,105 +42,47 @@ xdg_decoration_handle_request_mode(struct wl_listener *listener, void *data) - wlr_xdg_toplevel_decoration_v1_set_mode(xdg_decoration->wlr_decoration, mode); - } - --static void --xdg_popup_destroy(struct cg_view_child *child) --{ -- if (!child) { -- return; -- } -- -- struct cg_xdg_popup *popup = (struct cg_xdg_popup *) child; -- wl_list_remove(&popup->destroy.link); -- wl_list_remove(&popup->map.link); -- wl_list_remove(&popup->unmap.link); -- wl_list_remove(&popup->new_popup.link); -- view_child_finish(&popup->view_child); -- free(popup); --} -- --static void --handle_xdg_popup_map(struct wl_listener *listener, void *data) --{ -- struct cg_xdg_popup *popup = wl_container_of(listener, popup, map); -- view_damage_whole(popup->view_child.view); --} -- --static void --handle_xdg_popup_unmap(struct wl_listener *listener, void *data) -+static struct cg_view * -+popup_get_view(struct wlr_xdg_popup *popup) - { -- struct cg_xdg_popup *popup = wl_container_of(listener, popup, unmap); -- view_damage_whole(popup->view_child.view); --} -- --static void --handle_xdg_popup_destroy(struct wl_listener *listener, void *data) --{ -- struct cg_xdg_popup *popup = wl_container_of(listener, popup, destroy); -- struct cg_view_child *view_child = (struct cg_view_child *) popup; -- xdg_popup_destroy(view_child); --} -- --static void xdg_popup_create(struct cg_view *view, struct wlr_xdg_popup *wlr_popup); -+ while (true) { -+ if (popup->parent == NULL || !wlr_surface_is_xdg_surface(popup->parent)) { -+ return NULL; -+ } - --static void --popup_handle_new_xdg_popup(struct wl_listener *listener, void *data) --{ -- struct cg_xdg_popup *popup = wl_container_of(listener, popup, new_popup); -- struct wlr_xdg_popup *wlr_popup = data; -- xdg_popup_create(popup->view_child.view, wlr_popup); -+ struct wlr_xdg_surface *xdg_surface = wlr_xdg_surface_from_wlr_surface(popup->parent); -+ switch (xdg_surface->role) { -+ case WLR_XDG_SURFACE_ROLE_TOPLEVEL: -+ return xdg_surface->data; -+ case WLR_XDG_SURFACE_ROLE_POPUP: -+ popup = xdg_surface->popup; -+ break; -+ case WLR_XDG_SURFACE_ROLE_NONE: -+ return NULL; -+ } -+ } - } - - static void --popup_unconstrain(struct cg_xdg_popup *popup) -+popup_unconstrain(struct cg_view *view, struct wlr_xdg_popup *popup) - { -- struct cg_view *view = popup->view_child.view; - struct cg_server *server = view->server; -- struct wlr_box *popup_box = &popup->wlr_popup->geometry; -+ struct wlr_box *popup_box = &popup->current.geometry; - - struct wlr_output_layout *output_layout = server->output_layout; - struct wlr_output *wlr_output = - wlr_output_layout_output_at(output_layout, view->lx + popup_box->x, view->ly + popup_box->y); -- struct wlr_box *output_box = wlr_output_layout_get_box(output_layout, wlr_output); -+ struct wlr_box output_box; -+ wlr_output_layout_get_box(output_layout, wlr_output, &output_box); - - struct wlr_box output_toplevel_box = { -- .x = output_box->x - view->lx, -- .y = output_box->y - view->ly, -- .width = output_box->width, -- .height = output_box->height, -+ .x = output_box.x - view->lx, -+ .y = output_box.y - view->ly, -+ .width = output_box.width, -+ .height = output_box.height, - }; - -- wlr_xdg_popup_unconstrain_from_box(popup->wlr_popup, &output_toplevel_box); --} -- --static void --xdg_popup_create(struct cg_view *view, struct wlr_xdg_popup *wlr_popup) --{ -- struct cg_xdg_popup *popup = calloc(1, sizeof(struct cg_xdg_popup)); -- if (!popup) { -- return; -- } -- -- popup->wlr_popup = wlr_popup; -- view_child_init(&popup->view_child, view, wlr_popup->base->surface); -- popup->view_child.destroy = xdg_popup_destroy; -- popup->destroy.notify = handle_xdg_popup_destroy; -- wl_signal_add(&wlr_popup->base->events.destroy, &popup->destroy); -- popup->map.notify = handle_xdg_popup_map; -- wl_signal_add(&wlr_popup->base->events.map, &popup->map); -- popup->unmap.notify = handle_xdg_popup_unmap; -- wl_signal_add(&wlr_popup->base->events.unmap, &popup->unmap); -- popup->new_popup.notify = popup_handle_new_xdg_popup; -- wl_signal_add(&wlr_popup->base->events.new_popup, &popup->new_popup); -- -- popup_unconstrain(popup); --} -- --static void --handle_new_xdg_popup(struct wl_listener *listener, void *data) --{ -- struct cg_xdg_shell_view *xdg_shell_view = wl_container_of(listener, xdg_shell_view, new_popup); -- struct wlr_xdg_popup *wlr_popup = data; -- xdg_popup_create(&xdg_shell_view->view, wlr_popup); -+ wlr_xdg_popup_unconstrain_from_box(popup, &output_toplevel_box); - } - - static struct cg_xdg_shell_view * -@@ -152,7 +95,7 @@ static char * - get_title(struct cg_view *view) - { - struct cg_xdg_shell_view *xdg_shell_view = xdg_shell_view_from_view(view); -- return xdg_shell_view->xdg_surface->toplevel->title; -+ return xdg_shell_view->xdg_toplevel->title; - } - - static void -@@ -161,7 +104,7 @@ get_geometry(struct cg_view *view, int *width_out, int *height_out) - struct cg_xdg_shell_view *xdg_shell_view = xdg_shell_view_from_view(view); - struct wlr_box geom; - -- wlr_xdg_surface_get_geometry(xdg_shell_view->xdg_surface, &geom); -+ wlr_xdg_surface_get_geometry(xdg_shell_view->xdg_toplevel->base, &geom); - *width_out = geom.width; - *height_out = geom.height; - } -@@ -170,9 +113,9 @@ static bool - is_primary(struct cg_view *view) - { - struct cg_xdg_shell_view *xdg_shell_view = xdg_shell_view_from_view(view); -- struct wlr_xdg_surface *parent = xdg_shell_view->xdg_surface->toplevel->parent; -- /* FIXME: role is 0? */ -- return parent == NULL; /*&& role == WLR_XDG_SURFACE_ROLE_TOPLEVEL */ -+ struct wlr_xdg_toplevel *parent = xdg_shell_view->xdg_toplevel->parent; -+ -+ return parent == NULL; - } - - static bool -@@ -182,14 +125,13 @@ is_transient_for(struct cg_view *child, struct cg_view *parent) - return false; - } - struct cg_xdg_shell_view *_child = xdg_shell_view_from_view(child); -- struct wlr_xdg_surface *xdg_surface = _child->xdg_surface; -+ struct wlr_xdg_toplevel *xdg_toplevel = _child->xdg_toplevel; - struct cg_xdg_shell_view *_parent = xdg_shell_view_from_view(parent); -- struct wlr_xdg_surface *parent_xdg_surface = _parent->xdg_surface; -- while (xdg_surface) { -- if (xdg_surface->toplevel->parent == parent_xdg_surface) { -+ while (xdg_toplevel) { -+ if (xdg_toplevel->parent == _parent->xdg_toplevel) { - return true; - } -- xdg_surface = xdg_surface->toplevel->parent; -+ xdg_toplevel = xdg_toplevel->parent; - } - return false; - } -@@ -198,15 +140,15 @@ static void - activate(struct cg_view *view, bool activate) - { - struct cg_xdg_shell_view *xdg_shell_view = xdg_shell_view_from_view(view); -- wlr_xdg_toplevel_set_activated(xdg_shell_view->xdg_surface, activate); -+ wlr_xdg_toplevel_set_activated(xdg_shell_view->xdg_toplevel, activate); - } - - static void - maximize(struct cg_view *view, int output_width, int output_height) - { - struct cg_xdg_shell_view *xdg_shell_view = xdg_shell_view_from_view(view); -- wlr_xdg_toplevel_set_size(xdg_shell_view->xdg_surface, output_width, output_height); -- wlr_xdg_toplevel_set_maximized(xdg_shell_view->xdg_surface, true); -+ wlr_xdg_toplevel_set_size(xdg_shell_view->xdg_toplevel, output_width, output_height); -+ wlr_xdg_toplevel_set_maximized(xdg_shell_view->xdg_toplevel, true); - } - - static void -@@ -216,41 +158,21 @@ destroy(struct cg_view *view) - free(xdg_shell_view); - } - --static void --for_each_surface(struct cg_view *view, wlr_surface_iterator_func_t iterator, void *data) --{ -- struct cg_xdg_shell_view *xdg_shell_view = xdg_shell_view_from_view(view); -- wlr_xdg_surface_for_each_surface(xdg_shell_view->xdg_surface, iterator, data); --} -- --static void --for_each_popup_surface(struct cg_view *view, wlr_surface_iterator_func_t iterator, void *data) --{ -- struct cg_xdg_shell_view *xdg_shell_view = xdg_shell_view_from_view(view); -- wlr_xdg_surface_for_each_popup_surface(xdg_shell_view->xdg_surface, iterator, data); --} -- --static struct wlr_surface * --wlr_surface_at(struct cg_view *view, double sx, double sy, double *sub_x, double *sub_y) --{ -- struct cg_xdg_shell_view *xdg_shell_view = xdg_shell_view_from_view(view); -- return wlr_xdg_surface_surface_at(xdg_shell_view->xdg_surface, sx, sy, sub_x, sub_y); --} -- - static void - handle_xdg_shell_surface_request_fullscreen(struct wl_listener *listener, void *data) - { - struct cg_xdg_shell_view *xdg_shell_view = wl_container_of(listener, xdg_shell_view, request_fullscreen); -- struct wlr_xdg_toplevel_set_fullscreen_event *event = data; -- wlr_xdg_toplevel_set_fullscreen(xdg_shell_view->xdg_surface, event->fullscreen); --} - --static void --handle_xdg_shell_surface_commit(struct wl_listener *listener, void *data) --{ -- struct cg_xdg_shell_view *xdg_shell_view = wl_container_of(listener, xdg_shell_view, commit); -- struct cg_view *view = &xdg_shell_view->view; -- view_damage_part(view); -+ /** -+ * Certain clients do not like figuring out their own window geometry if they -+ * display in fullscreen mode, so we set it here. -+ */ -+ struct wlr_box layout_box; -+ wlr_output_layout_get_box(xdg_shell_view->view.server->output_layout, NULL, &layout_box); -+ wlr_xdg_toplevel_set_size(xdg_shell_view->xdg_toplevel, layout_box.width, layout_box.height); -+ -+ wlr_xdg_toplevel_set_fullscreen(xdg_shell_view->xdg_toplevel, -+ xdg_shell_view->xdg_toplevel->requested.fullscreen); - } - - static void -@@ -259,10 +181,6 @@ handle_xdg_shell_surface_unmap(struct wl_listener *listener, void *data) - struct cg_xdg_shell_view *xdg_shell_view = wl_container_of(listener, xdg_shell_view, unmap); - struct cg_view *view = &xdg_shell_view->view; - -- view_damage_whole(view); -- -- wl_list_remove(&xdg_shell_view->commit.link); -- - view_unmap(view); - } - -@@ -272,12 +190,7 @@ handle_xdg_shell_surface_map(struct wl_listener *listener, void *data) - struct cg_xdg_shell_view *xdg_shell_view = wl_container_of(listener, xdg_shell_view, map); - struct cg_view *view = &xdg_shell_view->view; - -- xdg_shell_view->commit.notify = handle_xdg_shell_surface_commit; -- wl_signal_add(&xdg_shell_view->xdg_surface->surface->events.commit, &xdg_shell_view->commit); -- -- view_map(view, xdg_shell_view->xdg_surface->surface); -- -- view_damage_whole(view); -+ view_map(view, xdg_shell_view->xdg_toplevel->base->surface); - } - - static void -@@ -290,8 +203,7 @@ handle_xdg_shell_surface_destroy(struct wl_listener *listener, void *data) - wl_list_remove(&xdg_shell_view->unmap.link); - wl_list_remove(&xdg_shell_view->destroy.link); - wl_list_remove(&xdg_shell_view->request_fullscreen.link); -- wl_list_remove(&xdg_shell_view->new_popup.link); -- xdg_shell_view->xdg_surface = NULL; -+ xdg_shell_view->xdg_toplevel = NULL; - - view_destroy(view); - } -@@ -304,9 +216,6 @@ static const struct cg_view_impl xdg_shell_view_impl = { - .activate = activate, - .maximize = maximize, - .destroy = destroy, -- .for_each_surface = for_each_surface, -- .for_each_popup_surface = for_each_popup_surface, -- .wlr_surface_at = wlr_surface_at, - }; - - void -@@ -315,29 +224,64 @@ handle_xdg_shell_surface_new(struct wl_listener *listener, void *data) - struct cg_server *server = wl_container_of(listener, server, new_xdg_shell_surface); - struct wlr_xdg_surface *xdg_surface = data; - -- if (xdg_surface->role != WLR_XDG_SURFACE_ROLE_TOPLEVEL) { -- return; -- } -+ switch (xdg_surface->role) { -+ case WLR_XDG_SURFACE_ROLE_TOPLEVEL:; -+ struct cg_xdg_shell_view *xdg_shell_view = calloc(1, sizeof(struct cg_xdg_shell_view)); -+ if (!xdg_shell_view) { -+ wlr_log(WLR_ERROR, "Failed to allocate XDG Shell view"); -+ return; -+ } - -- struct cg_xdg_shell_view *xdg_shell_view = calloc(1, sizeof(struct cg_xdg_shell_view)); -- if (!xdg_shell_view) { -- wlr_log(WLR_ERROR, "Failed to allocate XDG Shell view"); -- return; -- } -+ view_init(&xdg_shell_view->view, server, CAGE_XDG_SHELL_VIEW, &xdg_shell_view_impl); -+ xdg_shell_view->xdg_toplevel = xdg_surface->toplevel; -+ -+ xdg_shell_view->map.notify = handle_xdg_shell_surface_map; -+ wl_signal_add(&xdg_surface->events.map, &xdg_shell_view->map); -+ xdg_shell_view->unmap.notify = handle_xdg_shell_surface_unmap; -+ wl_signal_add(&xdg_surface->events.unmap, &xdg_shell_view->unmap); -+ xdg_shell_view->destroy.notify = handle_xdg_shell_surface_destroy; -+ wl_signal_add(&xdg_surface->events.destroy, &xdg_shell_view->destroy); -+ xdg_shell_view->request_fullscreen.notify = handle_xdg_shell_surface_request_fullscreen; -+ wl_signal_add(&xdg_surface->toplevel->events.request_fullscreen, &xdg_shell_view->request_fullscreen); -+ -+ xdg_surface->data = xdg_shell_view; -+ break; -+ case WLR_XDG_SURFACE_ROLE_POPUP:; -+ struct wlr_xdg_popup *popup = xdg_surface->popup; -+ struct cg_view *view = popup_get_view(popup); -+ if (view == NULL) { -+ return; -+ } -+ -+ struct wlr_scene_tree *parent_scene_tree = NULL; -+ struct wlr_xdg_surface *parent = wlr_xdg_surface_from_wlr_surface(popup->parent); -+ switch (parent->role) { -+ case WLR_XDG_SURFACE_ROLE_TOPLEVEL:; -+ parent_scene_tree = view->scene_tree; -+ break; -+ case WLR_XDG_SURFACE_ROLE_POPUP: -+ parent_scene_tree = parent->data; -+ break; -+ case WLR_XDG_SURFACE_ROLE_NONE: -+ break; -+ } -+ if (parent_scene_tree == NULL) { -+ return; -+ } - -- view_init(&xdg_shell_view->view, server, CAGE_XDG_SHELL_VIEW, &xdg_shell_view_impl); -- xdg_shell_view->xdg_surface = xdg_surface; -- -- xdg_shell_view->map.notify = handle_xdg_shell_surface_map; -- wl_signal_add(&xdg_surface->events.map, &xdg_shell_view->map); -- xdg_shell_view->unmap.notify = handle_xdg_shell_surface_unmap; -- wl_signal_add(&xdg_surface->events.unmap, &xdg_shell_view->unmap); -- xdg_shell_view->destroy.notify = handle_xdg_shell_surface_destroy; -- wl_signal_add(&xdg_surface->events.destroy, &xdg_shell_view->destroy); -- xdg_shell_view->request_fullscreen.notify = handle_xdg_shell_surface_request_fullscreen; -- wl_signal_add(&xdg_surface->toplevel->events.request_fullscreen, &xdg_shell_view->request_fullscreen); -- xdg_shell_view->new_popup.notify = handle_new_xdg_popup; -- wl_signal_add(&xdg_surface->events.new_popup, &xdg_shell_view->new_popup); -+ struct wlr_scene_tree *popup_scene_tree = wlr_scene_xdg_surface_create(parent_scene_tree, xdg_surface); -+ if (popup_scene_tree == NULL) { -+ wlr_log(WLR_ERROR, "Failed to allocate scene-graph node for XDG popup"); -+ return; -+ } -+ -+ popup_unconstrain(view, popup); -+ -+ xdg_surface->data = popup_scene_tree; -+ break; -+ case WLR_XDG_SURFACE_ROLE_NONE: -+ assert(false); // unreachable -+ } - } - - void -diff --git a/xdg_shell.h b/xdg_shell.h -index 45d87db..2fd506a 100644 ---- a/xdg_shell.h -+++ b/xdg_shell.h -@@ -9,24 +9,12 @@ - - struct cg_xdg_shell_view { - struct cg_view view; -- struct wlr_xdg_surface *xdg_surface; -+ struct wlr_xdg_toplevel *xdg_toplevel; - - struct wl_listener destroy; - struct wl_listener unmap; - struct wl_listener map; -- struct wl_listener commit; - struct wl_listener request_fullscreen; -- struct wl_listener new_popup; --}; -- --struct cg_xdg_popup { -- struct cg_view_child view_child; -- struct wlr_xdg_popup *wlr_popup; -- -- struct wl_listener destroy; -- struct wl_listener map; -- struct wl_listener unmap; -- struct wl_listener new_popup; - }; - - struct cg_xdg_decoration { -diff --git a/xwayland.c b/xwayland.c -index 2aae0f9..ef37a49 100644 ---- a/xwayland.c -+++ b/xwayland.c -@@ -9,7 +9,6 @@ - #include - #include - #include --#include - #include - #include - -@@ -96,18 +95,6 @@ destroy(struct cg_view *view) - free(xwayland_view); - } - --static void --for_each_surface(struct cg_view *view, wlr_surface_iterator_func_t iterator, void *data) --{ -- wlr_surface_for_each_surface(view->wlr_surface, iterator, data); --} -- --static struct wlr_surface * --wlr_surface_at(struct cg_view *view, double sx, double sy, double *sub_x, double *sub_y) --{ -- return wlr_surface_surface_at(view->wlr_surface, sx, sy, sub_x, sub_y); --} -- - static void - handle_xwayland_surface_request_fullscreen(struct wl_listener *listener, void *data) - { -@@ -116,24 +103,12 @@ handle_xwayland_surface_request_fullscreen(struct wl_listener *listener, void *d - wlr_xwayland_surface_set_fullscreen(xwayland_view->xwayland_surface, xwayland_surface->fullscreen); - } - --static void --handle_xwayland_surface_commit(struct wl_listener *listener, void *data) --{ -- struct cg_xwayland_view *xwayland_view = wl_container_of(listener, xwayland_view, commit); -- struct cg_view *view = &xwayland_view->view; -- view_damage_part(view); --} -- - static void - handle_xwayland_surface_unmap(struct wl_listener *listener, void *data) - { - struct cg_xwayland_view *xwayland_view = wl_container_of(listener, xwayland_view, unmap); - struct cg_view *view = &xwayland_view->view; - -- view_damage_whole(view); -- -- wl_list_remove(&xwayland_view->commit.link); -- - view_unmap(view); - } - -@@ -148,12 +123,7 @@ handle_xwayland_surface_map(struct wl_listener *listener, void *data) - view->ly = xwayland_view->xwayland_surface->y; - } - -- xwayland_view->commit.notify = handle_xwayland_surface_commit; -- wl_signal_add(&xwayland_view->xwayland_surface->surface->events.commit, &xwayland_view->commit); -- - view_map(view, xwayland_view->xwayland_surface->surface); -- -- view_damage_whole(view); - } - - static void -@@ -179,10 +149,6 @@ static const struct cg_view_impl xwayland_view_impl = { - .activate = activate, - .maximize = maximize, - .destroy = destroy, -- .for_each_surface = for_each_surface, -- /* XWayland doesn't have a separate popup iterator. */ -- .for_each_popup_surface = NULL, -- .wlr_surface_at = wlr_surface_at, - }; - - void -diff --git a/xwayland.h b/xwayland.h -index d257f57..31edb8f 100644 ---- a/xwayland.h -+++ b/xwayland.h -@@ -12,7 +12,6 @@ struct cg_xwayland_view { - struct wl_listener destroy; - struct wl_listener unmap; - struct wl_listener map; -- struct wl_listener commit; - struct wl_listener request_fullscreen; - }; - diff --git a/bino/.SRCINFO b/bino/.SRCINFO new file mode 100644 index 0000000..bdb70f2 --- /dev/null +++ b/bino/.SRCINFO @@ -0,0 +1,19 @@ +pkgbase = bino + pkgdesc = A video player with focus on 3D and Virtual Reality + pkgver = 2.5 + pkgrel = 1 + url = https://bino3d.org/ + arch = x86_64 + license = GPL-3.0-or-later + makedepends = cmake + makedepends = qt6-tools + depends = qt6-multimedia + depends = qt6-svg + depends = qvr + source = https://bino3d.org/releases/bino-2.5.tar.gz + source = https://bino3d.org/releases/bino-2.5.tar.gz.sig + validpgpkeys = 2F61B4828BBA779AECB3F32703A2A4AB1E32FD34 + sha512sums = 3e881b2299ac2922fbb915fcac74aea889e8118e3f1a7f2ffbfbf4ff70b038d0400fee734e6c55a37db416dce77df8b9fdde0d5ed154f7d39ff85a3c45f5aff7 + sha512sums = SKIP + +pkgname = bino diff --git a/bino/PKGBUILD b/bino/PKGBUILD new file mode 100644 index 0000000..6f97ba3 --- /dev/null +++ b/bino/PKGBUILD @@ -0,0 +1,31 @@ +# Maintainer: Manuel Hüsers +# Contributor: gruenfron +# Contributor: Jose Riha +# Contributor: archtux + +pkgname=bino +pkgver=2.5 +pkgrel=1 +pkgdesc='A video player with focus on 3D and Virtual Reality' +arch=('x86_64') +url='https://bino3d.org/' +license=('GPL-3.0-or-later') +depends=('qt6-multimedia' 'qt6-svg' 'qvr') +makedepends=('cmake' 'qt6-tools') +source=(https://bino3d.org/releases/$pkgname-$pkgver.tar.gz{,.sig}) +sha512sums=('3e881b2299ac2922fbb915fcac74aea889e8118e3f1a7f2ffbfbf4ff70b038d0400fee734e6c55a37db416dce77df8b9fdde0d5ed154f7d39ff85a3c45f5aff7' + 'SKIP') +validpgpkeys=('2F61B4828BBA779AECB3F32703A2A4AB1E32FD34') + +build() { + cmake -B build -S "$pkgname-$pkgver" \ + -DCMAKE_INSTALL_PREFIX=/usr \ + -DCMAKE_BUILD_TYPE=Release \ + -DBUILD_TESTING=OFF + + cmake --build build +} + +package() { + DESTDIR="$pkgdir" cmake --install build +} diff --git a/check-gvisor.sh b/check-gvisor.sh new file mode 100755 index 0000000..3459876 --- /dev/null +++ b/check-gvisor.sh @@ -0,0 +1,36 @@ +#!/bin/sh + +VERSION="$(echo $1 | jq -Rr @html)" +BINARY='runsc' +SHIM='containerd-shim-runsc-v1' +URL_BASE="https://storage.googleapis.com/gvisor/releases/release/" +URL="${URL_BASE}${VERSION}/$(uname -m)/" +URL_X64="${URL_BASE}${VERSION}/x86_64/" +URL_ARM="${URL_BASE}${VERSION}/aarch64/" + +STATUS=$(curl -s -o /dev/null -I -w "%{http_code}" "${URL}${BINARY}") +EXIT=0 + +case $STATUS in + 200) + echo "Release: ${VERSION}" + echo "" + echo "x86_64 sha512:" + echo "$(curl -s ${URL_X64}${BINARY}.sha512)" + echo "$(curl -s ${URL_X64}${SHIM}.sha512)" + echo "" + echo "aarch64 sha512:" + echo "$(curl -s ${URL_ARM}${BINARY}.sha512)" + echo "$(curl -s ${URL_ARM}${SHIM}.sha512)" + ;; + 404) + echo "Release ${VERSION} not found" + EXIT=1 + ;; + *) + echo "Error occured with status ${STATUS}" + EXIT=2 + ;; +esac + +exit $EXIT diff --git a/clonezilla-unstable/.SRCINFO b/clonezilla-unstable/.SRCINFO new file mode 100644 index 0000000..52651ae --- /dev/null +++ b/clonezilla-unstable/.SRCINFO @@ -0,0 +1,37 @@ +pkgbase = clonezilla-unstable + pkgdesc = ncurses partition and disk imaging/cloning program + pkgver = 5.13.10 + pkgrel = 1 + url = https://clonezilla.org + arch = any + license = GPL-2.0-or-later + depends = drbl + depends = partclone + depends = ntfs-3g + depends = partimage + depends = pigz + depends = sshfs + depends = parted + depends = gptfdisk + depends = dosfstools + depends = gzip + depends = bzip2 + depends = pbzip2 + depends = lbzip2 + depends = lrzip + depends = xz + depends = pixz + depends = lzop + depends = ecryptfs-utils + depends = screen + depends = perl + depends = cifs-utils + provides = clonezilla + conflicts = clonezilla + backup = etc/drbl/drbl-ocs.conf + source = https://gitlab.com/stevenshiau/clonezilla/-/archive/v5.13.10/clonezilla-v5.13.10.tar.gz + source = usrbin.patch + sha512sums = 6859c14d7298f929524a73cd25ecd9666993e10175a6964e57f640d5a493035408400425ff372a7e4cd6e7e33905508330bd14e73d022104814be8880dbf125d + sha512sums = 39e63eaa18ffaed7fe9a2dde449c8b57d4a3dc313024213881bd620d0011671bb7f8a0346df7c247c2da94f8d82afb669057cb05dd9cefffafb680826544d6ac + +pkgname = clonezilla-unstable diff --git a/clonezilla-unstable/PKGBUILD b/clonezilla-unstable/PKGBUILD new file mode 100644 index 0000000..733133c --- /dev/null +++ b/clonezilla-unstable/PKGBUILD @@ -0,0 +1,32 @@ +# Maintainer: Manuel Hüsers + +pkgname=clonezilla-unstable +_pkgname=clonezilla +pkgver=5.13.10 +pkgrel=1 +pkgdesc="ncurses partition and disk imaging/cloning program" +arch=('any') +url="https://clonezilla.org" +license=('GPL-2.0-or-later') +depends=('drbl' 'partclone' 'ntfs-3g' 'partimage' 'pigz' 'sshfs' 'parted' + 'gptfdisk' 'dosfstools' 'gzip' 'bzip2' 'pbzip2' 'lbzip2' 'lrzip' + 'xz' 'pixz' 'lzop' 'ecryptfs-utils' 'screen' 'perl' 'cifs-utils') +backup=('etc/drbl/drbl-ocs.conf') +conflicts=("${_pkgname}") +provides=("${_pkgname}") +source=("https://gitlab.com/stevenshiau/clonezilla/-/archive/v${pkgver}/${_pkgname}-v${pkgver}.tar.gz" + 'usrbin.patch') +sha512sums=('6859c14d7298f929524a73cd25ecd9666993e10175a6964e57f640d5a493035408400425ff372a7e4cd6e7e33905508330bd14e73d022104814be8880dbf125d' + '39e63eaa18ffaed7fe9a2dde449c8b57d4a3dc313024213881bd620d0011671bb7f8a0346df7c247c2da94f8d82afb669057cb05dd9cefffafb680826544d6ac') + +prepare() { + cd "${_pkgname}-v${pkgver}" + + patch -Np0 -i "${srcdir}/usrbin.patch" +} + +package() { + cd "${_pkgname}-v${pkgver}" + + make DESTDIR="${pkgdir}" install +} diff --git a/clonezilla-unstable/usrbin.patch b/clonezilla-unstable/usrbin.patch new file mode 100644 index 0000000..1970aeb --- /dev/null +++ b/clonezilla-unstable/usrbin.patch @@ -0,0 +1,13 @@ +--- Makefile.orig 2013-05-30 17:42:49.851418658 +0100 ++++ Makefile 2013-05-30 17:44:41.157482402 +0100 +@@ -18,8 +18,8 @@ + + install: + # install exec files +- install -d ${DESTDIR}/usr/ +- cp -a sbin bin ${DESTDIR}/usr/ ++ install -d ${DESTDIR}/usr/bin ++ cp -a sbin/* bin/* ${DESTDIR}/usr/bin/ + + # install setup dir + install -d $(DESTDIR)/$(SHAREDIR)/ diff --git a/discord-electron-openasar/.SRCINFO b/discord-electron-openasar/.SRCINFO new file mode 100644 index 0000000..725254d --- /dev/null +++ b/discord-electron-openasar/.SRCINFO @@ -0,0 +1,32 @@ +pkgbase = discord-electron-openasar + pkgdesc = Discord packaged with OpenAsar using system provided electron (v39) for increased security and performance + pkgver = 0.0.118+847 + pkgrel = 1 + url = https://discord.com + install = discord-electron-openasar.install + arch = x86_64 + license = custom + makedepends = git + makedepends = asar + makedepends = nodejs + makedepends = curl + depends = electron39 + depends = libxss + depends = unzip + optdepends = libpulse: Pulseaudio support + optdepends = xdg-utils: Open files + optdepends = python-pyelftools: Required for Krisp patcher + optdepends = python-capstone: Required for Krisp patcher + provides = discord + conflicts = discord + options = !strip + source = https://dl.discordapp.net/apps/linux/0.0.118/discord-0.0.118.tar.gz + source = discord-launcher.sh + source = krisp-patcher.py + source = git+https://github.com/goosemod/openasar.git#commit=5b259e4efaf9eee69aeca7b2ef153e5bfedc35d0 + sha512sums = 3658600194b60dfc7df9c2a77922be343ab181367a0fbc187699a8b6c2d06c6b1c2a67cb55aa8c8bf694ab4d190b6a8677618c5e5987edc0a1fdc5dbafd3300c + sha512sums = 618c89fdd90d6826dd44c3d5973428fb68b1836f1198a356e936da0b78c18b748d522ff7ecee15752d590dcd137ef16c4370ac6325c5b5f0aced4b5cce36b825 + sha512sums = 42cef68c1f7d574b4fbe859a4dc616e8994c7d16f62bcae3ff1f88e1edc58ac37b39c238d7defa9c97ceda417fcd6224cf0a0fd2608b8d18d0877e3c1befa59c + sha512sums = 86e296524f831b450620e4c0abb576f5b370982f70951beafdc821bcbce7db4b7b000bb2a7ce29516c209c2590fb428e8fed9450387ec37918dd79fc0a0a85e4 + +pkgname = discord-electron-openasar diff --git a/discord-electron-openasar/PKGBUILD b/discord-electron-openasar/PKGBUILD new file mode 100644 index 0000000..9dd19b6 --- /dev/null +++ b/discord-electron-openasar/PKGBUILD @@ -0,0 +1,92 @@ +# Maintainer: Manuel Hüsers + +pkgname=discord-electron-openasar +_pkgname=discord +pkgver=0.0.118+847 +_pkgver=${pkgver%%+*} +pkgrel=1 +_electronver=39 +_electronname="electron${_electronver}" +pkgdesc="Discord packaged with OpenAsar using system provided electron (v${_electronver}) for increased security and performance" +arch=('x86_64') +provides=("${_pkgname}") +conflicts=("${_pkgname}") +url='https://discord.com' +license=('custom') +options=('!strip') +install="$pkgname.install" +depends=("${_electronname}" 'libxss' 'unzip') +makedepends=('git' 'asar' 'nodejs' 'curl') +optdepends=( + 'libpulse: Pulseaudio support' + 'xdg-utils: Open files' + 'python-pyelftools: Required for Krisp patcher' + 'python-capstone: Required for Krisp patcher' +) +source=("https://dl.discordapp.net/apps/linux/${_pkgver}/${_pkgname}-${_pkgver}.tar.gz" + 'discord-launcher.sh' + 'krisp-patcher.py' # original: https://github.com/sersorrel/sys/blob/main/hm/discord/krisp-patcher.py + "git+https://github.com/goosemod/openasar.git#commit=5b259e4efaf9eee69aeca7b2ef153e5bfedc35d0") +sha512sums=('3658600194b60dfc7df9c2a77922be343ab181367a0fbc187699a8b6c2d06c6b1c2a67cb55aa8c8bf694ab4d190b6a8677618c5e5987edc0a1fdc5dbafd3300c' + '618c89fdd90d6826dd44c3d5973428fb68b1836f1198a356e936da0b78c18b748d522ff7ecee15752d590dcd137ef16c4370ac6325c5b5f0aced4b5cce36b825' + '42cef68c1f7d574b4fbe859a4dc616e8994c7d16f62bcae3ff1f88e1edc58ac37b39c238d7defa9c97ceda417fcd6224cf0a0fd2608b8d18d0877e3c1befa59c' + '86e296524f831b450620e4c0abb576f5b370982f70951beafdc821bcbce7db4b7b000bb2a7ce29516c209c2590fb428e8fed9450387ec37918dd79fc0a0a85e4') + +# just in case I get the version wrong +pkgver() { + cd "${srcdir}/openasar" + printf "%s+%s" "$_pkgver" "$(git rev-list --count HEAD)" +} + +prepare() { + # prepare launcher script + sed -i -e "s|@PKGNAME@|${_pkgname}|g" \ + -e "s|@PKGVER@|${_pkgver}|g" \ + -e "s|@ELECTRON@|${_electronname}|g" \ + discord-launcher.sh + + # fix the .desktop file + sed -i -e "s|Exec=.*|Exec=/usr/bin/${_pkgname}|" ${_pkgname^}/$_pkgname.desktop + + # create the license files + curl -o LICENSE.html https://discord.com/terms + curl -o OSS-LICENSES.html https://discord.com/licenses +} + +build() { + cd "${srcdir}"/openasar + + # pack openasar + sed -i -e "s|nightly|nightly-$(git rev-parse HEAD | cut -c 1-7)|" src/index.js + sed -i -e "/config.setup = true/a\ config.autoupdate = false;" src/config/index.js + sed -i -e "s|process.resourcesPath|'/usr/lib/${_pkgname}/resources'|" src/utils/buildInfo.js + sed -i -e "s|^Exec=\${exec}$|Exec=/usr/bin/${_pkgname}|" \ + -e "s|^Name=\${basename(exec)}$|Name=${_pkgname^}|" src/autoStart.js + node scripts/strip.js + asar p src app.asar +} + +package() { + # create necessary directories + install -d "${pkgdir}"/usr/lib/$_pkgname + + # copy relevant data + cp -r ${_pkgname^}/resources "${pkgdir}"/usr/lib/$_pkgname/ + + # intall icon and desktop file + install -Dm 644 ${_pkgname^}/$_pkgname.png "${pkgdir}"/usr/share/pixmaps/$_pkgname.png + install -Dm 644 ${_pkgname^}/$_pkgname.desktop "${pkgdir}"/usr/share/applications/$_pkgname.desktop + + # overwrite Discord asar + install -Dm 644 openasar/app.asar "${pkgdir}"/usr/lib/$_pkgname/resources/ + + # install the launch script + install -Dm 755 discord-launcher.sh "${pkgdir}"/usr/bin/$_pkgname + + # install krisp patcher + install -Dm 644 krisp-patcher.py "${pkgdir}"/usr/lib/$_pkgname/ + + # install licenses + install -Dm 644 LICENSE.html "${pkgdir}"/usr/share/licenses/$_pkgname/LICENSE.html + install -Dm 644 OSS-LICENSES.html "${pkgdir}"/usr/share/licenses/$_pkgname/OSS-LICENSES.html +} diff --git a/discord-electron-openasar/discord-electron-openasar.install b/discord-electron-openasar/discord-electron-openasar.install new file mode 100644 index 0000000..1732135 --- /dev/null +++ b/discord-electron-openasar/discord-electron-openasar.install @@ -0,0 +1,43 @@ +post_upgrade() { + # return if old package version is greater than or equal to 0.0.55+827-1... + (( $(vercmp $2 '0.0.55+827-1') >= 0 )) && return + + cat < Instead of using 'rizin' to patch Krisp support a patcher written in Python + is now used. Consider installing the necessary optional dependencies to use + this feature. +EOF + + # return if old package version is greater than or equal to 0.0.39+824-2... + (( $(vercmp $2 '0.0.39+824-2') >= 0 )) && return + + cat < In order to patch Krisp noise suppression support set 'PATCH_KRISP=true' + in '~/.config/discord.conf' in addition to having 'rizin' installed. +EOF + + # return if old package version is greater than or equal to 0.0.27+809-5... + (( $(vercmp $2 '0.0.27+809-5') >= 0 )) && return + + cat < The launch script will now patch Krisp noise suppression support + if 'rizin' is installed. Restart your Discord client after update + to apply the patch. +EOF + + # return if old package version is greater than or equal to 0.0.27+809-2... + (( $(vercmp $2 '0.0.27+809-2') >= 0 )) && return + + cat < You can now set additional Electron flags in '~/.config/discord-flags.conf'. +EOF +} + +post_install() { + cat < For Krisp noise suppression support consider installing the necessary optional + dependencies and setting 'PATCH_KRISP=true' in '~/.config/discord.conf'. + Restart your Discord client afterwards to apply the patch. +==> Additional Electron flags can be set in '~/.config/discord-flags.conf'. +EOF +} diff --git a/discord-electron-openasar/discord-launcher.sh b/discord-electron-openasar/discord-launcher.sh new file mode 100644 index 0000000..0e73370 --- /dev/null +++ b/discord-electron-openasar/discord-launcher.sh @@ -0,0 +1,40 @@ +#!/usr/bin/env bash + +set -euo pipefail + +declare -a flags +declare -l PATCH_KRISP + +[[ -r "${XDG_CONFIG_HOME:-$HOME/.config}/@PKGNAME@.conf" ]] && source "${XDG_CONFIG_HOME:-$HOME/.config}/@PKGNAME@.conf" + +flags_file="${XDG_CONFIG_HOME:-$HOME/.config}/@PKGNAME@-flags.conf" +krisp_bin="${DISCORD_USER_DATA_DIR:-${XDG_CONFIG_HOME:-$HOME/.config}/@PKGNAME@}/@PKGVER@/modules/@PKGNAME@_krisp/@PKGNAME@_krisp.node" + +if [[ "${PATCH_KRISP:-}" == true ]] && [[ -w "${krisp_bin}" ]]; then + if hash python &> /dev/null && python -c 'import capstone; import elftools' &> /dev/null; then + # Patch Krisp binary to ignore signature check + echo -n 'Running Krisp patcher... ' + python /usr/lib/@PKGNAME@/krisp-patcher.py "${krisp_bin}" + fi +fi + +if [[ -r "${flags_file}" ]]; then + # Replacing because old flag does not work + if [[ -w "${flags_file}" ]] && grep -q '\--ignore-gpu-blacklist' "${flags_file}"; then + sed -i 's|--ignore-gpu-blacklist|--ignore-gpu-blocklist|' "${flags_file}" + fi + mapfile -t < "${flags_file}" +fi + +for line in "${MAPFILE[@]}"; do + if [[ ! "${line}" =~ ^[[:space:]]*#.* ]] && [[ -n "${line}" ]]; then + flags+=("${line}") + fi +done + +unset flags_file krisp_bin + + +exec /usr/lib/@ELECTRON@/electron \ + /usr/lib/@PKGNAME@/resources/app.asar \ + "${flags[@]}" "$@" diff --git a/discord-electron-openasar/krisp-patcher.py b/discord-electron-openasar/krisp-patcher.py new file mode 100644 index 0000000..99107bf --- /dev/null +++ b/discord-electron-openasar/krisp-patcher.py @@ -0,0 +1,85 @@ +import sys +import shutil + +from elftools.elf.elffile import ELFFile +from capstone import * +from capstone.x86 import * + +if len(sys.argv) < 2: + print(f"Usage: {sys.argv[0]} [path to discord_krisp.node]") + # "Unix programs generally use 2 for command line syntax errors and 1 for all other kind of errors." + sys.exit(2) + +executable = sys.argv[1] + +elf = ELFFile(open(executable, "rb")) +symtab = elf.get_section_by_name('.symtab') + +krisp_initialize_address = symtab.get_symbol_by_name("_ZN7discordL17DoKrispInitializeEv")[0].entry.st_value +isSignedByDiscord_address = symtab.get_symbol_by_name("_ZN7discord4util17IsSignedByDiscordERKNSt4__Cr12basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEE")[0].entry.st_value + +text = elf.get_section_by_name('.text') +text_start = text['sh_addr'] +text_start_file = text['sh_offset'] +# This seems to always be zero (.text starts at the right offset in the file). Do it just in case? +address_to_file = text_start_file - text_start + +# Done with the ELF now. +# elf.close() + +krisp_initialize_offset = krisp_initialize_address - address_to_file +isSignedByDiscord_offset = krisp_initialize_address - address_to_file + +f = open(executable, "rb") +f.seek(krisp_initialize_offset) +krisp_initialize = f.read(96) +f.close() + +# States +found_issigned_by_discord_call = False +found_issigned_by_discord_test = False +found_issigned_by_discord_je = False +found_already_patched = False +je_location = None +je_size = 0 + +# We are looking for a call to IsSignedByDiscord, followed by a test, followed by a je. +# Then we replace the je with nops. + +md = Cs(CS_ARCH_X86, CS_MODE_64) +md.detail = True +for i in md.disasm(krisp_initialize, krisp_initialize_address): + if i.id == X86_INS_CALL: + if i.operands[0].type == X86_OP_IMM: + if i.operands[0].imm == isSignedByDiscord_address: + found_issigned_by_discord_call = True + + if i.id == X86_INS_TEST: + if found_issigned_by_discord_call: + found_issigned_by_discord_test = True + + if i.id == X86_INS_JE: + if found_issigned_by_discord_test: + found_issigned_by_discord_je = True + je_location = i.address + je_size = len(i.bytes) + break + + if i.id == X86_INS_NOP: + if found_issigned_by_discord_test: + found_already_patched = True + break + +if je_location: + print(f"Found patch location: 0x{je_location:x}") + + shutil.copyfile(executable, executable + ".orig") + f = open(executable, 'rb+') + f.seek(je_location - address_to_file) + f.write(b'\x90' * je_size) # je can be larger than 2 bytes given a large enough displacement :( + f.close() +else: + if found_already_patched: + print("Couldn't find patch location - already patched.") + else: + print("Couldn't find patch location - review manually. Sorry.") diff --git a/discord-electron-openasar/update-package.sh b/discord-electron-openasar/update-package.sh new file mode 100755 index 0000000..90cdc1e --- /dev/null +++ b/discord-electron-openasar/update-package.sh @@ -0,0 +1,57 @@ +#!/usr/bin/env bash + +set -euo pipefail + +readonly all_off="$(tput sgr0)" +readonly bold="${all_off}$(tput bold)" +readonly white="${bold}$(tput setaf 7)" +readonly blue="${bold}$(tput setaf 4)" +readonly red="${bold}$(tput setaf 1)" + +msg() { + printf "${blue}::${white} $1${all_off}\n" +} + +error() { + printf "${red}::${white} $1${all_off}\n" +} + +msgbegin() { + printf "${blue}::${white} $1" +} + +msgend() { + printf "$1${all_off}\n" +} + + +readonly krisp_zip='discord_krisp-1.zip' +readonly krisp_bin='discord_krisp.node' + +# head to directory of this script +cd $(dirname "$0") + +# update package to version used in PKGBUILD +source PKGBUILD + +msg "Running updpkgsums (Updating checksums)" +updpkgsums + +msg "Running mksrcinfo (Updating SRCINFO file)" +makepkg --printsrcinfo > .SRCINFO + +msg "Getting Krisp module" +curl -O "https://dl.discordapp.net/apps/linux/${_pkgver:-${pkgver}}/modules/${krisp_zip}" +unzip "${krisp_zip}" "${krisp_bin}" + +msg "Checking if Krisp module is patchable (watch output)" +python krisp-patcher.py "${krisp_bin}" + +#msg "Updating Krisp module checksum" +#readonly chcksm=$(b2sum "${krisp_bin}.orig" | head -c 128) +#sed -i "s/^_krisp_b2sum='.*'$/_krisp_b2sum='${chcksm}'/" PKGBUILD + +msgbegin "Cleaning up... " +rm -f "${krisp_zip}" "${krisp_bin}" "${krisp_bin}.orig" + +msgend "Done" diff --git a/discord-electron/.SRCINFO b/discord-electron/.SRCINFO new file mode 100644 index 0000000..9a0279a --- /dev/null +++ b/discord-electron/.SRCINFO @@ -0,0 +1,27 @@ +pkgbase = discord-electron + pkgdesc = Discord using system provided electron (v39) for increased security and performance + pkgver = 0.0.118 + pkgrel = 1 + url = https://discord.com + install = discord-electron.install + arch = x86_64 + license = custom + makedepends = asar + makedepends = curl + depends = electron39 + depends = libxss + optdepends = libpulse: Pulseaudio support + optdepends = xdg-utils: Open files + optdepends = python-pyelftools: Required for Krisp patcher + optdepends = python-capstone: Required for Krisp patcher + provides = discord + conflicts = discord + options = !strip + source = https://dl.discordapp.net/apps/linux/0.0.118/discord-0.0.118.tar.gz + source = discord-launcher.sh + source = krisp-patcher.py + sha512sums = 3658600194b60dfc7df9c2a77922be343ab181367a0fbc187699a8b6c2d06c6b1c2a67cb55aa8c8bf694ab4d190b6a8677618c5e5987edc0a1fdc5dbafd3300c + sha512sums = 618c89fdd90d6826dd44c3d5973428fb68b1836f1198a356e936da0b78c18b748d522ff7ecee15752d590dcd137ef16c4370ac6325c5b5f0aced4b5cce36b825 + sha512sums = 42cef68c1f7d574b4fbe859a4dc616e8994c7d16f62bcae3ff1f88e1edc58ac37b39c238d7defa9c97ceda417fcd6224cf0a0fd2608b8d18d0877e3c1befa59c + +pkgname = discord-electron diff --git a/discord-electron/PKGBUILD b/discord-electron/PKGBUILD new file mode 100644 index 0000000..a902f9e --- /dev/null +++ b/discord-electron/PKGBUILD @@ -0,0 +1,82 @@ +pkgname=discord-electron +_pkgname=discord +pkgver=0.0.118 +pkgrel=1 +_electronver=39 +_electronname="electron${_electronver}" +pkgdesc="Discord using system provided electron (v${_electronver}) for increased security and performance" +arch=('x86_64') +provides=("${_pkgname}") +conflicts=("${_pkgname}") +url='https://discord.com' +license=('custom') +options=('!strip') +install="$pkgname.install" +depends=("${_electronname}" 'libxss') +makedepends=('asar' 'curl') +optdepends=( + 'libpulse: Pulseaudio support' + 'xdg-utils: Open files' + 'python-pyelftools: Required for Krisp patcher' + 'python-capstone: Required for Krisp patcher' +) +source=("https://dl.discordapp.net/apps/linux/${pkgver}/${_pkgname}-${pkgver}.tar.gz" + 'discord-launcher.sh' + 'krisp-patcher.py') # original: https://github.com/sersorrel/sys/blob/main/hm/discord/krisp-patcher.py +sha512sums=('3658600194b60dfc7df9c2a77922be343ab181367a0fbc187699a8b6c2d06c6b1c2a67cb55aa8c8bf694ab4d190b6a8677618c5e5987edc0a1fdc5dbafd3300c' + '618c89fdd90d6826dd44c3d5973428fb68b1836f1198a356e936da0b78c18b748d522ff7ecee15752d590dcd137ef16c4370ac6325c5b5f0aced4b5cce36b825' + '42cef68c1f7d574b4fbe859a4dc616e8994c7d16f62bcae3ff1f88e1edc58ac37b39c238d7defa9c97ceda417fcd6224cf0a0fd2608b8d18d0877e3c1befa59c') + +prepare() { + # prepare launcher script + sed -i -e "s|@PKGNAME@|${_pkgname}|g" \ + -e "s|@PKGVER@|${pkgver}|g" \ + -e "s|@ELECTRON@|${_electronname}|g" \ + discord-launcher.sh + + # fix the .desktop file + sed -i -e "s|Exec=.*|Exec=/usr/bin/${_pkgname}|" ${_pkgname^}/$_pkgname.desktop + + # create the license files + curl -o LICENSE.html https://discord.com/terms + curl -o OSS-LICENSES.html https://discord.com/licenses +} + +build() { + cd "${srcdir}"/${_pkgname^} + + # use system electron + asar e resources/app.asar resources/app + rm resources/app.asar + sed -i -e "/resourcesPath = .*;$/d" -e "s|return resourcesPath|return '/usr/lib/${_pkgname}/resources'|" resources/app/common/paths.js + sed -i -e "s|process.resourcesPath|'/usr/lib/${_pkgname}/resources'|" resources/app/app_bootstrap/buildInfo.js + sed -i -e "/^const appName/d" -e "/^const exePath/d" -e "/^const exeDir/d" -e "/^const iconPath/d" \ + -e "s|^Exec=\${exePath}$|Exec=/usr/bin/${_pkgname}|" \ + -e "s|^Name=\${appName}$|Name=${_pkgname^}|" \ + -e "s|^Icon=\${iconPath}$|Icon=/usr/share/pixmaps/${_pkgname}.png|" \ + resources/app/app_bootstrap/autoStart/linux.js + asar p resources/app resources/app.asar + rm -rf resources/app +} + +package() { + # create necessary directories + install -d "${pkgdir}"/usr/lib/$_pkgname + + # copy relevant data + cp -r ${_pkgname^}/resources "${pkgdir}"/usr/lib/$_pkgname/ + + # intall icon and desktop file + install -Dm 644 ${_pkgname^}/$_pkgname.png "${pkgdir}"/usr/share/pixmaps/$_pkgname.png + install -Dm 644 ${_pkgname^}/$_pkgname.desktop "${pkgdir}"/usr/share/applications/$_pkgname.desktop + + # install the launch script + install -Dm 755 discord-launcher.sh "${pkgdir}"/usr/bin/$_pkgname + + # install krisp patcher + install -Dm 644 krisp-patcher.py "${pkgdir}"/usr/lib/$_pkgname/ + + # install licenses + install -Dm 644 LICENSE.html "${pkgdir}"/usr/share/licenses/$_pkgname/LICENSE.html + install -Dm 644 OSS-LICENSES.html "${pkgdir}"/usr/share/licenses/$_pkgname/OSS-LICENSES.html +} diff --git a/discord-electron/discord-electron.install b/discord-electron/discord-electron.install new file mode 100644 index 0000000..fe95226 --- /dev/null +++ b/discord-electron/discord-electron.install @@ -0,0 +1,44 @@ +post_upgrade() { + # return if old package version is greater than or equal to 0.0.55-1... + (( $(vercmp $2 '0.0.55-1') >= 0 )) && return + + cat < Instead of using 'rizin' to patch Krisp support a patcher written in Python + is now used. Consider installing the necessary optional dependencies to use + this feature. +EOF + + # return if old package version is greater than or equal to 0.0.39-2... + (( $(vercmp $2 '0.0.39-2') >= 0 )) && return + + cat < In order to patch Krisp noise suppression support set 'PATCH_KRISP=true' + in '~/.config/discord.conf' in addition to having 'rizin' installed. +EOF + + # return if old package version is greater than or equal to 0.0.27-5... + (( $(vercmp $2 '0.0.27-5') >= 0 )) && return + + cat < The launch script will now patch Krisp noise suppression support + if 'rizin' is installed. Restart your Discord client after update + to apply the patch. +EOF + + # return if old package version is greater than or equal to 0.0.27-2... + (( $(vercmp $2 '0.0.27-2') >= 0 )) && return + + cat < You can now set additional Electron flags in '~/.config/discord-flags.conf'. +EOF +} + +post_install() { + cat < For Krisp noise suppression support consider installing the necessary optional + dependencies and setting 'PATCH_KRISP=true' in '~/.config/discord.conf'. + Restart your Discord client afterwards to apply the patch. +==> In case of performance problems consider setting additional flags + in '~/.config/discord-flags.conf'. +EOF +} diff --git a/discord-electron/discord-launcher.sh b/discord-electron/discord-launcher.sh new file mode 100644 index 0000000..0e73370 --- /dev/null +++ b/discord-electron/discord-launcher.sh @@ -0,0 +1,40 @@ +#!/usr/bin/env bash + +set -euo pipefail + +declare -a flags +declare -l PATCH_KRISP + +[[ -r "${XDG_CONFIG_HOME:-$HOME/.config}/@PKGNAME@.conf" ]] && source "${XDG_CONFIG_HOME:-$HOME/.config}/@PKGNAME@.conf" + +flags_file="${XDG_CONFIG_HOME:-$HOME/.config}/@PKGNAME@-flags.conf" +krisp_bin="${DISCORD_USER_DATA_DIR:-${XDG_CONFIG_HOME:-$HOME/.config}/@PKGNAME@}/@PKGVER@/modules/@PKGNAME@_krisp/@PKGNAME@_krisp.node" + +if [[ "${PATCH_KRISP:-}" == true ]] && [[ -w "${krisp_bin}" ]]; then + if hash python &> /dev/null && python -c 'import capstone; import elftools' &> /dev/null; then + # Patch Krisp binary to ignore signature check + echo -n 'Running Krisp patcher... ' + python /usr/lib/@PKGNAME@/krisp-patcher.py "${krisp_bin}" + fi +fi + +if [[ -r "${flags_file}" ]]; then + # Replacing because old flag does not work + if [[ -w "${flags_file}" ]] && grep -q '\--ignore-gpu-blacklist' "${flags_file}"; then + sed -i 's|--ignore-gpu-blacklist|--ignore-gpu-blocklist|' "${flags_file}" + fi + mapfile -t < "${flags_file}" +fi + +for line in "${MAPFILE[@]}"; do + if [[ ! "${line}" =~ ^[[:space:]]*#.* ]] && [[ -n "${line}" ]]; then + flags+=("${line}") + fi +done + +unset flags_file krisp_bin + + +exec /usr/lib/@ELECTRON@/electron \ + /usr/lib/@PKGNAME@/resources/app.asar \ + "${flags[@]}" "$@" diff --git a/discord-electron/krisp-patcher.py b/discord-electron/krisp-patcher.py new file mode 100644 index 0000000..99107bf --- /dev/null +++ b/discord-electron/krisp-patcher.py @@ -0,0 +1,85 @@ +import sys +import shutil + +from elftools.elf.elffile import ELFFile +from capstone import * +from capstone.x86 import * + +if len(sys.argv) < 2: + print(f"Usage: {sys.argv[0]} [path to discord_krisp.node]") + # "Unix programs generally use 2 for command line syntax errors and 1 for all other kind of errors." + sys.exit(2) + +executable = sys.argv[1] + +elf = ELFFile(open(executable, "rb")) +symtab = elf.get_section_by_name('.symtab') + +krisp_initialize_address = symtab.get_symbol_by_name("_ZN7discordL17DoKrispInitializeEv")[0].entry.st_value +isSignedByDiscord_address = symtab.get_symbol_by_name("_ZN7discord4util17IsSignedByDiscordERKNSt4__Cr12basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEE")[0].entry.st_value + +text = elf.get_section_by_name('.text') +text_start = text['sh_addr'] +text_start_file = text['sh_offset'] +# This seems to always be zero (.text starts at the right offset in the file). Do it just in case? +address_to_file = text_start_file - text_start + +# Done with the ELF now. +# elf.close() + +krisp_initialize_offset = krisp_initialize_address - address_to_file +isSignedByDiscord_offset = krisp_initialize_address - address_to_file + +f = open(executable, "rb") +f.seek(krisp_initialize_offset) +krisp_initialize = f.read(96) +f.close() + +# States +found_issigned_by_discord_call = False +found_issigned_by_discord_test = False +found_issigned_by_discord_je = False +found_already_patched = False +je_location = None +je_size = 0 + +# We are looking for a call to IsSignedByDiscord, followed by a test, followed by a je. +# Then we replace the je with nops. + +md = Cs(CS_ARCH_X86, CS_MODE_64) +md.detail = True +for i in md.disasm(krisp_initialize, krisp_initialize_address): + if i.id == X86_INS_CALL: + if i.operands[0].type == X86_OP_IMM: + if i.operands[0].imm == isSignedByDiscord_address: + found_issigned_by_discord_call = True + + if i.id == X86_INS_TEST: + if found_issigned_by_discord_call: + found_issigned_by_discord_test = True + + if i.id == X86_INS_JE: + if found_issigned_by_discord_test: + found_issigned_by_discord_je = True + je_location = i.address + je_size = len(i.bytes) + break + + if i.id == X86_INS_NOP: + if found_issigned_by_discord_test: + found_already_patched = True + break + +if je_location: + print(f"Found patch location: 0x{je_location:x}") + + shutil.copyfile(executable, executable + ".orig") + f = open(executable, 'rb+') + f.seek(je_location - address_to_file) + f.write(b'\x90' * je_size) # je can be larger than 2 bytes given a large enough displacement :( + f.close() +else: + if found_already_patched: + print("Couldn't find patch location - already patched.") + else: + print("Couldn't find patch location - review manually. Sorry.") diff --git a/discord-electron/update-package.sh b/discord-electron/update-package.sh new file mode 100755 index 0000000..90cdc1e --- /dev/null +++ b/discord-electron/update-package.sh @@ -0,0 +1,57 @@ +#!/usr/bin/env bash + +set -euo pipefail + +readonly all_off="$(tput sgr0)" +readonly bold="${all_off}$(tput bold)" +readonly white="${bold}$(tput setaf 7)" +readonly blue="${bold}$(tput setaf 4)" +readonly red="${bold}$(tput setaf 1)" + +msg() { + printf "${blue}::${white} $1${all_off}\n" +} + +error() { + printf "${red}::${white} $1${all_off}\n" +} + +msgbegin() { + printf "${blue}::${white} $1" +} + +msgend() { + printf "$1${all_off}\n" +} + + +readonly krisp_zip='discord_krisp-1.zip' +readonly krisp_bin='discord_krisp.node' + +# head to directory of this script +cd $(dirname "$0") + +# update package to version used in PKGBUILD +source PKGBUILD + +msg "Running updpkgsums (Updating checksums)" +updpkgsums + +msg "Running mksrcinfo (Updating SRCINFO file)" +makepkg --printsrcinfo > .SRCINFO + +msg "Getting Krisp module" +curl -O "https://dl.discordapp.net/apps/linux/${_pkgver:-${pkgver}}/modules/${krisp_zip}" +unzip "${krisp_zip}" "${krisp_bin}" + +msg "Checking if Krisp module is patchable (watch output)" +python krisp-patcher.py "${krisp_bin}" + +#msg "Updating Krisp module checksum" +#readonly chcksm=$(b2sum "${krisp_bin}.orig" | head -c 128) +#sed -i "s/^_krisp_b2sum='.*'$/_krisp_b2sum='${chcksm}'/" PKGBUILD + +msgbegin "Cleaning up... " +rm -f "${krisp_zip}" "${krisp_bin}" "${krisp_bin}.orig" + +msgend "Done" diff --git a/ect/.SRCINFO b/ect/.SRCINFO new file mode 100644 index 0000000..9b53bc0 --- /dev/null +++ b/ect/.SRCINFO @@ -0,0 +1,19 @@ +pkgbase = ect + pkgdesc = File compressor, supports postcompression of PNG, JPEG, GZIP and ZIP files + pkgver = 0.9.5 + pkgrel = 3 + url = https://github.com/fhanau/efficient-compression-tool + arch = x86_64 + license = Apache-2.0 + makedepends = nasm + makedepends = git + makedepends = cmake + depends = gcc-libs + source = git+https://github.com/fhanau/efficient-compression-tool.git#tag=v0.9.5 + source = git+https://github.com/glennrp/libpng.git#commit=f135775ad4e5d4408d2e12ffcc71bb36e6b48551 + source = git+https://github.com/fhanau/mozjpeg.git#commit=182457e3e26e1e078d5dbd09137cf04865be2e49 + sha512sums = a1d0ad86aa8e6d720575daf7e833c3b787ac51595774b99b6fd4a8ece616150c2e2c174aa97a2bc0b89e16d6cd93ec0c0d657430c1a41bf08b121368af0a4abc + sha512sums = 13e286cf091b284d15888a959a8be5a90977bed92d861fd72d465199bd6112641b47d74a525d4100868d528a25921958e9ab579643b705befe48e5756ffa301f + sha512sums = 1bdd9efa8d9c49a16cf5f2135ed29dc120bc1b31eec7130802d22b3d09bf10fe337f734b39b38e422bbe6e1719aca6744d49e2b435c2cb94cbf401d89086947a + +pkgname = ect diff --git a/ect/PKGBUILD b/ect/PKGBUILD new file mode 100644 index 0000000..adb0d79 --- /dev/null +++ b/ect/PKGBUILD @@ -0,0 +1,42 @@ +# Maintainer: Manuel Hüsers +# Contributor: Stefan Husmann +# Contributor: William J. Bowman + +pkgname=ect +_pkgname=efficient-compression-tool +pkgver=0.9.5 +pkgrel=3 +pkgdesc='File compressor, supports postcompression of PNG, JPEG, GZIP and ZIP files' +url="https://github.com/fhanau/$_pkgname" +arch=('x86_64') +license=('Apache-2.0') +depends=('gcc-libs') +makedepends=('nasm' 'git' 'cmake') +source=("git+$url.git#tag=v$pkgver" + 'git+https://github.com/glennrp/libpng.git#commit=f135775ad4e5d4408d2e12ffcc71bb36e6b48551' + 'git+https://github.com/fhanau/mozjpeg.git#commit=182457e3e26e1e078d5dbd09137cf04865be2e49') +sha512sums=('a1d0ad86aa8e6d720575daf7e833c3b787ac51595774b99b6fd4a8ece616150c2e2c174aa97a2bc0b89e16d6cd93ec0c0d657430c1a41bf08b121368af0a4abc' + '13e286cf091b284d15888a959a8be5a90977bed92d861fd72d465199bd6112641b47d74a525d4100868d528a25921958e9ab579643b705befe48e5756ffa301f' + '1bdd9efa8d9c49a16cf5f2135ed29dc120bc1b31eec7130802d22b3d09bf10fe337f734b39b38e422bbe6e1719aca6744d49e2b435c2cb94cbf401d89086947a') + +prepare() { + cd "$_pkgname" + git submodule init + git config submodule.src/libpng.url "$srcdir"/libpng + git config submodule.src/mozjpeg.url "$srcdir"/mozjpeg + git -c protocol.file.allow=always submodule update +} + +build() { + cmake -B build -S "$_pkgname"/src \ + -DCMAKE_INSTALL_PREFIX=/usr \ + -DCMAKE_BUILD_TYPE=Release \ + -DCMAKE_POLICY_VERSION_MINIMUM=3.5 + cmake --build build +} + +package() { + DESTDIR="$pkgdir" cmake --install build + # Some things expect this to be an all-caps name + ln -s ect "$pkgdir"/usr/bin/ECT +} diff --git a/firefox-syncstorage/.SRCINFO b/firefox-syncstorage/.SRCINFO new file mode 100644 index 0000000..5b70068 --- /dev/null +++ b/firefox-syncstorage/.SRCINFO @@ -0,0 +1,29 @@ +pkgbase = firefox-syncstorage + pkgdesc = Sync storage server with built-in token server for running a self-hosted firefox sync server + pkgver = 0.21.1 + pkgrel = 1 + url = https://github.com/mozilla-services/syncstorage-rs + install = firefox-syncstorage.install + arch = i686 + arch = x86_64 + arch = arm + arch = armv6h + arch = armv7h + arch = aarch64 + license = MPL-2.0 + makedepends = rust + makedepends = cmake + makedepends = pkgconf + makedepends = mariadb-libs + depends = openssl + optdepends = mysql: for use with a local database server + options = !lto + backup = etc/firefox-syncstorage.toml + source = https://github.com/mozilla-services/syncstorage-rs/archive/0.21.1/syncstorage-rs-0.21.1.tar.gz + source = firefox-syncstorage.service + source = mariadb-compat.patch + sha512sums = dcf10d5d6e286dea69faaabdf6ad2f60e7d4e0563ec30dc113318c809d4224e05289423ed688080c7d74d97e5236176047ec889f96829ceb8dfc4aa9991e2d7e + sha512sums = 4c5fbb99160613ba3fb0fedce97f04f63b92699fe79c6edd899d4ec5f297c5a98c0c211df3eb9a6579c12c57f4c63513747ed8944a60fc76e32f1e0c0f5e3a95 + sha512sums = fc24c504defb2961388833a5d6f96d883c533f58476de595f697ff5d42daabd21f8ce3c52e3f1897e089fcd8f2791d93ecc42eeee49f0100a17fd1689fa112c7 + +pkgname = firefox-syncstorage diff --git a/firefox-syncstorage/PKGBUILD b/firefox-syncstorage/PKGBUILD new file mode 100644 index 0000000..d519dbf --- /dev/null +++ b/firefox-syncstorage/PKGBUILD @@ -0,0 +1,46 @@ +# Maintainer: Manuel Hüsers +# Contributor: Matthieu Valleton +# Contributor: jewelux + +# Based off the firefox-syncstorage-git PKGBUILD from jewelux + +pkgname=firefox-syncstorage +_pkgname=syncstorage-rs +pkgver=0.21.1 +pkgrel=1 +pkgdesc='Sync storage server with built-in token server for running a self-hosted firefox sync server' +arch=('i686' 'x86_64' 'arm' 'armv6h' 'armv7h' 'aarch64') +url="https://github.com/mozilla-services/${_pkgname}" +license=('MPL-2.0') +depends=('openssl') +makedepends=('rust' 'cmake' 'pkgconf' 'mariadb-libs') +optdepends=('mysql: for use with a local database server') +options=('!lto') +install="${pkgname}.install" +source=("https://github.com/mozilla-services/${_pkgname}/archive/${pkgver}/${_pkgname}-${pkgver}.tar.gz" + "${pkgname}.service" + "mariadb-compat.patch") +sha512sums=('dcf10d5d6e286dea69faaabdf6ad2f60e7d4e0563ec30dc113318c809d4224e05289423ed688080c7d74d97e5236176047ec889f96829ceb8dfc4aa9991e2d7e' + '4c5fbb99160613ba3fb0fedce97f04f63b92699fe79c6edd899d4ec5f297c5a98c0c211df3eb9a6579c12c57f4c63513747ed8944a60fc76e32f1e0c0f5e3a95' + 'fc24c504defb2961388833a5d6f96d883c533f58476de595f697ff5d42daabd21f8ce3c52e3f1897e089fcd8f2791d93ecc42eeee49f0100a17fd1689fa112c7') +backup=("etc/${pkgname}.toml") + +# Patch for MariaDB compatibility, cf. https://github.com/mozilla-services/syncstorage-rs/issues/1753 +prepare() { + cd ${_pkgname}-${pkgver} + patch -p1 -i "${srcdir}/mariadb-compat.patch" +} + +build() { + cd "${_pkgname}-${pkgver}" + cargo build --release --no-default-features --features=syncstorage-db/mysql +} + +package() { + cd "${_pkgname}-${pkgver}" + + # Installing manually + install -Dm 755 target/release/syncserver "${pkgdir}"/usr/bin/"${pkgname}" + install -Dm 644 config/local.example.toml "${pkgdir}"/etc/"${pkgname}".toml + install -Dm 644 "${srcdir}/${pkgname}".service "${pkgdir}"/usr/lib/systemd/system/"${pkgname}".service +} diff --git a/firefox-syncstorage/firefox-syncstorage.install b/firefox-syncstorage/firefox-syncstorage.install new file mode 100644 index 0000000..4475324 --- /dev/null +++ b/firefox-syncstorage/firefox-syncstorage.install @@ -0,0 +1,11 @@ +post_install() { + getent group syncstorage &>/dev/null || groupadd -r syncstorage >/dev/null + getent passwd syncstorage &>/dev/null || useradd -r -s /usr/bin/false \ + -g syncstorage -G syncstorage syncstorage >/dev/null +} + +pre_remove() { + getent passwd syncstorage &>/dev/null && userdel syncstorage >/dev/null + getent group syncstorage &>/dev/null && groupdel syncstorage >/dev/null + true +} \ No newline at end of file diff --git a/firefox-syncstorage/firefox-syncstorage.service b/firefox-syncstorage/firefox-syncstorage.service new file mode 100644 index 0000000..444624a --- /dev/null +++ b/firefox-syncstorage/firefox-syncstorage.service @@ -0,0 +1,24 @@ +[Unit] +Description=Actix web server running Mozilla Firefox Sync Storage +Wants=mysql.service +After=network.target mysql.service + +[Service] +ExecStart=/usr/bin/firefox-syncstorage --config=/etc/firefox-syncstorage.toml +Restart=on-abort + +User=syncstorage +Group=syncstorage +UMask=007 + +NoNewPrivileges=yes +ProtectSystem=strict +ProtectHome=true +PrivateTmp=true +PrivateDevices=true +ProtectKernelTunables=true +ProtectKernelModules=true +ProtectControlGroups=true + +[Install] +WantedBy=multi-user.target \ No newline at end of file diff --git a/firefox-syncstorage/mariadb-compat.patch b/firefox-syncstorage/mariadb-compat.patch new file mode 100644 index 0000000..860bc3e --- /dev/null +++ b/firefox-syncstorage/mariadb-compat.patch @@ -0,0 +1,69 @@ +idiff --git a/syncstorage-mysql/src/diesel_ext.rs b/syncstorage-mysql/src/diesel_ext.rs +index 18abb4a..fe52470 100644 +--- a/syncstorage-mysql/src/diesel_ext.rs ++++ b/syncstorage-mysql/src/diesel_ext.rs +@@ -3,11 +3,43 @@ use std::{fmt::Debug, marker::PhantomData}; + use diesel::{ + backend::Backend, + insertable::CanInsertInSingleQuery, ++ mysql::Mysql, + query_builder::{AstPass, InsertStatement, QueryFragment, QueryId}, ++ query_dsl::methods::LockingDsl, + result::QueryResult, + Expression, QuerySource, RunQueryDsl, + }; + ++/// Emit MySQL <= 5.7's `LOCK IN SHARE MODE` ++/// ++/// MySQL 8 supports `FOR SHARE` as an alias (which diesel natively supports) ++pub trait LockInShareModeDsl { ++ type Output; ++ ++ fn lock_in_share_mode(self) -> Self::Output; ++} ++ ++impl LockInShareModeDsl for T ++where ++ T: LockingDsl, ++{ ++ type Output = >::Output; ++ ++ fn lock_in_share_mode(self) -> Self::Output { ++ self.with_lock(LockInShareMode) ++ } ++} ++ ++#[derive(Debug, Clone, Copy, QueryId)] ++pub struct LockInShareMode; ++ ++impl QueryFragment for LockInShareMode { ++ fn walk_ast<'b>(&'b self, mut out: AstPass<'_, 'b, Mysql>) -> QueryResult<()> { ++ out.push_sql(" LOCK IN SHARE MODE"); ++ Ok(()) ++ } ++} ++ + #[allow(dead_code)] // Not really dead, Rust can't see it. + #[derive(Debug, Clone)] + pub struct OnDuplicateKeyUpdate( +diff --git a/syncstorage-mysql/src/models.rs b/syncstorage-mysql/src/models.rs +index 1114f21..fb54649 100644 +--- a/syncstorage-mysql/src/models.rs ++++ b/syncstorage-mysql/src/models.rs +@@ -25,6 +25,7 @@ use syncstorage_settings::{Quota, DEFAULT_MAX_TOTAL_RECORDS}; + + use super::{ + batch, ++ diesel_ext::LockInShareModeDsl, + error::DbError, + pool::{CollectionCache, Conn}, + schema::{bso, collections, user_collections}, +@@ -179,7 +180,7 @@ impl MysqlDb { + .select(user_collections::modified) + .filter(user_collections::user_id.eq(user_id)) + .filter(user_collections::collection_id.eq(collection_id)) +- .for_share() ++ .lock_in_share_mode() + .first(&mut *self.conn.write()?) + .optional()?; + if let Some(modified) = modified { diff --git a/gvisor-bin/.SRCINFO b/gvisor-bin/.SRCINFO new file mode 100644 index 0000000..0c0ac98 --- /dev/null +++ b/gvisor-bin/.SRCINFO @@ -0,0 +1,21 @@ +pkgbase = gvisor-bin + pkgdesc = OCI container sandbox runtime focused on security, efficiency, and ease of use + pkgver = 20251103.0 + pkgrel = 1 + url = https://gvisor.dev + arch = x86_64 + arch = aarch64 + license = Apache-2.0 + optdepends = docker: for Docker runtime support + provides = gvisor + conflicts = gvisor + source_x86_64 = runsc-x86_64-20251103.0::https://storage.googleapis.com/gvisor/releases/release/20251103.0/x86_64/runsc + source_x86_64 = containerd-shim-runsc-v1-x86_64-20251103.0::https://storage.googleapis.com/gvisor/releases/release/20251103.0/x86_64/containerd-shim-runsc-v1 + sha512sums_x86_64 = 01a465bb5bb37d3c6343a33420b6badfe6e5d8a5ff522f1fb2c183a6e24559cc660373137adc8f5a8c8c362c573a2d01ef6936e126c74c810b16bf9bd19bfd04 + sha512sums_x86_64 = 56a27dab74191db97f888c936b53861248851a2579d838073f528db7cb9353da5a919a27a38a48447b0a81bd42ab92873c480be769a9818a464ba9cf27872581 + source_aarch64 = runsc-aarch64-20251103.0::https://storage.googleapis.com/gvisor/releases/release/20251103.0/aarch64/runsc + source_aarch64 = containerd-shim-runsc-v1-aarch64-20251103.0::https://storage.googleapis.com/gvisor/releases/release/20251103.0/aarch64/containerd-shim-runsc-v1 + sha512sums_aarch64 = a124f892b6f937ff88f9833cba78bc22d2cf869a205e20694374cbad575c9c9dd501cd4b8897aa4338622b6171d7cf4ce8d5a9b3b259c60450a6ade5b3fbc4f5 + sha512sums_aarch64 = 8f2b16ad59e9ffdafd1218851cba9d007d4ffb15c5ec2003e0c691eb048935a82f9e8b578c051b05738e3b4e1f141ed893c73415313ec639f348fe989659b893 + +pkgname = gvisor-bin diff --git a/gvisor-bin/.gitignore b/gvisor-bin/.gitignore new file mode 100644 index 0000000..24cb63c --- /dev/null +++ b/gvisor-bin/.gitignore @@ -0,0 +1,2 @@ +/runsc-* +/containerd-shim-runsc-v1-* diff --git a/gvisor-bin/PKGBUILD b/gvisor-bin/PKGBUILD new file mode 100644 index 0000000..54251cd --- /dev/null +++ b/gvisor-bin/PKGBUILD @@ -0,0 +1,36 @@ +# Maintainer: Manuel Hüsers +# Contributor: Brad Erhart + +pkgname='gvisor-bin' +_pkgbin='runsc' +_pkgshim='containerd-shim-runsc-v1' +pkgver=20251103.0 +pkgrel=1 +pkgdesc='OCI container sandbox runtime focused on security, efficiency, and ease of use' +arch=('x86_64' 'aarch64') +url='https://gvisor.dev' +license=('Apache-2.0') +optdepends=('docker: for Docker runtime support') +provides=( + "${pkgname%-bin}" +) +conflicts=( + "${pkgname%-bin}" +) +source_x86_64=( + "$_pkgbin-x86_64-$pkgver::https://storage.googleapis.com/${pkgname%-bin}/releases/release/$pkgver/x86_64/$_pkgbin" + "$_pkgshim-x86_64-$pkgver::https://storage.googleapis.com/${pkgname%-bin}/releases/release/$pkgver/x86_64/$_pkgshim" +) +source_aarch64=( + "$_pkgbin-aarch64-$pkgver::https://storage.googleapis.com/${pkgname%-bin}/releases/release/$pkgver/aarch64/$_pkgbin" + "$_pkgshim-aarch64-$pkgver::https://storage.googleapis.com/${pkgname%-bin}/releases/release/$pkgver/aarch64/$_pkgshim" +) +sha512sums_x86_64=('01a465bb5bb37d3c6343a33420b6badfe6e5d8a5ff522f1fb2c183a6e24559cc660373137adc8f5a8c8c362c573a2d01ef6936e126c74c810b16bf9bd19bfd04' + '56a27dab74191db97f888c936b53861248851a2579d838073f528db7cb9353da5a919a27a38a48447b0a81bd42ab92873c480be769a9818a464ba9cf27872581') +sha512sums_aarch64=('a124f892b6f937ff88f9833cba78bc22d2cf869a205e20694374cbad575c9c9dd501cd4b8897aa4338622b6171d7cf4ce8d5a9b3b259c60450a6ade5b3fbc4f5' + '8f2b16ad59e9ffdafd1218851cba9d007d4ffb15c5ec2003e0c691eb048935a82f9e8b578c051b05738e3b4e1f141ed893c73415313ec639f348fe989659b893') + +package() { + install -Dm 755 "$_pkgbin-$CARCH-$pkgver" "$pkgdir/usr/bin/$_pkgbin" + install -Dm 755 "$_pkgshim-$CARCH-$pkgver" "$pkgdir/usr/bin/$_pkgshim" +} diff --git a/gvisor-git/.SRCINFO b/gvisor-git/.SRCINFO new file mode 100644 index 0000000..247116d --- /dev/null +++ b/gvisor-git/.SRCINFO @@ -0,0 +1,17 @@ +pkgbase = gvisor-git + pkgdesc = OCI container sandbox runtime focused on security, efficiency, and ease of use + pkgver = 20251103.0 + pkgrel = 1 + url = https://gvisor.dev + arch = x86_64 + arch = aarch64 + license = Apache-2.0 + makedepends = git + makedepends = go + optdepends = docker: for Docker runtime support + provides = gvisor + conflicts = gvisor + source = git+https://github.com/google/gvisor#branch=go + sha512sums = SKIP + +pkgname = gvisor-git diff --git a/gvisor-git/PKGBUILD b/gvisor-git/PKGBUILD new file mode 100644 index 0000000..fb80a5c --- /dev/null +++ b/gvisor-git/PKGBUILD @@ -0,0 +1,45 @@ +# Maintainer: Manuel Hüsers +# Contributor: Vincent Kobel (v@kobl.one) + +pkgname='gvisor-git' +_pkgbin='runsc' +_pkgshim='containerd-shim-runsc-v1' +pkgver=20251103.0 +pkgrel=1 +pkgdesc='OCI container sandbox runtime focused on security, efficiency, and ease of use' +arch=('x86_64' 'aarch64') +url='https://gvisor.dev' +license=('Apache-2.0') +makedepends=('git' 'go') +optdepends=('docker: for Docker runtime support') +provides=( + "${pkgname%-git}" +) +conflicts=( + "${pkgname%-git}" +) +source=("git+https://github.com/google/${pkgname%-git}#branch=go") +sha512sums=('SKIP') + +pkgver() { + cd "${pkgname%-git}" + git describe --long --tags | sed 's/\([^-]*-g\)/r\1/;s/release-//g;s/-/./g' +} + +build() { + cd "${pkgname%-git}" + export CGO_CPPFLAGS="${CPPFLAGS}" + export CGO_CFLAGS="${CFLAGS}" + export CGO_CXXFLAGS="${CXXFLAGS}" + export CGO_LDFLAGS="${LDFLAGS}" + export GOPATH="${srcdir}" + export GOFLAGS="-buildmode=pie -trimpath -mod=readonly -modcacherw" + go build -v -o "bin/$_pkgbin" -ldflags "-linkmode=external -compressdwarf=false -X gvisor.dev/gvisor/runsc/version.version=${pkgver}" gvisor.dev/gvisor/runsc + go build -v -o "bin/$_pkgshim" -ldflags "-linkmode=external -compressdwarf=false" gvisor.dev/gvisor/shim +} + +package() { + cd "${pkgname%-git}" + install -Dm 755 "bin/$_pkgbin" "$pkgdir/usr/bin/$_pkgbin" + install -Dm 755 "bin/$_pkgshim" "$pkgdir/usr/bin/$_pkgshim" +} diff --git a/lib32-amdvlk-2023q3.3/.SRCINFO b/lib32-amdvlk-2023q3.3/.SRCINFO new file mode 100644 index 0000000..19d9de7 --- /dev/null +++ b/lib32-amdvlk-2023q3.3/.SRCINFO @@ -0,0 +1,28 @@ +pkgbase = lib32-amdvlk-2023q3.3 + pkgdesc = AMD's standalone Vulkan driver for Pre-GFX10 GPUs (Vega, Polaris) + pkgver = 2023.Q3.3 + pkgrel = 2 + url = https://github.com/GPUOpen-Drivers + arch = x86_64 + license = MIT + makedepends = perl-xml-xpath + makedepends = python + makedepends = lib32-wayland + makedepends = lib32-libxrandr + makedepends = xorg-server-devel + makedepends = cmake + makedepends = ninja + makedepends = git + depends = lib32-zstd + provides = lib32-amdvlk + provides = lib32-vulkan-driver + conflicts = lib32-amdvlk + options = !lto + source = https://github.com/GPUOpen-Drivers/AMDVLK/archive/v-2023.Q3.3.tar.gz + sha512sums = 19e799030daee33d516f1276e08cd598a8ea7f8341b3955bda31b8576459486dbd3401d33670bfabb1872341025716e9610a8e9c4072a07a206eac90bd0f6ace + +pkgname = lib32-amdvlk-2023q3.3 + depends = lib32-glibc + depends = lib32-gcc-libs + depends = lib32-zlib + depends = lib32-zstd diff --git a/lib32-amdvlk-2023q3.3/PKGBUILD b/lib32-amdvlk-2023q3.3/PKGBUILD new file mode 100644 index 0000000..7797596 --- /dev/null +++ b/lib32-amdvlk-2023q3.3/PKGBUILD @@ -0,0 +1,72 @@ +# Maintainer: Manuel Hüsers +# Contributor: Laurent Carlier +# Contributor: lod + +pkgname=lib32-amdvlk-2023q3.3 +_pkgname=lib32-amdvlk +pkgver=2023.Q3.3 +pkgrel=2 +pkgdesc="AMD's standalone Vulkan driver for Pre-GFX10 GPUs (Vega, Polaris)" +arch=('x86_64') +url="https://github.com/GPUOpen-Drivers" +license=('MIT') +provides=("${_pkgname}" 'lib32-vulkan-driver') +conflicts=("${_pkgname}") +depends=('lib32-zstd') +makedepends=('perl-xml-xpath' 'python' 'lib32-wayland' 'lib32-libxrandr' 'xorg-server-devel' 'cmake' 'ninja' 'git') +options=('!lto') +source=("https://github.com/GPUOpen-Drivers/AMDVLK/archive/v-${pkgver}.tar.gz") +sha512sums=('19e799030daee33d516f1276e08cd598a8ea7f8341b3955bda31b8576459486dbd3401d33670bfabb1872341025716e9610a8e9c4072a07a206eac90bd0f6ace') + +prepare() { + local nrepos path name revision + + nrepos=$(xpath -q -e //project AMDVLK-v-${pkgver}/default.xml | wc -l) + + while (($nrepos>0)) + do + path=$(xpath -q -e //project[$nrepos]/@path AMDVLK-v-${pkgver}/default.xml | sed 's/ path="drivers\/\(.*\)"/\1/g') + name=$(xpath -q -e //project[$nrepos]/@name AMDVLK-v-${pkgver}/default.xml | sed 's/ name="\(.*\)"/\1/g') + revision=$(xpath -q -e //project[$nrepos]/@revision AMDVLK-v-${pkgver}/default.xml | sed 's/ revision="\(.*\)"/\1/g') + git clone --recurse-submodules https://github.com/GPUOpen-Drivers/$name $path + pushd $path + git checkout $revision + git submodule update + popd + (( nrepos-- )) + done +} + +build() { + export PKG_CONFIG_PATH="/usr/lib32/pkgconfig" + + cd ${srcdir}/xgl + cmake -H. -Bbuilds/Release \ + -DCMAKE_BUILD_TYPE=Release \ + -DCMAKE_C_FLAGS=-m32 \ + -DCMAKE_CXX_FLAGS=-m32 \ + -DLLVM_TARGET_ARCH:STRING=i686 \ + -DLLVM_DEFAULT_TARGET_TRIPLE="i686-pc-linux-gnu" \ + -DBUILD_WAYLAND_SUPPORT=On \ + -DVKI_RAY_TRACING=Off \ + -G Ninja + + ninja -C builds/Release +} + +package() { + depends=('lib32-glibc' 'lib32-gcc-libs' 'lib32-zlib' 'lib32-zstd') + + install -m755 -d "${pkgdir}"/usr/lib32 + install -m755 -d "${pkgdir}"/usr/share/vulkan/icd.d + install -m755 -d "${pkgdir}"/usr/share/vulkan/implicit_layer.d + install -m755 -d "${pkgdir}"/usr/share/licenses/${_pkgname} + + install xgl/builds/Release/icd/amdvlk32.so "${pkgdir}"/usr/lib32/ + install xgl/builds/Release/icd/amd_icd32.json "${pkgdir}"/usr/share/vulkan/icd.d/ + install xgl/builds/Release/icd/amd_icd32.json "${pkgdir}"/usr/share/vulkan/implicit_layer.d/ + install AMDVLK-v-${pkgver}/LICENSE.txt "${pkgdir}"/usr/share/licenses/${_pkgname}/ + + sed -i "s/\/lib/\/lib32/g" "${pkgdir}"/usr/share/vulkan/icd.d/amd_icd32.json + sed -i "s/\/lib/\/lib32/g" "${pkgdir}"/usr/share/vulkan/implicit_layer.d/amd_icd32.json +} diff --git a/libqxt/.SRCINFO b/libqxt/.SRCINFO new file mode 100644 index 0000000..3ce1d51 --- /dev/null +++ b/libqxt/.SRCINFO @@ -0,0 +1,27 @@ +pkgbase = libqxt + pkgdesc = Provides a suite of cross-platform utility classes to add functionality not readily available in the Qt toolkit + pkgver = 0.6.2 + pkgrel = 5 + url = http://www.libqxt.org + arch = i686 + arch = x86_64 + license = CPL-1.0 OR LGPL-2.1-only + makedepends = avahi + makedepends = libxrandr + depends = qt4 + depends = openssl + depends = db + optdepends = avahi: Zeroconf support + options = !emptydirs + source = http://bitbucket.org/libqxt/libqxt/get/v0.6.2.tar.bz2 + source = libqxt-linking.patch + source = libqxt-media-keys.patch + source = libqxt-header-fix.patch + source = libqxt-gcc6.patch + sha512sums = 13bc6d33694b43b07a1f40c27641389e21c5b172d75ee2f5cca1b818dc6c89e5f7d458cc6085b00079ae0b6dc63bca20fb2522125d293845e24612124e8d2592 + sha512sums = 6694fdea69fb0a84f4e8fc48c004f75599689624ca3a2b4cb60dd30115c8a2e3cd4e54a5a4e105050888d390610671f2e6087603135ccee9b899d1df24e982b9 + sha512sums = 35c5374d86f5a16a2e1bf002a4e02e2f33aa819db0ec568a73822daf5174a23b6496d96977ca319b0c3d2f312f2e31d75cd6b9983a87c8cd1b20520d20d504a3 + sha512sums = 01497cccc20ae7c39209cdb37260267e756d8e7bb276685019001f4288bff900b2aed0dcfefd5e2afdf411258bec078c4c0803a99eb218ceb230eed5f54ce958 + sha512sums = 0f508074218c50aa004896038b6834b98a7a9a5f790b21db673d5c71536f7598be86fae0c0b674dc428fb102d987bedd752c6f5689b8062b9581cb92615f48c0 + +pkgname = libqxt diff --git a/libqxt/PKGBUILD b/libqxt/PKGBUILD new file mode 100644 index 0000000..903caca --- /dev/null +++ b/libqxt/PKGBUILD @@ -0,0 +1,50 @@ +# Maintainer: Manuel Hüsers +# Contributor: (epsilom) Xavier Corredor +# Contributor: Roberto Alsina +# Contributor: Tim Besard + +pkgname=libqxt +pkgver=0.6.2 +pkgrel=5 +_pkgsuffix=dadc327c2a6a +pkgdesc='Provides a suite of cross-platform utility classes to add functionality not readily available in the Qt toolkit' +arch=('i686' 'x86_64') +url='http://www.libqxt.org' +license=('CPL-1.0 OR LGPL-2.1-only') +depends=('qt4' 'openssl' 'db') +makedepends=('avahi' 'libxrandr') +optdepends=('avahi: Zeroconf support') +options=('!emptydirs') +source=("http://bitbucket.org/${pkgname}/${pkgname}/get/v${pkgver}.tar.bz2" + 'libqxt-linking.patch' + 'libqxt-media-keys.patch' + 'libqxt-header-fix.patch' + 'libqxt-gcc6.patch') +sha512sums=('13bc6d33694b43b07a1f40c27641389e21c5b172d75ee2f5cca1b818dc6c89e5f7d458cc6085b00079ae0b6dc63bca20fb2522125d293845e24612124e8d2592' + '6694fdea69fb0a84f4e8fc48c004f75599689624ca3a2b4cb60dd30115c8a2e3cd4e54a5a4e105050888d390610671f2e6087603135ccee9b899d1df24e982b9' + '35c5374d86f5a16a2e1bf002a4e02e2f33aa819db0ec568a73822daf5174a23b6496d96977ca319b0c3d2f312f2e31d75cd6b9983a87c8cd1b20520d20d504a3' + '01497cccc20ae7c39209cdb37260267e756d8e7bb276685019001f4288bff900b2aed0dcfefd5e2afdf411258bec078c4c0803a99eb218ceb230eed5f54ce958' + '0f508074218c50aa004896038b6834b98a7a9a5f790b21db673d5c71536f7598be86fae0c0b674dc428fb102d987bedd752c6f5689b8062b9581cb92615f48c0') + +prepare() { + cd "${srcdir}/${pkgname}-${pkgname}-${_pkgsuffix}" + patch -p1 -i '../libqxt-linking.patch' + patch -p1 -i '../libqxt-media-keys.patch' + patch -p1 -i '../libqxt-header-fix.patch' + patch -p1 -i '../libqxt-gcc6.patch' +} + +build() { + cd "${srcdir}/${pkgname}-${pkgname}-${_pkgsuffix}" + ./configure -qmake-bin '/usr/bin/qmake-qt4' \ + -prefix '/usr' \ + -libdir '/usr/lib' \ + -docdir '/usr/share/doc' + make + #make docs +} + +package() { + cd "${srcdir}/${pkgname}-${pkgname}-${_pkgsuffix}" + make INSTALL_ROOT="${pkgdir}" install +} diff --git a/libqxt/libqxt-gcc6.patch b/libqxt/libqxt-gcc6.patch new file mode 100644 index 0000000..519646d --- /dev/null +++ b/libqxt/libqxt-gcc6.patch @@ -0,0 +1,11 @@ +--- a/src/core/qxtslotjob.cpp 2011-11-24 16:10:32.000000000 -0600 ++++ b/src/core/qxtslotjob.cpp 2016-03-07 16:20:32.758268253 -0600 +@@ -174,7 +174,7 @@ This uses QxtSignalWaiter so it will _no + + QVariant QxtFuture::delayedResult(int msec) + { +- if (!waiter->wait(msec, false)) ++ if (!waiter->wait(msec, NULL)) + return QVariant(); + return job->result(); + } diff --git a/libqxt/libqxt-header-fix.patch b/libqxt/libqxt-header-fix.patch new file mode 100644 index 0000000..78809f2 --- /dev/null +++ b/libqxt/libqxt-header-fix.patch @@ -0,0 +1,19 @@ +diff -rupN libqxt.old/src/network/qxtnetwork.h libqxt/src/network/qxtnetwork.h +--- libqxt.old/src/network/qxtnetwork.h 2010-11-07 09:18:41.000000000 -0500 ++++ libqxt/src/network/qxtnetwork.h 2011-08-25 19:18:47.000000000 -0400 +@@ -26,13 +26,13 @@ + #define QXTNETWORK_H_INCLUDED + + #include "qxtjsonrpcclient.h" +-#include "qxtjsonrpcresponse.h" ++#include "qxtjsonrpccall.h" + #include "qxtmailmessage.h" + #include "qxtmailattachment.h" + #include "qxtsmtp.h" + #include "qxtrpcpeer.h" + #include "qxttcpconnectionmanager.h" + #include "qxtxmlrpcclient.h" +-#include "qxtxmlrpcresponse.h" ++#include "qxtxmlrpccall.h" + + #endif // QXTNETWORK_H_INCLUDED diff --git a/libqxt/libqxt-linking.patch b/libqxt/libqxt-linking.patch new file mode 100644 index 0000000..f8aef09 --- /dev/null +++ b/libqxt/libqxt-linking.patch @@ -0,0 +1,8 @@ +diff -rupN libqxt.old/config.tests/xrandr/xrandr.pro libqxt/config.tests/xrandr/xrandr.pro +--- libqxt.old/config.tests/xrandr/xrandr.pro 2010-11-07 09:18:41.000000000 -0500 ++++ libqxt/config.tests/xrandr/xrandr.pro 2010-11-25 05:28:29.000000000 -0500 +@@ -5,3 +5,4 @@ DEPENDPATH += . + INCLUDEPATH += . + SOURCES += main.cpp + !win32:LIBS+=-lXrandr ++LIBS+=-lX11 diff --git a/libqxt/libqxt-media-keys.patch b/libqxt/libqxt-media-keys.patch new file mode 100644 index 0000000..a2f39b1 --- /dev/null +++ b/libqxt/libqxt-media-keys.patch @@ -0,0 +1,407 @@ +diff -rupN libqxt.old/src/gui/keymapper_x11.h libqxt/src/gui/keymapper_x11.h +--- libqxt.old/src/gui/keymapper_x11.h 1969-12-31 19:00:00.000000000 -0500 ++++ libqxt/src/gui/keymapper_x11.h 2010-07-18 15:37:16.000000000 -0400 +@@ -0,0 +1,364 @@ ++#ifndef KEYMAPPER_X11_H ++#define KEYMAPPER_X11_H ++ ++// (davidsansome) Nicked from qkeymapper_x11.cpp ++ ++#include ++ ++#define XK_MISCELLANY ++#define XK_LATIN1 ++#define XK_KOREAN ++#define XK_XKB_KEYS ++#include ++ ++// ++// Keyboard event translation ++// ++ ++#ifndef XK_ISO_Left_Tab ++#define XK_ISO_Left_Tab 0xFE20 ++#endif ++ ++#ifndef XK_dead_hook ++#define XK_dead_hook 0xFE61 ++#endif ++ ++#ifndef XK_dead_horn ++#define XK_dead_horn 0xFE62 ++#endif ++ ++#ifndef XK_Codeinput ++#define XK_Codeinput 0xFF37 ++#endif ++ ++#ifndef XK_Kanji_Bangou ++#define XK_Kanji_Bangou 0xFF37 /* same as codeinput */ ++#endif ++ ++// Fix old X libraries ++#ifndef XK_KP_Home ++#define XK_KP_Home 0xFF95 ++#endif ++#ifndef XK_KP_Left ++#define XK_KP_Left 0xFF96 ++#endif ++#ifndef XK_KP_Up ++#define XK_KP_Up 0xFF97 ++#endif ++#ifndef XK_KP_Right ++#define XK_KP_Right 0xFF98 ++#endif ++#ifndef XK_KP_Down ++#define XK_KP_Down 0xFF99 ++#endif ++#ifndef XK_KP_Prior ++#define XK_KP_Prior 0xFF9A ++#endif ++#ifndef XK_KP_Next ++#define XK_KP_Next 0xFF9B ++#endif ++#ifndef XK_KP_End ++#define XK_KP_End 0xFF9C ++#endif ++#ifndef XK_KP_Insert ++#define XK_KP_Insert 0xFF9E ++#endif ++#ifndef XK_KP_Delete ++#define XK_KP_Delete 0xFF9F ++#endif ++ ++// the next lines are taken from XFree > 4.0 (X11/XF86keysyms.h), defining some special ++// multimedia keys. They are included here as not every system has them. ++#define XF86XK_Standby 0x1008FF10 ++#define XF86XK_AudioLowerVolume 0x1008FF11 ++#define XF86XK_AudioMute 0x1008FF12 ++#define XF86XK_AudioRaiseVolume 0x1008FF13 ++#define XF86XK_AudioPlay 0x1008FF14 ++#define XF86XK_AudioStop 0x1008FF15 ++#define XF86XK_AudioPrev 0x1008FF16 ++#define XF86XK_AudioNext 0x1008FF17 ++#define XF86XK_HomePage 0x1008FF18 ++#define XF86XK_Calculator 0x1008FF1D ++#define XF86XK_Mail 0x1008FF19 ++#define XF86XK_Start 0x1008FF1A ++#define XF86XK_Search 0x1008FF1B ++#define XF86XK_AudioRecord 0x1008FF1C ++#define XF86XK_Back 0x1008FF26 ++#define XF86XK_Forward 0x1008FF27 ++#define XF86XK_Stop 0x1008FF28 ++#define XF86XK_Refresh 0x1008FF29 ++#define XF86XK_Favorites 0x1008FF30 ++#define XF86XK_AudioPause 0x1008FF31 ++#define XF86XK_AudioMedia 0x1008FF32 ++#define XF86XK_MyComputer 0x1008FF33 ++#define XF86XK_OpenURL 0x1008FF38 ++#define XF86XK_Launch0 0x1008FF40 ++#define XF86XK_Launch1 0x1008FF41 ++#define XF86XK_Launch2 0x1008FF42 ++#define XF86XK_Launch3 0x1008FF43 ++#define XF86XK_Launch4 0x1008FF44 ++#define XF86XK_Launch5 0x1008FF45 ++#define XF86XK_Launch6 0x1008FF46 ++#define XF86XK_Launch7 0x1008FF47 ++#define XF86XK_Launch8 0x1008FF48 ++#define XF86XK_Launch9 0x1008FF49 ++#define XF86XK_LaunchA 0x1008FF4A ++#define XF86XK_LaunchB 0x1008FF4B ++#define XF86XK_LaunchC 0x1008FF4C ++#define XF86XK_LaunchD 0x1008FF4D ++#define XF86XK_LaunchE 0x1008FF4E ++#define XF86XK_LaunchF 0x1008FF4F ++// end of XF86keysyms.h ++ ++// Special keys used by Qtopia, mapped into the X11 private keypad range. ++#define QTOPIAXK_Select 0x11000601 ++#define QTOPIAXK_Yes 0x11000602 ++#define QTOPIAXK_No 0x11000603 ++#define QTOPIAXK_Cancel 0x11000604 ++#define QTOPIAXK_Printer 0x11000605 ++#define QTOPIAXK_Execute 0x11000606 ++#define QTOPIAXK_Sleep 0x11000607 ++#define QTOPIAXK_Play 0x11000608 ++#define QTOPIAXK_Zoom 0x11000609 ++#define QTOPIAXK_Context1 0x1100060A ++#define QTOPIAXK_Context2 0x1100060B ++#define QTOPIAXK_Context3 0x1100060C ++#define QTOPIAXK_Context4 0x1100060D ++#define QTOPIAXK_Call 0x1100060E ++#define QTOPIAXK_Hangup 0x1100060F ++#define QTOPIAXK_Flip 0x11000610 ++ ++// keyboard mapping table ++static const unsigned int KeyTbl[] = { ++ ++ // misc keys ++ ++ XK_Escape, Qt::Key_Escape, ++ XK_Tab, Qt::Key_Tab, ++ XK_ISO_Left_Tab, Qt::Key_Backtab, ++ XK_BackSpace, Qt::Key_Backspace, ++ XK_Return, Qt::Key_Return, ++ XK_Insert, Qt::Key_Insert, ++ XK_Delete, Qt::Key_Delete, ++ XK_Clear, Qt::Key_Delete, ++ XK_Pause, Qt::Key_Pause, ++ XK_Print, Qt::Key_Print, ++ 0x1005FF60, Qt::Key_SysReq, // hardcoded Sun SysReq ++ 0x1007ff00, Qt::Key_SysReq, // hardcoded X386 SysReq ++ ++ // cursor movement ++ ++ XK_Home, Qt::Key_Home, ++ XK_End, Qt::Key_End, ++ XK_Left, Qt::Key_Left, ++ XK_Up, Qt::Key_Up, ++ XK_Right, Qt::Key_Right, ++ XK_Down, Qt::Key_Down, ++ XK_Prior, Qt::Key_PageUp, ++ XK_Next, Qt::Key_PageDown, ++ ++ // modifiers ++ ++ XK_Shift_L, Qt::Key_Shift, ++ XK_Shift_R, Qt::Key_Shift, ++ XK_Shift_Lock, Qt::Key_Shift, ++ XK_Control_L, Qt::Key_Control, ++ XK_Control_R, Qt::Key_Control, ++ XK_Meta_L, Qt::Key_Meta, ++ XK_Meta_R, Qt::Key_Meta, ++ XK_Alt_L, Qt::Key_Alt, ++ XK_Alt_R, Qt::Key_Alt, ++ XK_Caps_Lock, Qt::Key_CapsLock, ++ XK_Num_Lock, Qt::Key_NumLock, ++ XK_Scroll_Lock, Qt::Key_ScrollLock, ++ XK_Super_L, Qt::Key_Super_L, ++ XK_Super_R, Qt::Key_Super_R, ++ XK_Menu, Qt::Key_Menu, ++ XK_Hyper_L, Qt::Key_Hyper_L, ++ XK_Hyper_R, Qt::Key_Hyper_R, ++ XK_Help, Qt::Key_Help, ++ 0x1000FF74, Qt::Key_Backtab, // hardcoded HP backtab ++ 0x1005FF10, Qt::Key_F11, // hardcoded Sun F36 (labeled F11) ++ 0x1005FF11, Qt::Key_F12, // hardcoded Sun F37 (labeled F12) ++ ++ // numeric and function keypad keys ++ ++ XK_KP_Space, Qt::Key_Space, ++ XK_KP_Tab, Qt::Key_Tab, ++ XK_KP_Enter, Qt::Key_Enter, ++ //XK_KP_F1, Qt::Key_F1, ++ //XK_KP_F2, Qt::Key_F2, ++ //XK_KP_F3, Qt::Key_F3, ++ //XK_KP_F4, Qt::Key_F4, ++ XK_KP_Home, Qt::Key_Home, ++ XK_KP_Left, Qt::Key_Left, ++ XK_KP_Up, Qt::Key_Up, ++ XK_KP_Right, Qt::Key_Right, ++ XK_KP_Down, Qt::Key_Down, ++ XK_KP_Prior, Qt::Key_PageUp, ++ XK_KP_Next, Qt::Key_PageDown, ++ XK_KP_End, Qt::Key_End, ++ XK_KP_Begin, Qt::Key_Clear, ++ XK_KP_Insert, Qt::Key_Insert, ++ XK_KP_Delete, Qt::Key_Delete, ++ XK_KP_Equal, Qt::Key_Equal, ++ XK_KP_Multiply, Qt::Key_Asterisk, ++ XK_KP_Add, Qt::Key_Plus, ++ XK_KP_Separator, Qt::Key_Comma, ++ XK_KP_Subtract, Qt::Key_Minus, ++ XK_KP_Decimal, Qt::Key_Period, ++ XK_KP_Divide, Qt::Key_Slash, ++ ++ // International input method support keys ++ ++ // International & multi-key character composition ++ XK_ISO_Level3_Shift, Qt::Key_AltGr, ++ XK_Multi_key, Qt::Key_Multi_key, ++ XK_Codeinput, Qt::Key_Codeinput, ++ XK_SingleCandidate, Qt::Key_SingleCandidate, ++ XK_MultipleCandidate, Qt::Key_MultipleCandidate, ++ XK_PreviousCandidate, Qt::Key_PreviousCandidate, ++ ++ // Misc Functions ++ XK_Mode_switch, Qt::Key_Mode_switch, ++ XK_script_switch, Qt::Key_Mode_switch, ++ ++ // Japanese keyboard support ++ XK_Kanji, Qt::Key_Kanji, ++ XK_Muhenkan, Qt::Key_Muhenkan, ++ //XK_Henkan_Mode, Qt::Key_Henkan_Mode, ++ XK_Henkan_Mode, Qt::Key_Henkan, ++ XK_Henkan, Qt::Key_Henkan, ++ XK_Romaji, Qt::Key_Romaji, ++ XK_Hiragana, Qt::Key_Hiragana, ++ XK_Katakana, Qt::Key_Katakana, ++ XK_Hiragana_Katakana, Qt::Key_Hiragana_Katakana, ++ XK_Zenkaku, Qt::Key_Zenkaku, ++ XK_Hankaku, Qt::Key_Hankaku, ++ XK_Zenkaku_Hankaku, Qt::Key_Zenkaku_Hankaku, ++ XK_Touroku, Qt::Key_Touroku, ++ XK_Massyo, Qt::Key_Massyo, ++ XK_Kana_Lock, Qt::Key_Kana_Lock, ++ XK_Kana_Shift, Qt::Key_Kana_Shift, ++ XK_Eisu_Shift, Qt::Key_Eisu_Shift, ++ XK_Eisu_toggle, Qt::Key_Eisu_toggle, ++ //XK_Kanji_Bangou, Qt::Key_Kanji_Bangou, ++ //XK_Zen_Koho, Qt::Key_Zen_Koho, ++ //XK_Mae_Koho, Qt::Key_Mae_Koho, ++ XK_Kanji_Bangou, Qt::Key_Codeinput, ++ XK_Zen_Koho, Qt::Key_MultipleCandidate, ++ XK_Mae_Koho, Qt::Key_PreviousCandidate, ++ ++#ifdef XK_KOREAN ++ // Korean keyboard support ++ XK_Hangul, Qt::Key_Hangul, ++ XK_Hangul_Start, Qt::Key_Hangul_Start, ++ XK_Hangul_End, Qt::Key_Hangul_End, ++ XK_Hangul_Hanja, Qt::Key_Hangul_Hanja, ++ XK_Hangul_Jamo, Qt::Key_Hangul_Jamo, ++ XK_Hangul_Romaja, Qt::Key_Hangul_Romaja, ++ //XK_Hangul_Codeinput, Qt::Key_Hangul_Codeinput, ++ XK_Hangul_Codeinput, Qt::Key_Codeinput, ++ XK_Hangul_Jeonja, Qt::Key_Hangul_Jeonja, ++ XK_Hangul_Banja, Qt::Key_Hangul_Banja, ++ XK_Hangul_PreHanja, Qt::Key_Hangul_PreHanja, ++ XK_Hangul_PostHanja, Qt::Key_Hangul_PostHanja, ++ //XK_Hangul_SingleCandidate,Qt::Key_Hangul_SingleCandidate, ++ //XK_Hangul_MultipleCandidate,Qt::Key_Hangul_MultipleCandidate, ++ //XK_Hangul_PreviousCandidate,Qt::Key_Hangul_PreviousCandidate, ++ XK_Hangul_SingleCandidate, Qt::Key_SingleCandidate, ++ XK_Hangul_MultipleCandidate,Qt::Key_MultipleCandidate, ++ XK_Hangul_PreviousCandidate,Qt::Key_PreviousCandidate, ++ XK_Hangul_Special, Qt::Key_Hangul_Special, ++ //XK_Hangul_switch, Qt::Key_Hangul_switch, ++ XK_Hangul_switch, Qt::Key_Mode_switch, ++#endif // XK_KOREAN ++ ++ // dead keys ++ XK_dead_grave, Qt::Key_Dead_Grave, ++ XK_dead_acute, Qt::Key_Dead_Acute, ++ XK_dead_circumflex, Qt::Key_Dead_Circumflex, ++ XK_dead_tilde, Qt::Key_Dead_Tilde, ++ XK_dead_macron, Qt::Key_Dead_Macron, ++ XK_dead_breve, Qt::Key_Dead_Breve, ++ XK_dead_abovedot, Qt::Key_Dead_Abovedot, ++ XK_dead_diaeresis, Qt::Key_Dead_Diaeresis, ++ XK_dead_abovering, Qt::Key_Dead_Abovering, ++ XK_dead_doubleacute, Qt::Key_Dead_Doubleacute, ++ XK_dead_caron, Qt::Key_Dead_Caron, ++ XK_dead_cedilla, Qt::Key_Dead_Cedilla, ++ XK_dead_ogonek, Qt::Key_Dead_Ogonek, ++ XK_dead_iota, Qt::Key_Dead_Iota, ++ XK_dead_voiced_sound, Qt::Key_Dead_Voiced_Sound, ++ XK_dead_semivoiced_sound, Qt::Key_Dead_Semivoiced_Sound, ++ XK_dead_belowdot, Qt::Key_Dead_Belowdot, ++ XK_dead_hook, Qt::Key_Dead_Hook, ++ XK_dead_horn, Qt::Key_Dead_Horn, ++ ++ // Special multimedia keys ++ // currently only tested with MS internet keyboard ++ ++ // browsing keys ++ XF86XK_Back, Qt::Key_Back, ++ XF86XK_Forward, Qt::Key_Forward, ++ XF86XK_Stop, Qt::Key_Stop, ++ XF86XK_Refresh, Qt::Key_Refresh, ++ XF86XK_Favorites, Qt::Key_Favorites, ++ XF86XK_AudioMedia, Qt::Key_LaunchMedia, ++ XF86XK_OpenURL, Qt::Key_OpenUrl, ++ XF86XK_HomePage, Qt::Key_HomePage, ++ XF86XK_Search, Qt::Key_Search, ++ ++ // media keys ++ XF86XK_AudioLowerVolume, Qt::Key_VolumeDown, ++ XF86XK_AudioMute, Qt::Key_VolumeMute, ++ XF86XK_AudioRaiseVolume, Qt::Key_VolumeUp, ++ XF86XK_AudioPlay, Qt::Key_MediaPlay, ++ XF86XK_AudioStop, Qt::Key_MediaStop, ++ XF86XK_AudioPrev, Qt::Key_MediaPrevious, ++ XF86XK_AudioNext, Qt::Key_MediaNext, ++ XF86XK_AudioRecord, Qt::Key_MediaRecord, ++ ++ // launch keys ++ XF86XK_Mail, Qt::Key_LaunchMail, ++ XF86XK_MyComputer, Qt::Key_Launch0, ++ XF86XK_Calculator, Qt::Key_Launch1, ++ XF86XK_Standby, Qt::Key_Standby, ++ ++ XF86XK_Launch0, Qt::Key_Launch2, ++ XF86XK_Launch1, Qt::Key_Launch3, ++ XF86XK_Launch2, Qt::Key_Launch4, ++ XF86XK_Launch3, Qt::Key_Launch5, ++ XF86XK_Launch4, Qt::Key_Launch6, ++ XF86XK_Launch5, Qt::Key_Launch7, ++ XF86XK_Launch6, Qt::Key_Launch8, ++ XF86XK_Launch7, Qt::Key_Launch9, ++ XF86XK_Launch8, Qt::Key_LaunchA, ++ XF86XK_Launch9, Qt::Key_LaunchB, ++ XF86XK_LaunchA, Qt::Key_LaunchC, ++ XF86XK_LaunchB, Qt::Key_LaunchD, ++ XF86XK_LaunchC, Qt::Key_LaunchE, ++ XF86XK_LaunchD, Qt::Key_LaunchF, ++ ++ // Qtopia keys ++ QTOPIAXK_Select, Qt::Key_Select, ++ QTOPIAXK_Yes, Qt::Key_Yes, ++ QTOPIAXK_No, Qt::Key_No, ++ QTOPIAXK_Cancel, Qt::Key_Cancel, ++ QTOPIAXK_Printer, Qt::Key_Printer, ++ QTOPIAXK_Execute, Qt::Key_Execute, ++ QTOPIAXK_Sleep, Qt::Key_Sleep, ++ QTOPIAXK_Play, Qt::Key_Play, ++ QTOPIAXK_Zoom, Qt::Key_Zoom, ++ QTOPIAXK_Context1, Qt::Key_Context1, ++ QTOPIAXK_Context2, Qt::Key_Context2, ++ QTOPIAXK_Context3, Qt::Key_Context3, ++ QTOPIAXK_Context4, Qt::Key_Context4, ++ QTOPIAXK_Call, Qt::Key_Call, ++ QTOPIAXK_Hangup, Qt::Key_Hangup, ++ QTOPIAXK_Flip, Qt::Key_Flip, ++ ++ 0, 0 ++}; ++ ++#endif // KEYMAPPER_X11_H +diff -rupN libqxt.old/src/gui/qxtglobalshortcut_x11.cpp libqxt/src/gui/qxtglobalshortcut_x11.cpp +--- libqxt.old/src/gui/qxtglobalshortcut_x11.cpp 2010-07-18 15:32:53.000000000 -0400 ++++ libqxt/src/gui/qxtglobalshortcut_x11.cpp 2010-07-18 15:41:25.000000000 -0400 +@@ -26,6 +26,8 @@ + #include + #include + ++#include "keymapper_x11.h" ++ + static int (*original_x_errhandler)(Display* display, XErrorEvent* event); + + static int qxt_x_errhandler(Display* display, XErrorEvent *event) +@@ -83,8 +85,25 @@ quint32 QxtGlobalShortcutPrivate::native + + quint32 QxtGlobalShortcutPrivate::nativeKeycode(Qt::Key key) + { ++ // (davidsansome) Try the table from QKeyMapper first - this seems to be ++ // the only way to get Keysyms for the media keys. ++ unsigned int keysym = 0; ++ int i = 0; ++ while (KeyTbl[i]) { ++ if (KeyTbl[i+1] == static_cast(key)) { ++ keysym = KeyTbl[i]; ++ break; ++ } ++ i += 2; ++ } ++ ++ // If that didn't work then fall back on XStringToKeysym ++ if (!keysym) { ++ keysym = XStringToKeysym(QKeySequence(key).toString().toLatin1().data()); ++ } ++ + Display* display = QX11Info::display(); +- return XKeysymToKeycode(display, XStringToKeysym(QKeySequence(key).toString().toLatin1().data())); ++ return XKeysymToKeycode(display, keysym); + } + + bool QxtGlobalShortcutPrivate::registerShortcut(quint32 nativeKey, quint32 nativeMods) diff --git a/linpack/.SRCINFO b/linpack/.SRCINFO new file mode 100644 index 0000000..a66a713 --- /dev/null +++ b/linpack/.SRCINFO @@ -0,0 +1,17 @@ +pkgbase = linpack + pkgdesc = Benchmark that measures a system's floating-point rate of execution by solving dense linear equations + pkgver = 2025.2.0 + pkgrel = 1 + url = https://software.intel.com/en-us/articles/intel-math-kernel-library-linpack-download + arch = x86_64 + license = LicenseRef-Intel-SmpL-2022 + options = !strip + backup = etc/linpack.conf + source = https://downloadmirror.intel.com/861559/l_onemklbench_p_2025.2.0_532.tgz + source = linpack.conf + source = linpack_runme_xeon64 + sha512sums = 299866be93c6ce3cc44841fa073485c16fd3d381e40023e14c52a539fbe7ce61bcc20704751bd242ff81f78f6b555fb88ae296bf98d974b3a85bac62b4d51faf + sha512sums = 69b049a3a1c0b674e471bc61e1f88f729db1dd454eb0bfc9adde7c3a4876bb396a91f57f19d5e1add906ee4282068d8cd0fa5f1a59bf8a96784846a3c9f63ab1 + sha512sums = 3e880d4e0af8154ac1d591177e08ceda28f5ff5fbf698e47f99de8621e37137ecf26024048bd0ee81fc7af73ca8ae0deeb0a309325970a701ac5f13b571bdb60 + +pkgname = linpack diff --git a/linpack/PKGBUILD b/linpack/PKGBUILD new file mode 100644 index 0000000..2605bbe --- /dev/null +++ b/linpack/PKGBUILD @@ -0,0 +1,31 @@ +# Maintainer: Manuel Hüsers +# Contributor: graysky + +pkgname='linpack' +_pkgver=2025.2.0_532 +_pkgid=861559 +pkgver=${_pkgver%%_*} +_math_kernel_lib=${pkgver%%.0} +pkgrel=1 +pkgdesc="Benchmark that measures a system's floating-point rate of execution by solving dense linear equations" +arch=('x86_64') +url='https://software.intel.com/en-us/articles/intel-math-kernel-library-linpack-download' +license=('LicenseRef-Intel-SmpL-2022') +backup=('etc/linpack.conf') +options=('!strip') +source=("https://downloadmirror.intel.com/${_pkgid}/l_onemklbench_p_${_pkgver}.tgz" + 'linpack.conf' + 'linpack_runme_xeon64') +sha512sums=('299866be93c6ce3cc44841fa073485c16fd3d381e40023e14c52a539fbe7ce61bcc20704751bd242ff81f78f6b555fb88ae296bf98d974b3a85bac62b4d51faf' + '69b049a3a1c0b674e471bc61e1f88f729db1dd454eb0bfc9adde7c3a4876bb396a91f57f19d5e1add906ee4282068d8cd0fa5f1a59bf8a96784846a3c9f63ab1' + '3e880d4e0af8154ac1d591177e08ceda28f5ff5fbf698e47f99de8621e37137ecf26024048bd0ee81fc7af73ca8ae0deeb0a309325970a701ac5f13b571bdb60') + +package() { + local _base="${srcdir}/benchmarks_${_math_kernel_lib}" + local _test="${_base}/linux/share/mkl/benchmarks/linpack" + + install -Dm755 linpack_runme_xeon64 "${pkgdir}/usr/bin/linpack_runme_xeon64" + install -Dm644 linpack.conf "${pkgdir}/usr/share/${pkgname}/linpack.conf" + install -Dm644 "${_base}/license.txt" "${pkgdir}/usr/share/licenses/linpack/license.txt" + install -Dm755 "${_test}/xlinpack_xeon64" "${pkgdir}/usr/bin/xlinpack_xeon64" +} diff --git a/linpack/linpack.conf b/linpack/linpack.conf new file mode 100644 index 0000000..e64a880 --- /dev/null +++ b/linpack/linpack.conf @@ -0,0 +1,22 @@ +Sample Intel(R) LINPACK data file +Intel(R) LINPACK data +1 # number of tests +12600 # problem sizes +12600 # leading dimensions +100 # times to run a test +4 # alignment values (in KBytes) + +# Change the problem sizes and leading dimensions to suite your FREE physical memory +# +# Memory use = 8 x (problem size)^2 +# or +# Problem size = sqrt (memory use / 8) +# +# Consider the following as a conservative guide +# For 1 GB use a problem size and leading dimensions of 6300 +# For 2 GB use a problem size and leading dimensions of 12600 +# For 4 GB use a problem size and leading dimensions of 18900 +# For 8 GB use a problem size and leading dimensions of 25200 +# For 16 GB use a problem size and leading dimensions of 31500 +# For 32 GB use a problem size and leading dimensions of 37800 +# For 64 GB use a problem size and leading dimensions of 44100 diff --git a/linpack/linpack_runme_xeon64 b/linpack/linpack_runme_xeon64 new file mode 100644 index 0000000..bb10793 --- /dev/null +++ b/linpack/linpack_runme_xeon64 @@ -0,0 +1,26 @@ +#!/usr/bin/env bash +# +export KMP_AFFINITY=nowarnings,compact + +SKEL_CONFIG="/usr/share/linpack" +CONFIG="$SKEL_CONFIG/linpack.conf" +XDG_CONFIG_HOME="${XDG_CONFIG_HOME:-$HOME/.config}" + +[[ -f "$SKEL_CONFIG/linpack.conf" ]] || { + echo "ERROR: Missing $SKEL_CONFIG/linpack.conf - reinstall this package." ; exit 1 ; } + +[[ -d $XDG_CONFIG_HOME ]] || mkdir $XDG_CONFIG_HOME +[[ -f "$XDG_CONFIG_HOME/linpack.conf" ]] || cp "$CONFIG" "$XDG_CONFIG_HOME" + +echo -e "Edit \E[31m$XDG_CONFIG_HOME/linpack.conf\E[37m to adjust the amount of physical memory to consume." +echo +echo -e "Starting calculation.... hit ctrl+c to stop." +echo -e "Consult \E[31m~/lin_xeon64.txt\E[37m for results as they are caculated." + +date +date >> ~/lin_xeon64.txt + +/usr/bin/xlinpack_xeon64 $XDG_CONFIG_HOME/linpack.conf >> ~/lin_xeon64.txt +date >> ~/lin_xeon64.txt +echo -n "Done: " +date diff --git a/makepkg.conf b/makepkg.conf new file mode 100644 index 0000000..ee6b4b4 --- /dev/null +++ b/makepkg.conf @@ -0,0 +1,207 @@ +#!/hint/bash +# shellcheck disable=2034 + +# +# /etc/makepkg.conf +# + +######################################################################### +# SOURCE ACQUISITION +######################################################################### +# +#-- The download utilities that makepkg should use to acquire sources +# Format: 'protocol::agent' +DLAGENTS=('file::/usr/bin/curl -qgC - -o %o %u' + 'ftp::/usr/bin/curl -qgfC - --ftp-pasv --retry 3 --retry-delay 3 -o %o %u' + 'http::/usr/bin/curl -qgb "" -fLC - --retry 3 --retry-delay 3 -o %o %u' + 'https::/usr/bin/curl -qgb "" -fLC - --retry 3 --retry-delay 3 -o %o %u' + 'rsync::/usr/bin/rsync --no-motd -z %u %o' + 'scp::/usr/bin/scp -C %u %o') + +# Other common tools: +# /usr/bin/snarf +# /usr/bin/lftpget -c +# /usr/bin/wget + +#-- The package required by makepkg to download VCS sources +# Format: 'protocol::package' +VCSCLIENTS=('bzr::breezy' + 'fossil::fossil' + 'git::git' + 'hg::mercurial' + 'svn::subversion') + +######################################################################### +# ARCHITECTURE, COMPILE FLAGS +######################################################################### +# +CARCH="x86_64" +CHOST="x86_64-pc-linux-gnu" + +#-- Compiler and Linker Flags +#CPPFLAGS="" +CFLAGS="-march=x86-64-v3 -O3 -pipe -fno-plt -fexceptions -Wp,-D_FORTIFY_SOURCE=3 -Wformat -Werror=format-security -fstack-clash-protection -fcf-protection -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer -mpclmul" +CXXFLAGS="$CFLAGS -Wp,-D_GLIBCXX_ASSERTIONS" +LDFLAGS="-Wl,-O1 -Wl,--sort-common -Wl,--as-needed -Wl,-z,relro -Wl,-z,now \ + -Wl,-z,pack-relative-relocs" +LTOFLAGS="-flto=auto -falign-functions=32" +#-- Make Flags: change this for DistCC/SMP systems + +MAKEFLAGS="-j $(nproc)" +#-- Debugging flags +DEBUG_CFLAGS="-g" +DEBUG_CXXFLAGS="$DEBUG_CFLAGS" + +######################################################################### +# BUILD ENVIRONMENT +######################################################################### +# +# Makepkg defaults: BUILDENV=(!distcc !color !ccache check !sign) +# A negated environment option will do the opposite of the comments below. +# +#-- distcc: Use the Distributed C/C++/ObjC compiler +#-- color: Colorize output messages +#-- ccache: Use ccache to cache compilation +#-- check: Run the check() function if present in the PKGBUILD +#-- sign: Generate PGP signature file +# +BUILDENV=(!distcc !color !ccache check !sign) +# +#-- If using DistCC, your MAKEFLAGS will also need modification. In addition, +#-- specify a space-delimited list of hosts running in the DistCC cluster. +#DISTCC_HOSTS="" +# +#-- Specify a directory for package building. +#BUILDDIR=/tmp/makepkg + +######################################################################### +# GLOBAL PACKAGE OPTIONS +# These are default values for the options=() settings +######################################################################### +# +# Makepkg defaults: OPTIONS=(!strip docs libtool staticlibs emptydirs !zipman !purge !debug !lto !autodeps) +# A negated option will do the opposite of the comments below. +# +#-- strip: Strip symbols from binaries/libraries +#-- docs: Save doc directories specified by DOC_DIRS +#-- libtool: Leave libtool (.la) files in packages +#-- staticlibs: Leave static library (.a) files in packages +#-- emptydirs: Leave empty directories in packages +#-- zipman: Compress manual (man and info) pages in MAN_DIRS with gzip +#-- purge: Remove files specified by PURGE_TARGETS +#-- debug: Add debugging flags as specified in DEBUG_* variables +#-- lto: Add compile flags for building with link time optimization +#-- autodeps: Automatically add depends/provides +# +OPTIONS=(strip docs !libtool !staticlibs emptydirs zipman purge debug lto) + +#-- File integrity checks to use. Valid: md5, sha1, sha224, sha256, sha384, sha512, b2 +INTEGRITY_CHECK=(sha256) +#-- Options to be used when stripping binaries. See `man strip' for details. +STRIP_BINARIES="--strip-all" +#-- Options to be used when stripping shared libraries. See `man strip' for details. +STRIP_SHARED="--strip-unneeded" +#-- Options to be used when stripping static libraries. See `man strip' for details. +STRIP_STATIC="--strip-debug" +#-- Manual (man and info) directories to compress (if zipman is specified) +MAN_DIRS=({usr{,/local}{,/share},opt/*}/{man,info}) +#-- Doc directories to remove (if !docs is specified) +DOC_DIRS=(usr/{,local/}{,share/}{doc,gtk-doc} opt/*/{doc,gtk-doc}) +#-- Files to be removed from all packages (if purge is specified) +PURGE_TARGETS=(usr/{,share}/info/dir .packlist *.pod) +#-- Directory to store source code in for debug packages +DBGSRCDIR="/usr/src/debug" +#-- Prefix and directories for library autodeps +LIB_DIRS=('lib:usr/lib' 'lib32:usr/lib32') + +######################################################################### +# PACKAGE OUTPUT +######################################################################### +# +# Default: put built package and cached source in build directory +# +#-- Destination: specify a fixed directory where all packages will be placed +#PKGDEST=/home/packages +#-- Source cache: specify a fixed directory where source files will be cached +#SRCDEST=/home/sources +#-- Source packages: specify a fixed directory where all src packages will be placed +#SRCPKGDEST=/home/srcpackages +#-- Log files: specify a fixed directory where all log files will be placed +#LOGDEST=/home/makepkglogs +#-- Packager: name/email of the person or organization building packages + +PACKAGER="Manuel Hüsers " +#-- Specify a key to use for package signing +#GPGKEY="" + +######################################################################### +# COMPRESSION DEFAULTS +######################################################################### +# +COMPRESSGZ=(gzip -c -f -n) +COMPRESSBZ2=(bzip2 -c -f) +COMPRESSXZ=(xz -c -z -) +COMPRESSZST=(zstd -c -T0 -) +COMPRESSLRZ=(lrzip -q) +COMPRESSLZO=(lzop -q) +COMPRESSZ=(compress -c -f) +COMPRESSLZ4=(lz4 -q) +COMPRESSLZ=(lzip -c -f) + +######################################################################### +# EXTENSION DEFAULTS +######################################################################### +# +PKGEXT='.pkg.tar.zst' +SRCEXT='.src.tar.gz' + +######################################################################### +# OTHER +######################################################################### +# +#-- Command used to run pacman as root, instead of trying sudo and su +#PACMAN_AUTH=() +# vim: set ft=sh ts=2 sw=2 et: +#!/hint/bash +# +# /etc/makepkg.conf.d/fortran.conf +# + +######################################################################### +# FORTRAN LANGUAGE SUPPORT +######################################################################### + +# Flags used for the Fortran compiler, similar in spirit to CFLAGS. Read +# linkman:gfortran[1] for more details on the available flags. +FFLAGS="-O3 -pipe -march=x86-64-v3" + +FCFLAGS="$FFLAGS" + +# Additional compiler flags appended to `FFLAGS` and `FCFLAGS` for use in debugging. Usually +# this would include: ``-g''. Read linkman:gfortran[1] for more details on the wide +# variety of compiler flags available. +#DEBUG_FFLAGS="-g" +#!/hint/bash +# shellcheck disable=2034 + +# +# /etc/makepkg.conf.d/rust.conf +# + +######################################################################### +# RUST LANGUAGE SUPPORT +######################################################################### + +# Flags used for the Rust compiler, similar in spirit to CFLAGS. Read +# linkman:rustc[1] for more details on the available flags. +RUSTFLAGS="-Cforce-frame-pointers=yes -Copt-level=3 -Ctarget-cpu=x86-64-v3 -Clink-arg=-z -Clink-arg=pack-relative-relocs -Ccodegen-units=1" + +# Additional compiler flags appended to `RUSTFLAGS` for use in debugging. +# Usually this would include: ``-C debuginfo=2''. Read linkman:rustc[1] for +# more details on the available flags. +DEBUG_RUSTFLAGS="-C debuginfo=2" + +export KCFLAGS=" -march=x86-64-v3 -O3" +export GOAMD64=v3 +export KCPPFLAGS=" -march=x86-64-v3 -O3" +export CARGO_PROFILE_RELEASE_LTO=fat diff --git a/nginx-mod-traffic-accounting/.SRCINFO b/nginx-mod-traffic-accounting/.SRCINFO new file mode 100644 index 0000000..9c18352 --- /dev/null +++ b/nginx-mod-traffic-accounting/.SRCINFO @@ -0,0 +1,19 @@ +pkgbase = nginx-mod-traffic-accounting + pkgdesc = Monitor the incoming and outgoing traffic metrics in realtime for NGINX + pkgver = 2.0+18+g46aae3e + pkgrel = 1 + url = https://github.com/Lax/traffic-accounting-nginx-module + arch = x86_64 + license = BSD-2-Clause + makedepends = nginx-src + depends = nginx + source = https://github.com/Lax/traffic-accounting-nginx-module/archive/v2.0/traffic-accounting-nginx-module-2.0.tar.gz + source = d53a4a6.patch + source = server_addr.patch + source = succ_collect.patch + sha512sums = 0df34c3765e18dc5cc5a053d3a17dbee17a686a1f6e76ad057c262741c4e4465c66bcef86e627a19258f836cad5f14745bf046fd396b00960ad79ed20c2a07bb + sha512sums = c99fea97563bcb9463d5f4ef1880fe336ed8a675d964687cf3d70fdc50e8d2b2b7d83efbe3fe8ba35945cfaa83a17a6b9b432dc5daa5fc3228efff568ac6ff44 + sha512sums = 8624b4201e390465ceb0274c8e6241ed9075c9d600661c52ad2d77078f92b19fd011d8fe9878a4453519db465d644f430439eabb438ab7810d126955ee814910 + sha512sums = 1d0993d1f3f00f3682d6717192f95836bbf0f1d113e1fdf8b1437dd3f2ec250e36a687ed6238cc17019a829ce6d59baea7bda79bab154b5cba5b088452b0aec8 + +pkgname = nginx-mod-traffic-accounting diff --git a/nginx-mod-traffic-accounting/PKGBUILD b/nginx-mod-traffic-accounting/PKGBUILD new file mode 100644 index 0000000..03ba726 --- /dev/null +++ b/nginx-mod-traffic-accounting/PKGBUILD @@ -0,0 +1,53 @@ +# Maintainer: Manuel Hüsers + +pkgname=nginx-mod-traffic-accounting +pkgver=2.0+18+g46aae3e +pkgrel=1 + +_modname="traffic-accounting-nginx-module" + +pkgdesc='Monitor the incoming and outgoing traffic metrics in realtime for NGINX' +arch=('x86_64') +makedepends=('nginx-src') +depends=('nginx') +url="https://github.com/Lax/${_modname}" +license=('BSD-2-Clause') + +source=( + "https://github.com/Lax/${_modname}/archive/v${pkgver%%+*}/${_modname}-${pkgver%%+*}.tar.gz" + "d53a4a6.patch" + "server_addr.patch" + "succ_collect.patch" +) +sha512sums=('0df34c3765e18dc5cc5a053d3a17dbee17a686a1f6e76ad057c262741c4e4465c66bcef86e627a19258f836cad5f14745bf046fd396b00960ad79ed20c2a07bb' + 'c99fea97563bcb9463d5f4ef1880fe336ed8a675d964687cf3d70fdc50e8d2b2b7d83efbe3fe8ba35945cfaa83a17a6b9b432dc5daa5fc3228efff568ac6ff44' + '8624b4201e390465ceb0274c8e6241ed9075c9d600661c52ad2d77078f92b19fd011d8fe9878a4453519db465d644f430439eabb438ab7810d126955ee814910' + '1d0993d1f3f00f3682d6717192f95836bbf0f1d113e1fdf8b1437dd3f2ec250e36a687ed6238cc17019a829ce6d59baea7bda79bab154b5cba5b088452b0aec8') + +prepare() { + mkdir -p build + cd build + ln -sf /usr/src/nginx/auto + ln -sf /usr/src/nginx/src + + cd "../${_modname}-${pkgver%%+*}" + patch -Np1 -i '../d53a4a6.patch' + patch -Np1 -i '../server_addr.patch' + patch -Np1 -i '../succ_collect.patch' +} + +build() { + cd build + /usr/src/nginx/configure --with-compat --with-stream --add-dynamic-module="../${_modname}-${pkgver%%+*}" + make modules +} + +package() { + install -Dm644 "$srcdir"/"${_modname}-${pkgver%%+*}"/LICENSE \ + "$pkgdir"/usr/share/licenses/$pkgname/LICENSE + + cd build/objs + for mod in ngx_*.so; do + install -Dm755 $mod "$pkgdir"/usr/lib/nginx/modules/$mod + done +} diff --git a/nginx-mod-traffic-accounting/d53a4a6.patch b/nginx-mod-traffic-accounting/d53a4a6.patch new file mode 100644 index 0000000..9964c86 --- /dev/null +++ b/nginx-mod-traffic-accounting/d53a4a6.patch @@ -0,0 +1,235 @@ +diff --git a/src/http/ngx_http_accounting_module.c b/src/http/ngx_http_accounting_module.c +index 63eccf0..23a5fc3 100644 +--- a/src/http/ngx_http_accounting_module.c ++++ b/src/http/ngx_http_accounting_module.c +@@ -139,7 +139,7 @@ ngx_http_accounting_process_init(ngx_cycle_t *cycle) + } + + if (amcf->current == NULL) { +- if (ngx_traffic_accounting_period_create(cycle->pool, amcf) != NGX_OK) ++ if (ngx_traffic_accounting_period_create(amcf) != NGX_OK) + return NGX_ERROR; + } + +@@ -206,7 +206,7 @@ worker_process_alarm_handler(ngx_event_t *ev) + + amcf = ngx_http_cycle_get_module_main_conf(ngx_cycle, ngx_http_accounting_module); + +- ngx_traffic_accounting_period_rotate(amcf->current->pool, amcf); ++ ngx_traffic_accounting_period_rotate(amcf); + ngx_traffic_accounting_period_rbtree_iterate(amcf->previous, + worker_process_export_metrics, + amcf->previous->created_at, +@@ -243,10 +243,10 @@ ngx_http_accounting_request_handler(ngx_http_request_t *r) + + amcf = ngx_http_get_module_main_conf(r, ngx_http_accounting_module); + +- metrics = ngx_traffic_accounting_period_fetch_metrics(amcf->current, accounting_id); ++ metrics = ngx_traffic_accounting_period_fetch_metrics(amcf->current, accounting_id, amcf->log); + if (metrics == NULL) { return NGX_ERROR; } + +- if (ngx_traffic_accounting_metrics_init(metrics, amcf->current->pool, ngx_http_statuses_len) == NGX_ERROR) ++ if (ngx_traffic_accounting_metrics_init(metrics, ngx_http_statuses_len, amcf->log) == NGX_ERROR) + return NGX_ERROR; + + amcf->current->updated_at = ngx_timeofday(); +diff --git a/src/ngx_traffic_accounting.h b/src/ngx_traffic_accounting.h +index 1812927..462becf 100644 +--- a/src/ngx_traffic_accounting.h ++++ b/src/ngx_traffic_accounting.h +@@ -38,21 +38,19 @@ typedef struct { + ngx_rbtree_t rbtree; + ngx_rbtree_node_t sentinel; + +- ngx_pool_t *pool; +- + ngx_time_t *created_at; + ngx_time_t *updated_at; + } ngx_traffic_accounting_period_t; + +-ngx_int_t ngx_traffic_accounting_metrics_init(ngx_traffic_accounting_metrics_t *metrics, ngx_pool_t *pool, size_t len); ++ngx_int_t ngx_traffic_accounting_metrics_init(ngx_traffic_accounting_metrics_t *metrics, size_t len, ngx_log_t *log); + + ngx_int_t ngx_traffic_accounting_period_init(ngx_traffic_accounting_period_t *period); +-void ngx_traffic_accounting_period_insert(ngx_traffic_accounting_period_t *period, ngx_str_t *name); ++void ngx_traffic_accounting_period_insert(ngx_traffic_accounting_period_t *period, ngx_str_t *name, ngx_log_t *log); + void ngx_traffic_accounting_period_insert_metrics(ngx_traffic_accounting_period_t *period, ngx_traffic_accounting_metrics_t *metrics); + void ngx_traffic_accounting_period_delete(ngx_traffic_accounting_period_t *period, ngx_str_t *name); + void ngx_traffic_accounting_period_delete_metrics(ngx_traffic_accounting_period_t *period, ngx_traffic_accounting_metrics_t *metrics); + ngx_traffic_accounting_metrics_t * ngx_traffic_accounting_period_lookup_metrics(ngx_traffic_accounting_period_t *period, ngx_str_t *name); +-ngx_traffic_accounting_metrics_t * ngx_traffic_accounting_period_fetch_metrics(ngx_traffic_accounting_period_t *period, ngx_str_t *name); ++ngx_traffic_accounting_metrics_t * ngx_traffic_accounting_period_fetch_metrics(ngx_traffic_accounting_period_t *period, ngx_str_t *name, ngx_log_t *log); + + typedef ngx_int_t (*ngx_traffic_accounting_period_iterate_func)(void *val, void *para1, void *para2); + +diff --git a/src/ngx_traffic_accounting_module.c b/src/ngx_traffic_accounting_module.c +index ebc877a..2291db7 100644 +--- a/src/ngx_traffic_accounting_module.c ++++ b/src/ngx_traffic_accounting_module.c +@@ -9,15 +9,14 @@ + + + ngx_int_t +-ngx_traffic_accounting_period_create(ngx_pool_t *pool, ngx_traffic_accounting_main_conf_t *amcf) ++ngx_traffic_accounting_period_create(ngx_traffic_accounting_main_conf_t *amcf) + { + ngx_traffic_accounting_period_t *period; + +- period = ngx_pcalloc(pool, sizeof(ngx_traffic_accounting_period_t)); ++ period = ngx_calloc(sizeof(ngx_traffic_accounting_period_t), amcf->log); + if (period == NULL) + return NGX_ERROR; + +- period->pool = pool; + ngx_traffic_accounting_period_init(period); + + period->created_at = ngx_timeofday(); +@@ -28,11 +27,11 @@ ngx_traffic_accounting_period_create(ngx_pool_t *pool, ngx_traffic_accounting_ma + } + + ngx_int_t +-ngx_traffic_accounting_period_rotate(ngx_pool_t *pool, ngx_traffic_accounting_main_conf_t *amcf) ++ngx_traffic_accounting_period_rotate(ngx_traffic_accounting_main_conf_t *amcf) + { +- ngx_pfree(pool, amcf->previous); ++ ngx_free(amcf->previous); + + amcf->previous = amcf->current; + +- return ngx_traffic_accounting_period_create(pool, amcf); ++ return ngx_traffic_accounting_period_create(amcf); + } +diff --git a/src/ngx_traffic_accounting_module.h b/src/ngx_traffic_accounting_module.h +index 08881f1..adfccec 100644 +--- a/src/ngx_traffic_accounting_module.h ++++ b/src/ngx_traffic_accounting_module.h +@@ -46,8 +46,8 @@ ngx_str_t * ngx_traffic_accounting_get_accounting_id(void *entry, ngx_get_loc_co + ngx_get_indexed_variable_pt get_indexed_variable); + + +-ngx_int_t ngx_traffic_accounting_period_create(ngx_pool_t *pool, ngx_traffic_accounting_main_conf_t *amcf); +-ngx_int_t ngx_traffic_accounting_period_rotate(ngx_pool_t *pool, ngx_traffic_accounting_main_conf_t *amcf); ++ngx_int_t ngx_traffic_accounting_period_create(ngx_traffic_accounting_main_conf_t *amcf); ++ngx_int_t ngx_traffic_accounting_period_rotate(ngx_traffic_accounting_main_conf_t *amcf); + + + #endif /* _NGX_TRAFFIC_ACCOUNTING_MODULE_H_INCLUDED_ */ +diff --git a/src/ngx_traffic_accounting_period_metrics.c b/src/ngx_traffic_accounting_period_metrics.c +index b6b7055..7376ad9 100644 +--- a/src/ngx_traffic_accounting_period_metrics.c ++++ b/src/ngx_traffic_accounting_period_metrics.c +@@ -10,17 +10,17 @@ + static void ngx_traffic_accounting_period_insert_value(ngx_rbtree_node_t *temp, ngx_rbtree_node_t *node, ngx_rbtree_node_t *sentinel); + + ngx_int_t +-ngx_traffic_accounting_metrics_init(ngx_traffic_accounting_metrics_t *metrics, ngx_pool_t *pool, size_t len) ++ngx_traffic_accounting_metrics_init(ngx_traffic_accounting_metrics_t *metrics, size_t len, ngx_log_t *log) + { + if (metrics->nr_status == NULL) { +- metrics->nr_status = ngx_pcalloc(pool, sizeof(ngx_uint_t) * len); ++ metrics->nr_status = ngx_calloc(sizeof(ngx_uint_t) * len, log); + + if (metrics->nr_status == NULL) + return NGX_ERROR; + } + + if (metrics->nr_upstream_status == NULL) { +- metrics->nr_upstream_status = ngx_pcalloc(pool, sizeof(ngx_uint_t) * len); ++ metrics->nr_upstream_status = ngx_calloc(sizeof(ngx_uint_t) * len, log); + + if (metrics->nr_upstream_status == NULL) + return NGX_ERROR; +@@ -39,14 +39,14 @@ ngx_traffic_accounting_period_init(ngx_traffic_accounting_period_t *period) + } + + void +-ngx_traffic_accounting_period_insert(ngx_traffic_accounting_period_t *period, ngx_str_t *name) ++ngx_traffic_accounting_period_insert(ngx_traffic_accounting_period_t *period, ngx_str_t *name, ngx_log_t *log) + { + ngx_traffic_accounting_metrics_t *metrics; + +- metrics = ngx_pcalloc(period->pool, sizeof(ngx_traffic_accounting_metrics_t)); ++ metrics = ngx_calloc(sizeof(ngx_traffic_accounting_metrics_t), log); + + void *data; +- data = ngx_pcalloc(period->pool, name->len+1); ++ data = ngx_calloc(name->len+1, log); + ngx_memcpy(data, name->data, name->len); + + metrics->name.data = data; +@@ -82,7 +82,7 @@ void + ngx_traffic_accounting_period_delete_metrics(ngx_traffic_accounting_period_t *period, ngx_traffic_accounting_metrics_t *metrics) + { + ngx_rbtree_delete(&period->rbtree, &metrics->rbnode); +- ngx_pfree(period->pool, metrics); ++ ngx_free(metrics); + } + + ngx_traffic_accounting_metrics_t * +@@ -124,7 +124,7 @@ ngx_traffic_accounting_period_lookup_metrics(ngx_traffic_accounting_period_t *pe + } + + ngx_traffic_accounting_metrics_t * +-ngx_traffic_accounting_period_fetch_metrics(ngx_traffic_accounting_period_t *period, ngx_str_t *name) ++ngx_traffic_accounting_period_fetch_metrics(ngx_traffic_accounting_period_t *period, ngx_str_t *name, ngx_log_t *log) + { + ngx_traffic_accounting_metrics_t *n; + +@@ -132,7 +132,7 @@ ngx_traffic_accounting_period_fetch_metrics(ngx_traffic_accounting_period_t *per + if (n != NULL) + return n; + +- ngx_traffic_accounting_period_insert(period, name); ++ ngx_traffic_accounting_period_insert(period, name, log); + + return ngx_traffic_accounting_period_lookup_metrics(period, name); + } +@@ -158,9 +158,10 @@ ngx_traffic_accounting_period_rbtree_iterate(ngx_traffic_accounting_period_t *pe + if (rc == NGX_DONE) { + /* NGX_DONE -> destroy node */ + ngx_rbtree_delete(rbtree, node); +- ngx_pfree(period->pool, n->nr_status); +- ngx_pfree(period->pool, n->nr_upstream_status); +- ngx_pfree(period->pool, n); ++ ngx_free(n->nr_status); ++ ngx_free(n->nr_upstream_status); ++ ngx_free(n->name.data); ++ ngx_free(n); + + goto done; + } +diff --git a/src/stream/ngx_stream_accounting_module.c b/src/stream/ngx_stream_accounting_module.c +index b1839d1..3db787d 100644 +--- a/src/stream/ngx_stream_accounting_module.c ++++ b/src/stream/ngx_stream_accounting_module.c +@@ -136,7 +136,7 @@ ngx_stream_accounting_process_init(ngx_cycle_t *cycle) + } + + if (amcf->current == NULL) { +- if (ngx_traffic_accounting_period_create(cycle->pool, amcf) != NGX_OK) ++ if (ngx_traffic_accounting_period_create(amcf) != NGX_OK) + return NGX_ERROR; + } + +@@ -203,7 +203,7 @@ worker_process_alarm_handler(ngx_event_t *ev) + + amcf = ngx_stream_cycle_get_module_main_conf(ngx_cycle, ngx_stream_accounting_module); + +- ngx_traffic_accounting_period_rotate(amcf->current->pool, amcf); ++ ngx_traffic_accounting_period_rotate(amcf); + ngx_traffic_accounting_period_rbtree_iterate(amcf->previous, + worker_process_export_metrics, + amcf->previous->created_at, +@@ -240,10 +240,10 @@ ngx_stream_accounting_session_handler(ngx_stream_session_t *s) + + amcf = ngx_stream_get_module_main_conf(s, ngx_stream_accounting_module); + +- metrics = ngx_traffic_accounting_period_fetch_metrics(amcf->current, accounting_id); ++ metrics = ngx_traffic_accounting_period_fetch_metrics(amcf->current, accounting_id, amcf->log); + if (metrics == NULL) { return NGX_ERROR; } + +- if (ngx_traffic_accounting_metrics_init(metrics, amcf->current->pool, ngx_stream_statuses_len) == NGX_ERROR) ++ if (ngx_traffic_accounting_metrics_init(metrics, ngx_stream_statuses_len, amcf->log) == NGX_ERROR) + return NGX_ERROR; + + amcf->current->updated_at = ngx_timeofday(); diff --git a/nginx-mod-traffic-accounting/server_addr.patch b/nginx-mod-traffic-accounting/server_addr.patch new file mode 100644 index 0000000..19950f6 --- /dev/null +++ b/nginx-mod-traffic-accounting/server_addr.patch @@ -0,0 +1,80 @@ +diff --git a/src/http/ngx_http_accounting_module.c b/src/http/ngx_http_accounting_module.c +index 23a5fc3..ecc62d2 100644 +--- a/src/http/ngx_http_accounting_module.c ++++ b/src/http/ngx_http_accounting_module.c +@@ -237,7 +237,6 @@ ngx_http_accounting_request_handler(ngx_http_request_t *r) + ngx_time_t *tp = ngx_timeofday(); + ngx_msec_int_t ms = 0; + ngx_http_upstream_state_t *state; +- + accounting_id = ngx_http_accounting_get_accounting_id(r); + if (accounting_id == NULL) { return NGX_ERROR; } + +@@ -251,6 +250,27 @@ ngx_http_accounting_request_handler(ngx_http_request_t *r) + + amcf->current->updated_at = ngx_timeofday(); + ++ if (0 == metrics->server_addr.len) { ++ u_char var_name_buf[256] = {0}; ++ ngx_str_t server_addr_var_name = ngx_string("server_addr"); ++ ngx_uint_t server_addr_key = ngx_hash_strlow(var_name_buf, server_addr_var_name.data, server_addr_var_name.len); ++ ngx_http_variable_value_t* server_addr_val = ngx_http_get_variable(r, &server_addr_var_name, server_addr_key); ++ ++ if (NULL == server_addr_val) { ++ // ngx_log_error(NGXTA_LOG_LEVEL, amcf->log, ngx_errno, ++ // ngx_realpath_n " get server_addr failed"); ++ return NGX_ERROR; ++ } else { ++ // ngx_log_error(NGXTA_LOG_LEVEL, amcf->log, 0, ++ // ngx_realpath_n " %s", server_addr_val->data); ++ } ++ metrics->server_addr.data = ngx_calloc(server_addr_val->len + 1, amcf->log); ++ if (NULL == metrics->server_addr.data) { ++ return NGX_ERROR; ++ } ++ memcpy(metrics->server_addr.data, server_addr_val->data, server_addr_val->len); ++ metrics->server_addr.len = server_addr_val->len; ++ } + metrics->nr_entries += 1; + metrics->bytes_in += r->request_length; + metrics->bytes_out += r->connection->sent; +diff --git a/src/ngx_traffic_accounting.h b/src/ngx_traffic_accounting.h +index 462becf..6046d78 100644 +--- a/src/ngx_traffic_accounting.h ++++ b/src/ngx_traffic_accounting.h +@@ -24,6 +24,7 @@ typedef struct { + ngx_rbtree_node_t rbnode; + + ngx_str_t name; ++ ngx_str_t server_addr; + + ngx_uint_t nr_entries; + ngx_uint_t bytes_in; +diff --git a/src/ngx_traffic_accounting_log.c b/src/ngx_traffic_accounting_log.c +index 9b4cd46..652cefb 100644 +--- a/src/ngx_traffic_accounting_log.c ++++ b/src/ngx_traffic_accounting_log.c +@@ -35,9 +35,10 @@ ngx_traffic_accounting_log_metrics(void *val, void *para1, void *para2, + last = msg_buf + NGX_MAX_ERROR_STR; + + p = ngx_slprintf(p, last, +- "pid:%i|from:%i|to:%i|accounting_id:%V|%s:%ui|bytes_in:%ui|bytes_out:%ui|latency_ms:%ui|upstream_latency_ms:%ui", ++ "pid:%i|from:%i|to:%i|server_addr:%V|accounting_id:%V|%s:%ui|bytes_in:%ui|bytes_out:%ui|latency_ms:%ui|upstream_latency_ms:%ui", + ngx_getpid(), + created_at->sec, updated_at->sec, ++ &metrics->server_addr, + &metrics->name, entry_n, + metrics->nr_entries, + metrics->bytes_in, metrics->bytes_out, +diff --git a/src/ngx_traffic_accounting_period_metrics.c b/src/ngx_traffic_accounting_period_metrics.c +index 7376ad9..d454a3c 100644 +--- a/src/ngx_traffic_accounting_period_metrics.c ++++ b/src/ngx_traffic_accounting_period_metrics.c +@@ -161,6 +161,7 @@ ngx_traffic_accounting_period_rbtree_iterate(ngx_traffic_accounting_period_t *pe + ngx_free(n->nr_status); + ngx_free(n->nr_upstream_status); + ngx_free(n->name.data); ++ ngx_free(n->server_addr.data); + ngx_free(n); + + goto done; diff --git a/nginx-mod-traffic-accounting/succ_collect.patch b/nginx-mod-traffic-accounting/succ_collect.patch new file mode 100644 index 0000000..9642e3c --- /dev/null +++ b/nginx-mod-traffic-accounting/succ_collect.patch @@ -0,0 +1,96 @@ +From 46aae3eccffea884430d72f3d6cfc664a5789853 Mon Sep 17 00:00:00 2001 +From: David-Hang-12138 +Date: Thu, 15 Sep 2022 21:57:00 +0800 +Subject: [PATCH] DEVHUB-73 added option for collecting only successful + requests. + +--- + src/http/ngx_http_accounting_module.c | 27 +++++++++++++++++------- + src/ngx_traffic_accounting_module.h | 1 + + src/ngx_traffic_accounting_module_conf.c | 2 ++ + 3 files changed, 22 insertions(+), 8 deletions(-) + +diff --git a/src/http/ngx_http_accounting_module.c b/src/http/ngx_http_accounting_module.c +index ecc62d2..a35759c 100644 +--- a/src/http/ngx_http_accounting_module.c ++++ b/src/http/ngx_http_accounting_module.c +@@ -62,6 +62,13 @@ static ngx_command_t ngx_http_accounting_commands[] = { + 0, + NULL}, + ++ { ngx_string("accounting_20x"), ++ NGX_HTTP_MAIN_CONF|NGX_CONF_TAKE1, ++ ngx_conf_set_flag_slot, ++ NGX_HTTP_MAIN_CONF_OFFSET, ++ offsetof(ngx_http_accounting_main_conf_t, log_20x), ++ NULL}, ++ + ngx_null_command + }; + +@@ -242,6 +249,18 @@ ngx_http_accounting_request_handler(ngx_http_request_t *r) + + amcf = ngx_http_get_module_main_conf(r, ngx_http_accounting_module); + ++ if (r->err_status) { ++ status = r->err_status; ++ } else if (r->headers_out.status) { ++ status = r->headers_out.status; ++ } else { ++ status = NGX_HTTP_STATUS_UNSET; ++ } ++ ++ if (amcf->log_20x && NGX_HTTP_SPECIAL_RESPONSE <= status) { ++ // Only log successful requests whose response code is 10x or 20x ++ return NGX_DECLINED; ++ } + metrics = ngx_traffic_accounting_period_fetch_metrics(amcf->current, accounting_id, amcf->log); + if (metrics == NULL) { return NGX_ERROR; } + +@@ -275,14 +294,6 @@ ngx_http_accounting_request_handler(ngx_http_request_t *r) + metrics->bytes_in += r->request_length; + metrics->bytes_out += r->connection->sent; + +- if (r->err_status) { +- status = r->err_status; +- } else if (r->headers_out.status) { +- status = r->headers_out.status; +- } else { +- status = NGX_HTTP_STATUS_UNSET; +- } +- + metrics->nr_status[ngx_status_bsearch(status, ngx_http_statuses, ngx_http_statuses_len)] += 1; + + ms = (ngx_msec_int_t)((tp->sec - r->start_sec) * 1000 + (tp->msec - r->start_msec)); +diff --git a/src/ngx_traffic_accounting_module.h b/src/ngx_traffic_accounting_module.h +index adfccec..acc7d0b 100644 +--- a/src/ngx_traffic_accounting_module.h ++++ b/src/ngx_traffic_accounting_module.h +@@ -18,6 +18,7 @@ typedef struct { + ngx_log_t *log; + time_t interval; + ngx_flag_t perturb; ++ ngx_flag_t log_20x; // account only 20x success responses + + ngx_traffic_accounting_period_t *current; + ngx_traffic_accounting_period_t *previous; +diff --git a/src/ngx_traffic_accounting_module_conf.c b/src/ngx_traffic_accounting_module_conf.c +index ce1da71..d937666 100644 +--- a/src/ngx_traffic_accounting_module_conf.c ++++ b/src/ngx_traffic_accounting_module_conf.c +@@ -20,6 +20,7 @@ ngx_traffic_accounting_create_main_conf(ngx_conf_t *cf) + amcf->enable = NGX_CONF_UNSET; + amcf->interval = NGX_CONF_UNSET; + amcf->perturb = NGX_CONF_UNSET; ++ amcf->log_20x = NGX_CONF_UNSET; + + return amcf; + } +@@ -32,6 +33,7 @@ ngx_traffic_accounting_init_main_conf(ngx_conf_t *cf, void *conf) + if (amcf->enable == NGX_CONF_UNSET) { amcf->enable = 0; } + if (amcf->interval == NGX_CONF_UNSET) { amcf->interval = 60; } + if (amcf->perturb == NGX_CONF_UNSET) { amcf->perturb = 0; } ++ if (amcf->log_20x == NGX_CONF_UNSET) { amcf->log_20x = 0; } + + return NGX_CONF_OK; + } diff --git a/ntfs2btrfs-git/.SRCINFO b/ntfs2btrfs-git/.SRCINFO new file mode 100644 index 0000000..6ee12de --- /dev/null +++ b/ntfs2btrfs-git/.SRCINFO @@ -0,0 +1,20 @@ +pkgbase = ntfs2btrfs-git + pkgdesc = In-place conversion of Microsoft's NTFS filesystem to the open-source filesystem Btrfs + pkgver = 20250616.r0.g2b4e00a + pkgrel = 1 + url = https://github.com/maharmstone/ntfs2btrfs + arch = x86_64 + license = GPL-2.0-or-later + makedepends = git + makedepends = cmake + makedepends = pkgconf + depends = fmt + depends = zlib + depends = lzo + depends = zstd + provides = ntfs2btrfs + conflicts = ntfs2btrfs + source = git+https://github.com/maharmstone/ntfs2btrfs.git + sha512sums = SKIP + +pkgname = ntfs2btrfs-git diff --git a/ntfs2btrfs-git/PKGBUILD b/ntfs2btrfs-git/PKGBUILD new file mode 100644 index 0000000..d9fe0f5 --- /dev/null +++ b/ntfs2btrfs-git/PKGBUILD @@ -0,0 +1,35 @@ +# Maintainer: Manuel Hüsers +# Contributor: N Fytilis + +pkgname=ntfs2btrfs-git +pkgver=20250616.r0.g2b4e00a +pkgrel=1 +pkgdesc="In-place conversion of Microsoft's NTFS filesystem to the open-source filesystem Btrfs" +arch=('x86_64') +url="https://github.com/maharmstone/${pkgname%-git}" +license=('GPL-2.0-or-later') +depends=('fmt' 'zlib' 'lzo' 'zstd') +makedepends=('git' 'cmake' 'pkgconf') +provides=("${pkgname%-git}") +conflicts=("${pkgname%-git}") +source=("git+${url}.git") +sha512sums=('SKIP') + +pkgver() { + cd "${pkgname%-git}" + git describe --long --tags | sed 's/\([^-]*-g\)/r\1/;s/release-//g;s/-/./g' +} + +build() { + cmake -B build -S "${pkgname%-git}" \ + -DCMAKE_INSTALL_PREFIX=/usr \ + -DCMAKE_INSTALL_SBINDIR=bin \ + -DCMAKE_BUILD_TYPE=Release \ + -DBUILD_TESTING=OFF + + cmake --build build +} + +package() { + DESTDIR="$pkgdir" cmake --install build +} diff --git a/ntfs2btrfs/.SRCINFO b/ntfs2btrfs/.SRCINFO new file mode 100644 index 0000000..becff87 --- /dev/null +++ b/ntfs2btrfs/.SRCINFO @@ -0,0 +1,17 @@ +pkgbase = ntfs2btrfs + pkgdesc = In-place conversion of Microsoft's NTFS filesystem to the open-source filesystem Btrfs + pkgver = 20250616 + pkgrel = 1 + url = https://github.com/maharmstone/ntfs2btrfs + arch = x86_64 + license = GPL-2.0-or-later + makedepends = cmake + makedepends = pkgconf + depends = fmt + depends = zlib + depends = lzo + depends = zstd + source = https://github.com/maharmstone/ntfs2btrfs/archive/20250616/ntfs2btrfs-20250616.tar.gz + sha512sums = 86d7964667d1109f509d9a7972391d6294f18006ace63f8a9221ee8b74057273fe0cffdcd2c59bfc2b084eaccc1ba56ddc8ec3bb87a97d3e36d64f23aca8d7f1 + +pkgname = ntfs2btrfs diff --git a/ntfs2btrfs/PKGBUILD b/ntfs2btrfs/PKGBUILD new file mode 100644 index 0000000..2a299c8 --- /dev/null +++ b/ntfs2btrfs/PKGBUILD @@ -0,0 +1,27 @@ +# Maintainer: Manuel Hüsers + +pkgname=ntfs2btrfs +pkgver=20250616 +pkgrel=1 +pkgdesc="In-place conversion of Microsoft's NTFS filesystem to the open-source filesystem Btrfs" +arch=('x86_64') +url="https://github.com/maharmstone/$pkgname" +license=('GPL-2.0-or-later') +depends=('fmt' 'zlib' 'lzo' 'zstd') +makedepends=('cmake' 'pkgconf') +source=("$url/archive/$pkgver/$pkgname-$pkgver.tar.gz") +sha512sums=('86d7964667d1109f509d9a7972391d6294f18006ace63f8a9221ee8b74057273fe0cffdcd2c59bfc2b084eaccc1ba56ddc8ec3bb87a97d3e36d64f23aca8d7f1') + +build() { + cmake -B build -S "$pkgname-$pkgver" \ + -DCMAKE_INSTALL_PREFIX=/usr \ + -DCMAKE_INSTALL_SBINDIR=bin \ + -DCMAKE_BUILD_TYPE=Release \ + -DBUILD_TESTING=OFF + + cmake --build build +} + +package() { + DESTDIR="$pkgdir" cmake --install build +} diff --git a/obs-vkcapture/.SRCINFO b/obs-vkcapture/.SRCINFO new file mode 100644 index 0000000..7cb8656 --- /dev/null +++ b/obs-vkcapture/.SRCINFO @@ -0,0 +1,28 @@ +pkgbase = obs-vkcapture + pkgdesc = OBS Linux Vulkan/OpenGL game capture + pkgver = 1.5.3 + pkgrel = 1 + url = https://github.com/nowrep/obs-vkcapture + arch = x86_64 + license = GPL-2.0-or-later + makedepends = gcc + makedepends = cmake + makedepends = vulkan-headers + makedepends = lib32-gcc-libs + makedepends = lib32-vulkan-icd-loader + makedepends = lib32-libgl + makedepends = lib32-libegl + depends = vulkan-icd-loader + depends = libgl + depends = libegl + depends = obs-studio>=28 + source = https://github.com/nowrep/obs-vkcapture/archive/v1.5.3/obs-vkcapture-1.5.3.tar.gz + sha512sums = fdc3e1dd3d86b2ef6e5721e235abad4e45a3b03ad386f237c6bcf168f23f125e2cf2a4d10d040a53fadb5633a426d13d3152080ebc70fbbccf49cfb1d9f385fb + +pkgname = obs-vkcapture + +pkgname = lib32-obs-vkcapture + pkgdesc = OBS Linux Vulkan/OpenGL game capture (32-bit) + depends = lib32-vulkan-icd-loader + depends = lib32-libgl + depends = lib32-libegl diff --git a/obs-vkcapture/PKGBUILD b/obs-vkcapture/PKGBUILD new file mode 100644 index 0000000..fb6edf5 --- /dev/null +++ b/obs-vkcapture/PKGBUILD @@ -0,0 +1,48 @@ +# Maintainer: Manuel Hüsers + +pkgbase=obs-vkcapture +pkgname=("$pkgbase" "lib32-$pkgbase") +pkgver=1.5.3 +pkgrel=1 +pkgdesc='OBS Linux Vulkan/OpenGL game capture' +arch=('x86_64') +url="https://github.com/nowrep/$pkgbase" +license=('GPL-2.0-or-later') +depends=('vulkan-icd-loader' 'libgl' 'libegl' 'obs-studio>=28') +makedepends=('gcc' 'cmake' 'vulkan-headers' 'lib32-gcc-libs' 'lib32-vulkan-icd-loader' 'lib32-libgl' 'lib32-libegl') +source=("https://github.com/nowrep/$pkgbase/archive/v$pkgver/$pkgbase-$pkgver.tar.gz") +sha512sums=('fdc3e1dd3d86b2ef6e5721e235abad4e45a3b03ad386f237c6bcf168f23f125e2cf2a4d10d040a53fadb5633a426d13d3152080ebc70fbbccf49cfb1d9f385fb') + +build() { + cmake -B build -S "$pkgbase-$pkgver" \ + -DCMAKE_INSTALL_PREFIX=/usr \ + -DCMAKE_INSTALL_LIBDIR=lib \ + -DCMAKE_INSTALL_DATADIR=/share \ + -DCMAKE_BUILD_TYPE=Release + cmake --build build + + export CFLAGS="-m32 ${CFLAGS}" + export CXXFLAGS="-m32 ${CXXFLAGS}" + export LDFLAGS="-m32 ${LDFLAGS}" + + cmake -B build32 -S "$pkgbase-$pkgver" \ + -DCMAKE_INSTALL_PREFIX=/usr \ + -DCMAKE_INSTALL_LIBDIR=lib32 \ + -DCMAKE_INSTALL_DATADIR=/share \ + -DCMAKE_LIBRARY_PATH=/usr/lib32 \ + -DCMAKE_BUILD_TYPE=Release \ + -DBUILD_PLUGIN=OFF + cmake --build build32 +} + +package_obs-vkcapture() { + DESTDIR="$pkgdir" cmake --install build +} + +package_lib32-obs-vkcapture() { + pkgdesc+=' (32-bit)' + depends=('lib32-vulkan-icd-loader' 'lib32-libgl' 'lib32-libegl') + + DESTDIR="$pkgdir" cmake --install build32 + rm -r "$pkgdir/usr/bin" +} diff --git a/pacman.conf b/pacman.conf new file mode 100644 index 0000000..691344a --- /dev/null +++ b/pacman.conf @@ -0,0 +1,105 @@ +# +# /etc/pacman.conf +# +# See the pacman.conf(5) manpage for option and repository directives + +# +# GENERAL OPTIONS +# +[options] +# The following paths are commented out with their default values listed. +# If you wish to use different paths, uncomment and update the paths. +#RootDir = / +#DBPath = /var/lib/pacman/ +#CacheDir = /var/cache/pacman/pkg/ +#LogFile = /var/log/pacman.log +#GPGDir = /etc/pacman.d/gnupg/ +#HookDir = /etc/pacman.d/hooks/ +HoldPkg = pacman glibc +#XferCommand = /usr/bin/curl -L -C - -f -o %o %u +#XferCommand = /usr/bin/wget --passive-ftp -c -O %o %u +#CleanMethod = KeepInstalled +Architecture = auto + +# Pacman won't upgrade packages listed in IgnorePkg and members of IgnoreGroup +#IgnorePkg = +#IgnoreGroup = + +#NoUpgrade = +#NoExtract = + +# Misc options +#UseSyslog +#Color +#NoProgressBar +CheckSpace +#VerbosePkgLists +ParallelDownloads = 5 +DownloadUser = alpm +#DisableSandbox + +# By default, pacman accepts packages signed by keys that its local keyring +# trusts (see pacman-key and its man page), as well as unsigned packages. +SigLevel = Required DatabaseOptional +LocalFileSigLevel = Optional +#RemoteFileSigLevel = Required + +# NOTE: You must run `pacman-key --init` before first using pacman; the local +# keyring can then be populated with the keys of all official Arch Linux +# packagers with `pacman-key --populate archlinux`. + +# +# REPOSITORIES +# - can be defined here or included from another file +# - pacman will search repositories in the order defined here +# - local/custom mirrors can be added here or in separate files +# - repositories listed first will take precedence when packages +# have identical names, regardless of version number +# - URLs will have $repo replaced by the name of the current repo +# - URLs will have $arch replaced by the name of the architecture +# +# Repository entries are of the format: +# [repo-name] +# Server = ServerName +# Include = IncludePath +# +# The header [repo-name] is crucial - it must be present and +# uncommented to enable the repo. +# + +# The testing repositories are disabled by default. To enable, uncomment the +# repo name header and Include lines. You can add preferred servers immediately +# after the header, and they will be used before the default mirrors. + +#[core-testing] +#Server = https://mirror.sunred.org/archlinux/$repo/os/$arch +#Include = /etc/pacman.d/mirrorlist + +[core] +Server = https://mirror.sunred.org/archlinux/$repo/os/$arch +Include = /etc/pacman.d/mirrorlist + +#[extra-testing] +#Server = https://mirror.sunred.org/archlinux/$repo/os/$arch +#Include = /etc/pacman.d/mirrorlist + +[extra] +Server = https://mirror.sunred.org/archlinux/$repo/os/$arch +Include = /etc/pacman.d/mirrorlist + +# If you want to run 32 bit applications on your x86_64 system, +# enable the multilib repositories as required here. + +#[multilib-testing] +#Server = https://mirror.sunred.org/archlinux/$repo/os/$arch +#Include = /etc/pacman.d/mirrorlist + +[multilib] +Server = https://mirror.sunred.org/archlinux/$repo/os/$arch +Include = /etc/pacman.d/mirrorlist + +# An example of a custom package repository. See the pacman manpage for +# tips on creating your own repositories. +#[custom] +#SigLevel = Optional TrustAll +#Server = file:///home/custompkgs diff --git a/plymouth-theme-arch-logo/.SRCINFO b/plymouth-theme-arch-logo/.SRCINFO new file mode 100644 index 0000000..aa82fa3 --- /dev/null +++ b/plymouth-theme-arch-logo/.SRCINFO @@ -0,0 +1,13 @@ +pkgbase = plymouth-theme-arch-logo + pkgdesc = A remake of the ubuntu-logo Plymouth theme, based on the debian-logo theme, but featuring the Arch Linux logo. + pkgver = 1 + pkgrel = 2 + url = https://www.gnome-look.org/content/show.php/Arch-logo+plymouth?content=141697 + install = plymouth-theme-arch-logo.install + arch = any + license = GPL-3.0-or-later + depends = plymouth + source = plymouth-theme-arch-logo.tar.gz + sha512sums = 0c834bccc32d8d2df1a0bf2ae859487eef273ddf8047a7444f3630dffbbf04a9d014242304c5b2bcd9172bea2e04195f329dfe1fe4661bcc5af29ca64104af06 + +pkgname = plymouth-theme-arch-logo diff --git a/plymouth-theme-arch-logo/PKGBUILD b/plymouth-theme-arch-logo/PKGBUILD new file mode 100644 index 0000000..16f65bf --- /dev/null +++ b/plymouth-theme-arch-logo/PKGBUILD @@ -0,0 +1,26 @@ +# Maintainer: Manuel Hüsers +# Contributor: Manuel Hüsers +# Contributor: Guillermo Garcia + +pkgname=plymouth-theme-arch-logo +pkgver=1 +pkgrel=2 +pkgdesc='A remake of the ubuntu-logo Plymouth theme, based on the debian-logo theme, but featuring the Arch Linux logo.' +arch=('any') +# Alternative website(s) +#url='http://karlinux.deviantart.com/art/Arch-Logo-Plymouth-Theme-209553250' +url='https://www.gnome-look.org/content/show.php/Arch-logo+plymouth?content=141697' +license=('GPL-3.0-or-later') +depends=('plymouth') +install="${pkgname}.install" +source=( + 'plymouth-theme-arch-logo.tar.gz' +) +sha512sums=('0c834bccc32d8d2df1a0bf2ae859487eef273ddf8047a7444f3630dffbbf04a9d014242304c5b2bcd9172bea2e04195f329dfe1fe4661bcc5af29ca64104af06') + +package() { + cd "${srcdir}/arch-logo" + rm -fv *~ + mkdir -p "${pkgdir}/usr/share/plymouth/themes/arch-logo" + install -Dvm644 * "${pkgdir}/usr/share/plymouth/themes/arch-logo" +} diff --git a/plymouth-theme-arch-logo/plymouth-theme-arch-logo.install b/plymouth-theme-arch-logo/plymouth-theme-arch-logo.install new file mode 100644 index 0000000..4d65b5f --- /dev/null +++ b/plymouth-theme-arch-logo/plymouth-theme-arch-logo.install @@ -0,0 +1,12 @@ +post_install() { + cat < To activate the theme, run as root: +==> plymouth-set-default-theme -R arch-logo + +EOF +} + +post_upgrade() { + post_install $1 +} diff --git a/plymouth-theme-arch-logo/plymouth-theme-arch-logo.tar.gz b/plymouth-theme-arch-logo/plymouth-theme-arch-logo.tar.gz new file mode 100644 index 0000000..1ce0c86 Binary files /dev/null and b/plymouth-theme-arch-logo/plymouth-theme-arch-logo.tar.gz differ diff --git a/polkit-explorer-git/.SRCINFO b/polkit-explorer-git/.SRCINFO new file mode 100644 index 0000000..fc24cd5 --- /dev/null +++ b/polkit-explorer-git/.SRCINFO @@ -0,0 +1,16 @@ +pkgbase = polkit-explorer-git + pkgdesc = Present PolicyKit information in a human-readable form. + pkgver = 22.3ad139b + pkgrel = 5 + url = https://github.com/scarygliders/polkit-explorer + arch = any + license = ISC + makedepends = git + depends = pyside6 + depends = python-lxml + provides = polkit-explorer + conflicts = polkit-explorer + source = git+https://github.com/scarygliders/polkit-explorer.git + sha512sums = SKIP + +pkgname = polkit-explorer-git diff --git a/polkit-explorer-git/PKGBUILD b/polkit-explorer-git/PKGBUILD new file mode 100644 index 0000000..bc56b51 --- /dev/null +++ b/polkit-explorer-git/PKGBUILD @@ -0,0 +1,35 @@ +# Maintainer: Manuel Hüsers +# Contributor: Alad Wenter + +pkgname=polkit-explorer-git +_pkgname=${pkgname%-git} +pkgver=22.3ad139b +pkgrel=5 +pkgdesc='Present PolicyKit information in a human-readable form.' +arch=('any') +url="https://github.com/scarygliders/${_pkgname}" +license=('ISC') +depends=('pyside6' 'python-lxml') +makedepends=('git') +conflicts=('polkit-explorer') +provides=('polkit-explorer') +source=("git+${url}.git") +sha512sums=('SKIP') + +pkgver() { + cd "${srcdir}/${_pkgname}" + printf '%s.%s' "$(git rev-list --count HEAD)" "$(git rev-parse --short HEAD)" +} + +package() { + cd "${srcdir}/${_pkgname}" + + install -d -m755 "${pkgdir}"/{usr/bin,opt/$_pkgname} + install -m644 Ui_*.py "${pkgdir}/opt/${_pkgname}/" + + install -m755 'polkitex.py' "${pkgdir}/opt/${_pkgname}/" + ln -s "/opt/${_pkgname}/polkitex.py" "${pkgdir}/usr/bin/polkitex" + + install -Dm644 'LICENSE' "${pkgdir}/usr/share/licenses/${_pkgname}/LICENSE" + install -Dm644 "polkitex.desktop" "${pkgdir}/usr/share/applications/${_pkgname}.desktop" +} diff --git a/prepare-chroot.sh b/prepare-chroot.sh new file mode 100755 index 0000000..6a38479 --- /dev/null +++ b/prepare-chroot.sh @@ -0,0 +1,15 @@ +#!/bin/sh + +[ -z "$CHROOT" ] && echo "CHROOT env var is unset." && exit 1 + +sudo -v || exit 1 + +[ ! -d "$CHROOT/root" ] && sudo mkarchroot -C "$(dirname "$0")"/pacman.conf -M "$(dirname "$0")"/makepkg.conf "$CHROOT/root" base-devel + +arch-nspawn "$CHROOT/root" pacman -Syu +mkdir -p -m 0755 "$CHROOT/$USER" + +mountpoint -q "$CHROOT/$USER" +test $? -ne 0 && sudo mount -t tmpfs -o defaults,nodev,mode=0755,uid=$(id -u),gid=$(id -g) tmpfs "$CHROOT/$USER" + +exit 0 diff --git a/qvr/.SRCINFO b/qvr/.SRCINFO new file mode 100644 index 0000000..4fff039 --- /dev/null +++ b/qvr/.SRCINFO @@ -0,0 +1,16 @@ +pkgbase = qvr + pkgdesc = A library that makes writing Virtual Reality (VR) applications very easy + pkgver = 4.1.0 + pkgrel = 1 + url = https://marlam.de/qvr/ + arch = x86_64 + license = MIT + makedepends = cmake + depends = qt6-base + source = https://marlam.de/qvr/releases/qvr-4.1.0.tar.gz + source = https://marlam.de/qvr/releases/qvr-4.1.0.tar.gz.sig + validpgpkeys = 2F61B4828BBA779AECB3F32703A2A4AB1E32FD34 + sha512sums = 609b706f06d21668db85dbdc282a1b86931ba380c0044e2918bbcd11903748ccc83579d9790dcf372ea8ebc7c86daa6810f12a43b8d7fc941b32b17f34c0b716 + sha512sums = SKIP + +pkgname = qvr diff --git a/qvr/PKGBUILD b/qvr/PKGBUILD new file mode 100644 index 0000000..d46769c --- /dev/null +++ b/qvr/PKGBUILD @@ -0,0 +1,28 @@ +# Maintainer: Manuel Hüsers + +pkgname=qvr +pkgver=4.1.0 +pkgrel=1 +pkgdesc='A library that makes writing Virtual Reality (VR) applications very easy' +arch=('x86_64') +url='https://marlam.de/qvr/' +license=('MIT') +depends=('qt6-base') +makedepends=('cmake') +source=(https://marlam.de/qvr/releases/$pkgname-$pkgver.tar.gz{,.sig}) +sha512sums=('609b706f06d21668db85dbdc282a1b86931ba380c0044e2918bbcd11903748ccc83579d9790dcf372ea8ebc7c86daa6810f12a43b8d7fc941b32b17f34c0b716' + 'SKIP') +validpgpkeys=('2F61B4828BBA779AECB3F32703A2A4AB1E32FD34') + +build() { + cmake -B build -S "$pkgname-$pkgver/libqvr" \ + -DCMAKE_INSTALL_PREFIX=/usr \ + -DCMAKE_BUILD_TYPE=Release \ + -DBUILD_TESTING=OFF + + cmake --build build +} + +package() { + DESTDIR="$pkgdir" cmake --install build +} diff --git a/rc-local/.SRCINFO b/rc-local/.SRCINFO new file mode 100644 index 0000000..20915f2 --- /dev/null +++ b/rc-local/.SRCINFO @@ -0,0 +1,16 @@ +pkgbase = rc-local + pkgdesc = Support for legacy rc.local scripts + pkgver = 4 + pkgrel = 1 + url = https://aur.archlinux.org/packages/rc-local/ + install = rc-local.install + arch = any + license = LGPL-2.1-or-later + depends = systemd + backup = etc/rc.local + source = rc.local + source = rc-local.service + sha512sums = 4c3f8498957d47cf2c6ed6d755f6d6a6e42a59ac176b5a752ea4cdd23418d009c180bd53609bc34a1b11f720d71e702d71b4014ae4f98008c89f86323dc9afab + sha512sums = 85c7eafe5d79c4829b48c4df867e28bdb0b4464cab3581fd67e288648d416ceb69fe4e6b5193f86517f1e9578ef05fba8f708097625de6b903c6794fbec5078e + +pkgname = rc-local diff --git a/rc-local/PKGBUILD b/rc-local/PKGBUILD new file mode 100644 index 0000000..4ac415a --- /dev/null +++ b/rc-local/PKGBUILD @@ -0,0 +1,23 @@ +# Maintainer: Manuel Hüsers +# Contributor: megadriver +# Contributor: $pooky Hunter + +pkgname=rc-local +pkgver=4 +pkgrel=1 +pkgdesc='Support for legacy rc.local scripts' +url="https://aur.archlinux.org/packages/${pkgname}/" +arch=('any') +license=('LGPL-2.1-or-later') +install="${pkgname}.install" +depends=('systemd') +backup=('etc/rc.local') +source=('rc.local' + 'rc-local.service') +sha512sums=('4c3f8498957d47cf2c6ed6d755f6d6a6e42a59ac176b5a752ea4cdd23418d009c180bd53609bc34a1b11f720d71e702d71b4014ae4f98008c89f86323dc9afab' + '85c7eafe5d79c4829b48c4df867e28bdb0b4464cab3581fd67e288648d416ceb69fe4e6b5193f86517f1e9578ef05fba8f708097625de6b903c6794fbec5078e') + +package() { + install -Dm755 'rc.local' "${pkgdir}/etc/rc.local" + install -Dm644 'rc-local.service' "${pkgdir}/usr/lib/systemd/system/rc-local.service" +} diff --git a/rc-local/rc-local.install b/rc-local/rc-local.install new file mode 100644 index 0000000..19b1b46 --- /dev/null +++ b/rc-local/rc-local.install @@ -0,0 +1,8 @@ +post_install() { + cat < Please activate the rc-local service to execute /etc/rc.local on boot. +==> Run as root: systemctl enable rc-local.service + +EOF +} diff --git a/rc-local/rc-local.service b/rc-local/rc-local.service new file mode 100644 index 0000000..bc099a7 --- /dev/null +++ b/rc-local/rc-local.service @@ -0,0 +1,20 @@ +# This file is part of systemd. +# +# systemd is free software; you can redistribute it and/or modify it +# under the terms of the GNU Lesser General Public License as published by +# the Free Software Foundation; either version 2.1 of the License, or +# (at your option) any later version. + +[Unit] +Description=/etc/rc.local Compatibility +ConditionFileIsExecutable=/etc/rc.local + +[Service] +Type=forking +ExecStart=/etc/rc.local start +TimeoutSec=0 +StandardOutput=tty +RemainAfterExit=yes + +[Install] +WantedBy=multi-user.target diff --git a/rc-local/rc.local b/rc-local/rc.local new file mode 100644 index 0000000..65634df --- /dev/null +++ b/rc-local/rc.local @@ -0,0 +1,14 @@ +#!/bin/sh -e +# +# rc.local +# +# This script is executed at the end of each multiuser runlevel. +# Make sure that the script will "exit 0" on success or any other +# value on error. +# +# In order to enable or disable this script just change the execution +# bits. +# +# By default this script does nothing. + +exit 0 diff --git a/rcedit-bin/.SRCINFO b/rcedit-bin/.SRCINFO new file mode 100644 index 0000000..0a22d92 --- /dev/null +++ b/rcedit-bin/.SRCINFO @@ -0,0 +1,18 @@ +pkgbase = rcedit-bin + pkgdesc = Command line tool to edit resources of windows exe files + pkgver = 2.0.0 + pkgrel = 4 + url = https://github.com/electron/rcedit + arch = any + license = MIT + depends = wine + provides = rcedit + conflicts = rcedit + source = https://github.com/electron/rcedit/releases/download/v2.0.0/rcedit-x64.exe + source = https://raw.githubusercontent.com/electron/rcedit/v2.0.0/LICENSE + source = rcedit.sh + sha512sums = c13e7ffd60169c348e16a3ea59a171c1777acdb241f950c11a6e9b69c955a3a4eb3432182aee7f489a87a555d0bd51fde3b597826f7c1e6488f1f5097359ab4d + sha512sums = ca664e9ec12e6e23878c55f2b56e44fac50fc8b88c71499a4794fe3a0e8de18008c7435970628c8386410534dd5cc27af3ea5e7a818d6244f6159bc183969638 + sha512sums = ce46f14c4e7c945c69fdfbc48bfd22c8241f653a974f4950d8378bb81943144f5b3ee2e49cb08a26637c46558327184c6504714f7e781f86fbf7b0c64f561bd0 + +pkgname = rcedit-bin diff --git a/rcedit-bin/PKGBUILD b/rcedit-bin/PKGBUILD new file mode 100644 index 0000000..1ccd122 --- /dev/null +++ b/rcedit-bin/PKGBUILD @@ -0,0 +1,26 @@ +# Maintainer: Manuel Hüsers +# Contributor: jdigi78 + +pkgname=rcedit-bin +_pkgname=${pkgname%-bin} +pkgver=2.0.0 +pkgrel=4 +pkgdesc='Command line tool to edit resources of windows exe files' +arch=('any') +url="https://github.com/electron/${_pkgname}" +license=('MIT') +depends=('wine') +provides=("${_pkgname}") +conflicts=("${_pkgname}") +source=("https://github.com/electron/${_pkgname}/releases/download/v${pkgver}/${_pkgname}-x64.exe" + "https://raw.githubusercontent.com/electron/${_pkgname}/v${pkgver}/LICENSE" + "${_pkgname}.sh") +sha512sums=('c13e7ffd60169c348e16a3ea59a171c1777acdb241f950c11a6e9b69c955a3a4eb3432182aee7f489a87a555d0bd51fde3b597826f7c1e6488f1f5097359ab4d' + 'ca664e9ec12e6e23878c55f2b56e44fac50fc8b88c71499a4794fe3a0e8de18008c7435970628c8386410534dd5cc27af3ea5e7a818d6244f6159bc183969638' + 'ce46f14c4e7c945c69fdfbc48bfd22c8241f653a974f4950d8378bb81943144f5b3ee2e49cb08a26637c46558327184c6504714f7e781f86fbf7b0c64f561bd0') + +package() { + install -Dm755 "${_pkgname}-x64.exe" "${pkgdir}/opt/${_pkgname}/${_pkgname}-x64.exe" + install -Dm755 "${_pkgname}.sh" "${pkgdir}/usr/bin/${_pkgname}" + install -Dm644 "LICENSE" "${pkgdir}/usr/share/licenses/${_pkgname}/LICENSE" +} diff --git a/rcedit-bin/rcedit.sh b/rcedit-bin/rcedit.sh new file mode 100755 index 0000000..32aa13a --- /dev/null +++ b/rcedit-bin/rcedit.sh @@ -0,0 +1,4 @@ +#!/bin/sh +export WINEDEBUG=-all +export DISPLAY="" +exec wine /opt/rcedit/rcedit-x64.exe "$@" diff --git a/sierra-breeze-enhanced/.SRCINFO b/sierra-breeze-enhanced/.SRCINFO new file mode 100644 index 0000000..bbbb659 --- /dev/null +++ b/sierra-breeze-enhanced/.SRCINFO @@ -0,0 +1,15 @@ +pkgbase = sierra-breeze-enhanced + pkgdesc = A kwin decoration with support for transparency, rounded corners, multiple titlebar button presets and more + pkgver = 2.1.1 + pkgrel = 1 + url = https://github.com/kupiqu/sierrabreezeenhanced + arch = x86_64 + license = GPL-3.0-or-later + makedepends = cmake + makedepends = extra-cmake-modules + depends = kwin>=6.3 + depends = qt6-base>=6.9 + source = https://github.com/kupiqu/sierrabreezeenhanced/archive/V.2.1.1/sierra-breeze-enhanced-V.2.1.1.tar.gz + sha512sums = 5ebe3dcb0e9ab56eee914aefa249a2664e62d1c68e1d623bf0e2ef7e1c1c735e3a63f841db8a5c910b21935ee13ba35eef4443ef2f1bc23fc9eda2e36d81ad7b + +pkgname = sierra-breeze-enhanced diff --git a/sierra-breeze-enhanced/PKGBUILD b/sierra-breeze-enhanced/PKGBUILD new file mode 100644 index 0000000..4044b25 --- /dev/null +++ b/sierra-breeze-enhanced/PKGBUILD @@ -0,0 +1,30 @@ +# Maintainer: Manuel Hüsers +# Contributor: Leo sk + +pkgname=sierra-breeze-enhanced +_pkgname=SierraBreezeEnhanced +pkgver=2.1.1 +pkgrel=1 +pkgdesc="A kwin decoration with support for transparency, rounded corners, multiple titlebar button presets and more" +arch=('x86_64') +url="https://github.com/kupiqu/${_pkgname,,}" +license=('GPL-3.0-or-later') +depends=('kwin>=6.3' 'qt6-base>=6.9') +makedepends=('cmake' 'extra-cmake-modules') +source=("${url}/archive/V.${pkgver}/${pkgname}-V.${pkgver}.tar.gz") +sha512sums=('5ebe3dcb0e9ab56eee914aefa249a2664e62d1c68e1d623bf0e2ef7e1c1c735e3a63f841db8a5c910b21935ee13ba35eef4443ef2f1bc23fc9eda2e36d81ad7b') + +build() { + cmake -B build -S "${_pkgname}-V.${pkgver}" \ + -DCMAKE_INSTALL_PREFIX=/usr \ + -DCMAKE_BUILD_TYPE=Release \ + -DKDE_INSTALL_LIBDIR=lib \ + -DBUILD_TESTING=OFF \ + -DKDE_INSTALL_USE_QT_SYS_PATHS=ON \ + -Wno-dev +} + +package() { + #DESTDIR="$pkgdir" cmake --install build + make -C build DESTDIR="$pkgdir" install +} diff --git a/spot-client/.SRCINFO b/spot-client/.SRCINFO new file mode 100644 index 0000000..7cd862e --- /dev/null +++ b/spot-client/.SRCINFO @@ -0,0 +1,34 @@ +pkgbase = spot-client + pkgdesc = Gtk/Rust native Spotify client + pkgver = 0.5.0 + pkgrel = 1 + url = https://github.com/xou816/spot + arch = x86_64 + arch = i686 + arch = arm + arch = armv6h + arch = armv7h + arch = aarch64 + license = MIT + checkdepends = appstream-glib + makedepends = cargo + makedepends = meson>=0.59.0 + makedepends = blueprint-compiler>=0.8.1 + depends = alsa-lib + depends = cairo + depends = glib2 + depends = glibc + depends = graphene + depends = gtk4 + depends = libadwaita + depends = libpulse + depends = openssl + depends = pango + optdepends = org.freedesktop.secrets + options = !lto + source = https://github.com/xou816/spot/archive/0.5.0/spot-0.5.0.tar.gz + source = disable-clippy.patch + sha512sums = a2acbc2666c3acea86562227b490373bdeff67831bef7275b47e759db366cacbeb2411578f56be824cca6cd72c833e5830db89c203af1c8165e06927eabcf3ec + sha512sums = 4e38fff2a5867c46749959ceb0fb16372f12c8f8038b6a33d43e126e741f43e524e1499bb9b514e56b036097aaa0ac5dd149823c2c9eba277ab0ea4f58d5fb55 + +pkgname = spot-client diff --git a/spot-client/PKGBUILD b/spot-client/PKGBUILD new file mode 100644 index 0000000..0b50251 --- /dev/null +++ b/spot-client/PKGBUILD @@ -0,0 +1,51 @@ +# Maintainer: Manuel Hüsers +# Contributor: Daniel Peukert +# Contributor: NicoHood + +_projectname='spot' +pkgname="$_projectname-client" +pkgver=0.5.0 +pkgrel=1 +pkgdesc='Gtk/Rust native Spotify client' +arch=('x86_64' 'i686' 'arm' 'armv6h' 'armv7h' 'aarch64') +url="https://github.com/xou816/$_projectname" +license=('MIT') +depends=('alsa-lib' 'cairo' 'glib2' 'glibc' 'graphene' 'gtk4' 'libadwaita' 'libpulse' 'openssl' 'pango') +optdepends=('org.freedesktop.secrets') +makedepends=('cargo' 'meson>=0.59.0' 'blueprint-compiler>=0.8.1') +checkdepends=('appstream-glib') +options=('!lto') # Build breaks with LTO enabled +source=("https://github.com/xou816/$_projectname/archive/$pkgver/$_projectname-$pkgver.tar.gz" + 'disable-clippy.patch') +sha512sums=('a2acbc2666c3acea86562227b490373bdeff67831bef7275b47e759db366cacbeb2411578f56be824cca6cd72c833e5830db89c203af1c8165e06927eabcf3ec' + '4e38fff2a5867c46749959ceb0fb16372f12c8f8038b6a33d43e126e741f43e524e1499bb9b514e56b036097aaa0ac5dd149823c2c9eba277ab0ea4f58d5fb55') +validpgpkeys=() # Waiting for https://github.com/xou816/spot/issues/283 + +_sourcedirectory="$_projectname-$pkgver" +_builddirectory='build' + +prepare() { + cd "$srcdir/$_sourcedirectory/" + # Disable failing clippy tests + patch -Np1 < '../disable-clippy.patch' +} + +build() { + cd "$srcdir/" + # We're not using arch-meson, because upstream recommends using --buildtype 'release' + # The offline build flag is turned off, as we're not predownloading rust dependencies + meson setup --prefix '/usr' --libexecdir 'lib' --sbindir 'bin' --buildtype 'release' --wrap-mode 'nodownload' \ + -Db_lto='true' -Db_pie='true' -Doffline='false' "$_sourcedirectory" "$_builddirectory" + meson compile -C "$_builddirectory" +} + +check() { + cd "$srcdir/" + meson test -C "$_builddirectory" --timeout-multiplier -1 +} + +package() { + cd "$srcdir/" + meson install -C "$_builddirectory" --destdir "$pkgdir" + install -Dm644 "$_sourcedirectory/LICENSE" "$pkgdir/usr/share/licenses/$pkgname/LICENSE" +} diff --git a/spot-client/disable-clippy.patch b/spot-client/disable-clippy.patch new file mode 100644 index 0000000..a845936 --- /dev/null +++ b/spot-client/disable-clippy.patch @@ -0,0 +1,24 @@ +diff --git a/src/meson.build b/src/meson.build +index 900f3fa..e08b062 100644 +--- a/src/meson.build ++++ b/src/meson.build +@@ -149,19 +149,3 @@ test('Unit tests', + timeout: 180, + env: env + ) +- +-test('Clippy', +- cargo, +- args: [ +- 'clippy', +- '--manifest-path', cargo_manifest, +- '--target-dir', meson.project_build_root() / 'src', +- '--', +- '-D', 'warnings', +- '-A', 'clippy::module_inception', +- '-A', 'clippy::new_without_default', +- '-A', 'clippy::enum-variant-names' +- ], +- timeout: 180, +- env: env +-) diff --git a/sublime-text-3/.SRCINFO b/sublime-text-3/.SRCINFO new file mode 100644 index 0000000..4f75fb2 --- /dev/null +++ b/sublime-text-3/.SRCINFO @@ -0,0 +1,16 @@ +pkgbase = sublime-text-3 + pkgdesc = Sophisticated text editor for code, html and prose (legacy version) + pkgver = 3.3211 + pkgrel = 5 + url = https://www.sublimetext.com/3 + install = sublime-text-3.install + arch = x86_64 + license = custom + depends = libpng + depends = gtk2 + source = https://download.sublimetext.com/sublime_text_3_build_3211_x64.tar.bz2 + source = sublime-text-3.sh + sha512sums = a6a068119eff95c5360e9ccbe1d845e7a93e4ad13b3659073752a7bd0e87f4691555820185514875649e677a4e8702e2338f74f5584fc80f69c16b323685d6f1 + sha512sums = ac56e9b7dddaebb3d222795cfc644109c93cc3f79695b8f9ee56022c74fe04a1134dd54cab07c74ff1f96b783cb3dbc026c16095552f1d2dd83115ea274dc2e9 + +pkgname = sublime-text-3 diff --git a/sublime-text-3/PKGBUILD b/sublime-text-3/PKGBUILD new file mode 100644 index 0000000..b607d65 --- /dev/null +++ b/sublime-text-3/PKGBUILD @@ -0,0 +1,46 @@ +# Maintainer: Manuel Hüsers +# Contributor: marcospb19 + +pkgname=sublime-text-3 +pkgver=3.3211 +pkgrel=5 +pkgdesc='Sophisticated text editor for code, html and prose (legacy version)' +arch=('x86_64') +url='https://www.sublimetext.com/3' +license=('custom') +depends=('libpng' 'gtk2') +install="${pkgname}.install" +source=("https://download.sublimetext.com/sublime_text_3_build_${pkgver:2}_x64.tar.bz2" + "${pkgname}.sh") +sha512sums=('a6a068119eff95c5360e9ccbe1d845e7a93e4ad13b3659073752a7bd0e87f4691555820185514875649e677a4e8702e2338f74f5584fc80f69c16b323685d6f1' + 'ac56e9b7dddaebb3d222795cfc644109c93cc3f79695b8f9ee56022c74fe04a1134dd54cab07c74ff1f96b783cb3dbc026c16095552f1d2dd83115ea274dc2e9') + +prepare() { + sed -i -e "s|@ST_PATH@|/opt/sublime_text_3|g" "${pkgname}.sh" + + # Adjust naming in desktop entry + sed -i -e 's#Sublime Text#Sublime Text 3#g' 'sublime_text_3/sublime_text.desktop' + sed -i -e 's#sublime-text#sublime-text-3#g' 'sublime_text_3/sublime_text.desktop' + sed -i -e 's#/opt/sublime_text/sublime_text#/usr/bin/subl3#g' 'sublime_text_3/sublime_text.desktop' + sed -i -e '\#^StartupNotify=#a StartupWMClass=subl3' 'sublime_text_3/sublime_text.desktop' +} + +package() { + # Install sublime text 3 + install -dm755 "${pkgdir}/opt" + cp --preserve=mode -r 'sublime_text_3' "${pkgdir}/opt/sublime_text_3" + rm -f "${pkgdir}/opt/sublime_text_3/sublime_text.desktop" + + # Install icons + for res in 128x128 16x16 256x256 32x32 48x48; do + install -dm755 "${pkgdir}/usr/share/icons/hicolor/${res}/apps" + ln -s "/opt/sublime_text_3/Icon/${res}/sublime-text.png" "${pkgdir}/usr/share/icons/hicolor/${res}/apps/sublime-text-3.png" + done + + # Install desktop entry and executable + install -dm755 "${pkgdir}/usr/share/applications" + install -Dm644 'sublime_text_3/sublime_text.desktop' "${pkgdir}/usr/share/applications/sublime_text_3.desktop" + + install -dm755 "${pkgdir}/usr/bin" + install -Dm755 "${pkgname}.sh" "${pkgdir}/usr/bin/subl3" +} diff --git a/sublime-text-3/sublime-text-3.install b/sublime-text-3/sublime-text-3.install new file mode 100644 index 0000000..83f0138 --- /dev/null +++ b/sublime-text-3/sublime-text-3.install @@ -0,0 +1,18 @@ +post_install() { + cat << _EOF + + ==> sublime-text-3 install note: + ------------------------------------------------------------------------------ + Since this is the last version of Sublime Text 3, you might want to disable + in-application reminders about new Sublime Text versions (reportedly only + works as a licensed user). + + Add the following setting to your User Preferences file: + "update_check": false + +_EOF +} + +post_upgrade() { + post_install +} diff --git a/sublime-text-3/sublime-text-3.sh b/sublime-text-3/sublime-text-3.sh new file mode 100644 index 0000000..5d228a4 --- /dev/null +++ b/sublime-text-3/sublime-text-3.sh @@ -0,0 +1,3 @@ +#!/bin/sh + +exec @ST_PATH@/sublime_text "$@" diff --git a/sublime-text-4/.SRCINFO b/sublime-text-4/.SRCINFO new file mode 100644 index 0000000..5c5c6ff --- /dev/null +++ b/sublime-text-4/.SRCINFO @@ -0,0 +1,20 @@ +pkgbase = sublime-text-4 + pkgdesc = Sophisticated text editor for code, html and prose - stable build + pkgver = 4.4200 + pkgrel = 1 + url = https://www.sublimetext.com/download + arch = x86_64 + arch = aarch64 + license = custom + depends = libpng + depends = gtk3 + provides = sublime-text + conflicts = sublime-text + source = sublime-text-4.sh + sha512sums = ac56e9b7dddaebb3d222795cfc644109c93cc3f79695b8f9ee56022c74fe04a1134dd54cab07c74ff1f96b783cb3dbc026c16095552f1d2dd83115ea274dc2e9 + source_x86_64 = sublime_text_4_4_4200_1_x64.tar.xz::https://download.sublimetext.com/sublime_text_build_4200_x64.tar.xz + sha512sums_x86_64 = 0a6ff4be7ae35ce80d568a2bf8dc5ed6fcf9f845517f7a1b8b24f180842f72ef16f9792e91fc70a277cfaf66bf1be482bb1328c98252d7c524d3412cfe9f22e3 + source_aarch64 = sublime_text_4_4_4200_1_arm64.tar.xz::https://download.sublimetext.com/sublime_text_build_4200_arm64.tar.xz + sha512sums_aarch64 = bb8f314e3c0ffff2536f91331fe43fe55d42fed27fca32bced5e779331296c7ee4b619dacc0193bc7f2cfa16a770177a81783ed959c786522e9688b028c7c221 + +pkgname = sublime-text-4 diff --git a/sublime-text-4/PKGBUILD b/sublime-text-4/PKGBUILD new file mode 100644 index 0000000..7114b57 --- /dev/null +++ b/sublime-text-4/PKGBUILD @@ -0,0 +1,43 @@ +# Maintainer: Manuel Hüsers + +pkgname=sublime-text-4 +pkgver=4.4200 +pkgrel=1 +pkgdesc='Sophisticated text editor for code, html and prose - stable build' +arch=('x86_64' 'aarch64') +url='https://www.sublimetext.com/download' +license=('custom') +depends=('libpng' 'gtk3') +conflicts=('sublime-text') +provides=('sublime-text') + +source=("${pkgname}.sh") +source_x86_64=("${pkgname//-/_}_${pkgver/./_}_${pkgrel}_x64.tar.xz::https://download.sublimetext.com/sublime_text_build_${pkgver:2}_x64.tar.xz") +source_aarch64=("${pkgname//-/_}_${pkgver/./_}_${pkgrel}_arm64.tar.xz::https://download.sublimetext.com/sublime_text_build_${pkgver:2}_arm64.tar.xz") + +sha512sums=('ac56e9b7dddaebb3d222795cfc644109c93cc3f79695b8f9ee56022c74fe04a1134dd54cab07c74ff1f96b783cb3dbc026c16095552f1d2dd83115ea274dc2e9') +sha512sums_x86_64=('0a6ff4be7ae35ce80d568a2bf8dc5ed6fcf9f845517f7a1b8b24f180842f72ef16f9792e91fc70a277cfaf66bf1be482bb1328c98252d7c524d3412cfe9f22e3') +sha512sums_aarch64=('bb8f314e3c0ffff2536f91331fe43fe55d42fed27fca32bced5e779331296c7ee4b619dacc0193bc7f2cfa16a770177a81783ed959c786522e9688b028c7c221') + +prepare() { + sed -i -e "s|@ST_PATH@|/opt/sublime_text|g" "${pkgname}.sh" + sed -i -e 's#/opt/sublime_text/sublime_text#/usr/bin/subl#g' 'sublime_text/sublime_text.desktop' + sed -i -e '\#^StartupNotify=#a StartupWMClass=subl' 'sublime_text/sublime_text.desktop' +} + +package() { + install -dm755 "${pkgdir}/opt" + cp --preserve=mode -r 'sublime_text' "${pkgdir}/opt/sublime_text" + rm -f "${pkgdir}/opt/sublime_text/sublime_text.desktop" + + for res in 128x128 16x16 256x256 32x32 48x48; do + install -dm755 "${pkgdir}/usr/share/icons/hicolor/${res}/apps" + ln -s "/opt/sublime_text/Icon/${res}/sublime-text.png" "${pkgdir}/usr/share/icons/hicolor/${res}/apps/sublime-text.png" + done + + install -dm755 "${pkgdir}/usr/share/applications" + install -Dm644 'sublime_text/sublime_text.desktop' "${pkgdir}/usr/share/applications/sublime_text.desktop" + + install -dm755 "${pkgdir}/usr/bin" + install -Dm755 "${pkgname}.sh" "${pkgdir}/usr/bin/subl" +} diff --git a/sublime-text-4/sublime-text-4.sh b/sublime-text-4/sublime-text-4.sh new file mode 100644 index 0000000..5d228a4 --- /dev/null +++ b/sublime-text-4/sublime-text-4.sh @@ -0,0 +1,3 @@ +#!/bin/sh + +exec @ST_PATH@/sublime_text "$@" diff --git a/sublime-text-dev/.SRCINFO b/sublime-text-dev/.SRCINFO new file mode 100644 index 0000000..a575ab2 --- /dev/null +++ b/sublime-text-dev/.SRCINFO @@ -0,0 +1,21 @@ +pkgbase = sublime-text-dev + pkgdesc = Sophisticated text editor for code, html and prose - dev build + pkgver = 4.4199 + pkgrel = 1 + url = https://www.sublimetext.com/dev + install = sublime-text-dev.install + arch = x86_64 + arch = aarch64 + license = custom + depends = libpng + depends = gtk3 + provides = sublime-text + conflicts = sublime-text + source = sublime-text-dev.sh + sha512sums = ac56e9b7dddaebb3d222795cfc644109c93cc3f79695b8f9ee56022c74fe04a1134dd54cab07c74ff1f96b783cb3dbc026c16095552f1d2dd83115ea274dc2e9 + source_x86_64 = sublime_text_dev_4_4199_1_x64.tar.xz::https://download.sublimetext.com/sublime_text_build_4199_x64.tar.xz + sha512sums_x86_64 = 617daf32df1660c7bb3ff94e0dc1b3b0b56c6999700da71f50b7df35f3c05cd8ebbcdc385266427186533624bb53be9c58bf1610ded762338d0be3ba2e0293de + source_aarch64 = sublime_text_dev_4_4199_1_arm64.tar.xz::https://download.sublimetext.com/sublime_text_build_4199_arm64.tar.xz + sha512sums_aarch64 = ce8e60bfc2da91606a2537ff2b111b4ef6a26d2d307eeb0429d8a59007dcfdfc3fdc54a960e51b06db3f42521fe4a84aa5994bded1caef86c77520fc8d458317 + +pkgname = sublime-text-dev diff --git a/sublime-text-dev/PKGBUILD b/sublime-text-dev/PKGBUILD new file mode 100644 index 0000000..e0eb1d5 --- /dev/null +++ b/sublime-text-dev/PKGBUILD @@ -0,0 +1,46 @@ +# Maintainer: Manuel Hüsers +# Contributor: Sander Boom +# Contributor: realitygaps + +pkgname=sublime-text-dev +pkgver=4.4199 +pkgrel=1 +pkgdesc='Sophisticated text editor for code, html and prose - dev build' +arch=('x86_64' 'aarch64') +url='https://www.sublimetext.com/dev' +license=('custom') +depends=('libpng' 'gtk3') +conflicts=('sublime-text') +provides=('sublime-text') +install=${pkgname}.install + +source=("${pkgname}.sh") +source_x86_64=("${pkgname//-/_}_${pkgver/./_}_${pkgrel}_x64.tar.xz::https://download.sublimetext.com/sublime_text_build_${pkgver:2}_x64.tar.xz") +source_aarch64=("${pkgname//-/_}_${pkgver/./_}_${pkgrel}_arm64.tar.xz::https://download.sublimetext.com/sublime_text_build_${pkgver:2}_arm64.tar.xz") + +sha512sums=('ac56e9b7dddaebb3d222795cfc644109c93cc3f79695b8f9ee56022c74fe04a1134dd54cab07c74ff1f96b783cb3dbc026c16095552f1d2dd83115ea274dc2e9') +sha512sums_x86_64=('617daf32df1660c7bb3ff94e0dc1b3b0b56c6999700da71f50b7df35f3c05cd8ebbcdc385266427186533624bb53be9c58bf1610ded762338d0be3ba2e0293de') +sha512sums_aarch64=('ce8e60bfc2da91606a2537ff2b111b4ef6a26d2d307eeb0429d8a59007dcfdfc3fdc54a960e51b06db3f42521fe4a84aa5994bded1caef86c77520fc8d458317') + +prepare() { + sed -i -e "s|@ST_PATH@|/opt/sublime_text|g" "${pkgname}.sh" + sed -i -e 's#/opt/sublime_text/sublime_text#/usr/bin/subl#g' 'sublime_text/sublime_text.desktop' + sed -i -e '\#^StartupNotify=#a StartupWMClass=subl' 'sublime_text/sublime_text.desktop' +} + +package() { + install -dm755 "${pkgdir}/opt" + cp --preserve=mode -r 'sublime_text' "${pkgdir}/opt/sublime_text" + rm -f "${pkgdir}/opt/sublime_text/sublime_text.desktop" + + for res in 128x128 16x16 256x256 32x32 48x48; do + install -dm755 "${pkgdir}/usr/share/icons/hicolor/${res}/apps" + ln -s "/opt/sublime_text/Icon/${res}/sublime-text.png" "${pkgdir}/usr/share/icons/hicolor/${res}/apps/sublime-text.png" + done + + install -dm755 "${pkgdir}/usr/share/applications" + install -Dm644 'sublime_text/sublime_text.desktop' "${pkgdir}/usr/share/applications/sublime_text.desktop" + + install -dm755 "${pkgdir}/usr/bin" + install -Dm755 "${pkgname}.sh" "${pkgdir}/usr/bin/subl" +} diff --git a/sublime-text-dev/sublime-text-dev.install b/sublime-text-dev/sublime-text-dev.install new file mode 100644 index 0000000..0ef6354 --- /dev/null +++ b/sublime-text-dev/sublime-text-dev.install @@ -0,0 +1,28 @@ +post_install() { + cat << _EOF + + ==> sublime-text-dev install note: + ------------------------------------------------------------------------------ + This package is used for the actual 'dev' branch of Sublime Text that + requires a license to be purchased from the Sublime Text website. + If you want to keep using the latest stable release you should instead + install 'sublime-text-4' or use the official repos provided by Sublime Text. + + To disable in-application reminders about new Sublime Text dev versions, + add the following setting to your User Preferences file: + "update_check": false + +_EOF +} + +post_upgrade() { + cat << _EOF + + ==> sublime-text-dev upgrade note: + ------------------------------------------------------------------------------ + To disable in-application reminders about new Sublime Text dev versions, + add the following setting to your User Preferences file: + "update_check": false + +_EOF +} diff --git a/sublime-text-dev/sublime-text-dev.sh b/sublime-text-dev/sublime-text-dev.sh new file mode 100644 index 0000000..5d228a4 --- /dev/null +++ b/sublime-text-dev/sublime-text-dev.sh @@ -0,0 +1,3 @@ +#!/bin/sh + +exec @ST_PATH@/sublime_text "$@" diff --git a/tuned-git/.SRCINFO b/tuned-git/.SRCINFO new file mode 100644 index 0000000..c0e63dc --- /dev/null +++ b/tuned-git/.SRCINFO @@ -0,0 +1,50 @@ +pkgbase = tuned-git + pkgdesc = Daemon that performs monitoring and adaptive configuration of devices in the system + pkgver = 2.26.0.r0.g181472a + pkgrel = 1 + url = https://github.com/redhat-performance/tuned + arch = any + license = GPL-2.0-or-later + makedepends = desktop-file-utils + makedepends = git + depends = ethtool + depends = gawk + depends = hdparm + depends = polkit + depends = perf + depends = python-configobj + depends = python-dbus + depends = python-gobject + depends = python-linux-procfs + depends = python-pyudev + source = git+https://github.com/redhat-performance/tuned.git + sha512sums = SKIP + +pkgname = tuned-git + optdepends = virt-what: Virtual machine detection + optdepends = systemtap: Detailed system monitoring + optdepends = tuned-ppd: power-profiles-daemon api translation + optdepends = wireless_tools: Wireless device power management + optdepends = x86_energy_perf_policy: Energy Performance Bias (EPB) support + provides = tuned + conflicts = tuned + backup = etc/tuned/active_profile + backup = etc/tuned/bootcmdline + backup = etc/tuned/cpu-partitioning-powersave-variables.conf + backup = etc/tuned/cpu-partitioning-variables.conf + backup = etc/tuned/post_loaded_profile + backup = etc/tuned/profile_mode + backup = etc/tuned/realtime-variables.conf + backup = etc/tuned/realtime-virtual-guest-variables.conf + backup = etc/tuned/realtime-virtual-host-variables.conf + backup = etc/tuned/tuned-main.conf + +pkgname = tuned-ppd-git + pkgdesc = Daemon that allows applications to easily transition to TuneD from power-profiles-daemon (PPD) + depends = tuned + depends = python-pyinotify + provides = tuned-ppd + provides = power-profiles-daemon + conflicts = tuned-ppd + conflicts = power-profiles-daemon + backup = etc/tuned/ppd.conf diff --git a/tuned-git/PKGBUILD b/tuned-git/PKGBUILD new file mode 100644 index 0000000..e40b411 --- /dev/null +++ b/tuned-git/PKGBUILD @@ -0,0 +1,71 @@ +# Maintainer: Manuel Hüsers +# Contributor: Wes Jackson +# Contributor: Iwan Timmer +# Contributor: Timothée Ravier +# Contributor: Tom + +_pkgbase=tuned +pkgbase="${_pkgbase}-git" +pkgname=("${_pkgbase}-git" "${_pkgbase}-ppd-git") +pkgver=2.26.0.r0.g181472a +pkgrel=1 +pkgdesc='Daemon that performs monitoring and adaptive configuration of devices in the system' +arch=('any') +url="https://github.com/redhat-performance/${_pkgbase}" +license=('GPL-2.0-or-later') +depends=('ethtool' 'gawk' 'hdparm' 'polkit' 'perf' 'python-configobj' + 'python-dbus' 'python-gobject' 'python-linux-procfs' 'python-pyudev') +makedepends=('desktop-file-utils' 'git') +source=("git+${url}.git") +sha512sums=('SKIP') + +pkgver() { + cd "${_pkgbase}" + git describe --long --tags | sed 's/\([^-]*-g\)/r\1/;s/^v//g;s/-/./g' +} + +prepare() { + cd "${_pkgbase}" + + sed -i 's|/sbin/|/bin/|g' tuned.service tuned-gui.py tuned-gui.desktop tuned/ppd/tuned-ppd.service +} + +package_tuned-git() { + optdepends=('virt-what: Virtual machine detection' + 'systemtap: Detailed system monitoring' + 'tuned-ppd: power-profiles-daemon api translation' + 'wireless_tools: Wireless device power management' + 'x86_energy_perf_policy: Energy Performance Bias (EPB) support') + provides=("${_pkgbase}") + conflicts=("${_pkgbase}") + backup=('etc/tuned/active_profile' + 'etc/tuned/bootcmdline' + 'etc/tuned/cpu-partitioning-powersave-variables.conf' + 'etc/tuned/cpu-partitioning-variables.conf' + 'etc/tuned/post_loaded_profile' + 'etc/tuned/profile_mode' + 'etc/tuned/realtime-variables.conf' + 'etc/tuned/realtime-virtual-guest-variables.conf' + 'etc/tuned/realtime-virtual-host-variables.conf' + 'etc/tuned/tuned-main.conf') + + cd "${_pkgbase}" + + make DESTDIR="${pkgdir}" SBINDIR="/usr/bin" LIBEXECDIR="/usr/lib" install + rm -rv "${pkgdir}"/{run,var} + + python -m compileall -d /usr/lib "${pkgdir}/usr/lib" + python -O -m compileall -d /usr/lib "${pkgdir}/usr/lib" +} + +package_tuned-ppd-git() { + pkgdesc='Daemon that allows applications to easily transition to TuneD from power-profiles-daemon (PPD)' + depends=("${_pkgbase}" 'python-pyinotify') + provides=("${_pkgbase}-ppd" 'power-profiles-daemon') + conflicts=("${_pkgbase}-ppd" 'power-profiles-daemon') + backup=('etc/tuned/ppd.conf') + + cd "${_pkgbase}" + + make DESTDIR="${pkgdir}" SBINDIR="/usr/bin" LIBEXECDIR="/usr/lib" install-ppd +} diff --git a/waifu2x-ncnn-vulkan/.SRCINFO b/waifu2x-ncnn-vulkan/.SRCINFO new file mode 100644 index 0000000..6716718 --- /dev/null +++ b/waifu2x-ncnn-vulkan/.SRCINFO @@ -0,0 +1,20 @@ +pkgbase = waifu2x-ncnn-vulkan + pkgdesc = waifu2x converter ncnn version, runs fast on intel / amd / nvidia GPU with vulkan + pkgver = 20220728 + pkgrel = 1 + url = https://github.com/nihui/waifu2x-ncnn-vulkan + arch = x86_64 + arch = aarch64 + license = MIT + makedepends = cmake + makedepends = glslang + makedepends = vulkan-headers + makedepends = ncnn + depends = vulkan-icd-loader + depends = libwebp + source = https://github.com/nihui/waifu2x-ncnn-vulkan/archive/20220728/waifu2x-ncnn-vulkan-20220728.tar.gz + source = model_path.patch + sha512sums = ea17cbbcb7318586793222c6c7139f67395c49c567b601969b829fc426eb517308509b7c1da69171fcbf8e68baa5cec3e52e98159e3c5e6c35ce47a8514dadb7 + sha512sums = 1a286730a7168f63c56544b334277234b84415bcc4c2956c8f8f39ef0d864f9de4ecb38cb9491da91c45b43d5ecdba0018931c2926fb6e2aea98edf3ca42657a + +pkgname = waifu2x-ncnn-vulkan diff --git a/waifu2x-ncnn-vulkan/PKGBUILD b/waifu2x-ncnn-vulkan/PKGBUILD new file mode 100644 index 0000000..60fa12d --- /dev/null +++ b/waifu2x-ncnn-vulkan/PKGBUILD @@ -0,0 +1,41 @@ +pkgname=waifu2x-ncnn-vulkan +pkgver=20220728 +pkgrel=1 +pkgdesc='waifu2x converter ncnn version, runs fast on intel / amd / nvidia GPU with vulkan' +arch=('x86_64' 'aarch64') +url="https://github.com/nihui/$pkgname" +license=('MIT') +depends=('vulkan-icd-loader' 'libwebp') +makedepends=('cmake' 'glslang' 'vulkan-headers' 'ncnn') +source=("https://github.com/nihui/$pkgname/archive/$pkgver/$pkgname-$pkgver.tar.gz" + 'model_path.patch') +sha512sums=('ea17cbbcb7318586793222c6c7139f67395c49c567b601969b829fc426eb517308509b7c1da69171fcbf8e68baa5cec3e52e98159e3c5e6c35ce47a8514dadb7' + '1a286730a7168f63c56544b334277234b84415bcc4c2956c8f8f39ef0d864f9de4ecb38cb9491da91c45b43d5ecdba0018931c2926fb6e2aea98edf3ca42657a') + +prepare() { + cd $pkgname-$pkgver + + # TODO: Make proper patch + patch -Np1 < '../model_path.patch' +} + +build() { + cmake -B build -S "$pkgname-$pkgver/src" \ + -DCMAKE_INSTALL_PREFIX=/usr \ + -DGLSLANG_TARGET_DIR=/usr/lib/cmake \ + -DCMAKE_BUILD_TYPE=Release \ + -DUSE_SYSTEM_NCNN=on \ + -DUSE_SYSTEM_WEBP=on + + cmake --build build +} + +package() { + install -Dm755 -t "$pkgdir/usr/bin" build/$pkgname + install -Dm644 -t "$pkgdir/usr/share/licenses/$pkgname" $pkgname-$pkgver/LICENSE + + cd $pkgname-$pkgver/models + for f in models-*/*; do + install -Dm644 "$f" "$pkgdir/usr/share/$pkgname/$f" + done +} diff --git a/waifu2x-ncnn-vulkan/model_path.patch b/waifu2x-ncnn-vulkan/model_path.patch new file mode 100644 index 0000000..3fd7396 --- /dev/null +++ b/waifu2x-ncnn-vulkan/model_path.patch @@ -0,0 +1,26 @@ +diff --git a/src/filesystem_utils.h b/src/filesystem_utils.h +index fdf172c..9706dc9 100644 +--- a/src/filesystem_utils.h ++++ b/src/filesystem_utils.h +@@ -169,7 +169,7 @@ static path_t sanitize_filepath(const path_t& path) + if (filepath_is_readable(path)) + return path; + +- return get_executable_directory() + path; ++ return "/usr/share/waifu2x-ncnn-vulkan/" + path; + } + + #endif // FILESYSTEM_UTILS_H +diff --git a/src/main.cpp b/src/main.cpp +index fa10e6f..5590b2f 100644 +--- a/src/main.cpp ++++ b/src/main.cpp +@@ -470,7 +470,7 @@ int main(int argc, char** argv) + int noise = 0; + int scale = 2; + std::vector tilesize; +- path_t model = PATHSTR("models-cunet"); ++ path_t model = PATHSTR("/usr/share/waifu2x-ncnn-vulkan/models-cunet"); + std::vector gpuid; + int jobs_load = 1; + std::vector jobs_proc; diff --git a/wxedid/.SRCINFO b/wxedid/.SRCINFO new file mode 100644 index 0000000..17345be --- /dev/null +++ b/wxedid/.SRCINFO @@ -0,0 +1,12 @@ +pkgbase = wxedid + pkgdesc = wxWidgets-based EDID (Extended Display Identification Data) editor + pkgver = 0.0.33 + pkgrel = 1 + url = https://sourceforge.net/projects/wxedid/ + arch = x86_64 + license = GPL-3.0-or-later + depends = wxwidgets-gtk3 + source = https://downloads.sourceforge.net/wxedid/wxedid-0.0.33.tar.gz + sha512sums = e09fcf9cc4c538c9ed7d8b92568cd16fbfaa84f58b9b8bf95de7d6e215606d4de5e5f7ecbf041cf676591cb93e1c36479ec88615684e4e4f4700af41c01074c9 + +pkgname = wxedid diff --git a/wxedid/PKGBUILD b/wxedid/PKGBUILD new file mode 100644 index 0000000..635a19d --- /dev/null +++ b/wxedid/PKGBUILD @@ -0,0 +1,30 @@ +# Maintainer: Manuel Hüsers +# Contributor: Jonathan Liu + +pkgname=wxedid +pkgver=0.0.33 +pkgrel=1 +pkgdesc='wxWidgets-based EDID (Extended Display Identification Data) editor' +arch=('x86_64') +url="https://sourceforge.net/projects/${pkgname}/" +license=('GPL-3.0-or-later') +depends=('wxwidgets-gtk3') +source=("https://downloads.sourceforge.net/${pkgname}/${pkgname}-${pkgver}.tar.gz") +sha512sums=('e09fcf9cc4c538c9ed7d8b92568cd16fbfaa84f58b9b8bf95de7d6e215606d4de5e5f7ecbf041cf676591cb93e1c36479ec88615684e4e4f4700af41c01074c9') + +build() { + cd "${pkgname}-${pkgver}" + autoreconf -f -i + ./configure --prefix=/usr + make +} + +check() { + cd "${pkgname}-${pkgver}" + make check +} + +package() { + cd "${pkgname}-${pkgver}" + make DESTDIR="$pkgdir" install +}