Guest User

Untitled

a guest
Jul 1st, 2017
130
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.88 KB | None | 0 0
  1. # In this example, we use a xenial deb
  2.  
  3. APP=RetroArch
  4. LOWERAPP=${APP,,}
  5.  
  6. mkdir -p ./$APP/$APP.AppDir/usr/lib
  7.  
  8. cd ./$APP/
  9.  
  10. wget -q https://github.com/probonopd/AppImages/raw/master/functions.sh -O ./functions.sh
  11. . ./functions.sh
  12.  
  13. generate_status
  14.  
  15. # Needs a specific version (FIXME)
  16. sed -i -e 's|libegl1-mesa|xxxlibegl1-mesa|g' status
  17. cat > status <<\EOF
  18. Package: libegl-mesa
  19. Status: install ok installed
  20. Architecture: all
  21. Version: 9:999.999.999
  22.  
  23. Package: libegl1-mesa
  24. Status: install ok installed
  25. Architecture: all
  26. Version: 9:999.999.999
  27.  
  28. Package: libwayland-egl1-mesa
  29. Status: install ok installed
  30. Architecture: all
  31. Version: 9:999.999.999
  32.  
  33. Package: libgl1-mesa-glx
  34. Status: install ok installed
  35. Architecture: all
  36. Version: 9:999.999.999
  37.  
  38. Package: libgl1-mesa-dri
  39. Status: install ok installed
  40. Architecture: all
  41. Version: 9:999.999.999
  42.  
  43. Package: debconf
  44. Status: install ok installed
  45. Architecture: all
  46. Version: 9:999.999.999
  47.  
  48. Package: libc6
  49. Status: install ok installed
  50. Architecture: all
  51. Version: 9:999.999.999
  52.  
  53. Package: libstdc++6
  54. Status: install ok installed
  55. Architecture: all
  56. Version: 9:999.999.999
  57.  
  58. Package: libgcc1
  59. Status: install ok installed
  60. Architecture: all
  61. Version: 9:999.999.999
  62.  
  63. EOF
  64.  
  65. echo "deb http://archive.ubuntu.com/ubuntu/ xenial main universe multiverse
  66. deb http://ppa.launchpad.net/libretro/testing/ubuntu xenial main
  67. " > sources.list
  68. apt-get $OPTIONS update
  69. URLS=$(apt-get $OPTIONS -y install --print-uris $LOWERAPP | cut -d "'" -f 2 | grep -e "^http")
  70. wget -c $URLS
  71.  
  72. cd ./$APP.AppDir/
  73.  
  74. find ../*.deb -exec dpkg -x {} . \; || true
  75.  
  76. get_desktop
  77. # get_icon
  78. # Dear upstream developers, this is a nonstandard location for an app icon;
  79. # please consider using a standard location instead
  80. cp ./usr/share/libretro/assets/xmb/retroactive/png/retroarch.png .
  81. get_apprun
  82.  
  83. mv ./usr/lib/x86_64-linux-gnu/pulseaudio/* ./usr/lib/x86_64-linux-gnu/ || true
  84.  
  85. # Workaround for:
  86. # /usr/lib/x86_64-linux-gnu/libdrm_amdgpu.so.1: error: symbol lookup error:
  87. # undefined symbol: drmGetNodeTypeFromFd (fatal)
  88. # libGL error: unable to load driver: swrast_dri.so
  89. # libGL error: failed to load driver: swrast
  90. rm -rf ./usr/lib/x86_64-linux-gnu/libdrm.* || true
  91.  
  92. # patch_usr
  93. # Patching only the executable files seems not to be enough for some apps
  94. find usr/ -type f -exec sed -i -e "s|/usr|././|g" {} \;
  95.  
  96. # Patch to make it load usr/share/retroarch from inside the AppDir
  97. mv etc e
  98. sed -i -e 's|/etc|../e|g' ./usr/bin/retroarch
  99. sed -i -e 's|/usr|././|g' e/retroarch.cfg
  100.  
  101. # Workaround for:
  102. # Two icons in dock
  103. # https://github.com/probonopd/AppImageKit/issues/260
  104. echo "StartupWMClass=retroarch" >> retroarch.desktop
  105.  
  106. VERSION=$(find ../*.deb -name $LOWERAPP"_*" | head -n 1 | cut -d "~" -f 1 | cut -d "_" -f 2 | cut -d "-" -f 1 | sed -e 's|1%3a||g' )
  107.  
  108. echo $VERSION
  109.  
  110. get_desktopintegration $LOWERAPP
  111.  
  112. # Go out of AppImage
  113. cd ..
  114.  
  115. generate_type2_appimage
Advertisement
Add Comment
Please, Sign In to add comment