gabm / Satty

Satty - Modern Screenshot Annotation. A tool inspired by Swappy and Flameshot.
Mozilla Public License 2.0
388 stars 18 forks source link

`cargo-aur` generated wrong PKGBUILD and I want to maintain the PKGBUILD #29

Closed TD-Sky closed 7 months ago

TD-Sky commented 7 months ago

The wrong PKGBUILD executes cp -r . "$pkgdir/usr/" so it copies all artifacts and the tar.gz to user directory:

# Maintainer: Matthias Gabriel <gabm+aur@mailbox.org>
#
# This PKGBUILD was generated by `cargo aur`: https://crates.io/crates/cargo-aur

pkgname=satty-bin
pkgver=0.8.1
pkgrel=1
pkgdesc="A screenshot annotation tool inspired by Swappy and Flameshot"
url="https://github.com/gabm/satty"
license=("MPL-2.0")
arch=("x86_64")
provides=("satty")
conflicts=("satty")
source=("https://github.com/gabm/satty/releases/download/v$pkgver/satty-v$pkgver-x86_64.tar.gz")
sha256sums=("1902268b51d6f6533483afadd0d321b9e56d7abf42bc9c7d045f6f43df6d6d40")

package() {
    depends=('pango' 'glib2' 'cairo' 'libadwaita' 'gtk4' 'gdk-pixbuf2')

    mkdir -p "$pkgdir/usr/"
    cp -r . "$pkgdir/usr/"
}

Run pacman -Ql satty-bin | choose 1 | tree --fromfile | xs then get:

.
└── usr
    ├── bin
    │   └── satty
    ├── satty-v0.8.1-x86_64.tar.gz
    └── share
        ├── applications
        │   └── satty.desktop
        ├── icons
        │   └── hicolor
        │       └── scalable
        │           └── apps
        │               └── satty.svg
        └── licenses
            └── satty
                └── LICENSE

I can fix it. But do you want to host it to someone else? I'm maintaining a PKGBUILD repository: https://github.com/TD-Sky/PKGBUILDs . There is a famous repository https://github.com/orhun/PKGBUILDs hosting many rust project packages as well.

gabm commented 7 months ago

I did write that manually - and failed miserably :) thanks for pointing that out.

Could you specify what you suggest? do you want to help maintaining the package as is, or transfer the PKGSBUILD to your repo or contribute it to orhuns repo? Who will be maintaining it in those cases?

I would appreciate any help here and I am happy to include others as maintainers to help out.

TD-Sky commented 7 months ago

Transfer to my repository and I maintain it on my own. It doesn't require much work, so I don't think it's necessary to collaborate.

gabm commented 7 months ago

okay lets, go.. what do I need to do? add you as maintainer to AUR?

TD-Sky commented 7 months ago

Add me here: https://aur.archlinux.org/packages/satty-bin

I'm https://aur.archlinux.org/account/TD-Sky

gabm commented 7 months ago

done, can you confirm it works?

TD-Sky commented 7 months ago

Received.

TD-Sky commented 7 months ago

Please check https://github.com/TD-Sky/PKGBUILDs/blob/main/satty-bin/PKGBUILD . I'll upload it after you pass it.

gabm commented 7 months ago

thank you for this.. I have three questions

TD-Sky commented 7 months ago
gabm commented 7 months ago

That sounds weird. Dependencies should always stay in the metadata part. I'm not sure I understand what you mean.

I am referring to this line: https://aur.archlinux.org/cgit/aur.git/tree/PKGBUILD?h=satty-bin#n18

According to the PKGBUILD Documentation, there is:

An array of packages that must be installed for the software to build and run. Dependencies defined inside the package() function are only required to run the software.

.. technically, our dependencies for the bin package are purely "runtime" dependencies. During build time, we only need tar to unpack.


Yes, but most of them are required by gtk4 so we don't need to write them explicitly.

In principle you should not rely on transitive dependencies (e.g. deps pulled by deps) because that might - or might not - change..


anyways, none of this is a deal-breaker... go ahead if you don't want to fix it

TD-Sky commented 7 months ago

You misunderstood the document 😂. The word runtime is relative to the "build" of software instead of the package, which means we will write dependencies (gtk4, libadwaita... etc.) in package() only if the software itself isn't built from them but uses them at runtime.

Obviously satty is built from these dependencies so there are no needs to put depends in package(). This rule doesn't change whatever the package is (source,-bin,-git).


You could find that I execute yum install -y gtk4-devel libadwaita-devel in .github/workflows/release.yml. So trust gtk dependencies are stable.

gabm commented 7 months ago

