summaryrefslogtreecommitdiff
path: root/libre/syslinux/PKGBUILD
blob: 9d1927b1776e6cf1d0d45a5dfffd7d55c7039ee1 (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
123
124
125
126
127
128
# Maintainer (Arch): Tobias Powalowski <tpowa@archlinux.org>
# Maintainer (Arch): Thomas Bächler <thomas@archlinux.org>
# Maintainer (Arch): Anatol Pomozov <anatol.pomozov@gmail.com>
# Contributor (Arch): Keshav Amburay <(the ddoott ridikulus ddoott rat) (aatt) (gemmaeiil) (ddoott) (ccoomm)>
# Maintainer (Hyperbola): André Silva <emulatorman@hyperbola.info>
# Maintainer: Omar Vega Ramos <ovruni@gnu.org.pe>

pkgname=syslinux
pkgver=6.04.pre2.r11.gbf6db5b4
#_tag=syslinux-$pkgver
_commit=bf6db5b4
pkgrel=2
pkgrel+=.parabola1
pkgdesc='Collection of boot loaders that boot from FAT, ext2/3/4 and btrfs filesystems, from CDs and via PXE (Parabola rebranded)'
url='http://www.syslinux.org/'
arch=(i686 x86_64)
backup=(boot/syslinux/syslinux.cfg
        boot/syslinux/splash.png)
install=syslinux.install
license=(GPL2)
# syslinux build system is a mess of submakes that does not work with -jN
# efi32/com32 do not like Parabola cflags/ldflags, though it would be nice to have the flags for userspace tools
options=(!makeflags !buildflags)
replaces=(${pkgname}-parabola)
conflicts=(${pkgname}-parabola)
makedepends=(git python2 nasm upx asciidoc)
makedepends_x86_64=(lib32-glibc) # efi32 needs it
optdepends=('perl-crypt-passwdmd5: For md5pass'
            'perl-digest-sha1: For sha1pass'
            'mtools:           For mkdiskimage and syslinux support'
            'gptfdisk:         For GPT support'
            'util-linux:       For isohybrid'
            'efibootmgr:       For EFI support'
            'dosfstools:       For EFI support')

# The syslinux-install_update script is maintained at https://gist.github.com/pyther/772138
# Script not yet updated for syslinux-efi
source=(git+https://repo.or.cz/syslinux.git#commit=$_commit
        gnu-efi::git://git.code.sf.net/p/gnu-efi/code
        syslinux.cfg
        syslinux-install_update
        0002-gfxboot-menu-label.patch
        0005-gnu-efi-version-compatibility.patch
        0017-single-load-segment.patch
        0004-gnu-efi-from-arch.patch
        0016-strip-gnu-property.patch
        0018-prevent-pow-optimization.patch
        splash.png)
sha1sums=('SKIP'
          'SKIP'
          'e40acf4cf9d05ec000c59284f959d1540b35a3be'
          'df5160a138ca8c6502d67fe1a64fec78b50e82c2'
          '69239fda4a3d5a247f0e48c5c683e0124c7d9201'
          '1e0cd52252622f206d22e84f2a4d358508c902f4'
          '81d05572b15dc5c55b63489fecdc79a6a332959c'
          '4c3706e7a5620e450a6abb9238c08d7b39bb6945'
          'f4a6768c7e5b8d02428ae550e37a7ca445ad1bb8'
          'c94622eaa14ad9512e4f43b13302ba35d1787cbc'
          'aab1c7789e0d7290fe87538abad181abac069d40')

sha256sums=('SKIP'
            'SKIP'
            '67fe3050e60a0d1572293ff095dac2e6cab9da6d0f98fb1fc555850ec046d6ea'
            '5f86b5813465c48ba7bd178389aacb5149ff0b5f2467ab1772a4f862c5b15d41'
            'd1fe9084ce2526619f94b8a07b89fb0194e874beef9f202f8b974879d77f2e1a'
            '8610959df6c01568ff478ca1eb4aac301f3ba1f5bd4739daaec072865e8be2d7'
            '5b017ba5eae77caa09fa5af6ecfa0df1e7e22776b2b13c8744c6cb7ecd7ad0e9'
            'cf3c3da9300d6ea70eab5b8dca724ce03a3651bd63fb0168594dcfeb35eec11c'
            '7facb5c2abc71c9bfe01bf4db388306ed7b7abf6654009af336262839527f962'
            '755cd7062fe8495f6f62053ce664451c12ae65dba9fb5c75062a495fbe040fb1'
            'a839e3e1242c5279f95f5f913af47be73cf16339c7aa55af378a428c904f1595')

_targets='bios efi32'
case "$CARCH" in
  x86_64) _targets+=' efi64' ;;
esac

pkgver() {
  cd syslinux
  git describe --long | sed 's/^syslinux-//;s/\([^-]*-g\)/r\1/;s/-/./g'
}

prepare() {
  cd syslinux

  patch -p1 < ../0002-gfxboot-menu-label.patch
  patch -p1 < ../0017-single-load-segment.patch
  patch -p1 < ../0016-strip-gnu-property.patch
  patch -p1 < ../0018-prevent-pow-optimization.patch

  # TODO: use 'gnu-efi-libs' package instead of embedded sources
  # patch -p1 < ../0004-gnu-efi-from-arch.patch
  # patch -p1 < ../0005-gnu-efi-version-compatibility.patch

  # do not swallow efi compilation output to make debugging easier
  sed 's|> /dev/null 2>&1||' -i efi/check-gnu-efi.sh

  # disable debug and development flags to reduce bootloader size
  truncate --size 0 mk/devel.mk

  git submodule init
  git config --local submodule.gnu-efi.url "$srcdir/gnu-efi"
  git submodule update
}

build() {
  cd syslinux
  export LDFLAGS+=--no-dynamic-linker # workaround for binutils 2.28 http://www.syslinux.org/wiki/index.php?title=Building
  export EXTRA_CFLAGS=-fno-PIE # to fix gpxe build
  make PYTHON=python2 $_targets
}

package() {
  cd syslinux
  make $_targets install INSTALLROOT="$pkgdir" SBINDIR=/usr/bin MANDIR=/usr/share/man AUXDIR=/usr/lib/syslinux

  rm -r "$pkgdir"/usr/lib/syslinux/{com32,dosutil,syslinux.com}
  install -D -m644 COPYING "$pkgdir"/usr/share/licenses/syslinux/COPYING
  install -d "$pkgdir"/usr/share/doc
  cp -ar doc "$pkgdir"/usr/share/doc/syslinux

  install -d "$pkgdir"/usr/lib/syslinux/bios
  mv "$pkgdir"/usr/lib/syslinux/{*.bin,*.c32,*.0,memdisk} "$pkgdir"/usr/lib/syslinux/bios 

  install -D -m0644 ../syslinux.cfg "$pkgdir"/boot/syslinux/syslinux.cfg
  install -D -m0755 ../syslinux-install_update "$pkgdir"/usr/bin/syslinux-install_update
  install -D -m0644 ../splash.png "$pkgdir"/boot/syslinux/splash.png
}