mirror of
https://github.com/YGGverse/xash3d-fwgs.git
synced 2025-01-20 03:50:08 +00:00
3rdparty: extras: build ZIP archive and install to engine default gamefolder
This commit is contained in:
parent
f571a41cf3
commit
084089b919
29
3rdparty/extras/wscript
vendored
Normal file
29
3rdparty/extras/wscript
vendored
Normal file
@ -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)
|
@ -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…
x
Reference in New Issue
Block a user