aboutsummaryrefslogtreecommitdiff
path: root/binutils-source/PKGBUILD
blob: 6e38917323d72135e5717936efa91ec17e24fd72 (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
# Contributor: Wojtek Kosior <kwojtus@protonmail.com>

# Loosely based on Hyperbola's binutils package

pkgname=binutils-source
_pkgver=2.28
pkgver=${_pkgver}.0
_debrel=5
pkgrel=1
pkgdesc="Source of a set of programs to assemble and manipulate binary and object files"
arch=('any')
url="https://www.gnu.org/software/binutils/"
license=('GPL-3' 'LGPL-3')
depends=('quilt')
source=(https://ftp.gnu.org/gnu/binutils/binutils-$_pkgver.tar.bz2{,.sig}
        https://deb.debian.org/debian/pool/main/b/binutils/binutils_$_pkgver-$_debrel.diff.gz)
validpgpkeys=('EAF1C276A747E9ED86210CBAC3126D3B4AE55E93') # Tristan Gingold <gingold@adacore.com>
sha512sums=('ede2e4e59a800260eea8c14eafbaee94e30abadafd5c419a3370f9f62213cf027d6400a1d4970b6958bd4d220e675dcd483a708107016e7abd5c99d7392ba8fd'
            'SKIP'
            '77933ab9543db3ad9640f737d4cd688ddc9da7b91d72fe0f18f9f3457a499e31ca9b27674790e00b5e7c29c85a5ec4fd09ed58de92ca0a8622422886d20a6add')

noextract=(binutils-$_pkgver.tar.bz2)

# Many patches fail to apply. These are the files that work. We'll only use them.
_desired_patch_files=(001_ld_makefile_patch.patch
		      006_better_file_error.patch
		      012_check_ldrunpath_length.patch
		      013_bash_in_ld_testsuite.patch
		      128_build_id.patch
		      130_gold_disable_testsuite_build.patch
		      131_ld_bootstrap_testsuite.patch
		      157_ar_scripts_with_tilde.patch
		      i18n-fr.diff
		      pr21074-revert.diff
		      pr21135.diff
		      pr21137.diff
		      pr21139.diff
		      pr21156.diff
		      pr21157.diff
		      pr21342.diff
		      pr21412.diff
		      pr21414.diff
		      pr21431.diff
		      pr21432.diff
		      pr21434.diff
		      pr21438.diff
		      pr21440.diff
		      pr70909.diff
		      pr-ld-16428.diff
		      series)

prepare() {
    cd "${srcdir}"

    # this command creates, among all, the directory debian/patches and fills it
    patch -p1 -i binutils_$_pkgver-$_debrel.diff

    # Patches and 'series' file will go to /usr/src/binutils/debian_patches.
    # We're not interested in rest of the stuff in debian/.

    # here we create script to be used for unpacking binutils sources we'll install
    
    echo "\
#!/bin/sh

mkdir -p \"\$1\" && cd \"\$1\"

bsdtar -xf /usr/src/binutils/binutils-$_pkgver.tar.bz2

export QUILT_PATCHES=/usr/src/binutils/debian_patches
export QUILT_REFRESH_ARGS='-p ab --no-timestamps --no-index'	
export QUILT_DIFF_ARGS='--no-timestamps'

cd binutils-${_pkgver}

quilt push -av
rm -r .pc/" > prepare-binutils-source
}

package () {
    install -m755 -d "${pkgdir}/usr/src/binutils/debian_patches/"

    # install patches
    cd "${srcdir}/debian/patches"
    install -m644 ${_desired_patch_files[@]} "${pkgdir}/usr/src/binutils/debian_patches"

    # install tarballs
    install -m644 "${srcdir}/binutils-$_pkgver.tar.bz2" "${pkgdir}/usr/src/binutils"

    # install our script
    install -m755 -d "${pkgdir}/usr/bin"
    install -m755 "${srcdir}/prepare-binutils-source" "${pkgdir}/usr/bin"
}