From c17260f31eb68d182498b562028361c76768dd73 Mon Sep 17 00:00:00 2001 From: Vaughn Kottler Date: Wed, 15 May 2024 12:06:20 -0700 Subject: [PATCH 01/13] Fix some Python handling --- scripts/sh/install_python.sh | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/scripts/sh/install_python.sh b/scripts/sh/install_python.sh index ede8b7a..78ace9a 100644 --- a/scripts/sh/install_python.sh +++ b/scripts/sh/install_python.sh @@ -14,11 +14,18 @@ if ! is_cmd pip; then fi fi -if is_debian || is_ubuntu; then - install_package python3-venv "python$PYTHON_VERSION" "python$PYTHON_VERSION-venv" -else - # If we can't directly install Python, fallback on source building. +source_install_python() { run_install_if_not "python$PYTHON_VERSION" python-src +} + +if is_rpi; then + source_install_python +elif is_debian || is_ubuntu; then + install_package python3-venv \ + "python$PYTHON_VERSION" \ + "python$PYTHON_VERSION-venv" +else + source_install_python fi # Create a virtual environment. From a7d51cd1e836ab5cd0a19c29d59d07e4d602b353 Mon Sep 17 00:00:00 2001 From: Vaughn Kottler Date: Wed, 15 May 2024 12:08:42 -0700 Subject: [PATCH 02/13] Update Python release --- scripts/sh/install_python-src.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/scripts/sh/install_python-src.sh b/scripts/sh/install_python-src.sh index 19e924a..d2ce324 100644 --- a/scripts/sh/install_python-src.sh +++ b/scripts/sh/install_python-src.sh @@ -44,7 +44,8 @@ elif is_debian || is_ubuntu; then fi # This is used for downloading pre-built releases. -[ "$PYTHON_FULL_VERSION" ] || export PYTHON_FULL_VERSION="$PYTHON_VERSION.4" +PYTHON_RELEASE=3 +[ "$PYTHON_FULL_VERSION" ] || export PYTHON_FULL_VERSION="$PYTHON_VERSION.$PYTHON_RELEASE" PYTHON_SRC_ARCHIVE="v$PYTHON_FULL_VERSION.tar.gz" PYTHON_SRC="cpython-$PYTHON_FULL_VERSION" From c013142fdb1dd05e44b1f5f9fd0a21d8f0f08a40 Mon Sep 17 00:00:00 2001 From: Vaughn Kottler Date: Wed, 15 May 2024 12:16:51 -0700 Subject: [PATCH 03/13] Fix for Python install script --- scripts/sh/install_python-src.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/sh/install_python-src.sh b/scripts/sh/install_python-src.sh index d2ce324..e91fe75 100644 --- a/scripts/sh/install_python-src.sh +++ b/scripts/sh/install_python-src.sh @@ -76,7 +76,7 @@ sudo_cmd make altinstall sudo_cmd ldconfig # lists modules / prints missing -./python ./setup.py build -n +./python ./setup.py build -n || true safe_popd From 56dd12d87914682d53ce5761bed206bb156c8b95 Mon Sep 17 00:00:00 2001 From: Vaughn Kottler Date: Wed, 15 May 2024 12:22:23 -0700 Subject: [PATCH 04/13] Run locale generation earlier --- scripts/sh/install_debian.sh | 4 ++-- scripts/sh/install_locale.sh | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/scripts/sh/install_debian.sh b/scripts/sh/install_debian.sh index fbeadd8..1c08e3a 100644 --- a/scripts/sh/install_debian.sh +++ b/scripts/sh/install_debian.sh @@ -3,9 +3,9 @@ sudo apt-get update && sudo apt-get upgrade -y # micropython circuitpython -TASKS+=(git python rcmpy pkgconf lua neovim zsh ninja-src tio clang) +TASKS+=(locale git python rcmpy pkgconf lua neovim zsh ninja-src tio clang) -TASKS+=(picotool go fzf-src rust locale) +TASKS+=(picotool go fzf-src rust) if is_rpi; then run_install raspberrypi diff --git a/scripts/sh/install_locale.sh b/scripts/sh/install_locale.sh index 825adc5..bd5f93b 100644 --- a/scripts/sh/install_locale.sh +++ b/scripts/sh/install_locale.sh @@ -1,3 +1,3 @@ -[ "$LANG" ] || export LANG=en_US.UTF-8 +export LANG=en_US.UTF-8 sudo_cmd locale-gen "$LANG" -sudo update-locale +sudo_cmd update-locale From 4c25158e26090c40a72288bd4bc316437ede5d73 Mon Sep 17 00:00:00 2001 From: Vaughn Kottler Date: Wed, 15 May 2024 12:23:26 -0700 Subject: [PATCH 05/13] Fix gcc install for rpi --- scripts/sh/install_debian.sh | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/scripts/sh/install_debian.sh b/scripts/sh/install_debian.sh index 1c08e3a..0419ecb 100644 --- a/scripts/sh/install_debian.sh +++ b/scripts/sh/install_debian.sh @@ -13,7 +13,11 @@ fi # build tools PACKAGES+=(cmake gcc-arm-none-eabi libnewlib-arm-none-eabi build-essential) -PACKAGES+=(libstdc++-arm-none-eabi-newlib mold gcc-13 g++-13) +PACKAGES+=(libstdc++-arm-none-eabi-newlib mold) +if ! is_rpi; then + PACKAGES+=(gcc-13 g++-13) +fi + PACKAGES+=(emscripten) # gnu From 4369809284a2c5c68d7461ff8d99b5a34c212e75 Mon Sep 17 00:00:00 2001 From: Vaughn Kottler Date: Wed, 15 May 2024 12:24:54 -0700 Subject: [PATCH 06/13] Add more locale variables --- scripts/sh/install_locale.sh | 3 +++ 1 file changed, 3 insertions(+) diff --git a/scripts/sh/install_locale.sh b/scripts/sh/install_locale.sh index bd5f93b..ae90f6b 100644 --- a/scripts/sh/install_locale.sh +++ b/scripts/sh/install_locale.sh @@ -1,3 +1,6 @@ +export LC_ALL=en_US.UTF-8 export LANG=en_US.UTF-8 +export LANGUAGE=en_US + sudo_cmd locale-gen "$LANG" sudo_cmd update-locale From a9be5324cfa7c783787ee2fb62c3cafbc452a22f Mon Sep 17 00:00:00 2001 From: Vaughn Kottler Date: Wed, 15 May 2024 12:29:19 -0700 Subject: [PATCH 07/13] Try to fix locale-gen script --- scripts/sh/install_locale.sh | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/scripts/sh/install_locale.sh b/scripts/sh/install_locale.sh index ae90f6b..79b1fe6 100644 --- a/scripts/sh/install_locale.sh +++ b/scripts/sh/install_locale.sh @@ -2,5 +2,10 @@ export LC_ALL=en_US.UTF-8 export LANG=en_US.UTF-8 export LANGUAGE=en_US +if is_rpi; then + sudo_cmd perl -pi -e \ + 's/# en_US.UTF-8 UTF-8/en_US.UTF-8 UTF-8/g' /etc/locale.gen +fi + sudo_cmd locale-gen "$LANG" sudo_cmd update-locale From 52854844446bc059fefb29f44de54cf0a4de5e92 Mon Sep 17 00:00:00 2001 From: Vaughn Kottler Date: Wed, 15 May 2024 12:35:33 -0700 Subject: [PATCH 08/13] Try to fix some more things --- config | 2 +- scripts/sh/install_locale.sh | 5 +++-- scripts/sh/install_pkgconf.sh | 7 ++++++- 3 files changed, 10 insertions(+), 4 deletions(-) diff --git a/config b/config index 8f74fcf..89d2df6 160000 --- a/config +++ b/config @@ -1 +1 @@ -Subproject commit 8f74fcfe41ffec906c5470ffa028b8809200ce8e +Subproject commit 89d2df60e8837b5bfa786597feea3606a2b29911 diff --git a/scripts/sh/install_locale.sh b/scripts/sh/install_locale.sh index 79b1fe6..3b68da3 100644 --- a/scripts/sh/install_locale.sh +++ b/scripts/sh/install_locale.sh @@ -1,7 +1,8 @@ -export LC_ALL=en_US.UTF-8 -export LANG=en_US.UTF-8 export LANGUAGE=en_US +export LC_ALL=$LANGUAGE.UTF-8 +export LANG=$LANGUAGE.UTF-8 +# https://www.jaredwolff.com/raspberry-pi-setting-your-locale/ if is_rpi; then sudo_cmd perl -pi -e \ 's/# en_US.UTF-8 UTF-8/en_US.UTF-8 UTF-8/g' /etc/locale.gen diff --git a/scripts/sh/install_pkgconf.sh b/scripts/sh/install_pkgconf.sh index 06abd60..5aa4b14 100644 --- a/scripts/sh/install_pkgconf.sh +++ b/scripts/sh/install_pkgconf.sh @@ -1,13 +1,18 @@ #!/bin/bash PROJECT=pkgconf +VERSION=2.2.0 + +if is_ubuntu || is_rpi; then + sudo_cmd apt-get remove pkgconf pkg-config +fi if ! is_cmd $PROJECT; then clone_third_party_github $PROJECT $PROJECT safe_pushd "$THIRD_PARTY/$PROJECT" - git checkout $PROJECT-2.2.0 + git checkout $PROJECT-$VERSION if [ ! -f configure ]; then ./autogen.sh From 0a36682f20f415eb0a31f118024716faee385c62 Mon Sep 17 00:00:00 2001 From: Vaughn Kottler Date: Wed, 15 May 2024 12:37:10 -0700 Subject: [PATCH 09/13] More updates for pkgconf --- scripts/sh/install_pkgconf.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/scripts/sh/install_pkgconf.sh b/scripts/sh/install_pkgconf.sh index 5aa4b14..46d371b 100644 --- a/scripts/sh/install_pkgconf.sh +++ b/scripts/sh/install_pkgconf.sh @@ -4,7 +4,8 @@ PROJECT=pkgconf VERSION=2.2.0 if is_ubuntu || is_rpi; then - sudo_cmd apt-get remove pkgconf pkg-config + sudo_cmd apt-get remove -y pkgconf pkg-config + sudo_cmd apt-get autoremove -y fi if ! is_cmd $PROJECT; then From 708345863f48ccc0bc3cf023cf1e869e709c9e9e Mon Sep 17 00:00:00 2001 From: Vaughn Kottler Date: Wed, 15 May 2024 12:43:08 -0700 Subject: [PATCH 10/13] Some lua fixes --- scripts/sh/install_lua.sh | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/scripts/sh/install_lua.sh b/scripts/sh/install_lua.sh index d36858b..a962e5d 100644 --- a/scripts/sh/install_lua.sh +++ b/scripts/sh/install_lua.sh @@ -12,7 +12,9 @@ LUA_SLUG=$LUA_VER.$LUA_RELEASE # export LUA_CPATH="?.so;$LUA_DIR/?.so" # export LUA_PATH="?.$PROJECT;$LUA_DIR/?.$PROJECT" -if ! is_cmd $PROJECT; then +PKG_CONF_DIR=/usr/local/lib/pkgconfig + +if [ ! -f $PKG_CONF_DIR/$LUA_VER.pc ]; then safe_pushd "$THIRD_PARTY" if [ ! -d $LUA_SLUG ]; then @@ -32,6 +34,6 @@ if ! is_cmd $PROJECT; then safe_popd # Copy custom pkgconf file. - sudo_cmd mkdir -p /usr/local/lib/pkgconfig - sudo_cmd cp "$REPO/data/$LUA_VER.pc" /usr/local/lib/pkgconfig + sudo_cmd mkdir -p $PKG_CONF_DIR + sudo_cmd cp "$REPO/data/$LUA_VER.pc" $PKG_CONF_DIR fi From d47bf3cab08f15e111859f33d5149c6c1bc4092a Mon Sep 17 00:00:00 2001 From: Vaughn Kottler Date: Wed, 15 May 2024 12:54:21 -0700 Subject: [PATCH 11/13] More fix attempts --- scripts/sh/install_debian.sh | 3 --- scripts/sh/install_pkgconf.sh | 1 - scripts/sh/install_tio.sh | 3 +++ 3 files changed, 3 insertions(+), 4 deletions(-) diff --git a/scripts/sh/install_debian.sh b/scripts/sh/install_debian.sh index 0419ecb..b23a6c3 100644 --- a/scripts/sh/install_debian.sh +++ b/scripts/sh/install_debian.sh @@ -32,9 +32,6 @@ PACKAGES+=(gdb-multiarch lcov) # utilities PACKAGES+=(tmux ack htop mtools shellcheck tree xdg-utils) -# needed by tio -PACKAGES+=(libglib2.0-dev) - if is_wsl; then PACKAGES+=(wslu) fi diff --git a/scripts/sh/install_pkgconf.sh b/scripts/sh/install_pkgconf.sh index 46d371b..02b5b09 100644 --- a/scripts/sh/install_pkgconf.sh +++ b/scripts/sh/install_pkgconf.sh @@ -5,7 +5,6 @@ VERSION=2.2.0 if is_ubuntu || is_rpi; then sudo_cmd apt-get remove -y pkgconf pkg-config - sudo_cmd apt-get autoremove -y fi if ! is_cmd $PROJECT; then diff --git a/scripts/sh/install_tio.sh b/scripts/sh/install_tio.sh index 6801a08..1cc3377 100644 --- a/scripts/sh/install_tio.sh +++ b/scripts/sh/install_tio.sh @@ -13,6 +13,9 @@ meson --version clone_third_party_github $PROJECT $PROJECT safe_pushd "$THIRD_PARTY/$PROJECT" +install_package libglib2.0-dev +sudo_cmd ldconfig + meson setup --prefix "$INSTALL_PREFIX" build meson compile -C build meson install -C build From b19705f3523dea40fad749742fdfd0fc8471cddf Mon Sep 17 00:00:00 2001 From: Vaughn Kottler Date: Wed, 15 May 2024 12:57:38 -0700 Subject: [PATCH 12/13] Don't install tio on pi's --- scripts/sh/install_debian.sh | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/scripts/sh/install_debian.sh b/scripts/sh/install_debian.sh index b23a6c3..8835ebe 100644 --- a/scripts/sh/install_debian.sh +++ b/scripts/sh/install_debian.sh @@ -3,7 +3,7 @@ sudo apt-get update && sudo apt-get upgrade -y # micropython circuitpython -TASKS+=(locale git python rcmpy pkgconf lua neovim zsh ninja-src tio clang) +TASKS+=(locale git python rcmpy pkgconf lua neovim zsh ninja-src clang) TASKS+=(picotool go fzf-src rust) @@ -37,6 +37,9 @@ if is_wsl; then fi if ! is_rpi; then + # ubuntu seems to be required + TASKS+=(tio) + if ! is_wsl; then # stuff for kicad PACKAGES+=(libglu1-mesa-dev libgl1-mesa-dev libglew-dev) From 69d29023eddacde4f5dbc637b2b8be6dd9e32684 Mon Sep 17 00:00:00 2001 From: Vaughn Kottler Date: Wed, 15 May 2024 12:59:54 -0700 Subject: [PATCH 13/13] It was actually clang install that wasn't working --- scripts/sh/install_debian.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/sh/install_debian.sh b/scripts/sh/install_debian.sh index 8835ebe..3c64c2f 100644 --- a/scripts/sh/install_debian.sh +++ b/scripts/sh/install_debian.sh @@ -3,7 +3,7 @@ sudo apt-get update && sudo apt-get upgrade -y # micropython circuitpython -TASKS+=(locale git python rcmpy pkgconf lua neovim zsh ninja-src clang) +TASKS+=(locale git python rcmpy pkgconf lua neovim zsh ninja-src tio) TASKS+=(picotool go fzf-src rust) @@ -38,7 +38,7 @@ fi if ! is_rpi; then # ubuntu seems to be required - TASKS+=(tio) + TASKS+=(clang) if ! is_wsl; then # stuff for kicad