summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 906eeba3e2f2ad601675bb5f16aa0a25d907fa99 (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
# Maintainer: Martchus <martchus@gmx.net>
# Contributor: Alexander Rødseth <rodseth@gmail.com>
# Contributor: Angel Velasquez <angvp@archlinux.org>
# Contributor: Ionut Biru  <ibiru@archlinux.ro>
# Contributor: William Rea <sillywilly@gmail.com>
# Contributor: Allan McRae <mcrae_allan@hotmail.com>

# All my PKGBUILDs are managed at https://github.com/Martchus/PKGBUILDs where
# you also find the URL of a binary repository.

_name=geany
pkgname=mingw-w64-geany
pkgver=1.27.9681888
pkgrel=1
pkgdesc='Fast and lightweight IDE (mingw-w64)'
arch=('any')
url='https://www.geany.org/'
license=('GPL')
depends=('mingw-w64-crt' 'mingw-w64-gtk2')
makedepends=('perl-xml-parser' 'setconf' 'intltool' 'mingw-w64-gcc' 'mingw-w64-configure' 'mingw-w64-binutils' 'git')
optdepends=('mingw-w64-geany-plugins: various extra features'
            'mingw-w64-python2')

#source=("https://download.geany.org/${_name}-$pkgver.tar.bz2")
#sha256sums=('846ff699a5944c5c3c068ae0199d4c13946a668bfc6d03f8c79765667c20cadf')

# current stable version doesn't build so I'm using a more recent commit where the issue is fixed
source=(${_name}-$pkgver::"git+https://github.com/geany/geany.git#commit=9681888")
sha256sums=('SKIP')

options=(!buildflags staticlibs !strip !emptydirs)

_architectures="i686-w64-mingw32 x86_64-w64-mingw32"

prepare() {
  cd "${_name}-$pkgver"

  # Python2 fix
  sed -i '0,/on/s//on2/' data/templates/files/main.py

  # Syntax highlighting for PKGBUILD files
  sed -i 's/Sh=/Sh=PKGBUILD;/' data/filetype_extensions.conf

  # Can't run ./autogen.sh since it would check for regular libs and not the
  # cross versions
  test -d build-aux || mkdir build-aux
  echo "no" | glib-gettextize --force --copy
  intltoolize --copy --force --automake
  libtoolize --copy --force || glibtoolize --copy --force
  aclocal -I m4
  autoheader
  automake --add-missing --copy --gnu
  autoconf
}

build() {
  cd "${_name}-$pkgver"
  for _arch in ${_architectures}; do
    mkdir -p "build-${_arch}"
    pushd "build-${_arch}"
    ${_arch}-configure \
        --exec-prefix=/usr/${_arch} \
        --sysconfdir=/etc \
        --prefix=/usr/${_arch} \
        --disable-html-docs
    make
    popd
  done
}

package() {
  cd "${_name}-$pkgver"
  for _arch in ${_architectures}; do
    pushd "build-${_arch}"
    make DESTDIR="$pkgdir" install
    ${_arch}-strip -g "${pkgdir}/usr/${_arch}/lib/"*.a
    ${_arch}-strip -g "${pkgdir}/usr/${_arch}/lib/geany/"*.a
    ${_arch}-strip --strip-unneeded "${pkgdir}/usr/${_arch}/lib/geany/"*.dll
    ${_arch}-strip --strip-all "${pkgdir}/usr/${_arch}/bin/"*.exe
    ${_arch}-strip --strip-unneeded "${pkgdir}/usr/${_arch}/bin/"*.dll
    rm "${pkgdir}/usr/${_arch}/"*.txt
    popd
  done
}

# getver: -u 7 geany.org/Documentation/ReleaseNotes
# vim:set ts=2 sw=2 et: