summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 59f4091839cf5e60fdbf7df13afa7df2403e0d89 (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
# Maintainer: Corwin <corwin@kuiper.dev>

# Contributor: carstene1ns <arch carsten-teibes de> - http://git.io/ctPKG

pkgname=devkitarm
pkgver=r55
_buildscriptsver=20201105
_rulesver=1.0.0
_crtlsver=1.0.0
_binutilsver=2.32
_gccver=10.1.0
_newlibver=3.3.0
_gdbver=8.2.1
pkgrel=1
pkgdesc="ARM toolchain for GP32, Nintendo (3)DS and GBA homebrew development"
arch=('x86_64')
url="http://devkitpro.org"
license=('GPL')
options=(!strip libtool staticlibs emptydirs)
depends=('flex' 'libmpc' 'python' 'xz')
conflicts=('devkitARM')
provides=('devkitARM')
install=devkitarm.install
source=(buildscripts-$_buildscriptsver.tar.gz::"https://github.com/devkitPro/buildscripts/archive/v$_buildscriptsver.tar.gz"
        "https://github.com/devkitPro/devkitarm-rules/releases/download/v$_rulesver/devkitarm-rules-$_rulesver.tar.xz"
        "https://github.com/devkitPro/devkitarm-crtls/releases/download/v$_crtlsver/devkitarm-crtls-$_crtlsver.tar.xz"
        "https://github.com/devkitPro/buildscripts/releases/download/sources/binutils-$_binutilsver.tar.xz"
        "https://github.com/devkitPro/buildscripts/releases/download/sources/gcc-$_gccver.tar.xz"
        "https://github.com/devkitPro/buildscripts/releases/download/sources/newlib-$_newlibver.tar.gz"
        "https://github.com/devkitPro/buildscripts/releases/download/sources/gdb-$_gdbver.tar.xz"
        "devkitarm.sh"
        "devkitarm.fish"
        "gdb-and-rules.patch"
        "crtls-makefile.patch"
        "rules-makefile.patch")
sha256sums=('a945e0300a9785a04fcaf0349c7c0fa63efbf93346a318cacb79d23f0840d543'
            '10ad51c68eda70cba4ca6ed4d0bfd938ad33199f254cb0412dff6edabc56fa70'
            'db8b2f6a08909a3cdd476b8b2e2ece3270d3d6b2bf625ef3da1edd25f345643c'
            '0ab6c55dd86a92ed561972ba15b9b70a8b9f75557f896446c82e8b36e473ee04'
            'b6898a23844b656f1b68691c5c012036c2e694ac4b53a8918d4712ad876e7ea2'
            '58dd9e3eaedf519360d92d84205c3deef0b3fc286685d1c562e245914ef72c66'
            'baaabb28026ba47e3fd56f0138e020c9b3d51e11800a3b220d736fae8e677112'
            '2162a4cf8ae8567b5ddff631474f28b6a0a5d0bce43915396b7dea602e2131e0'
            '13357e81de7ec8d7ad7f9fb37a78c23c4f99c6f7ca67d3a0070eedc388deb938'
            '925870adc0545f10dbcfd4333c503a18e6ef92c617b59b520c078c54b3c9c716'
            '0acf8d4c07e7e193c662cd15c8f69a76d73fc07de33ed9116bbbae5196475d74'
            '9bb96e00a7130a3a228759ee588f4614159ee7c323011b2885fbb5da878b2508')
noextract=("devkitarm-rules-$_rulesver.tar.xz" "devkitarm-crtls-$_crtlsver.tar.xz"
           "binutils-$_binutilsver.tar.xz" "gcc-$_gccver.tar.xz"
           "newlib-$_newlibver.tar.gz" "gdb-$_gdbver.tar.xz")

prepare() {
  # reset build dir
  rm -rf build

  (cd buildscripts-$_buildscriptsver
    # force reinstalling already built tools
    [ -d .devkitARM ] && find .devkitARM \( -name "installed-*" -o -name "installed" \) -delete

    # generate config file for automatic build
    cat << END > config.sh
#!bin/sh
BUILD_DKPRO_PACKAGE=1
BUILD_DKPRO_INSTALLDIR="$srcdir"/build
BUILD_DKPRO_SRCDIR="$srcdir"
BUILD_DKPRO_SKIP_TOOLS=1
BUILD_DKPRO_AUTOMATED=1
END

    # do not try to download or extract tool packages
    sed 's/ \$hostarchives/ ""/g;s/archives=\"devkitarm.*/echo ""/' -i build-devkit.sh

    # do not build gdb with guile support (broken)
    sed '/gdb/,$ s/--disable-werror/& --with-guile=no/' -i dkarm-eabi/scripts/build-gcc.sh

    # fix search path to use correct tools
    sed 's|$PATH:$TOOLPATH/$package/bin|$TOOLPATH/$package/bin:$PATH|' -i build-devkit.sh

    patch --strip=1 < ../gdb-and-rules.patch
  )
}

build() {
  cd buildscripts-$_buildscriptsver

  # disable conflicting build flags
  unset CPPFLAGS
  ./build-devkit.sh
}

package() {
  install -d "$pkgdir"/opt/devkitpro
  cp -r build/devkitARM "$pkgdir"/opt/devkitpro
  # gzip manually, as makepkg only cares for standard directories
  gzip "$pkgdir"/opt/devkitpro/devkitARM/share/man/man*/*
  gzip "$pkgdir"/opt/devkitpro/devkitARM/share/info/*
  # export environment variables
  install -Dm755 devkitarm.sh "$pkgdir"/etc/profile.d/devkitarm.sh
  install -Dm644 devkitarm.fish "$pkgdir"/etc/fish/conf.d/devkitarm.fish
}