diff options
author | Mike Gilbert <floppym@gentoo.org> | 2017-04-30 13:22:57 -0400 |
---|---|---|
committer | Mike Gilbert <floppym@gentoo.org> | 2017-04-30 13:23:09 -0400 |
commit | e53ac2698567f4699f24f27630592fcfb0938015 (patch) | |
tree | a50700686f5d567f05b06abe9452fade89a5e3b5 /sys-fs | |
parent | app-text/qpdfview: bump to 0.4.17_beta1 (diff) | |
download | gentoo-e53ac2698567f4699f24f27630592fcfb0938015.tar.gz gentoo-e53ac2698567f4699f24f27630592fcfb0938015.tar.bz2 gentoo-e53ac2698567f4699f24f27630592fcfb0938015.zip |
sys-fs/udev: convert to meson
Package-Manager: Portage-2.3.5_p31, Repoman-2.3.2_p61
Diffstat (limited to 'sys-fs')
-rw-r--r-- | sys-fs/udev/udev-9999.ebuild | 229 |
1 files changed, 99 insertions, 130 deletions
diff --git a/sys-fs/udev/udev-9999.ebuild b/sys-fs/udev/udev-9999.ebuild index ef90718a2366..43e3e7cc2cce 100644 --- a/sys-fs/udev/udev-9999.ebuild +++ b/sys-fs/udev/udev-9999.ebuild @@ -3,7 +3,7 @@ EAPI=6 -inherit autotools bash-completion-r1 linux-info multilib-minimal toolchain-funcs udev user versionator +inherit bash-completion-r1 linux-info multilib-minimal multiprocessing toolchain-funcs udev user versionator if [[ ${PV} = 9999* ]]; then EGIT_REPO_URI="https://github.com/systemd/systemd.git" @@ -44,6 +44,9 @@ COMMON_DEPEND=">=sys-apps/util-linux-2.27.1[${MULTILIB_USEDEP}] DEPEND="${COMMON_DEPEND} dev-util/gperf >=dev-util/intltool-0.50 + >=dev-util/meson-0.40.0 + dev-util/ninja + dev-util/patchelf >=sys-apps/coreutils-8.16 virtual/os-headers virtual/pkgconfig @@ -119,14 +122,9 @@ src_prepare() { # change rules back to group uucp instead of dialout for now wrt #454556 sed -i -e 's/GROUP="dialout"/GROUP="uucp"/' rules/*.rules || die - # stub out the am_path_libcrypt function - echo 'AC_DEFUN([AM_PATH_LIBGCRYPT],[:])' > m4/gcrypt.m4 - # apply user patches eapply_user - eautoreconf - if ! [[ ${PV} = 9999* ]]; then check_default_rules fi @@ -137,167 +135,138 @@ src_prepare() { fi } +meson_multilib_native_use() { + if multilib_is_native_abi && use "$1"; then + echo true + else + echo false + fi +} + +multilib_src_configure() { + local myconf=( + --buildtype=plain + --libdir="$(get_libdir)" + --localstatedir="${EPREFIX}/var" + --prefix="${EPREFIX}/usr" + --sysconfdir="${EPREFIX}/etc" + -Dacl=$(meson_multilib_native_use acl) + -Defi=false + -Dkmod=$(meson_multilib_native_use kmod) + -Dselinux=$(meson_multilib_native_use selinux) + -Dsplit-usr=true + ) + set -- meson "${myconf[@]}" "${S}" + echo "$@" + "$@" || die +} + src_configure() { # Prevent conflicts with i686 cross toolchain, bug 559726 tc-export AR CC NM OBJCOPY RANLIB multilib-minimal_src_configure } -multilib_src_configure() { - tc-export CC #463846 - export cc_cv_CFLAGS__flto=no #502950 - export cc_cv_CFLAGS__Werror_shadow=no #554454 - export cc_cv_LDFLAGS__Wl__fuse_ld_gold=no #573874 - - # Keep sorted by ./configure --help and only pass --disable flags - # when *required* to avoid external deps or unnecessary compile - local econf_args - econf_args=( - --libdir=/usr/$(get_libdir) - --docdir=/usr/share/doc/${PF} - --disable-nls - --disable-dbus - $(multilib_native_use_enable kmod) - --disable-xkbcommon - --disable-seccomp - $(multilib_native_use_enable selinux) - --disable-xz - --disable-lz4 - --disable-pam - $(multilib_native_use_enable acl) - --disable-gcrypt - --disable-audit - --disable-libcryptsetup - --disable-qrencode - --disable-microhttpd - --disable-gnuefi - --disable-gnutls - --disable-libcurl - --disable-libidn - --disable-quotacheck - --disable-logind - --disable-polkit - --disable-myhostname - $(multilib_is_native_abi || echo "--disable-manpages") - --enable-split-usr - --without-python - --with-bashcompletiondir="$(get_bashcompdir)" - --with-rootprefix= - $(multilib_is_native_abi && echo "--with-rootlibdir=/$(get_libdir)") - --disable-elfutils - ) - - if ! multilib_is_native_abi; then - econf_args+=( - MOUNT_{CFLAGS,LIBS}=' ' - ) +eninja() { + if [[ -z ${NINJAOPTS+set} ]]; then + NINJAOPTS="-j$(makeopts_jobs) -l$(makeopts_loadavg "${MAKEOPTS}" 0)" fi - - ECONF_SOURCE=${S} econf "${econf_args[@]}" + set -- ninja -v ${NINJAOPTS} "$@" + echo "$@" + "$@" || die } multilib_src_compile() { - echo 'BUILT_SOURCES: $(BUILT_SOURCES)' > "${T}"/Makefile.extra - emake -f Makefile -f "${T}"/Makefile.extra BUILT_SOURCES + # meson creates this link + local libudev=$(readlink src/libudev/libudev.so.1) - # Most of the parallel build problems were solved by >=sys-devel/make-3.82-r4, - # but not everything -- separate building of the binaries as a workaround, - # which will force internal libraries required for the helpers to be built - # early enough, like eg. libsystemd-shared.la + local targets=( + src/libudev/${libudev} + ) if multilib_is_native_abi; then - local lib_targets=( libudev.la ) - emake "${lib_targets[@]}" - - local exec_targets=( + targets+=( systemd-udevd udevadm - ) - emake "${exec_targets[@]}" - - local helper_targets=( - ata_id - cdrom_id - collect - scsi_id - v4l_id - mtd_probe - ) - emake "${helper_targets[@]}" - - local man_targets=( + src/udev/ata_id + src/udev/cdrom_id + src/udev/collect + src/udev/mtd_probe + src/udev/scsi_id + src/udev/v4l_id man/udev.conf.5 man/systemd.link.5 + man/hwdb.7 man/udev.7 man/systemd-udevd.service.8 man/udevadm.8 ) - emake "${man_targets[@]}" - else - local lib_targets=( libudev.la ) - emake "${lib_targets[@]}" fi + ninja -v "${targets[@]}" || die +} + +# meson uses an private python script for this +strip_rpath() { + local x + for x; do + patchelf --remove-rpath "${x}" || die + done } multilib_src_install() { + local libudev=$(readlink src/libudev/libudev.so.1) + + into / + strip_rpath src/libudev/${libudev} + dolib.so src/libudev/{${libudev},libudev.so.1,libudev.so} + + insinto "/usr/$(get_libdir)/pkgconfig" + doins src/libudev/libudev.pc + if multilib_is_native_abi; then - local targets=( - install-includeHEADERS - install-rootbinPROGRAMS - install-rootlibLTLIBRARIES - install-rootlibexecPROGRAMS - install-udevlibexecPROGRAMS - install-dist_udevconfDATA - install-dist_udevrulesDATA - install-pkgconfiglibDATA - install-pkgconfigdataDATA - install-dist_docDATA - install-directories-hook - install-dist_bashcompletionDATA - install-dist_networkDATA - rootlibexec_PROGRAMS=systemd-udevd - rootbin_PROGRAMS=udevadm - rootlib_LTLIBRARIES="libudev.la" - pkgconfiglib_DATA="src/libudev/libudev.pc" - pkgconfigdata_DATA="src/udev/udev.pc" - INSTALL_DIRS='$(sysconfdir)/udev/rules.d $(sysconfdir)/udev/hwdb.d $(sysconfdir)/systemd/network' - dist_bashcompletion_DATA="shell-completion/bash/udevadm" - dist_network_DATA="network/99-default.link" - ) - emake -j1 DESTDIR="${D}" "${targets[@]}" - doman man/{udev.conf.5,systemd.link.5,udev.7,systemd-udevd.service.8,udevadm.8} + into / + strip_rpath udevadm + dobin udevadm - # Compatibility symlink for software that looks for libudev.so - # without using pkg-config - dosym ../../$(get_libdir)/libudev.so.1 \ - /usr/$(get_libdir)/libudev.so - else - local targets=( - install-libLTLIBRARIES - install-includeHEADERS - install-pkgconfiglibDATA - lib_LTLIBRARIES="libudev.la" - pkgconfiglib_DATA="src/libudev/libudev.pc" - include_HEADERS="src/libudev/libudev.h" - ) + exeinto /lib/systemd + strip_rpath systemd-udevd + doexe systemd-udevd + + exeinto /lib/udev + strip_rpath src/udev/{ata_id,cdrom_id,collect,mtd_probe,scsi_id,v4l_id} + doexe src/udev/{ata_id,cdrom_id,collect,mtd_probe,scsi_id,v4l_id} + + rm rules/99-systemd.rules || die + insinto /lib/udev/rules.d + doins rules/*.rules - emake -j1 DESTDIR="${D}" "${targets[@]}" + insinto /usr/share/pkgconfig + doins src/udev/udev.pc + + mv man/systemd-udevd.service.8 man/systemd-udevd.8 || die + rm man/systemd-udevd-{control,kernel}.socket.8 || die + doman man/*.[0-9] fi } multilib_src_install_all() { - dodoc TODO + doheader src/libudev/libudev.h + + insinto /etc/udev + doins src/udev/udev.conf - prune_libtool_files --all - rm -f "${D}"/lib/udev/rules.d/99-systemd.rules - rm -f "${D}"/usr/share/doc/${PF}/{LICENSE.*,GVARIANT-SERIALIZATION,DIFFERENCES,PORTING-DBUS1,sd-shutdown.h} + insinto /lib/systemd/network + doins network/99-default.link # see src_prepare() for content of 40-gentoo.rules insinto /lib/udev/rules.d doins "${T}"/40-gentoo.rules - # maintainer note: by not letting the upstream build-sys create the .so - # link, you also avoid a parallel make problem - mv "${D}"/usr/share/man/man8/systemd-udevd{.service,}.8 + dobashcomp shell-completion/bash/udevadm + + insinto /usr/share/zsh/site-functions + doins shell-completion/zsh/_udevadm + + einstalldocs } pkg_postinst() { |