Files
chromebrew/packages/ld_default.rb
Satadru Pramanik, DO, MPH, MEng 79efa1dfd5 Python => 3.13.0 (#10585)
* Python => 3.13

Signed-off-by: Satadru Pramanik <satadru@gmail.com>

* fix VER variables in const.rb

Signed-off-by: Satadru Pramanik <satadru@gmail.com>

* bugfixes

Signed-off-by: Satadru Pramanik <satadru@gmail.com>

* More plumbing changes...

Signed-off-by: Satadru Pramanik <satadru@gmail.com>

* Adjust py3_pip and py3_setuptools to not error during python3 preinstall.

Signed-off-by: Satadru Pramanik <satadru@gmail.com>

* fix hash error

Signed-off-by: Satadru Pramanik <satadru@gmail.com>

* Add no_binaries_needed

Signed-off-by: Satadru Pramanik <satadru@gmail.com>

* bugfixes...

Signed-off-by: Satadru Pramanik <satadru@gmail.com>

* Add PYO3_USE_ABI3_FORWARD_COMPATIBILITY=1 to pip.rb to fix python 3.13 builds.

Signed-off-by: Satadru Pramanik <satadru@gmail.com>

* Add workaround for missing binaries...

Signed-off-by: Satadru Pramanik <satadru@gmail.com>

* update cmake

Signed-off-by: Satadru Pramanik <satadru@gmail.com>

* Add lots of package updates.

Signed-off-by: Satadru Pramanik <satadru@gmail.com>

* Add py3_bcrypt, rename asciidoc, add more package builds.

Signed-off-by: Satadru Pramanik <satadru@gmail.com>

* More updates

Signed-off-by: Satadru Pramanik <satadru@gmail.com>

* revert postgresql update

Signed-off-by: Satadru Pramanik <satadru@gmail.com>

* final updates?

Signed-off-by: Satadru Pramanik <satadru@gmail.com>

* update curl

Signed-off-by: Satadru Pramanik <satadru@gmail.com>

* lint

Signed-off-by: Satadru Pramanik <satadru@gmail.com>

* Add curl to essential packages to try to prevent unit test failure on i686.

Signed-off-by: Satadru Pramanik <satadru@gmail.com>

* updates

Signed-off-by: Satadru Pramanik <satadru@gmail.com>

* lint

Signed-off-by: Satadru Pramanik <satadru@gmail.com>

* fix accidental change to docker package.

Signed-off-by: Satadru Pramanik <satadru@gmail.com>

* Fiz condition of no new updates leavimg a message with CREW_UNATTENDED set.

Signed-off-by: Satadru Pramanik <satadru@gmail.com>

* more updates, add missing libabigail binaries

Signed-off-by: Satadru Pramanik <satadru@gmail.com>

* rebuild py3_dbus_python

Signed-off-by: Satadru Pramanik <satadru@gmail.com>

* add arm build for 5.10 musl_linuxheaders

Signed-off-by: Satadru Pramanik <satadru@gmail.com>

* Add builds for openimageio.

Signed-off-by: Satadru Pramanik <satadru@gmail.com>

* Adjust ruby buildsystem slightly to use cache more, adjust unit tests to properly invoke setarch, add py3_pynacl, update libsodium.

Signed-off-by: Satadru Pramanik <satadru@gmail.com>

* Ruby adjustments...

Signed-off-by: Satadru Pramanik <satadru@gmail.com>

* unit test adjustments...

Signed-off-by: Satadru Pramanik <satadru@gmail.com>

* unit test adjustments...

Signed-off-by: Satadru Pramanik <satadru@gmail.com>

* Add error message to pip install...

Signed-off-by: Satadru Pramanik <satadru@gmail.com>

* expand pip error reporting

Signed-off-by: Satadru Pramanik <satadru@gmail.com>

* More pip adjustments.

Signed-off-by: Satadru Pramanik <satadru@gmail.com>

* Add more pip verbose error reporting.

Signed-off-by: Satadru Pramanik <satadru@gmail.com>

* Add new workaround for pip failure on i686...

Signed-off-by: Satadru Pramanik <satadru@gmail.com>

* Refactor pip again...

Signed-off-by: Satadru Pramanik <satadru@gmail.com>

* more refactoring...

Signed-off-by: Satadru Pramanik <satadru@gmail.com>

* Adjust py3_pip version restriction.

Signed-off-by: Satadru Pramanik <satadru@gmail.com>

* Avoid container jdk dependency in snowflake.

Signed-off-by: Satadru Pramanik <satadru@gmail.com>

* update trove classifiers.

Signed-off-by: Satadru Pramanik <satadru@gmail.com>

* adjust package fxn exit

Signed-off-by: Satadru Pramanik <satadru@gmail.com>

* adjust more jdk deps

Signed-off-by: Satadru Pramanik <satadru@gmail.com>

---------

Signed-off-by: Satadru Pramanik <satadru@gmail.com>
2024-10-12 16:03:50 -05:00

103 lines
2.5 KiB
Ruby

require 'package'
class Ld_default < Package
description "Select the default ld executable and check for libraries in #{CREW_LIB_PREFIX} first"
homepage 'https://github.com/chromebrew/chromebrew/wiki/FAQ'
version '1.3'
license 'GPL-3+'
compatibility 'all'
source_url 'SKIP'
depends_on 'llvm19_dev'
no_binaries_needed
def self.build
system "cat << 'EOF' > ld_default
#!/bin/bash
set -e
mktmp=\$(mktemp -d)
cd #{CREW_PREFIX}/bin
type=\$(file ld | cut -d' ' -f2 | tr -d '\\n')
if [[ \"\${type}\" == \"ELF\" ]]; then
current=\$(basename $(find . -inum \$(ls -i ld | cut -d' ' -f1) | fgrep 'ld.'))
elif [[ \"${type}\" == \"symbolic\" ]]; then
current=\$(basename \$(readlink ld))
elif [[ \"${type}\" == \"Bourne-Again\" ]]; then
current=\$(basename \$(tail -1 ld | cut -d' ' -f1))
else # Fall back to \"Unknown\" if linker was not identified
current=\"Unknown\"
fi
if [[ -z \"\${1}\" ]]; then
echo
echo \" Current default linker: \${current}\"
echo
echo ' Enter the new default linker:'
echo
echo ' b = ld.bfd'
echo ' g = ld.gold'
echo ' l = ld.lld'
echo ' 0 = Cancel'
echo
else
echo \"\${current}\" | cut -d'.' -f2 | cut -c1
fi
while true; do
if [[ -z \"\${1}\" ]]; then
read default
else
default=\"\${1}\"
if [[ \"\${default}\" != 'b' ]] && [[ \"\${default}\" != 'g' ]] && [[ \"\${default}\" != 'l' ]]; then
echo \"Invalid linker configuration: \${default}\"
exit 1
fi
fi
case \"\${default}\" in
b)
new='ld.bfd'
break;;
g)
new='ld.gold'
break;;
l)
new='ld.lld'
break;;
0)
exit;;
*)
echo 'Please select from one of the options or enter 0 to cancel.'
echo
esac
done
echo '#!/bin/bash' > \${mktmp}/ld
echo \"\${new}\"' --library-path #{CREW_LIB_PREFIX} -rpath #{CREW_LIB_PREFIX} \"\$@\"' >> \${mktmp}/ld
install -Dm755 \${mktmp}/ld #{CREW_PREFIX}/bin/ld
rm -rf \${mktmp}
EOF"
end
def self.install
system "install -Dm755 ld_default #{CREW_DEST_PREFIX}/bin/ld_default"
end
def self.postinstall
puts
puts 'To change the default linker, execute `ld_default`.'.lightblue
puts
puts 'To change the default linker without any user interaction,'.lightblue
puts "execute `ld_default <letter>` where '<letter>' is b, g, or l".lightblue
puts 'for BFD, Gold, or LLD, respectively.'.lightblue
puts
end
end