2021-04-02 14:08:19 +02:00
|
|
|
#!/bin/bash
|
|
|
|
|
2022-06-30 21:07:47 +02:00
|
|
|
# Copy necessary binaries for Cygwin/Windows version
|
|
|
|
# After, you must copy all files to /bin directory
|
|
|
|
mkdir -p ${HOME}/Irssi/bin/
|
|
|
|
cd /usr/bin
|
2021-04-02 14:08:19 +02:00
|
|
|
|
2022-06-30 21:07:47 +02:00
|
|
|
# All executables
|
|
|
|
list_binary="bash irssi botti mintty cygwin-console-helper"
|
2021-04-02 14:08:19 +02:00
|
|
|
|
2022-06-30 21:07:47 +02:00
|
|
|
echo "* Copying script bashbug"
|
|
|
|
cp -rfv /usr/bin/bashbug ${HOME}/Irssi/bin/
|
|
|
|
for binary in ${list_binary} ; do
|
|
|
|
echo "* Copying binary ${binary}"
|
|
|
|
cp -rfv /usr/bin/${binary}.exe ${HOME}/Irssi/bin/
|
|
|
|
echo "* Searching dependencies for ${binary}"
|
|
|
|
ldd /usr/bin/${binary}.exe | grep "/bin/" | cut -d ">" -f 2 | cut -d "(" -f 1 | tr -s " " > /tmp/deps.txt
|
|
|
|
file_size=$(cat /tmp/deps.txt | wc -l)
|
|
|
|
file_scan=1
|
|
|
|
echo "* Copying dependencies for ${binary}"
|
|
|
|
while [ ${file_scan} -le ${file_size} ] ; do
|
|
|
|
library=$(cat /tmp/deps.txt | head -${file_scan} | tail -1)
|
|
|
|
cp -rfv ${library} ${HOME}/Irssi/bin/
|
|
|
|
file_scan=$(expr ${file_scan} + 1)
|
|
|
|
done
|
|
|
|
done
|
|
|
|
strip --strip-all ${HOME}/Irssi/bin/*
|
|
|
|
cp -rfv /usr/bin/cyggcc_s-*.dll ${HOME}/Irssi/bin/
|
|
|
|
cp -rfv /usr/bin/cygwin1.dll ${HOME}/Irssi/bin/
|
|
|
|
cp -rfv /usr/bin/cygz.dll ${HOME}/Irssi/bin/
|