okay.. strange.. I don't get it them

  1. when the executable is built and linked we usually need the dependencies present. This process I call build and I would say the "build dependencies" are required to do so
  2. when a prebuilt executable is packaged, we dont need any dependencies, because we only copy the prebuilt executable around. This process I call "packaging" and in that case, no dependencies need to be present
  3. when a package is installed, the required dependencies need to be pulled in order for the executable to be able to run. This process I call "installation" which should pull the "runtime dependencies"

In the case of satty-bin, the first step is executed as part of the upstream release process. only step 2 and 3 are executed by makepkg/pacman...


I just verified that with the current AUR package. There is no toplevel depends field but installing it in a clean archlinux docker image yields the following packages:

Package (92)                       New Version              Net Change  Download Size

extra/adobe-source-code-pro-fonts  2.042u+1.062i+1.026vf-1    1.86 MiB       0.91 MiB
extra/adwaita-cursors              45.0-1                    11.40 MiB       0.54 MiB
extra/adwaita-icon-theme           45.0-1                     1.20 MiB       0.21 MiB
extra/appstream                    1.0.0-5                   18.18 MiB       3.49 MiB
extra/avahi                        1:0.8+r189+g35bb1ba-1      1.89 MiB       0.42 MiB
extra/cairo                        1.18.0-1                   1.59 MiB       0.60 MiB
extra/cantarell-fonts              1:0.303.1-1                0.19 MiB       0.11 MiB
extra/dconf                        0.40.0-2                   0.45 MiB       0.10 MiB
extra/default-cursors              2-1                        0.00 MiB       0.00 MiB
extra/desktop-file-utils           0.27-1                     0.20 MiB       0.04 MiB
extra/duktape                      2.7.0-6                    0.79 MiB       0.17 MiB
extra/fontconfig                   2:2.14.2-1                 1.09 MiB       0.36 MiB
extra/freetype2                    2.13.2-1                   1.63 MiB       0.51 MiB
extra/fribidi                      1.0.13-2                   0.24 MiB       0.07 MiB
extra/gdk-pixbuf2                  2.42.10-2                  2.96 MiB       0.50 MiB
extra/glib-networking              1:2.78.0-1                 0.60 MiB       0.13 MiB
extra/graphene                     1.10.8-1                   2.49 MiB       0.19 MiB
extra/graphite                     1:1.3.14-3                 0.20 MiB       0.08 MiB
extra/gsettings-desktop-schemas    45.0-1                     4.92 MiB       0.68 MiB
extra/gssdp                        1.6.3-1                    0.24 MiB       0.06 MiB
extra/gst-plugins-bad-libs         1.22.7-1                  10.40 MiB       2.40 MiB
extra/gst-plugins-base-libs        1.22.7-1                  11.63 MiB       2.18 MiB
extra/gstreamer                    1.22.7-1                  10.49 MiB       1.79 MiB
extra/gtk-update-icon-cache        1:4.12.4-1                 0.04 MiB       0.02 MiB
extra/gtk4                         1:4.12.4-1                31.95 MiB       6.05 MiB
extra/gupnp                        1:1.6.6-1                  0.70 MiB       0.12 MiB
extra/gupnp-igd                    1.6.0-1                    0.11 MiB       0.03 MiB
extra/harfbuzz                     8.3.0-1                    3.90 MiB       0.98 MiB
extra/hicolor-icon-theme           0.17-3                     0.05 MiB       0.01 MiB
extra/iso-codes                    4.15.0-1                  18.47 MiB       3.25 MiB
extra/jbigkit                      2.1-7                      0.16 MiB       0.05 MiB
extra/json-glib                    1.8.0-1                    0.97 MiB       0.17 MiB
extra/lcms2                        2.16-1                     0.67 MiB       0.21 MiB
extra/libadwaita                   1:1.4.2-1                  3.90 MiB       0.55 MiB
extra/libcloudproviders            0.3.5-1                    0.47 MiB       0.06 MiB
extra/libcolord                    1.4.6-1                    1.25 MiB       0.18 MiB
extra/libcups                      1:2.4.7-2                  0.82 MiB       0.27 MiB
extra/libdaemon                    0.14-5                     0.06 MiB       0.02 MiB
extra/libdatrie                    0.2.13-4                   0.48 MiB       0.11 MiB
extra/libdrm                       2.4.118-1                  1.22 MiB       0.33 MiB
core/libedit                       20230828_3.1-1             0.28 MiB       0.11 MiB
extra/libepoxy                     1.5.10-2                   2.78 MiB       0.32 MiB
extra/libglvnd                     1.7.0-1                    3.70 MiB       0.35 MiB
extra/libgudev                     238-1                      0.39 MiB       0.04 MiB
extra/libjpeg-turbo                3.0.1-1                    2.39 MiB       0.52 MiB
extra/libnice                      0.1.21-2                   1.84 MiB       0.31 MiB
extra/libomxil-bellagio            0.9.3-4                    0.58 MiB       0.12 MiB
extra/libpciaccess                 0.17-1                     0.06 MiB       0.02 MiB
extra/libpng                       1.6.40-2                   0.57 MiB       0.24 MiB
extra/libproxy                     0.5.3-2                    0.09 MiB       0.03 MiB
extra/librsvg                      2:2.57.0-1                 9.69 MiB       2.57 MiB
extra/libsoup3                     3.4.4-1                    1.93 MiB       0.39 MiB
extra/libstemmer                   2.2.0-2                    0.79 MiB       0.14 MiB
extra/libthai                      0.1.29-3                   1.22 MiB       0.27 MiB
extra/libtiff                      4.6.0-2                    5.06 MiB       0.94 MiB
extra/libunwind                    1.7.2-1                    0.26 MiB       0.11 MiB
extra/libva                        2.20.0-1                   0.88 MiB       0.18 MiB
extra/libx11                       1.8.7-1                    9.79 MiB       2.02 MiB
extra/libxau                       1.0.11-2                   0.02 MiB       0.01 MiB
extra/libxcb                       1.16-1                     3.86 MiB       1.00 MiB
extra/libxcursor                   1.2.1-3                    0.06 MiB       0.03 MiB
extra/libxdamage                   1.1.6-1                    0.02 MiB       0.01 MiB
extra/libxdmcp                     1.1.4-2                    0.13 MiB       0.03 MiB
extra/libxext                      1.3.5-1                    0.30 MiB       0.10 MiB
extra/libxfixes                    6.0.1-1                    0.04 MiB       0.01 MiB
extra/libxft                       2.3.8-1                    0.13 MiB       0.06 MiB
extra/libxi                        1.8.1-1                    0.48 MiB       0.15 MiB
extra/libxinerama                  1.1.5-1                    0.02 MiB       0.01 MiB
extra/libxkbcommon                 1.6.0-1                    0.79 MiB       0.20 MiB
extra/libxkbcommon-x11             1.6.0-1                    0.07 MiB       0.02 MiB
extra/libxmlb                      0.3.14-1                   1.23 MiB       0.15 MiB
extra/libxrandr                    1.5.4-1                    0.07 MiB       0.03 MiB
extra/libxrender                   0.9.11-1                   0.10 MiB       0.03 MiB
extra/libxshmfence                 1.3.2-1                    0.02 MiB       0.01 MiB
extra/libxv                        1.0.12-1                   0.06 MiB       0.03 MiB
extra/libxxf86vm                   1.1.5-1                    0.03 MiB       0.02 MiB
extra/libyaml                      0.2.5-2                    0.18 MiB       0.06 MiB
extra/llvm-libs                    16.0.6-1                 131.52 MiB      31.23 MiB
extra/lm_sensors                   1:3.6.0.r41.g31d1f125-2    0.47 MiB       0.13 MiB
core/lzo                           2.10-5                     0.38 MiB       0.09 MiB
extra/mesa                         1:23.2.1-2                93.01 MiB      17.75 MiB
extra/orc                          0.4.34-1                   1.20 MiB       0.25 MiB
extra/pango                        1:1.51.1-1                 2.26 MiB       0.39 MiB
extra/pixman                       0.42.2-1                   0.72 MiB       0.26 MiB
extra/shared-mime-info             2.4-1                      4.55 MiB       0.62 MiB
extra/tracker3                     3.6.0-1                    3.20 MiB       0.70 MiB
extra/vulkan-icd-loader            1.3.269-1                  0.52 MiB       0.14 MiB
extra/wayland                      1.22.0-1                   0.78 MiB       0.13 MiB
extra/xcb-proto                    1.16.0-1                   1.04 MiB       0.13 MiB
extra/xkeyboard-config             2.40-1                     6.55 MiB       0.86 MiB
extra/xorgproto                    2023.2-1                   1.43 MiB       0.24 MiB
satty-bin                          0.8.1-1                    1.88 MiB               

-> so basically the full visual stack, wayland, X11, GTK4, Adwaita etc..

TD-Sky commented 7 months ago

It's better to write PKGBUILD by the standard. You can find no depends inside package() in orhun's repo as it has high quality. I've only encountered this when generating multiple packages from the one PKGBUILD like linux.

gabm commented 7 months ago

:) ... okay.. well.. go ahead..

TD-Sky commented 7 months ago

I released it.

gabm commented 7 months ago

great, thank you for your effort!