Remove unused files [skip ci]

This commit is contained in:
Vaibhav Sagar 2019-01-02 23:44:56 -05:00
parent a1cf94e1b0
commit ff046bf2c4
6 changed files with 0 additions and 371 deletions

104
build.sh
View File

@ -1,104 +0,0 @@
#!/bin/sh
set -e
print_help () {
echo "Run build.sh from inside the ihaskell directory to install packages in this repository:"
echo " ./build.sh ihaskell # Install ihaskell and its dependencies"
echo " ./build.sh quick # Install ihaskell, but not its dependencies"
echo " ./build.sh all # Install ihaskell, dependencies, and all display packages"
echo " ./build.sh display # Install ihaskell and display libraries"
echo
echo "A second argument 'no-widgets' can be provided to not install ihaskell-widgets and depending packages."
echo
echo "If this is your first time installing ihaskell, run './build.sh ihaskell'."
}
# Verify that we're in the ihaskell directory.
if [ ! -e ihaskell.cabal ]; then
print_help;
exit 1
fi
if [ $# -lt 1 ]; then
print_help;
exit 1
fi
if [ ! $1 = "all" ] && [ ! $1 = "ihaskell" ] && [ ! $1 = "display" ] && [ ! $1 = "quick" ]; then
print_help;
exit 1;
fi
# What to install.
INSTALLS=""
# Compile dependencies.
if [ $# -gt 0 ]; then
if [ $1 = "all" ] || [ $1 = "ihaskell" ]; then
INSTALLS="$INSTALLS ghc-parser ipython-kernel"
fi
fi
# Always make ihaskell itself
INSTALLS="$INSTALLS ."
# Install ihaskell-display packages.
if [ $# -gt 0 ]; then
if [ $1 = "display" ] || [ $1 = "all" ]; then
# Install all the display libraries
cd ihaskell-display
for dir in `ls | grep -v ihaskell-widgets`
do
INSTALLS="$INSTALLS ihaskell-display/$dir"
done
cd ..
fi
fi
cleanup () {
# Remove old kernelspec
rm -rf ~/.ipython/kernels/haskell
# Clean all required directories, just in case.
TOP=`pwd`
for pkg in $INSTALLS
do
cd ./$pkg
cabal clean
cd $TOP
done
}
install_selected () {
# Stick a "./" before everything.
INSTALL_DIRS=`echo $INSTALLS | tr ' ' '\n' | sed 's#^#./#' | tr ' ' '\n'`
echo CMD: cabal install --constraint "arithmoi -llvm" -j $INSTALL_DIRS --force-reinstalls --max-backjumps=-1 --reorder-goals
cabal install --constraint "arithmoi -llvm" -j $INSTALL_DIRS --force-reinstalls --max-backjumps=-1 --reorder-goals
}
install_widgets () {
echo CMD: cabal install ./ghc-parser ./ipython-kernel ./ihaskell-display/ihaskell-widgets --force-reinstalls
cabal install ./ghc-parser ./ipython-kernel ./ihaskell-display/ihaskell-widgets --force-reinstalls
}
# Check if arguments are correct, and proceed as required
if [ -z $2 ]; then
cleanup
install_selected
if [ $1 = "display" ] || [ $1 = "all" ]; then
install_widgets
fi
elif [ $2 = "no-widgets" ]; then
cleanup
install_selected
else
print_help
exit 1
fi
if hash ihaskell 2>/dev/null; then
ihaskell install 2>/dev/null || echo "The command \"ihaskell install\" failed. Please check your 'ipython --version'. 3.0 or up is required. Yours is $(ipython --version)."
else
echo "Reminder: run 'ihaskell install' to install the IHaskell kernel to Jupyter."
fi

View File

@ -1,24 +0,0 @@
dependencies:
cache_directories:
- ~/.stack
- .stack-work
- ~/.cache/pip
pre:
- rm -rf /opt/circleci/.pyenv
- sudo apt-get install -y python3-pip git libtinfo-dev libzmq3-dev libcairo2-dev libpango1.0-dev
- sudo pip3 install pip --upgrade
- sudo pip3 install -r requirements.txt
- curl -sSL https://get.haskellstack.org/ | sh
override:
- stack setup
- |
echo "apply-ghc-options: everything" >> stack.yaml
- stack install gtk2hs-buildtools --fast
- stack build --fast
- stack install --fast
- stack exec ihaskell -- install
- stack test --no-run-tests --fast
test:
override:
- stack test --fast

View File

@ -1,88 +0,0 @@
#!/bin/sh
set -e
# Installation for Mac OS X from IHaskell repo directory.
# TODO Split out setup for installation from Hackage released versions.
#
# This script assumes use of Homebrew.
# It is assumed you already have GHC and Cabal installed through Homebrew
# and your environment set up to install executables through Cabal.
#
# Also, XCode command line tools must be installed.
#
# XQuartz is needed for Cairo and Pango.
function abort() {
for line
do
echo >&2 "$line"
done
exit 1
}
brew --version >& /dev/null || abort \
"Homebrew needs to be installed." \
" Download from http://brew.sh/"
# Install IPython.
if command -v pip3 >/dev/null 2>&1
then
PIP=pip3
elif command -v pip >/dev/null 2>&1
then
PIP=pip
else
abort \
"Python pip needs to be installed." \
" One way is to install Homebrew Python:" \
" $ brew install python"
fi
$PIP --version >& /dev/null || abort \
"Python $PIP needs to be installed." \
" One way is to install Homebrew Python:" \
" $ brew install python"
$PIP install -U 'ipython[all]'
[ -n "`brew --config | grep '^CLT:.*N/A'`" ] && abort \
"You need to have XCode command line tools installed." \
" $ xcode-select --install"
ghc --version >& /dev/null || abort \
"Please install ghc." \
" $ brew install ghc"
cabal --version >& /dev/null || abort \
"Please install Cabal." \
" $ brew install cabal-install"
# Make sure to have basic tools installed.
cabal update
cabal install happy alex
cabal install cpphs
cabal install gtk2hs-buildtools
# Homebrew stuff.
brew update
brew ls --versions zeromq | grep -q . || brew install zeromq
brew ls --versions libmagic | grep -q . || brew install libmagic
# XQuartz is required: http://xquartz.macosforge.org/landing/
# The easiest way is through Homebrew.
brew tap Caskroom/cask
brew ls --versions brew-cask | grep -q . || brew install brew-cask
brew cask ls --versions xquartz | grep -q . || brew cask install xquartz
brew ls --versions cairo | grep -q . || brew install cairo
brew ls --versions pango | grep -q . || brew install pango
# make cabal install magic, which won't work correctly if done using
# default flags, since Homebrew dumps libmagic into /usr/local/lib rather than /lib
brew_prefix=$(brew --prefix)
cabal install magic-1.1 --extra-lib "$brew_prefix/lib" --extra-include "$brew_prefix/include"
# For C compiler to pick up /usr/local and X11 stuff during Cabal builds.
# You may want to put this in your shell startup.
export PKG_CONFIG_PATH=/usr/local/lib/pkgconfig:/opt/X11/lib/pkgconfig
./build.sh all

View File

@ -1,53 +0,0 @@
#!/bin/bash
# Script for installing ihaskell dependencies. Specifically, this script
# installs dependencies using apt-get, and needs to be executed as root.
# Directly utilized for providing ihaskell to jupyter/docker-demo-images
if [ $(id -u) -ne 0 ]; then
echo "Please run as root"
exit 1
fi
if [ -z "$(which ghc)" ]; then
echo "Please install ghc."
exit 1
fi
if [ -z "$(which cabal)" ]; then
echo "Please install Cabal."
exit 1
fi
# If ipython is installed, and has a major version >= 3, then use the
# installed version. Otherwise we install from scratch.
if [ -n "$(which ipython)" ] && { [ $(ipython --version | cut -f 1 -d '.') -ge 3 ]; } then
echo "Using ipython already installed: $(which ipython)"
else
# Install IPython.
# python-pip is out of date, causes problems, so we get the latest version
# using easy_install instead.
#sudo apt-get install python-pip
apt-get install -y python-dev
# To get easy_install
apt-get install -y python-setuptools
easy_install -U pip
# -H to use .cache in /root
pip install -U 'ipython[all]'
fi
# C libraries
apt-get install -y libtinfo-dev
apt-get install -y libzmq3-dev
apt-get install -y libcairo2-dev
apt-get install -y libpango1.0-dev
apt-get install -y libmagic-dev
apt-get install -y libblas-dev
apt-get install -y liblapack-dev

View File

@ -1,17 +0,0 @@
#!/bin/bash
# Installation for Ubuntu Linux (tested on v14.10) from IHaskell repo directory.
# TODO Split out setup for installation from Hackage released versions.
# Install the dependencies as root user
sudo ./root-deps.sh
# Make sure to have basic tools installed.
cabal update
cabal install happy alex
cabal install cpphs
cabal install gtk2hs-buildtools
cabal install HTTP
# Build ihaskell, and all the display packages
./build.sh all

View File

@ -1,85 +0,0 @@
#!/usr/bin/env python3
from __future__ import print_function
import sys
import os
import subprocess
def hindent(contents):
with open(".tmp3", "w") as f:
f.write(contents)
with open(".tmp3", "r") as f:
output = subprocess.check_output(["hindent", "--style", "gibiansky"],
stdin=f)
return output.decode('utf-8')
def diff(src1, src2):
# Ignore trailing newlines
if src1[-1] == "\n":
src1 = src1[:-1]
if src2[-1] == "\n":
src2 = src2[:-1]
with open(".tmp1", "w") as f1:
f1.write(src1)
with open(".tmp2", "w") as f2:
f2.write(src2)
try:
output = subprocess.check_output(["diff", ".tmp1", ".tmp2"])
return output.decode('utf-8')
except subprocess.CalledProcessError as e:
return e.output.decode('utf-8')
# Verify that we're in the right directory
try:
open("ihaskell.cabal", "r").close()
except:
print(sys.argv[0], "must be run from the ihaskell directory",
file=sys.stderr)
# Find all the source files
sources = []
widget_dir = "ihaskell-display/ihaskell-widgets/src/IHaskell/Display/Widgets"
for source_dir in ["src", "ipython-kernel", "ihaskell-display"]:
for root, dirnames, filenames in os.walk(source_dir):
# Skip cabal dist directories
if "dist" in root:
continue
# Ignore IHaskellPrelude.hs, it uses CPP in weird places
if widget_dir in root:
ignored_files = ["Types.hs"]
else:
ignored_files = ["IHaskellPrelude.hs"]
for filename in filenames:
if filename.endswith(".hs") and filename not in ignored_files:
sources.append(os.path.join(root, filename))
hindent_outputs = {}
for source_file in sources:
print("Formatting file", source_file)
with open(source_file, "r") as f:
original_source = f.read()
formatted_source = hindent(original_source)
hindent_outputs[source_file] = (original_source, formatted_source)
diffs = {filename: diff(original, formatted)
for (filename, (original, formatted)) in hindent_outputs.items()}
incorrect_formatting = False
for filename, diff in diffs.items():
if diff:
incorrect_formatting = True
print('Incorrect formatting in', filename)
print('=' * 10)
print(diff)
if incorrect_formatting:
sys.exit(1)