Skip to content

Commit

Permalink
feat(pamac)
Browse files Browse the repository at this point in the history
  • Loading branch information
xiota committed Nov 5, 2024
1 parent 3fbb45c commit 239b682
Show file tree
Hide file tree
Showing 6 changed files with 253 additions and 0 deletions.
1 change: 1 addition & 0 deletions pamac/.CI/PKGBUILD.append
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
_pkgext=''
3 changes: 3 additions & 0 deletions pamac/.CI/config
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
CI_ON_TRIGGER=check
BUILDER_CACHE_SOURCES=true
CI_PKGBUILD_SOURCE=https://aur.archlinux.org/pamac-git.git
2 changes: 2 additions & 0 deletions pamac/.CI/info
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
REQ_ORIGIN=chaotic
REQ_REASON=request
49 changes: 49 additions & 0 deletions pamac/.SRCINFO
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
pkgbase = pamac-git
pkgdesc = Pamac package manager
pkgver = 11.7.2.r0.g71ced27
pkgrel = 1
url = https://github.com/manjaro/pamac
arch = x86_64
license = GPL-3.0-or-later
makedepends = git
makedepends = pacman
makedepends = polkit
makedepends = appstream
makedepends = appstream-glib
makedepends = archlinux-appstream-data
makedepends = flatpak
makedepends = gtk4
makedepends = libadwaita
makedepends = libnotify
makedepends = gtk3
makedepends = asciidoc
makedepends = gobject-introspection
makedepends = meson
makedepends = vala
optdepends = polkit-gnome: needed for authentication in Cinnamon, Gnome
optdepends = lxsession: needed for authentication in Xfce, LXDE etc.
source = pamac::git+https://github.com/manjaro/pamac.git
source = libpamac::git+https://github.com/manjaro/libpamac.git
source = pamac-cli::git+https://github.com/manjaro/pamac-cli.git
sha256sums = SKIP
sha256sums = SKIP
sha256sums = SKIP

pkgname = pamac-git
pkgdesc = Pamac package manager - library, gui, cli
depends = pacman
depends = polkit
depends = appstream
depends = appstream-glib
depends = archlinux-appstream-data
depends = flatpak
depends = gtk4
depends = libadwaita
depends = libnotify
depends = gtk3
provides = libpamac=11.7.2
provides = pamac=11.7.2
conflicts = libpamac
conflicts = pamac
conflicts = pamac-cli
backup = etc/pamac.conf
4 changes: 4 additions & 0 deletions pamac/.nvchecker.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
[pamac-git]
source = "git"
git = "https://github.com/manjaro/pamac.git"
prefix = "v"
194 changes: 194 additions & 0 deletions pamac/PKGBUILD
Original file line number Diff line number Diff line change
@@ -0,0 +1,194 @@
# Maintainer:

## options
: ${_build_appstream:=true}
: ${_build_aur:=true}
: ${_build_flatpak:=true}
: ${_build_snap:=false}

: ${_pkgext=-git}

_pkgname="pamac"
pkgname="$_pkgname${_pkgext:-}"
pkgver=11.7.2.r0.g71ced27
pkgrel=1
pkgdesc="Pamac package manager"
url="https://github.com/manjaro/pamac"
license=('GPL-3.0-or-later')
arch=('x86_64')

_depends_libpamac=(
'pacman'
'polkit'
)
_depends_pamac=(
'gtk4'
'libadwaita'
'libnotify'
)
_depends_tray_gtk=(
'gtk3'
)

if [ "${_build_appstream::1}" = "t" ]; then
_depends_libpamac+=(
'appstream'
'appstream-glib'
'archlinux-appstream-data'
)
fi
if [ "${_build_flatpak::1}" = "t" ]; then
_depends_libpamac+=(
'flatpak'
)
fi
if [ "${_build_snap::1}" = "t" ]; then
_depends_libpamac+=(
'snapd'
'snapd-glib'
)
fi

_make_cli=(
'asciidoc'
)
_make_libpamac=(
'gobject-introspection'
'meson'
'vala'
)

makedepends=(
'git'
${_depends_libpamac[@]}
${_depends_pamac[@]}
${_depends_tray_gtk[@]}
${_make_cli[@]}
${_make_libpamac[@]}
)
optdepends=(
'polkit-gnome: needed for authentication in Cinnamon, Gnome'
'lxsession: needed for authentication in Xfce, LXDE etc.'
)

