Browse Source

3rdparty: extras: build ZIP archive and install to engine default gamefolder

pull/2/head
Alibek Omarov 2 years ago
parent
commit
084089b919
  1. 29
      3rdparty/extras/wscript
  2. 11
      scripts/waifulib/zip.py

29
3rdparty/extras/wscript vendored

@ -0,0 +1,29 @@
#! /usr/bin/env python
# encoding: utf-8
import os
def options(opt):
pass
def configure(conf):
if not conf.path.find_dir('xash-extras'):
conf.fatal('Can\'t find xash-extras submodule.')
return
conf.load('zip')
def build(bld):
srcdir = bld.path.find_dir('xash-extras')
if bld.env.DEST_OS in ['android']:
install_path = bld.env.PREFIX
else:
install_path = os.path.join(bld.env.SHAREDIR, bld.env.GAMEDIR)
bld(features='zip',
name = 'extras.pk3',
files = srcdir.ant_glob('**/*'),
relative_to = srcdir,
compresslevel = 0,
install_path = install_path)

11
scripts/waifulib/zip.py

@ -1,7 +1,7 @@
#! /usr/bin/env python #! /usr/bin/env python
# encoding: utf-8 # encoding: utf-8
from waflib import TaskGen, Task, Logs from waflib import TaskGen, Task, Logs, Utils
import zipfile import zipfile
class ziparchive(Task.Task): class ziparchive(Task.Task):
@ -51,3 +51,12 @@ def create_zip_archive(self):
setattr(tsk, 'compresslevel', compresslevel) setattr(tsk, 'compresslevel', compresslevel)
setattr(tsk, 'relative_to', relative_to) setattr(tsk, 'relative_to', relative_to)
try:
inst_to = self.install_path
self.install_task = self.add_install_files(
install_to=inst_to, install_from=target,
chmod=Utils.O644, task=tsk)
except AttributeError:
pass

Loading…
Cancel
Save