actions.py 3.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586
  1. # -*- coding: utf-8 -*-
  2. #
  3. # Licensed under the GNU General Public License, version 3.
  4. # See the file http://www.gnu.org/licenses/gpl.txt
  5. from pisi.actionsapi import autotools
  6. from pisi.actionsapi import pisitools
  7. from pisi.actionsapi import shelltools
  8. from pisi.actionsapi import get
  9. def setup():
  10. shelltools.system("install=wine.keyring")
  11. # For 32bit machines:
  12. # * It get compiled with the normal options below. The emul32 are ignored
  13. # on 32bit machines. Nothing is added to options variable.
  14. #
  15. # For 64bit machines:
  16. # * First we compile for 64bit with the option --enable-win64. These build
  17. # files are stored in the normal "work" dir
  18. # * In the second run (for emul32 buildType), the 32bit part is compiled
  19. # with the spesific libdir and the --with-wine64 options that is pointing
  20. # to the 64bit files that was compiled in the first step (files in the work)
  21. #
  22. # More info can be obtained here: http://wiki.winehq.org/Wine64
  23. shelltools.export("CPPFLAGS", "-D_FORTIFY_SOURCE=2 -D_FORTIFY_SOURCE=0")
  24. shelltools.system("sed -i -e 's!^loader server: libs/port libs/wine tools.*!& include!' Makefile.in")
  25. shelltools.system("make -C ./wine-staging-%s/patches DESTDIR=$(pwd) install" %get.srcVERSION())
  26. shelltools.system("sed 's|OpenCL/opencl.h|CL/opencl.h|g' -i configure*")
  27. autotools.autoreconf("-vif")
  28. options = "--without-capi \
  29. --with-curses \
  30. --without-hal \
  31. --without-gstreamer \
  32. --with-dbus \
  33. --with-opengl \
  34. --with-opencl \
  35. --with-alsa \
  36. --with-x \
  37. --with-xattr \
  38. --prefix=/usr"
  39. if get.buildTYPE() == "emul32":
  40. options += " --with-wine64=%s/work/wine-%s/build-wine \
  41. --libdir=/usr/lib32 \
  42. " % (get.pkgDIR(), get.srcVERSION())
  43. shelltools.system("mkdir build-wine")
  44. shelltools.cd("build-wine")
  45. shelltools.system(". ../configure %s" %options)
  46. elif get.ARCH() == "x86_64":
  47. options += " --enable-win64 \
  48. --libdir=/usr/lib \
  49. "
  50. shelltools.system("mkdir build-wine")
  51. shelltools.cd("build-wine")
  52. shelltools.system(". ../configure %s" %options)
  53. autotools.configure(options)
  54. def build():
  55. shelltools.cd("build-wine")
  56. autotools.make()
  57. def install():
  58. # We need especially specify libdir and dlldir prefixes. Otherwise the
  59. # 32bit parts overwrite the 64bit files under /usr/lib
  60. shelltools.cd("build-wine")
  61. if get.buildTYPE() == "emul32":
  62. autotools.install("UPDATE_DESKTOP_DATABASE=/bin/true libdir=%s/usr/lib32 dlldir=%s/usr/lib32/wine" % (get.installDIR(), get.installDIR()))
  63. else:
  64. autotools.install("UPDATE_DESKTOP_DATABASE=/bin/true libdir=%s/usr/lib dlldir=%s/usr/lib/wine" % (get.installDIR(), get.installDIR()))
  65. shelltools.cd("..")
  66. pisitools.dodoc("ANNOUNCE", "AUTHORS", "COPYING.LIB", "LICENSE*", "README", "documentation/README.*")
  67. pisitools.insinto("/usr/share/wine/mono/", "wine-mono-4.5.6.msi")
  68. pisitools.insinto("/usr/share/wine/gecko/", "wine_gecko-2.40-x86.msi")
  69. pisitools.insinto("/usr/share/wine/gecko/", "wine_gecko-2.40-x86_64.msi")