dev-lang/rust-bin: fix cargo on ppc64
authorGeorgy Yakovlev <gyakovlev@gentoo.org>
Mon, 11 Mar 2019 04:46:09 +0000 (21:46 -0700)
committerGeorgy Yakovlev <gyakovlev@gentoo.org>
Mon, 11 Mar 2019 04:51:16 +0000 (21:51 -0700)
Bug: https://bugs.gentoo.org/679806
Package-Manager: Portage-2.3.62, Repoman-2.3.12
Signed-off-by: Georgy Yakovlev <gyakovlev@gentoo.org>
dev-lang/rust-bin/rust-bin-1.32.0.ebuild
dev-lang/rust-bin/rust-bin-1.33.0.ebuild

index a2af32c2885bbdafc0b35bfc75b88f1dcf47c49e..170a05bf8146f360e0907fd568dc4f00e78db483 100644 (file)
@@ -76,7 +76,18 @@ src_install() {
        dosym "../../opt/${P}/bin/${rustlldb}" "/usr/bin/${rustlldb}"
 
        local cargo=cargo-bin-${PV}
-       mv "${D}/opt/${P}/bin/cargo" "${D}/opt/${P}/bin/${cargo}" || die
+       # ugly hack for https://bugs.gentoo.org/679806
+       if use ppc64; then
+               mv "${D}/opt/${P}/bin/cargo" "${D}/opt/${P}/bin/${cargo}".bin || die
+               sed -i 's/getentropy/gEtEnTrOpY/g' "${D}/opt/${P}/bin/${cargo}".bin || die
+               cat <<- 'EOF' > "${D}/opt/${P}/bin/${cargo}"
+                       #!/bin/sh
+                       OPENSSL_ppccap=0 $(realpath $0).bin "${@}"
+               EOF
+               fperms +x "/opt/${P}/bin/${cargo}"
+       else
+               mv "${D}/opt/${P}/bin/cargo" "${D}/opt/${P}/bin/${cargo}" || die
+       fi
        dosym "../../opt/${P}/bin/${cargo}" "/usr/bin/${cargo}"
        if use clippy; then
                local clippy_driver=clippy-driver-bin-${PV}
index a2af32c2885bbdafc0b35bfc75b88f1dcf47c49e..170a05bf8146f360e0907fd568dc4f00e78db483 100644 (file)
@@ -76,7 +76,18 @@ src_install() {
        dosym "../../opt/${P}/bin/${rustlldb}" "/usr/bin/${rustlldb}"
 
        local cargo=cargo-bin-${PV}
-       mv "${D}/opt/${P}/bin/cargo" "${D}/opt/${P}/bin/${cargo}" || die
+       # ugly hack for https://bugs.gentoo.org/679806
+       if use ppc64; then
+               mv "${D}/opt/${P}/bin/cargo" "${D}/opt/${P}/bin/${cargo}".bin || die
+               sed -i 's/getentropy/gEtEnTrOpY/g' "${D}/opt/${P}/bin/${cargo}".bin || die
+               cat <<- 'EOF' > "${D}/opt/${P}/bin/${cargo}"
+                       #!/bin/sh
+                       OPENSSL_ppccap=0 $(realpath $0).bin "${@}"
+               EOF
+               fperms +x "/opt/${P}/bin/${cargo}"
+       else
+               mv "${D}/opt/${P}/bin/cargo" "${D}/opt/${P}/bin/${cargo}" || die
+       fi
        dosym "../../opt/${P}/bin/${cargo}" "/usr/bin/${cargo}"
        if use clippy; then
                local clippy_driver=clippy-driver-bin-${PV}