1 Star 0 Fork 1

李云帆/codeblocks

forked from leegoobin/codeblocks 
加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
bundle.sh.in 2.78 KB
一键复制 编辑 原始数据 按行查看 历史
长沙招聘C/C++/verilog 提交于 2021-08-19 22:14 . 20.03
#!/bin/bash
PREFIX_DIR="@prefix@"
INSTALL_SHAREDIR="${PREFIX_DIR}/share/codeblocks"
APPNAME="CodeBlocks"
APPDIR="${APPNAME}.app"
SHAREDATADIR="`pwd`/${APPDIR}/Contents/Resources/share/codeblocks"
if [ ! -d "$APPDIR" ]
then
echo "Building ${APPDIR} directory..."
mkdir "${APPDIR}"
mkdir "${APPDIR}/Contents"
mkdir "${APPDIR}/Contents/MacOS"
mkdir "${APPDIR}/Contents/Resources"
mkdir -p "${SHAREDATADIR}/plugins/"
fi
cp ${INSTALL_SHAREDIR}/osx_bundle/codeblocks.plist "$APPDIR/Contents/Info.plist"
cp ${INSTALL_SHAREDIR}/osx_bundle/icons/*.icns "${APPDIR}/Contents/Resources"
PLUGINS=`echo ${PREFIX_DIR}/lib/codeblocks/plugins/*.dylib `
EXECUTABLES=`echo ${PREFIX_DIR}/bin/* `
ALL_DEPS=""
copy_deps() {
for dep in `otool -L "$1" | sed -n 's/\(.*[^\\ ]\) (.*/\1/gp'`
do
current_dep=$(basename $dep)
if [[ $dep =~ libcodeblocks ]]
then
install_name_tool -change $dep @executable_path/$(basename $dep) $1
fi
if [[ $dep =~ libwx ]]
then
oldfile=$dep
oldlink=$dep
newfile=$dep
while [ -L $newfile ]
do
newfile=`readlink $newfile`
if ! echo $newfile | grep '^/'
then
newfile=$(dirname $oldfile)/$newfile
fi
oldfile=$newfile
done
dep=$newfile
current_dep=$(basename $dep)
install_name_tool -change $oldlink "@executable_path/$current_dep" $1
if [[ ! $ALL_DEPS =~ $current_dep ]]
then
ALL_DEPS="$ALL_DEPS $current_dep"
echo "Copying $dep"
cp "$dep" "$APPDIR/Contents/MacOS/"
install_name_tool -id "@executable_path/$current_dep" "$APPDIR/Contents/MacOS/$current_dep"
copy_deps "$APPDIR/Contents/MacOS/$current_dep"
fi
fi
done
}
echo "Copying libcodeblocks ..."
cp -v ${PREFIX_DIR}/lib/libcodeblocks.0.dylib "$APPDIR/Contents/MacOS/"
copy_deps "${APPDIR}/Contents/MacOS/libcodeblocks.0.dylib"
install_name_tool -id "@executable_path/libcodeblocks.0.dylib" "$APPDIR/Contents/MacOS/libcodeblocks.0.dylib"
echo "Copying binaries"
for file in ${EXECUTABLES}
do
echo $file
cp $file "${APPDIR}/Contents/MacOS"
copy_deps "${APPDIR}/Contents/MacOS/$(basename $file)"
done
echo "Copying plugins"
for file in ${PLUGINS}
do
echo $file
cp $file "${APPDIR}/Contents/Resources/share/codeblocks/plugins/"
install_name_tool -id @loader_path/$(basename $file) "${SHAREDATADIR}/plugins/$(basename $file)"
copy_deps "${SHAREDATADIR}/plugins/$(basename $file)"
done
rsync -lpdtgou --include='*.zip' --exclude='*' ${INSTALL_SHAREDIR}/ ${SHAREDATADIR}/
rsync -rlpdtgou ${INSTALL_SHAREDIR}/images ${SHAREDATADIR}/
rsync -rlpdtgou ${INSTALL_SHAREDIR}/templates ${SHAREDATADIR}/
rsync -rlpdtgou ${INSTALL_SHAREDIR}/lexers ${SHAREDATADIR}/
rsync -rlpdtgou ${INSTALL_SHAREDIR}/scripts ${SHAREDATADIR}/
rsync -rlpdtgou ${INSTALL_SHAREDIR}/compilers ${SHAREDATADIR}/
rsync -rlpdtgou ${INSTALL_SHAREDIR}/SpellChecker ${SHAREDATADIR}/
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/guyunli/codeblocks.git
[email protected]:guyunli/codeblocks.git
guyunli
codeblocks
codeblocks
master

搜索帮助