summaryrefslogtreecommitdiff
path: root/packaging/build-chroot.sh
blob: c79e6642e51c8ca56b52e1e25d5953ad39b4c9fe (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
#!/usr/bin/env bash
###############################################################################
# nanoengineer-chroot creator
#
# This installs Ubuntu 7.04 into a chroot. You should probably just use the 
# archive of the created chroot rather than re-creating it from scratch.
#
# created: 2012-04-29
# updated: 2012-04-30
#
# blame:
#   Bryan Bishop <kanzure@gmail.com>
#   Joe Rayhawk <jrayhawk@omgwallhack.org>
#
# support:
#   irc.freenode.net ##hplusroadmap
#
# links:
#   http://diyhpl.us/~bryan/irc/nanoengineer/nanoengineer-chroot.tar.gz (1.2 GB)
#   http://github.com/kanzure/nanoengineer
#   http://groups.google.com/group/nanoengineer-dev
#   http://nanoengineer-1.net/
#   http://nanorex.com/
#
# backup mirror of some packages:
#   http://diyhpl.us/~bryan/irc/nanoengineer/dependencies/
#
# An error like:
#   mknod: `$CHROOT/test-dev-null`: Operation not permitted
#   E: Cannot install into target '$CHROOT' mounted with noexec or nodev
# on a vserver means that debootstrap is looking to install device nodes, so
# you will have to create this outside the vserver environment.
#
# Note: you can't actually run this file, but it should be easy to follow along.
###############################################################################

export CHROOT=/root/nanoengineer-chroot
mkdir -p $CHROOT

# install a known working version of ubuntu
sudo apt-get install debootstrap
sudo debootstrap --arch i386 feisty $CHROOT http://old-releases.ubuntu.com/ubuntu/

# switch into the chroot
sudo chroot $CHROOT

# this should be refactored
exit

# this is for git config later
export GHUSERNAME="your github username"
export FULLNAME="Jack Saturn"
export EMAIL="jack@saturn.com"

# add a user to the chroot
# username: nanoengineeruser
# password: password
adduser nanoengineeruser

# add user to the 'video' group in case direct rendering happens to be working
adduser nanoengineeruser video

# add the user to sudoers
visudo

# switch to the user
su nanoengineeruser

# add "universe"
sudo vim /etc/apt/sources.list
sudo apt-get update

# set 'readline' and 'low'
dpkg-reconfigure debconf

# necessary to get locales working?
export LANG=C

sudo apt-get install locales git-core python2.5-dev g++ libqt4-dev \
     qt4-dev-tools qt4-qtconfig python-numarray=1.5.2-2.2ubuntu1 \
     python-numeric-ext=24.2-7ubuntu1 libgle3 python-imaging=1.1.6-0ubuntu3 \
     libdb4.5=4.5.20-1ubuntu1 libdb4.5-dev=4.5.20-1ubuntu1 wget make \
     python-setuptools automake libtool unzip libhdf5-serial-dev python-pyrex \
     freeglut3 mesa-utils libgl1-mesa-swx11

# replace libgl1-mesa-swx11 with libgl1-mesa-dri libgl1-mesa-glx if you want
# direct rendering

mkdir -p ~/locals
cd ~/locals

# download and install pybsddb
mkdir -p ~/local/pybsddb; cd ~/local/pybsddb
wget http://www.nanoengineer-1.com/bhelfrich/BuildMeister/bsddb3-4.5.0.tar.gz
tar -zxvf bsddb3-4.5.0.tar.gz
sudo python setup.py install

# download and install sip 4.7.4
mkdir ~/local/sip; cd ~/local/sip
wget http://www.nanoengineer-1.com/bhelfrich/BuildMeister/sip-4.7.4.tar.gz
tar -zxvf sip-4.7.4.tar.gz
cd sip-4.7.4
python configure.py
make
sudo make install

# download and install pyqt 4.3.3
mkdir ~/local/pyqt; cd ~/local/pyqt
wget http://www.nanoengineer-1.com/bhelfrich/BuildMeister/PyQt-x11-gpl-4.3.3.tar.gz
tar -zxvf PyQt-x11-gpl-4.3.3.tar.gz
cd PyQt-x11-gpl-4.3.3/
# you will need to type "YES"
python configure.py
# this next one will take a while.. why isn't there a package for 4.3.3?
time make
sudo make install

# repos only have numpy 1.0.1
mkdir ~/local/numpy; cd ~/local/numpy
wget http://www.nanoengineer-1.com/bhelfrich/BuildMeister/numpy-1.0.2.tar.gz
tar -zxvf numpy-1.0.2.tar.gz
cd numpy-1.0.2/
sudo python setup.py install

# ctypes
mkdir ~/local/ctypes; cd ~/local/ctypes
wget http://www.nanoengineer-1.com/bhelfrich/BuildMeister/ctypes-1.0.2.tar.gz
tar -zxvf ctypes-1.0.2.tar.gz
cd ctypes-1.0.2/
sudo python setup.py install

# pyopengl
mkdir ~/local/pyopengl; cd ~/local/pyopengl
wget http://www.nanoengineer-1.com/bhelfrich/BuildMeister/PyOpenGL-3.0.0a6.tar.gz
tar -zxvf PyOpenGL-3.0.0a6.tar.gz
cd PyOpenGL-3.0.0a6/
sudo python setup.py install

# pyrex
mkdir -p ~/local/pyrex; cd ~/local/pyrex
wget "http://pkgs.fedoraproject.org/repo/pkgs/Pyrex/Pyrex-0.9.3.1.tar.gz/0415b95a023061679021323d9ce56fe0/Pyrex-0.9.3.1.tar.gz"
tar -zxvf Pyrex-0.9.3.1.tar.gz
cd Pyrex-0.9.3.1/
sudo python setup.py install

# get the nanoengineer sources
mkdir -p ~/code
cd ~/code
git clone git://diyhpl.us/nanoengineer.git nanoengineer 
cd ~/code/nanoengineer

# get a particular version of the sources
#git checkout 4a5b6dc163d3c248f688433d40d39ae1307d95cf

# any change you make should be on your own branch
git checkout -b experimental

# also.. set up your remotes and config
git config --user.name $FULLNAME
git config --user.email $EMAIL
git remote rm origin
git remote add origin https://$GHUSERNAME@github.com/$GHUSERNAME/nanoengineer.git experimental

# start to compile nanoengineer
./bootstrap
./configure
## Numeric version 24.2 was found. That version may work, but the
## officially supported version is 23.8.

# quick detour
cd ~/code/nanoengineer/sim/src
make version.h
make

# ok now make everything
cd ~/code/nanoengineer
make

# run
DISPLAY=127.0.0.1:11 python ~/code/nanoengineer/cad/src/main.py