From 335c80a33945507b12188d7585d9c9d321de7c3f Mon Sep 17 00:00:00 2001
From: Robert Martin-Legene <robert@nic.ar>
Date: Fri, 24 May 2019 20:11:35 -0300
Subject: [PATCH] Proveer solc, pero no por defecto

---
 bin/installsolc.sh | 23 +++++++++++++++++++++++
 bin/solc           | 32 ++++++++++++++++++++++++++++++++
 2 files changed, 55 insertions(+)
 create mode 100755 bin/installsolc.sh
 create mode 100755 bin/solc

diff --git a/bin/installsolc.sh b/bin/installsolc.sh
new file mode 100755
index 0000000..e570285
--- /dev/null
+++ b/bin/installsolc.sh
@@ -0,0 +1,23 @@
+#!/bin/bash
+
+trap "exit 1" ERR
+set -x
+
+test -d ~/new || mkdir ~/new
+cd ~/new
+if [ -d "solidity" ]
+then
+    cd solidity
+    git pull
+else
+    git clone --recursive https://github.com/ethereum/solidity.git
+    cd solidity
+fi
+
+scripts/install_deps.sh 
+
+mkdir -p build 
+cd build
+cmake ..
+make solc
+install --owner=bfa --target-directory=$( echo ~bfa )/bin solc/solc
diff --git a/bin/solc b/bin/solc
new file mode 100755
index 0000000..56dce9c
--- /dev/null
+++ b/bin/solc
@@ -0,0 +1,32 @@
+#!/bin/bash
+# (c) 20190524 NIC Argentina, GPLv2
+# Robert Martin-Legene <robert@nic.ar>
+
+# See if PATH is set up incorrectly (look for another install of this binary).
+
+set -x
+mypath=$( realpath $0 )
+myname=${mypath##*/}
+for p in ${PATH//:/ }
+do
+    checkfile=${p}/${myname}
+    if [ -x ${checkfile} ]
+    then
+        if [ $( realpath ${checkfile} ) = $mypath ]
+        then
+            continue
+        fi
+        # we found another one, yay!
+        exec ${checkfile} "$@"
+        exit 1
+    fi
+done
+
+# not found .. tell to install it.
+set +x
+exec >&2
+echo "***********************************"
+echo "solc no esta instalado."
+echo "Para instalarlo, usa installsolc.sh"
+echo "***********************************"
+exit 1
-- 
GitLab