summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: eb57460a4b420426ff50fa31b583f4aaa6080c77 (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
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
# Maintainer: Que Quotion <quequotion@bugmenot.com>
# Maintainer: Dave Reisner <d@falconindy.com>
# Contributor: Thomas Dziedzic < gostrc at gmail >
# Contributor: godane <slaxemulator@gmail.com.com>
# Contributor: Andres Perera <aepd87@gmail.com>

pkgname=pacman-buildenv_ext-git
pkgver=5.1.1.57.gde915c4f
pkgrel=1
pkgdesc="A library-based package manager with dependency support with support for build environment extensions. git version."
arch=('i686' 'x86_64')
url="https://bbs.archlinux.org/viewtopic.php?pid=1613555"
license=('GPL')
depends=('archlinux-keyring' 'bash' 'curl' 'gpgme' 'libarchive' 'pacman-mirrorlist')
optdepends=('pacman-contrib: various helper utilities'
            'makepkg-optimize: supplemental build and packaging optimizations')
makedepends=('git' 'asciidoc')
checkdepends=('python' 'fakechroot')
provides=(pacman{,-git}=${pkgver%.*.*})
conflicts=('pacman')
options=('!libtool' '!strip')
backup=(etc/pacman.conf
        etc/makepkg.conf)
source=(git://git.archlinux.org/pacman.git
        pacman.conf.{i686,x86_64,arm}
        buildenv-libmakepkg.patch
        makepkg.conf)
sha1sums=('SKIP'
          'f3b8b360bf4c8775f439ab189e445f455334cccf'
          '0b3ad0e7e28b6b28a611ea6cc4a12515532e1b78'
          '1ac32ed5b20d62d3709fc21c67371a9ec1ce199e'
          '27d104ac92ecd7d157bba077a792195c515633e9'
          '31025906f087af36e7af5d50220c4a63acadc754')

pkgver() {
  cd pacman
  git describe | sed 's/^v//;s/-/./g'
}

prepare() {
  cd pacman
  patch -Np1 < ../buildenv-libmakepkg.patch
  ./autogen.sh
}

build() {
  cd "pacman"

  ./configure \
    --prefix=/usr \
    --sysconfdir=/etc \
    --localstatedir=/var \
    --enable-doc \
    --enable-git-version \
    --enable-debug \
    --with-scriptlet-shell=/usr/bin/bash \
    --with-ldconfig=/usr/bin/ldconfig

  make
}

check() {
  make -C "pacman" check
}

package() {
  cd "pacman"

  make DESTDIR="$pkgdir" install

  # install Arch specific stuff
  install -dm755 "$pkgdir/etc"
  if [[ $CARCH =~ arm* || $CARCH = aarch64 ]]; then
    # $CARCH != uname -m
    sed -e "s|@CARCH[@]|$CARCH|g" "$srcdir/pacman.conf.arm" \
      | install -m644 /dev/stdin "$pkgdir/etc/pacman.conf"
  else
    install -m644 "$srcdir/pacman.conf.$CARCH" "$pkgdir/etc/pacman.conf"
  fi

  # set things correctly in the default conf file
  case $CARCH in
    i686)
      mychost="i686-pc-linux-gnu"
      myflags="-march=i686 "
      ;;
    x86_64)
      mychost="x86_64-unknown-linux-gnu"
      myflags="-march=x86-64 "
      ;;
    arm)
      mychost="armv5tel-unknown-linux-gnueabi"
      myflags="-march=armv5te"
      ;;
    armv6h)
      mychost="armv6l-unknown-linux-gnueabihf"
      myflags="-march=armv6 -mfloat-abi=hard -mfpu=vfp"
      ;;
    armv7h)
      mychost="armv7l-unknown-linux-gnueabihf"
      myflags="-march=armv7-a -mfloat-abi=hard -mfpu=vfpv3-d16"
      ;;
    aarch64)
      mychost="aarch64-unknown-linux-gnu"
      myflags="-march=armv8-a"
      ;;
  esac

  # set things correctly in the default conf file
  install -m644 "$srcdir/makepkg.conf" "$pkgdir/etc"
  sed -i "$pkgdir/etc/makepkg.conf" \
    -e "s|@CARCH[@]|$CARCH|g" \
    -e "s|@CHOST[@]|$mychost|g" \
    -e "s|@CARCHFLAGS[@]|$myflags|g"

  install -Dm644 scripts/completion/bash_completion "$pkgdir/usr/share/bash-completion/completions/pacman"

  install -Dm644 scripts/completion/zsh_completion $pkgdir/usr/share/zsh/site-functions/_pacman

}

# vim: set ts=2 sw=2 et: