Du kan inte välja fler än 25 ämnen Ämnen måste starta med en bokstav eller siffra, kan innehålla bindestreck ('-') och vara max 35 tecken långa.
 
 

486 rader
17 KiB

  1. #!/usr/bin/env bash
  2. HERE="$(dirname "$(readlink -f "${0}")")"
  3. export PATH="${HERE}"/usr/bin/:"${HERE}"/usr/sbin/:"${HERE}"/usr/games/:"${HERE}"/bin/:"${HERE}"/sbin/:"${PATH}"
  4. export LD_LIBRARY_PATH="${HERE}"/usr/lib/:"${HERE}"/usr/lib/i386-linux-gnu/:"${HERE}"/usr/lib/x86_64-linux-gnu/:"${HERE}"/usr/lib32/:"${HERE}"/usr/lib64/:"${HERE}"/lib/:"${HERE}"/lib/i386-linux-gnu/:"${HERE}"/lib/x86_64-linux-gnu/:"${HERE}"/lib32/:"${HERE}"/lib64/:"${LD_LIBRARY_PATH}"
  5. export XDG_DATA_DIRS="${HERE}"/usr/share/:"${XDG_DATA_DIRS}"
  6. # Specify a certain commit if you do not want to use master
  7. # by using:
  8. # export PKG2AICOMMIT=<git sha>
  9. if [ -z "$PKG2AICOMMIT" ] ; then
  10. PKG2AICOMMIT=master
  11. fi
  12. usage() {
  13. if [ -z "$APPIMAGE" ] ; then
  14. MYSELF="$0"
  15. else
  16. MYSELF="$APPIMAGE"
  17. fi
  18. echo "usage:"
  19. echo " $MYSELF [--di] META-NAME|YAMLFILE"
  20. echo ""
  21. echo "options:"
  22. echo " --di enable legacy desktop integration (unsupported)"
  23. exit 1
  24. }
  25. check_dependencies() {
  26. for executable in $@; do
  27. which "${executable}" >/dev/null 2>&1 || {
  28. (echo "${executable} missing"; exit 1)
  29. }
  30. done
  31. }
  32. if [ $# -eq 0 ] || [ "x${!#}" = "x--di" ] ; then
  33. usage
  34. fi
  35. if [ $# -eq 2 ] && [ "x$1" != "x--di" ] ; then
  36. usage
  37. fi
  38. if [ "x$1" = "x--di" ] ; then
  39. ENABLE_DI="yes"
  40. else
  41. ENABLE_DI="no"
  42. fi
  43. # Halt on errors
  44. set -e
  45. set -x
  46. # Check dependencies
  47. check_dependencies \
  48. dpkg \
  49. dpkg-deb \
  50. convert \
  51. wget \
  52. grep \
  53. sed \
  54. cut \
  55. file \
  56. desktop-file-validate \
  57. strings
  58. # If the yaml file doesn't exist locally, get it from GitHub
  59. if [ ! -f "${!#}" ] ; then
  60. YAMLFILE=/tmp/_recipe.yml
  61. rm -f "$YAMLFILE"
  62. wget -q "https://github.com/AppImage/AppImages/raw/${PKG2AICOMMIT}/recipes/${!#}.yml" -O "$YAMLFILE"
  63. else
  64. YAMLFILE=$(readlink -f "${!#}")
  65. fi
  66. # Lightweight bash-only dpkg-scanpackages replacement
  67. scanpackages() {
  68. for deb in *.deb ; do
  69. dpkg -I $deb | sed 's/^ *//g' | grep -i -E '(package|version|installed-size|architecture|depends|priority):'
  70. echo "Filename: $(readlink -f $deb)"
  71. echo "MD5sum: $(md5sum -b $deb | cut -d' ' -f1)"
  72. echo "SHA1: $(sha1sum -b $deb | cut -d' ' -f1)"
  73. echo "SHA256: $(sha256sum -b $deb | cut -d' ' -f1)"
  74. echo
  75. done
  76. }
  77. # Function to parse yaml
  78. # https://gist.github.com/epiloque/8cf512c6d64641bde388
  79. # based on https://gist.github.com/pkuczynski/8665367
  80. parse_yaml() {
  81. local prefix=$2
  82. local s
  83. local w
  84. local fs
  85. s='[[:blank:]]*'
  86. w='[a-zA-Z0-9_]*'
  87. fs="$(echo @|tr @ '\034')"
  88. sed -ne "s|^\($s\)\($w\)$s:$s\"\(.*\)\"$s\$|\1$fs\2$fs\3|p" \
  89. -e "s|^\($s\)\($w\)$s[:-]$s\(.*\)$s\$|\1$fs\2$fs\3|p" "$1" |
  90. awk -F"$fs" '{
  91. indent = length($1)/2;
  92. vname[indent] = $2;
  93. for (i in vname) {if (i > indent) {delete vname[i]}}
  94. if (length($3) > 0) {
  95. vn=""; for (i=0; i<indent; i++) {vn=(vn)(vname[i])("_")}
  96. printf("%s%s%s=(\"%s\")\n", "'"$prefix"'",vn, $2, $3);
  97. }
  98. }' | sed 's/_=/+=/g'
  99. }
  100. # Read yaml file
  101. parse_yaml $YAMLFILE "_"
  102. eval $(parse_yaml $YAMLFILE "_")
  103. if [ ! -z $_enable_di ]; then
  104. ENABLE_DI="$_enable_di"
  105. fi
  106. # Execute multiple script lines together as one
  107. # shell_execute filename key_of_group_of_commands
  108. shell_execute() {
  109. if [ -f /tmp/recipe_script ] ; then
  110. rm /tmp/recipe_script
  111. fi
  112. parse_yaml $YAMLFILE "_" | grep "^$2+=" > /tmp/recipe_script
  113. sed -i -e 's|^'$2'+=("||g' /tmp/recipe_script
  114. sed -i -e 's|")$||g' /tmp/recipe_script
  115. bash -ex /tmp/recipe_script
  116. rm /tmp/recipe_script
  117. }
  118. APP=$_app
  119. LOWERAPP=${APP,,}
  120. if [ ! -z $_lowerapp ] ; then
  121. LOWERAPP=$_lowerapp
  122. fi
  123. mkdir -p ./$APP/$APP.AppDir/usr/lib
  124. cd ./$APP/
  125. if [ -d "./$APP.AppDir/" ] ; then
  126. rm -rf ./$APP.AppDir/
  127. fi
  128. # Source the bundled functions.sh if it exists
  129. # in "${HERE}/usr/share/pkg2appimage/functions.sh"
  130. # or source a user-provided functions.sh if the environment
  131. # variable FUNCTIONS_SH was set and the file exists
  132. if [ -e "${HERE}/usr/share/pkg2appimage/functions.sh" ] ; then
  133. . "${HERE}/usr/share/pkg2appimage/functions.sh"
  134. elif [ -z "$FUNCTIONS_SH" ] ; then
  135. if [ ! -e functions.sh ] ; then
  136. wget -q https://github.com/AppImage/AppImages/raw/${PKG2AICOMMIT}/functions.sh -O ./functions.sh
  137. fi
  138. . ./functions.sh
  139. else
  140. if [ -e "$FUNCTIONS_SH" ] ; then
  141. . "$FUNCTIONS_SH"
  142. fi
  143. fi
  144. # If there is an ARCH environment variable, then use that
  145. # architecture to for apt-get. Not that for the AppImage to be
  146. # operable, we also need to embed a matching AppImage runtime
  147. # and ingredients of that architecture. Debian packages
  148. # should be available for most architectures, e.g., oldstable
  149. # has "armhf"
  150. if [ ! -z "$ARCH" ] ; then
  151. OPTIONS="$OPTIONS -o APT::Architecture=$ARCH"
  152. fi
  153. if [ ! -z "${_ingredients_ghreleases[0]}" ] ; then
  154. for GHREPO in "${_ingredients_ghreleases[@]}" ; do
  155. wget -q "https://github.com/${GHREPO}/releases/" -O /tmp/gh-release.html
  156. DEB=$(cat /tmp/gh-release.html | grep ".deb" | grep x86_64 | head -n 1 | cut -d '"' -f 2)
  157. if [ -z "$DEB" ] ; then
  158. DEB=$(cat /tmp/gh-release.html | grep ".deb" | grep amd64 | head -n 1 | cut -d '"' -f 2)
  159. fi
  160. if [ -z "$DEB" ] ; then
  161. DEB=$(cat /tmp/gh-release.html | grep ".deb" | grep x64 | head -n 1 | cut -d '"' -f 2)
  162. fi
  163. if [ -z "$DEB" ] ; then
  164. DEB=$(cat /tmp/gh-release.html | grep ".deb" | grep linux64 | head -n 1 | cut -d '"' -f 2)
  165. fi
  166. rm /tmp/gh-release.html
  167. wget -c "https://github.com/${DEB}"
  168. done
  169. fi
  170. if [ ! -z "${_ingredients_dist}" ] ; then
  171. rm status 2>/dev/null || true
  172. generate_status
  173. # Some packages depend on packages which we do not want to bundle,
  174. # in addition to the global excludes defined in excludedeblist.
  175. # Use
  176. # ingredients:
  177. # exclude:
  178. # - packagename
  179. if [ ! -z "${_ingredients_exclude[0]}" ] ; then
  180. for PACKAGE in "${_ingredients_exclude[@]}" ; do
  181. printf "Package: $PACKAGE\nStatus: install ok installed\nArchitecture: all\nVersion: 9:999.999.999\n\n" >> status
  182. done
  183. fi
  184. # Some packages depend on an exact version of a dependency to be installed.
  185. # Use
  186. # ingredients:
  187. # pretend:
  188. # - packagename version_to_be_pretended
  189. if [ ! -z "${_ingredients_pretend[0]}" ] ; then
  190. for PRETEND in "${_ingredients_pretend[@]}" ; do
  191. P_PKG=$(echo "$PRETEND" | cut -d " " -f 1)
  192. P_VER=$(echo "$PRETEND" | cut -d " " -f 2)
  193. cat status | tr '\n' '@' | sed -e 's|@@|\n\n|g' | sed -e 's|Package: '"$P_PKG"'@Status: install ok installed@Architecture: all@Version: 9:999.999.999|Package: '"$P_PKG"'@Status: install ok installed@Architecture: all@Version: '"$P_VER"'|g' | sed -e 's|@|\n|g' > status.temp
  194. mv status.temp status
  195. done
  196. fi
  197. if [ -e sources.list ] ; then
  198. rm sources.list
  199. fi
  200. for PPA in "${_ingredients_ppas[@]}" ; do
  201. echo "deb http://ppa.launchpad.net/${PPA}/ubuntu/ ${_ingredients_dist} main" >> sources.list
  202. done
  203. for SOURCE in "${_ingredients_sources[@]}" ; do
  204. echo "${SOURCE}" >> sources.list
  205. done
  206. for DEBFILE in "${_ingredients_debs[@]}" ; do
  207. cp ${DEBFILE} .
  208. done
  209. # Use libcurl-slim to reduce AppImage size, thanks darealshinji
  210. # Not really compiled on xenial but CentOS 6, https://github.com/AppImage/AppImages/issues/187
  211. echo "deb http://ppa.launchpad.net/djcj/libcurl-slim/ubuntu xenial main" >> sources.list
  212. # Use gnutls-patched to have libgnutls look in various distributions' places for certificates,
  213. # https://github.com/darealshinji/vlc-AppImage/issues/1#issuecomment-321041496
  214. # echo "deb http://ppa.launchpad.net/djcj/gnutls-patched/ubuntu ${_ingredients_dist} main" >> sources.list
  215. ### echo "deb http://ppa.launchpad.net/djcj/gnutls-patched/ubuntu trusty main" >> sources.list # https://github.com/AppImage/pkg2appimage/issues/345
  216. fi
  217. if [ ! -z "${_ingredients_script[0]}" ] ; then
  218. # Execute extra steps defined in recipe
  219. shell_execute $YAMLFILE _ingredients_script
  220. fi
  221. if [ ! -z "${_ingredients_dist}" ] ; then
  222. # Some projects provide raw .deb files without a repository
  223. # hence we create our own local repository as part of
  224. # the AppImage creation process in order to "install"
  225. # the package using apt-get as normal
  226. if [ ! -z "${_ingredients_debs[0]}" ] ; then
  227. for DEB in "${_ingredients_debs[@]}" ; do
  228. if [ ! -f $(basename "$DEB") ] ; then
  229. wget -c $DEB
  230. fi
  231. done
  232. fi
  233. scanpackages | gzip -9c > Packages.gz
  234. echo "deb file:$(readlink -e $PWD) ./" >> sources.list
  235. INSTALL=$LOWERAPP
  236. if [ ! -z "${_ingredients_package}" ] ; then
  237. INSTALL="${_ingredients_package}"
  238. fi
  239. if [ ! -z "${_ingredients_packages}" ] ; then
  240. INSTALL=""
  241. fi
  242. # If packages are specifically listed, only install these, not a package with the name of the app
  243. if [ ! -z "${_ingredients_packages[0]}" ] ; then
  244. INSTALL=${_ingredients_packages[@]}
  245. fi
  246. # apt-get -o Acquire::AllowInsecureRepositories=true -o Acquire::Languages="none" -o Acquire::AllowDowngradeToInsecureRepositories=true $OPTIONS update || true
  247. # URLS=$(apt-get --allow-unauthenticated -o Apt::Get::AllowUnauthenticated=true $OPTIONS -y install --print-uris $INSTALL | cut -d "'" -f 2 | grep -e "^http") || true
  248. # if which aria2c &>/dev/null; then
  249. # dltool=aria2c
  250. # else
  251. # dltool=wget
  252. # fi
  253. # $dltool -c -i- <<<"$URLS"
  254. apt-get.update
  255. INSTALL=$(echo "${INSTALL}" | sed "s| |\n|g")
  256. for pkg in ${INSTALL}; do
  257. apt-get.do-download ${pkg}
  258. done
  259. fi
  260. if [ ! -z "${_ingredients_post_script[0]}" ] ; then
  261. # Execute extra steps defined in recipe
  262. shell_execute $YAMLFILE _ingredients_post_script
  263. fi
  264. mkdir -p ./$APP.AppDir/
  265. cd ./$APP.AppDir/
  266. mkdir -p usr/bin usr/lib
  267. find ../*.deb -exec dpkg-deb -X {} . \; || true
  268. unset LD_PRELOAD
  269. # Try to copy icons to standard locations where appimaged can pick them up
  270. mkdir -p usr/share/icons/hicolor/{22x22,24x24,32x32,48x48,64x64,128x128,256x256,512x512}/apps/
  271. find . -path *icons* -path *22* -name "*$LOWERAPP*" -exec cp {} usr/share/icons/hicolor/22x22/apps/ \; || true
  272. find . -path *icons* -path *24* -name "*$LOWERAPP*" -exec cp {} usr/share/icons/hicolor/24x24/apps/ \; || true
  273. find . -path *icons* -path *32* -name "*$LOWERAPP*" -exec cp {} usr/share/icons/hicolor/32x32/apps/ \; || true
  274. find . -path *icons* -path *48* -name "*$LOWERAPP*" -exec cp {} usr/share/icons/hicolor/48x48/apps/ \; || true
  275. find . -path *icons* -path *64* -name "*$LOWERAPP*" -exec cp {} usr/share/icons/hicolor/64x64/apps/ \; || true
  276. find . -path *icons* -path *128* -name "*$LOWERAPP*" -exec cp {} usr/share/icons/hicolor/128x128/apps/ \; || true
  277. find . -path *icons* -path *256* -name "*$LOWERAPP*" -exec cp {} usr/share/icons/hicolor/256x256/apps/ \; || true
  278. find . -path *icons* -path *512* -name "*$LOWERAPP*" -exec cp {} usr/share/icons/hicolor/512x512/apps/ \; || true
  279. get_icon
  280. if [ -z "${_union}" ] ; then
  281. get_apprun
  282. else
  283. cat > AppRun <<\EOF
  284. #!/bin/sh
  285. HERE="$(dirname "$(readlink -f "${0}")")"
  286. export UNION_PRELOAD="${HERE}"
  287. export LD_PRELOAD="${HERE}/libunionpreload.so"
  288. export PATH="${HERE}"/usr/bin/:"${HERE}"/usr/sbin/:"${HERE}"/usr/games/:"${HERE}"/bin/:"${HERE}"/sbin/:"${PATH}"
  289. export LD_LIBRARY_PATH="${HERE}"/usr/lib/:"${HERE}"/usr/lib/i386-linux-gnu/:"${HERE}"/usr/lib/x86_64-linux-gnu/:"${HERE}"/usr/lib32/:"${HERE}"/usr/lib64/:"${HERE}"/lib/:"${HERE}"/lib/i386-linux-gnu/:"${HERE}"/lib/x86_64-linux-gnu/:"${HERE}"/lib32/:"${HERE}"/lib64/:"${LD_LIBRARY_PATH}"
  290. export PYTHONPATH="${HERE}"/usr/share/pyshared/:"${PYTHONPATH}"
  291. export PYTHONHOME="${HERE}"/usr/
  292. export XDG_DATA_DIRS="${HERE}"/usr/share/:"${XDG_DATA_DIRS}"
  293. export PERLLIB="${HERE}"/usr/share/perl5/:"${HERE}"/usr/lib/perl5/:"${PERLLIB}"
  294. export GSETTINGS_SCHEMA_DIR="${HERE}"/usr/share/glib-2.0/schemas/:"${GSETTINGS_SCHEMA_DIR}"
  295. export QT_PLUGIN_PATH="${HERE}"/usr/lib/qt4/plugins/:"${HERE}"/usr/lib/i386-linux-gnu/qt4/plugins/:"${HERE}"/usr/lib/x86_64-linux-gnu/qt4/plugins/:"${HERE}"/usr/lib32/qt4/plugins/:"${HERE}"/usr/lib64/qt4/plugins/:"${HERE}"/usr/lib/qt5/plugins/:"${HERE}"/usr/lib/i386-linux-gnu/qt5/plugins/:"${HERE}"/usr/lib/x86_64-linux-gnu/qt5/plugins/:"${HERE}"/usr/lib32/qt5/plugins/:"${HERE}"/usr/lib64/qt5/plugins/:"${QT_PLUGIN_PATH}"
  296. EXEC=$(grep -e '^Exec=.*' "${HERE}"/*.desktop | head -n 1 | cut -d "=" -f 2- | sed -e 's|%.||g')
  297. exec ${EXEC} "$@"
  298. EOF
  299. chmod a+x AppRun
  300. fi
  301. get_desktop
  302. # Prevent Qt from loading plugins from the system
  303. unset QTPATH
  304. QTPATH=$(find usr/lib -type d -name qt4 -or -name qt5 | sed -e 's|usr/|../|g')
  305. if [ ! -z $QTPATH ] ; then
  306. cat > usr/bin/qt.conf <<EOF
  307. [Paths]
  308. Prefix = $QTPATH
  309. EOF
  310. fi
  311. # http://www.mono-project.com/docs/advanced/assemblies-and-the-gac/
  312. # At runtime, Mono looks in three places for assemblies necessary
  313. # to run a program. It first searches the location of the executing assembly.
  314. # For this to work without setting $MONO_PATH, we need to move the
  315. # main *.exe to usr/lib/mono/exe, because we move all "assemblies" (sic)
  316. # there in this script
  317. if [ -e usr/lib/mono ] ; then
  318. # Force all so files referenced in config files into LD_LIBRARY_PATH
  319. find . -name "*.dll.config" -exec cat {} > temp \;
  320. # Remove all absolute paths
  321. sed -i -E 's|target=\"\/(.*\/)([a-z0-9].*?)>|target=\"\2>|g' temp
  322. SONAMES=$(cat temp | cut -d '"' -f 4 | grep ".so" || true)
  323. if [ "" != "$SONAMES" ] ; then
  324. for SONAME in $SONAMES; do
  325. find . -name "$SONAME" -exec mv {} usr/lib \;
  326. done
  327. fi
  328. rm temp
  329. PATH_OF_THE_EXE="usr/lib/mono/exe"
  330. mkdir -p "$PATH_OF_THE_EXE"
  331. # Force all dll files into PATH_OF_THE_EXE (or MONO_PATH which we would have to set)
  332. find . -name "*.dll" -and -not -name "mscorlib.dll" -exec mv {} "$PATH_OF_THE_EXE" \;
  333. # Edit all config files in place to remove absolute paths
  334. find . -name "*.dll.config" -exec sed -i -E 's|target=\"\/(.*\/)([a-z0-9].*?)>|target=\"\2>|g' {} \;
  335. # Force all config files into the PATH_OF_THE_EXE (or MONO_PATH which we would have to set)
  336. find . -name "*.dll.config" -exec mv {} "$PATH_OF_THE_EXE" \;
  337. # Remove gac, we are not using it since it is convoluted
  338. rm -rf usr/lib/mono/gac/
  339. fi
  340. if [ -d "./usr/lib/x86_64-linux-gnu/gstreamer-1.0/" ] ; then
  341. mv ./usr/lib/x86_64-linux-gnu/gstreamer-1.0/* ./usr/lib/x86_64-linux-gnu/
  342. rm -r ./usr/lib/x86_64-linux-gnu/gstreamer-1.0
  343. fi
  344. if [ -d "./usr/lib/x86_64-linux-gnu/pulseaudio/" ] ; then
  345. mv ./usr/lib/x86_64-linux-gnu/pulseaudio/* ./usr/lib/x86_64-linux-gnu/
  346. rm -r ./usr/lib/x86_64-linux-gnu/pulseaudio
  347. fi
  348. # Execute extra steps defined in recipe
  349. if [ ! -z "${_script}" ] ; then
  350. shell_execute $YAMLFILE _script
  351. fi
  352. DESKTOP=$(find . -name '*.desktop' | sort | head -n 1)
  353. # desktop-file-validate complains about missing trailing semicolons for some
  354. # keys although the format definition says that they are optional
  355. fix_desktop "$DESKTOP"
  356. # Some non-distribution provided applications have an absolute
  357. # path in the Exec= line which we remove for relocateability
  358. if [ -z "$DESKTOP" ] ; then
  359. echo "desktop file not found, aborting"
  360. exit 1
  361. else
  362. desktop-file-validate "$DESKTOP" || exit 1
  363. ORIG=$(grep -o "^Exec=.*$" "${DESKTOP}" | head -n 1| cut -d " " -f 1)
  364. REPL=$(basename $(grep -o "^Exec=.*$" "${DESKTOP}" | head -n 1 | cut -d " " -f 1 | sed -e 's|Exec=||g'))
  365. sed -i -e 's|'"${ORIG}"'|Exec='"${REPL}"'|g' "${DESKTOP}"
  366. fi
  367. # Compile GLib schemas if the subdirectory is present in the AppImage
  368. # AppRun has to export GSETTINGS_SCHEMA_DIR for this to work
  369. if [ -d usr/share/glib-2.0/schemas/ ] ; then
  370. ( cd usr/share/glib-2.0/schemas/ ; glib-compile-schemas . )
  371. fi
  372. if [ -f ../VERSION ] ; then
  373. VERSION=$(cat ../VERSION)
  374. else
  375. get_version || true
  376. fi
  377. # patch_usr
  378. # Patching only the executable files seems not to be enough for some apps
  379. if [ ! -z "${_binpatch}" ] ; then
  380. find usr/ -type f -exec sed -i -e 's|/usr|././|g' {} \;
  381. find usr/ -type f -exec sed -i -e 's@././/bin/env@/usr/bin/env@g' {} \;
  382. fi
  383. # Don't suffer from NIH; use LD_PRELOAD to override calls to /usr paths
  384. if [ ! -z "${_union}" ] ; then
  385. mkdir -p usr/src/
  386. wget -q "https://raw.githubusercontent.com/mikix/deb2snap/master/src/preload.c" -O - | \
  387. sed -e 's|SNAPPY|UNION|g' | sed -e 's|SNAPP|UNION|g' | sed -e 's|SNAP|UNION|g' | \
  388. sed -e 's|snappy|union|g' > usr/src/libunionpreload.c
  389. gcc -shared -fPIC usr/src/libunionpreload.c -o libunionpreload.so -ldl -DUNION_LIBNAME=\"libunionpreload.so\"
  390. strip libunionpreload.so
  391. fi
  392. delete_blacklisted
  393. if [ "$ENABLE_DI" = "yes" ] ; then
  394. get_desktopintegration $LOWERAPP
  395. fi
  396. # Fix desktop files that have file endings for icons
  397. sed -i -e 's|\.png||g' *.desktop || true
  398. sed -i -e 's|\.svg||g' *.desktop || true
  399. sed -i -e 's|\.svgz||g' *.desktop || true
  400. sed -i -e 's|\.xpm||g' *.desktop || true
  401. # Setting PYTHONHOME instead
  402. # Fix Python imports,
  403. # https://github.com/AppImage/AppImages/issues/172
  404. # SITECUSTOMIZEFILES=$(find . -name "sitecustomize.py")
  405. # for SITECUSTOMIZEFILE in $SITECUSTOMIZEFILES ; do
  406. # rm $SITECUSTOMIZEFILE # Remove symlinks, replace by files
  407. # cat > $SITECUSTOMIZEFILE <<\EOF
  408. # import sys,os
  409. # if sys.version_info[0] < 3:
  410. # prefix = os.path.dirname(os.path.dirname(os.path.dirname(os.path.dirname(sys.path[0]))))
  411. # sys.path = [ prefix+s for s in sys.path if not s.startswith(prefix) ]
  412. # EOF
  413. # done
  414. # Execute extra steps defined in recipe
  415. if [ ! -z "${_post_script[0]}" ] ; then
  416. shell_execute $YAMLFILE _post_script
  417. fi
  418. # Go out of AppImage
  419. cd ..
  420. generate_type2_appimage
  421. ls -lh ../out/*.AppImage