Browse Source

Avoid "sudo make install", which breaks some frameworks

In particular, using sudo here causes stuff in the "installs" directory
to be owned by root.  Then if another framework wanted to put something
in one of the same subdirectories of installs, and it was (properly) not
using sudo, it would fail.  For example, this happened with cutelyst
(used sudo inappropriately, created an installs/bin owned by root) and
ffead-cpp (correctly did *not* use sudo, could not add to installs/bin
because it was owned by root).

The fix for cmake is a bit messier.  cmake-3.5.sh was overriding whatever
version of cmake that other frameworks had installed, which was not good.
It turns out that swift/vapor run just fine using the same version of
cmake (3.2 or something) as the other frameworks, so I got rid of the
cmake-3.5.sh script and used apt-get instead.  I copied the related lines
from cutelyst -- another framework that uses cmake.

Ideally we should be using fw_depends instead of apt-get in the cutelyst
and swift installation scripts, but that was not the focus of this
change.  This change is about fixing file permissions.
Michael Hixson 8 years ago
parent
commit
8485208c81

+ 1 - 1
toolset/setup/linux/frameworks/cutelyst.sh

@@ -32,7 +32,7 @@ mkdir build && cd build
 
 cmake .. -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=$IROOT -DUSE_JEMALLOC=on
 
-make -j $MAX_THREADS && sudo make install
+make -j $MAX_THREADS && make install
 
 echo "QT_VERSION_MM=${QT_VERSION_MM}" > $IROOT/cutelyst.installed
 

+ 3 - 3
toolset/setup/linux/frameworks/urweb.sh

@@ -10,9 +10,9 @@ RETCODE=$(fw_exists ${COMPILER}.installed)
   fw_get -O http://www.impredicative.com/ur/urweb-$VERSION.tgz
   fw_untar urweb-$VERSION.tgz
   cd urweb-$VERSION
-  sudo ./configure --prefix=$IROOT/urweb
-  sudo make
-  sudo make install
+  ./configure --prefix=$IROOT/urweb
+  make
+  make install
 
   echo "export URWEB_HOME=${COMPILER}" > $COMPILER.installed
   echo "export LD_LIBRARY_PATH=${COMPILER}/lib" >> $COMPILER.installed

+ 3 - 1
toolset/setup/linux/languages/swift3.sh

@@ -7,7 +7,9 @@ fw_depends clang-3.9
 sudo update-alternatives --install /usr/bin/clang clang /usr/bin/clang-3.9 100
 sudo update-alternatives --install /usr/bin/clang++ clang++ /usr/bin/clang++-3.9 100
 
-fw_depends cmake-3.5
+sudo apt-add-repository --yes ppa:george-edison55/cmake-3.x
+sudo apt-get update -qq
+sudo apt-get install -qqy cmake
 
 SWIFT_SNAPSHOT="swift-3.0.2-RELEASE"
 SWIFT_SNAPSHOT_LOWERCASE="swift-3.0.2-release"

+ 0 - 15
toolset/setup/linux/systools/cmake-3.5.sh

@@ -1,15 +0,0 @@
-#!/bin/bash
-
-fw_installed cmake-3.5 && return 0
-
-fw_get -O http://www.cmake.org/files/v3.5/cmake-3.5.2.tar.gz
-fw_untar cmake-3.5.2.tar.gz
-cd cmake-3.5.2
-./configure
-make
-sudo make install
-sudo update-alternatives --install /usr/bin/cmake cmake /usr/local/bin/cmake 1 --force
-
-echo -e "" >> $IROOT/cmake-3.5.installed
-
-source $IROOT/cmake-3.5.installed