template (2204B)
1 # Template file for 'gptfdisk' 2 pkgname=gptfdisk 3 version=1.0.10 4 revision=0 5 short_desc="GPT partitioning tools (sgdisk)" 6 maintainer="finwo <finwo@pm.me>" 7 license="GPL-2.0-only" 8 homepage="https://www.rodsbooks.com/gdisk/" 9 distfiles="https://downloads.sourceforge.net/project/gptfdisk/gptfdisk/${version}/gptfdisk-${version}.tar.gz" 10 checksum=2abed61bc6d2b9ec498973c0440b8b804b7a72d7144069b5a9209b2ad693a282 11 # libstdc++ is a real runtime dep: this is the first C++ package in UNOS. 12 depends="glibc busybox libstdc++ e2fsprogs popt" 13 makedepends="e2fsprogs popt libstdc++ linux-headers" 14 15 # Notes: 16 # - Why: installer/install.sh partitions with sgdisk. ONIE provides it on a 17 # switch, but without it here a UNOS image cannot install UNOS -- which is 18 # what makes the plain qemu image usable as a rescue/installer environment. 19 # - C++: linked against our packaged libstdc++ (see that template for why we 20 # build the runtime from GCC source rather than static-linking it). 21 # - libuuid comes from e2fsprogs (upstream e2fsprogs defaults it off; our 22 # template enables it precisely because this package needs it). 23 # - Upstream ships a plain Makefile, no configure. It also builds gdisk and 24 # cgdisk; cgdisk needs ncurses, which UNOS does not package, so only the 25 # non-curses tools are built and only sgdisk is shipped. 26 27 do_build() { 28 cd "${WRKSRC}" 29 # Upstream assigns these with =, so append rather than replace. 30 make -j"$(nproc)" \ 31 CXX="g++" \ 32 CXXFLAGS="${CXXFLAGS:-} -O2 -D_FILE_OFFSET_BITS=64" \ 33 LDFLAGS="${LDFLAGS:-}" \ 34 sgdisk 35 } 36 37 do_install() { 38 cd "${WRKSRC}" 39 vmkdir usr/sbin 40 vinstall sgdisk 0755 usr/sbin 41 vmkdir usr/share/man/man8 42 [ -f sgdisk.8 ] && vinstall sgdisk.8 0644 usr/share/man/man8 43 44 [ -x "${DESTDIR}/usr/sbin/sgdisk" ] || die "gptfdisk: no sgdisk" 45 # Assert we picked up our own C++ runtime, not a static copy and not the 46 # host's: a static libstdc++ would silently violate the shared-only rule. 47 readelf -d "${DESTDIR}/usr/sbin/sgdisk" | grep -q 'libstdc++\.so\.6' \ 48 || die "gptfdisk: sgdisk does not link libstdc++.so.6 (static C++ runtime?)" 49 readelf -d "${DESTDIR}/usr/sbin/sgdisk" | grep -q 'libuuid\.so\.1' \ 50 || die "gptfdisk: sgdisk does not link libuuid.so.1" 51 }