_pkgsrc_pamac="$_pkgname"
_pkgsrc_libpamac="libpamac"
_pkgsrc_cli="pamac-cli"
source=(
"$_pkgsrc_pamac"::"git+$url.git"
"$_pkgsrc_libpamac"::"git+https://github.com/manjaro/libpamac.git"
"$_pkgsrc_cli"::"git+https://github.com/manjaro/pamac-cli.git"
)
sha256sums=(
'SKIP'
'SKIP'
'SKIP'
)

pkgver() {
cd "$_pkgsrc_pamac"
if [ -z "$_pkgext" ]; then
git describe --tags
else
git describe --long --tags --abbrev=7 --exclude='*[a-zA-Z][a-zA-Z]*'
fi | sed -E 's/^[^0-9]*//;s/([^-]*-g)/r\1/;s/-/./g'
}

_prepare_pamac() (
>&2 echo "Preparing for pamac..."
cd "$_pkgsrc_pamac"
local _tag=$(git tag | grep -Ev '(^[a-z]|[A-Za-z]{2})' | sort -rV | head -1)
[ -z "$_pkgext" ] && git -c advice.detachedHead=false checkout -f "${_tag:?}"
git describe --tags --long
)

_prepare_libpamac() (
>&2 echo "Preparing for libpamac..."
cd "$_pkgsrc_libpamac"
local _tag=$(git tag | grep -Ev '(^[a-z]|[A-Za-z]{2})' | sort -rV | head -1)
[ -z "$_pkgext" ] && git -c advice.detachedHead=false checkout -f "${_tag:?}"
git describe --tags --long
)

_prepare_cli() (
>&2 echo "Preparing for pamac-cli..."
cd "$_pkgsrc_cli"
local _tag=$(git tag | grep -Ev '(^[a-z]|[A-Za-z]{2})' | sort -rV | head -1)
[ -z "$_pkgext" ] && git -c advice.detachedHead=false checkout -f "${_tag:?}"
git describe --tags --long
)

prepare() {
_prepare_libpamac
_prepare_pamac
_prepare_cli

sed -E \
-e '/version.*\)$/a '"add_project_arguments(['--vapidir', '$srcdir/fakeinstall/usr/share/vala/vapi'], language: 'vala')" \
-e '/version.*\)$/a '"add_project_arguments(['--girdir', '$srcdir/fakeinstall/usr/share/gir-1.0'], language: 'vala')" \
-i "$_pkgsrc_pamac/meson.build" "$_pkgsrc_cli/meson.build"
}

_build_libpamac() (
local _meson_args=(
-Denable-appstream=${_build_appstream:-true}
-Denable-aur=${_build_aur:-true}
-Denable-flatpak=${_build_flatpak:-true}
-Denable-snap=${_build_snap:-true}
)

arch-meson "$_pkgsrc_libpamac" build_libpamac "${_meson_args[@]}"
meson compile -C build_libpamac
meson install -C build_libpamac --destdir "$srcdir/fakeinstall"

sed -E -e 's&^prefix=.*$&prefix='"$srcdir/fakeinstall/usr&" \
-i "fakeinstall/usr/lib/pkgconfig/pamac.pc"
)

_build_pamac() (
local _meson_args=(
-Denable-fake-gnome-software=false
)

arch-meson "$_pkgsrc_pamac" build_pamac "${_meson_args[@]}"
meson compile -C build_pamac
)

_build_cli() (
arch-meson "$_pkgsrc_cli" build_cli
meson compile -C build_cli
)

build() (
export PKG_CONFIG_PATH="$srcdir/fakeinstall/usr/lib/pkgconfig:$PKG_CONFIG_PATH"
_build_libpamac
_build_pamac
_build_cli
)

package() {
pkgdesc+=" - library, gui, cli"
depends=(
${_depends_libpamac[@]}
${_depends_pamac[@]}
${_depends_tray_gtk[@]}
)

local _pkgver_libpamac=$(git -C "$_pkgsrc_libpamac" describe --tags --abbrev=0)

provides=(
"libpamac=${_pkgver_libpamac:-${pkgver%.r*}}"
"pamac=${pkgver%.r*}"
)
conflicts=(
'libpamac'
'pamac'
'pamac-cli'
)

backup=('etc/pamac.conf')

meson install -C build_libpamac --destdir "$pkgdir"
meson install -C build_pamac --destdir "$pkgdir"
meson install -C build_cli --destdir "$pkgdir"
}

1 comment on commit 239b682

@xiota
Copy link
Contributor Author

@xiota xiota commented on 239b682 Nov 5, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.