summaryrefslogtreecommitdiff
path: root/init
blob: b7cfe5fe2c26c1ce728319aaff90b6158af4b21a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
#!/bin/sh -ex

cd luasystem
mv rockspecs/* .
luarocks config variables.CFLAGS " $CFLAGS"
#No easy way to fool luarocks into building win32 instead of linux platform-specific stuff
sed -i "s/linux/foobar/g" *.rockspec
sed -i "s/win32/linux/g" *.rockspec
luarocks make --pack-binary-rock luasystem-$packver.rockspec
obj="luasystem-$packver.$(luarocks config arch).rock"
cp $obj /root
cd /root
if [ -z $(echo $CFLAGS | grep -o -E -- '( |^)-g( |$)') ]; then
  # Release build, delete docs/
  zip -d $obj doc/ doc/*
  # And pack the library with upx
  unzip $obj lib/*
  upx --no-progress lib/system/*
  zip -r "$obj" lib
fi