unos-repository

APK repository for unos
git clone git://git.finwo.net/misc/unos-repository
Log | Files | Refs | README

template (2324B)


      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++"
     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 	# Build against the sysroot so we link our glibc/libuuid/libstdc++ rather
     30 	# than the host's. gdisk/sgdisk/fixparts only; cgdisk needs ncurses.
     31 	make -j"$(nproc)" \
     32 		CXX="g++" \
     33 		CXXFLAGS="-O2 -D_FILE_OFFSET_BITS=64 -I${SYSROOT}/usr/include" \
     34 		LDFLAGS="-L${SYSROOT}/usr/lib -Wl,-rpath-link,${SYSROOT}/usr/lib" \
     35 		sgdisk
     36 }
     37 
     38 do_install() {
     39 	cd "${WRKSRC}"
     40 	vmkdir usr/sbin
     41 	vinstall sgdisk 0755 usr/sbin
     42 	vmkdir usr/share/man/man8
     43 	[ -f sgdisk.8 ] && vinstall sgdisk.8 0644 usr/share/man/man8
     44 
     45 	[ -x "${DESTDIR}/usr/sbin/sgdisk" ] || die "gptfdisk: no sgdisk"
     46 	# Assert we picked up our own C++ runtime, not a static copy and not the
     47 	# host's: a static libstdc++ would silently violate the shared-only rule.
     48 	readelf -d "${DESTDIR}/usr/sbin/sgdisk" | grep -q 'libstdc++\.so\.6' \
     49 		|| die "gptfdisk: sgdisk does not link libstdc++.so.6 (static C++ runtime?)"
     50 	readelf -d "${DESTDIR}/usr/sbin/sgdisk" | grep -q 'libuuid\.so\.1' \
     51 		|| die "gptfdisk: sgdisk does not link libuuid.so.1"
     52 }