aboutsummaryrefslogtreecommitdiffstats
path: root/scripts
diff options
context:
space:
mode:
authorLibravatar Vijay Aravamudhan <vraravam@users.noreply.github.com>2024-03-28 10:12:05 +0000
committerLibravatar GitHub <noreply@github.com>2024-03-28 15:42:05 +0530
commit53c72ea5ac4f103291fdd347b7cd9cc0dbafa4b5 (patch)
treeb5317730f7e7ac879732c1557a53ef4515a654e4 /scripts
parentUpgrade electron to '29.1.6' (diff)
downloadferdium-app-53c72ea5ac4f103291fdd347b7cd9cc0dbafa4b5.tar.gz
ferdium-app-53c72ea5ac4f103291fdd347b7cd9cc0dbafa4b5.tar.zst
ferdium-app-53c72ea5ac4f103291fdd347b7cd9cc0dbafa4b5.zip
Bring in missing python (system dependency) (#1639)
* Introduce python as a system dependency (needed by node-gyp to compile native modules) * Introduce node-pre-gyp as a dependency * Upgrade sqlite3 to 5.1.7 to test the above Note: Currently this still depends on the availability of prebuilt binaries from the prebuild library. Which means that once a new version is available, only then will we know if this python/node-gyp integration works or whether it will still fallback to the availability of the prebuilt binaries from external sources. Only time will tell if we have solved the issue or not.
Diffstat (limited to 'scripts')
-rwxr-xr-xscripts/build-unix.sh19
-rw-r--r--scripts/build-windows.ps12
2 files changed, 13 insertions, 8 deletions
diff --git a/scripts/build-unix.sh b/scripts/build-unix.sh
index 04aa9e70f..f485f9087 100755
--- a/scripts/build-unix.sh
+++ b/scripts/build-unix.sh
@@ -3,7 +3,7 @@
3# INTRO: 3# INTRO:
4# This file is used to build ferdium on both x64 and arm-based for macos and linux (not tested on arm for linux). 4# This file is used to build ferdium on both x64 and arm-based for macos and linux (not tested on arm for linux).
5# It also handles any corrupted node modules with the 'CLEAN' env var (set it to 'true' for cleaning) 5# It also handles any corrupted node modules with the 'CLEAN' env var (set it to 'true' for cleaning)
6# It will install the system dependencies except for node (which is still verified) 6# It will install the system dependencies except for node and python (which are still verified)
7# I sometimes symlink my 'recipes' folder so that any changes that I need to do in it can also be committed and pushed independently 7# I sometimes symlink my 'recipes' folder so that any changes that I need to do in it can also be committed and pushed independently
8# This file can live anywhere in your PATH 8# This file can live anywhere in your PATH
9 9
@@ -32,6 +32,7 @@ command_exists() {
32# Checking the developer environment 32# Checking the developer environment
33# Check for installed programmes 33# Check for installed programmes
34command_exists node || fail_with_docs "Node is not installed" 34command_exists node || fail_with_docs "Node is not installed"
35command_exists python || fail_with_docs "python is not installed"
35 36
36# Check node version 37# Check node version
37EXPECTED_NODE_VERSION=$(cat .nvmrc) 38EXPECTED_NODE_VERSION=$(cat .nvmrc)
@@ -42,6 +43,15 @@ if [ "v$EXPECTED_NODE_VERSION" != "$ACTUAL_NODE_VERSION" ]; then
42 actual : [$ACTUAL_NODE_VERSION]" 43 actual : [$ACTUAL_NODE_VERSION]"
43fi 44fi
44 45
46# Check python version
47EXPECTED_PYTHON_VERSION=$(node -p 'require("./package.json").engines.python')
48ACTUAL_PYTHON_VERSION=$(python --version | sed -e "s/Python //")
49if [[ "$ACTUAL_PYTHON_VERSION" != "$EXPECTED_PYTHON_VERSION" ]]; then
50 fail_with_docs "You are not running the expected version of Python!
51 expected: [$EXPECTED_PYTHON_VERSION]
52 actual : [$ACTUAL_PYTHON_VERSION]"
53fi
54
45# Check if the 'recipes' folder is present either as a git submodule or a symbolic link 55# Check if the 'recipes' folder is present either as a git submodule or a symbolic link
46if ! [ -f "recipes/package.json" ]; then 56if ! [ -f "recipes/package.json" ]; then
47 fail_with_docs "'recipes' folder is missing or submodule has not been checked out" 57 fail_with_docs "'recipes' folder is missing or submodule has not been checked out"
@@ -68,7 +78,7 @@ else
68 fi 78 fi
69 79
70 npm cache clean --force 80 npm cache clean --force
71 rm -rf ~/.npm ~/.electron-gyp ~/.asdf/installs/nodejs/*/.npm/ 81 rm -rf ~/.npm ~/.electron-gyp
72 82
73 git -C recipes clean -fxd # Clean recipes folder/submodule 83 git -C recipes clean -fxd # Clean recipes folder/submodule
74 git clean -fxd # Note: This will blast away the 'recipes' folder if you have symlinked it 84 git clean -fxd # Note: This will blast away the 'recipes' folder if you have symlinked it
@@ -79,8 +89,6 @@ fi
79 89
80# ----------------------------------------------------------------------------- 90# -----------------------------------------------------------------------------
81# Ensure that the system dependencies are at the correct version - recover if not 91# Ensure that the system dependencies are at the correct version - recover if not
82# If 'asdf' is installed, reshim for new nodejs if necessary
83command_exists asdf && asdf reshim nodejs
84 92
85# Ensure that the system dependencies are at the correct version 93# Ensure that the system dependencies are at the correct version
86# Check pnpm version 94# Check pnpm version
@@ -99,9 +107,6 @@ if [[ "$EXPECTED_PNPM_VERSION" != "$EXPECTED_RECIPES_PNPM_VERSION" ]]; then
99 actual : [$EXPECTED_PNPM_VERSION]" 107 actual : [$EXPECTED_PNPM_VERSION]"
100fi 108fi
101 109
102# If 'asdf' is installed, reshim for new nodejs if necessary
103command_exists asdf && asdf reshim nodejs
104
105# ----------------------------------------------------------------------------- 110# -----------------------------------------------------------------------------
106printf "\n*************** Building recipes ***************\n" 111printf "\n*************** Building recipes ***************\n"
107pushd recipes 112pushd recipes
diff --git a/scripts/build-windows.ps1 b/scripts/build-windows.ps1
index 5da7df540..02289d172 100644
--- a/scripts/build-windows.ps1
+++ b/scripts/build-windows.ps1
@@ -1,7 +1,7 @@
1# INTRO: 1# INTRO:
2# This file is used to build ferdium on windows. 2# This file is used to build ferdium on windows.
3# It also handles any corrupted node modules with the 'CLEAN' env var (set it to 'true' for cleaning) 3# It also handles any corrupted node modules with the 'CLEAN' env var (set it to 'true' for cleaning)
4# It will install the system dependencies except for node (which is still verified) 4# It will install the system dependencies except for node and python (which are still verified)
5# I sometimes symlink my 'recipes' folder so that any changes that I need to do in it can also be committed and pushed independently 5# I sometimes symlink my 'recipes' folder so that any changes that I need to do in it can also be committed and pushed independently
6# This file can live anywhere in your PATH 6# This file can live anywhere in your PATH
7 7