summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: a940d0da7673312b7f8388abdffc773c7e1c8663 (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
# Maintainer: KostyaTheSon <konstantinkorovajcev@outlook.com>
pkgname=huawei-unlockboot
pkgver=0.1
pkgrel=1
epoch=0

# Description of the package
pkgdesc="A tool to unlock the bootloader of Huawei or Honor devices even if the code can't be found."

# Architecture supported by this package
arch=('x86_64')

# URL of the project
url="https://github.com/Martazza/Huawei-Bootloader-Unlocker"

# License under which the package is released
license=('MIT')

# Groups this package belongs to (optional)
groups=(base-devel)

# Dependencies required to run this package
depends=(gcc android-tools)

build() {
  # Clone the repository if it doesn't exist
  if [ ! -d "$srcdir/$pkgname" ]; then
      git clone https://github.com/Martazza/Huawei-Bootloader-Unlocker.git "$srcdir/$pkgname"
  fi

  # Change into the source directory
  cd "$srcdir/$pkgname"

  # Compile the program
  gcc huawei_bootloader_unlocker.c -o huawei-unlockboot

  # Make the executable executable
  chmod +x huawei-unlockboot
}

package() {
  # Install the compiled binary
  install -Dm755 "$srcdir/$pkgname/huawei-unlockboot" "$pkgdir/usr/bin/huawei-unlockboot"
}