summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 36c9ff068632936deb5bece27c7547f267b7fe5b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
# -*- mode: pkgbuild -*-
# Maintainer  : Jeremy Borgman <borgman.jeremy@pm.me>
# Maintainer  : Mehrad Mahmoudian <m.mahmoudian@gmail.com>
# Contributor : Feresey <p.milko1999@yandex.ru>
# Contributor : j1simon <stemp@ono.com>
# Contributor : Feresey <p.milko1999@yandex.ru>
# 
# Contribution Instructions:
#  0. Use this as the guide:
#       https://wiki.archlinux.org/title/PKGBUILD
#  
#  1. clone the git:
#     ```sh
#     git clone https://aur.archlinux.org/flameshot-git.git
#     ```
#  
#  2. Apply the changes you think are necessary to the following:
#       pkgrel=
#       depends=
#       makedepends=
#       optdepends=
#       build()
#  
#  3. In terminal, naviagate to the folder you have the PKGBUILD in
#  
#  4. Test the modified PKGBUILD file with all of the following commands
#       ```sh
#       # remove the possible builds
#       rm -f flameshot-git-r*.zst
#
#       # read this for more info about namcap: https://wiki.archlinux.org/title/Namcap
#       namcap -i PKGBUILD
#       
#       # read this for more info about makepkg: https://wiki.archlinux.org/title/Makepkg
#       makepkg
#       
#       pacman -U flameshot-git-r*.zst
#       ```
#  
#  5. Fix any possible errors
#  
#  6. create a patch with your modifications:
#       ```sh
#       git diff --oneline --graph > my.patch
#       ```
#  
#  7. copy the content of the my.patch file and post it in the discussion of
#     the AUR: https://aur.archlinux.org/packages/flameshot-git/



pkgname=flameshot-git
_pkgname=flameshot
pkgver=r1629.0fe55916
pkgrel=1
pkgdesc="Powerful yet simple to use screenshot software"
arch=('i686' 'x86_64')
url="https://github.com/flameshot-org/flameshot"
license=('GPL')
depends=(qt5-base hicolor-icon-theme qt5-svg)
makedepends=(qt5-tools git cmake kguiaddons)
optdepends=('xdg-desktop-portal: To make Sway and wlroots work'
            'xdg-desktop-portal-wlr: To make Sway and wlroots work'
            'grim: To make Sway and wlroots work')
provides=(flameshot-git)
conflicts=(flameshot)
source=("git+https://github.com/flameshot-org/flameshot.git")
md5sums=('SKIP')

pkgver() {
  cd "${srcdir}/${_pkgname}"

  # Get the version number.
  printf "r%s.%s" "$(git rev-list --count HEAD)" "$(git rev-parse --short HEAD)"
}

build() {
  cd "${srcdir}/${_pkgname}"

  # # get the details of the version numbers
  # NORMAL_VERSION="$(grep -oP 'FLAMESHOT_VERSION\s\d+\.\d+\.\d+' CMakeLists.txt | cut -d ' ' -f2)"
  # ROLLING_VERSION="r$(git rev-list --count HEAD).$(git rev-parse --short HEAD)"
  #
  # # skip the special characters in the versions
  # NORMAL_VERSION_PATTERN="$(echo ${NORMAL_VERSION} | sed 's/\./\\\./g')"
  # ROLLING_VERSION_PATTERN="$(echo ${ROLLING_VERSION} | sed 's/\./\\\./g')"
  #
  # # Replace the version number in the cmake with the combination of versions above
  # sed "s/${NORMAL_VERSION_PATTERN}/${NORMAL_VERSION_PATTERN}_${ROLLING_VERSION_PATTERN}/" CMakeLists.txt


  cmake -S ./ \
      -DCMAKE_INSTALL_PREFIX=/usr \
      -DUSE_WAYLAND_CLIPBOARD=1

  make -j$(nproc --ignore 1)
}

package() {
  cd "${srcdir}/${_pkgname}"
  make DESTDIR="${pkgdir}" install
}