Skip to content

Commit

Permalink
Merge branch 'master' into resourcesystem
Browse files Browse the repository at this point in the history
  • Loading branch information
danij-deng committed Nov 15, 2013
2 parents afc6483 + bf039d4 commit 10c60ab
Show file tree
Hide file tree
Showing 16 changed files with 133 additions and 32 deletions.
1 change: 1 addition & 0 deletions distrib/.gitignore
Expand Up @@ -2,6 +2,7 @@
builddir
build-stamp
work
srcwork
plugins
build*.txt
products
44 changes: 44 additions & 0 deletions distrib/autobuild.py
Expand Up @@ -175,6 +175,49 @@ def update_debian_changelog():
update_changes(debChanges=True)


def build_source_package():
"""Builds the source tarball and a Debian source package."""
ev = builder.Event(latestAvailable=True)
print "Creating source tarball for build %i." % ev.number()
os.chdir(os.path.join(builder.config.DISTRIB_DIR))
remkdir('srcwork')
os.chdir('srcwork')
if ev.release_type() == 'stable':
system_command('deng_package_source.sh ' + ev.version_base())
else:
system_command('deng_package_source.sh build %i %s' % (ev.number(),
ev.version_base()))
for fn in os.listdir('.'):
if fn[:9] == 'doomsday-' and fn[-7:] == '.tar.gz':
remote_copy(fn, ev.file_path(fn))
break

# Create a source Debian package and upload it to Launchpad.
pkgVer = '%s.%i' % (ev.version_base(), ev.number())
pkgDir = 'doomsday-%s' % pkgVer
system_command('tar xzf %s' % fn)
os.rename(fn[:-7], pkgDir)
os.chdir(pkgDir)
system_command('echo "" | dh_make -s -c gpl2 --file ../%s' % fn)
os.chdir('debian')
for fn in os.listdir('.'):
if fn[-3:].lower() == '.ex': os.remove(fn)
os.remove('README.Debian')
os.remove('README.source')

def gen_changelog(src, dst, extraSub=''):
system_command("sed 's/%s-build%i/%s/;%s' %s > %s" % (
ev.version_base(), ev.number(), pkgVer, extraSub, src, dst))

gen_changelog('../../../debian/changelog', 'changelog')
system_command("sed 's/${Arch}/i386 amd64/' ../../../debian/control.template > control")
system_command("sed 's/`..\/build_number.py --print`/%i/;s/..\/..\/doomsday/..\/doomsday/' ../../../debian/rules > rules" % ev.number())
os.chdir('..')
system_command('debuild -S')
os.chdir('..')
system_command('dput ppa:sjke/doomsday doomsday_%s_source.changes' % (pkgVer))


def rebuild_apt_repository():
"""Rebuilds the Apt repository by running apt-ftparchive."""
aptDir = builder.config.APT_REPO_DIR
Expand Down Expand Up @@ -454,6 +497,7 @@ def sorted_commands():
'publish': publish_packages,
'changes': update_changes,
'debchanges': update_debian_changelog,
'source': build_source_package,
'apt': rebuild_apt_repository,
'feed': update_feed,
'xmlfeed': update_xml_feed,
Expand Down
12 changes: 8 additions & 4 deletions distrib/builder/event.py
Expand Up @@ -50,7 +50,8 @@ def __init__(self, build=None, latestAvailable=False):
('Mac OS X 10.6+ (x86_64/i386)', 'mac10_6.dmg', 'darwin-64bit'),
('Mac OS X 10.4+ (ppc/i386)', '32bit.dmg', 'darwin-32bit'),
('Ubuntu (x86_64)', 'amd64.deb', 'linux2-64bit'),
('Ubuntu (x86)', 'i386.deb', 'linux2-32bit')]
('Ubuntu (x86)', 'i386.deb', 'linux2-32bit'),
('Source', '.tar.gz', 'source')]

if self.has_version() and utils.version_cmp(self.version_base(), '1.11') >= 0:
del self.oses[3] # no more OS X 10.4
Expand All @@ -76,7 +77,8 @@ def __init__(self, build=None, latestAvailable=False):
'darwin-64bit': 'mac10_6-x86-x86_64',
'macx8-64bit': 'mac10_8-x86_64',
'linux2-32bit': 'linux-x86',
'linux2-64bit': 'linux-x86_64'}
'linux2-64bit': 'linux-x86_64',
'source': 'source'}

# Prepare compiler logs present in the build dir.
self.compress_logs()
Expand Down Expand Up @@ -161,7 +163,8 @@ def clean(self):
def list_package_files(self):
files = glob.glob(os.path.join(self.buildDir, '*.dmg')) + \
glob.glob(os.path.join(self.buildDir, '*.exe')) + \
glob.glob(os.path.join(self.buildDir, '*.deb'))
glob.glob(os.path.join(self.buildDir, '*.deb')) + \
glob.glob(os.path.join(self.buildDir, '*.tar.gz'))

return [os.path.basename(f) for f in files]

Expand Down Expand Up @@ -198,7 +201,7 @@ def text_summary(self):
if commitCount == 100: moreThan = 'more than '
msg += " contains %s%i commits and" % (moreThan, commitCount)

msg += " produced %i installable binary package%s." % \
msg += " produced %i package%s." % \
(pkgCount, 's' if (pkgCount != 1) else '')

return msg
Expand Down Expand Up @@ -334,6 +337,7 @@ def html_description(self, encoded=True):
return msg

def release_type(self):
"""Returns the release type as a lower-case string."""
fn = self.file_path('releaseType.txt')
if os.path.exists(fn):
return file(fn).read().lower().strip()
Expand Down
15 changes: 12 additions & 3 deletions distrib/builder/utils.py
@@ -1,4 +1,5 @@
import os, sys, platform
import shutil
import subprocess
import string
import glob
Expand All @@ -8,6 +9,13 @@
import build_number
import config

def remkdir(n):
if os.path.exists(n):
print n, 'exists, clearing it...'
shutil.rmtree(n, True)
os.mkdir(n)


def omit_path(path, omitted):
if path.startswith(omitted):
path = path[len(omitted):]
Expand Down Expand Up @@ -71,12 +79,13 @@ def sys_id():

# Special case: the Snow Leopard builder targets 64-bit.
if plat == 'darwin':
if platform.mac_ver()[0][:4] == '10.8':
macVer = mac_os_version()
if macVer == '10.8' or macVer == '10.9':
plat = 'macx8'
bits = '64bit'
elif platform.mac_ver()[0][:4] == '10.6':
elif macVer == '10.6':
bits = '64bit'
elif platform.mac_ver()[0][:4] == '10.5':
elif macVer == '10.5':
plat = 'macx5'

return "%s-%s" % (plat, bits)
Expand Down
9 changes: 4 additions & 5 deletions distrib/debian/control.template
Expand Up @@ -2,11 +2,11 @@ Source: doomsday
Section: universe/games
Priority: optional
Maintainer: Jaakko Keränen <jaakko.keranen@iki.fi>
Build-Depends: debhelper (>= 7.0.50~)
Standards-Version: 3.9.1
Build-Depends: debhelper (>= 8.0.0), python, libsdl1.2-dev, libsdl-mixer1.2-dev, libxrandr-dev, libxxf86vm-dev, libqt4-network (>= 4.7), libqtcore4 (>= 4.7), libqtgui4 (>= 4.7), qt4-qmake (>= 4.7), libqt4-opengl-dev (>= 4.7), zlib1g-dev, libfluidsynth-dev
Standards-Version: 3.9.3
Homepage: http://dengine.net/
Vcs-Git: git://deng.git.sourceforge.net/gitroot/deng/deng
Vcs-Browser: http://deng.git.sourceforge.net/git/gitweb.cgi?p=deng/deng;a=summary
Vcs-Git: https://github.com/skyjake/Doomsday-Engine.git
Vcs-Browser: http://github.com/skyjake/Doomsday-Engine

Package: doomsday
Architecture: ${Arch}
Expand All @@ -18,4 +18,3 @@ Description: Doom/Heretic/Hexen port with enhanced graphics
models, and dynamic lighting effects. Data files from the original games
are not included; you must acquire a copy of the original games from
id Software and/or Raven Software.

6 changes: 4 additions & 2 deletions distrib/debian/rules
Expand Up @@ -4,9 +4,11 @@ builddir:
mkdir -p builddir

builddir/Makefile: builddir
cd builddir && qmake-qt4 PREFIX=/usr CONFIG+=release DENG_BUILD=`../build_number.py --print` ../../doomsday/$(APPNAME).pro
cd builddir && qmake-qt4 PREFIX=/usr CONFIG+=deng_fluidsynth CONFIG+=release DENG_BUILD=`../build_number.py --print` ../../doomsday/$(APPNAME).pro

build: build-stamp
build: build-arch build-indep
build-arch: build-stamp
build-indep: build-stamp

build-stamp: builddir/Makefile
dh_testdir
Expand Down
9 changes: 8 additions & 1 deletion distrib/pilot.py
Expand Up @@ -326,6 +326,10 @@ def doTask(task):
msg("BUILD RELEASE")
return autobuild('platform_release')

elif task == 'source':
msg("PACKAGE SOURCE")
return autobuild('source')

elif task == 'sign':
msg("SIGN PACKAGES")
return autobuild('sign')
Expand Down Expand Up @@ -390,7 +394,10 @@ def handleCompletedTasks():
newTask('generate_wiki', forClient='master')

elif task == 'build':
newTask('sign', forClient='master')
newTask('source', forClient='ubuntu')

elif task == 'source':
newTask('sign', forClient='master')

elif task == 'sign':
newTask('publish', forClient='master')
Expand Down
5 changes: 1 addition & 4 deletions distrib/platform_release.py
Expand Up @@ -44,10 +44,7 @@ def mkdir(n):


def remkdir(n):
if os.path.exists(n):
print n, 'exists, clearing it...'
shutil.rmtree(n, True)
os.mkdir(n)
builder.utils.remkdir(n)


def remove(n):
Expand Down
3 changes: 1 addition & 2 deletions doomsday/client/include/render/drawlist.h
Expand Up @@ -22,12 +22,11 @@
#define DENG_CLIENT_RENDER_DRAWLIST_H

#include "gl/gltextureunit.h"
#include "api_gl.h" // blendmode_e
#include <de/GLBuffer>
#include <de/Vector>
#include <QFlags>

enum blendmode_e;

/// Semantic geometry group identifiers.
enum GeomGroup
{
Expand Down
2 changes: 2 additions & 0 deletions doomsday/client/src/render/drawlists.cpp
Expand Up @@ -55,6 +55,8 @@ DENG2_PIMPL(DrawLists)
case LightGeom: return dynHash;
case ShadowGeom: return shadowHash;
case ShineGeom: return shinyHash;

case SkyMaskGeom: break; // n/a?
}
DENG2_ASSERT(false);
return unlitHash;
Expand Down
17 changes: 15 additions & 2 deletions doomsday/client/src/render/rend_main.cpp
Expand Up @@ -3845,7 +3845,7 @@ void Rend_UpdateLightModMatrix()
{
if(novideo) return;

std::memset(lightModRange, 0, sizeof(float) * 255);
zap(lightModRange);

if(!App_World().hasMap())
{
Expand All @@ -3855,9 +3855,13 @@ void Rend_UpdateLightModMatrix()

int mapAmbient = App_World().map().ambientLightLevel();
if(mapAmbient > ambientLight)
{
rAmbient = mapAmbient;
}
else
{
rAmbient = ambientLight;
}

for(int i = 0; i < 255; ++i)
{
Expand All @@ -3879,16 +3883,25 @@ void Rend_UpdateLightModMatrix()

// Lower than the ambient limit?
if(rAmbient != 0 && i+lightlevel <= rAmbient)
{
lightlevel = rAmbient - i;
}

// Clamp the result as a modifier to the light value (j).
if((i + lightlevel) >= 255)
{
lightlevel = 255 - i;
}
else if((i + lightlevel) <= 0)
{
lightlevel = -i;
}

// Insert it into the matrix
// Insert it into the matrix.
lightModRange[i] = lightlevel / 255.0f;

// Ensure the resultant value never exceeds the expected [0..1] range.
DENG2_ASSERT(INRANGE_OF(i / 255.0f + lightModRange[i], 0.f, 1.f));
}
}

Expand Down
2 changes: 1 addition & 1 deletion doomsday/client/src/ui/widgets/dialogwidget.cpp
Expand Up @@ -527,7 +527,7 @@ bool DialogWidget::handleEvent(Event const &event)
if(d->modality == Modal)
{
// The event should already have been handled by the children.
if(event.isKeyDown() ||
if((event.isKeyDown() && !(event.as<KeyEvent>().qtKey() == Qt::Key_Shift)) ||
(event.type() == Event::MouseButton &&
event.as<MouseEvent>().state() == MouseEvent::Pressed &&
!hitTest(event)))
Expand Down
12 changes: 8 additions & 4 deletions doomsday/client/src/world/map.cpp
Expand Up @@ -1658,8 +1658,9 @@ int Map::mobjTouchedLineIterator(mobj_t *mo, int (*callback) (Line *, void *),
linkStore.append(reinterpret_cast<Line *>(tn[nix].ptr));
}

foreach(Line *line, linkStore)
for(int i = 0; i < linkStore.count(); ++i)
{
Line *line = linkStore[i];
if(int result = callback(line, context))
return result;
}
Expand Down Expand Up @@ -1711,8 +1712,9 @@ int Map::mobjTouchedSectorIterator(mobj_t *mo, int (*callback) (Sector *, void *
}
}

foreach(Sector *sector, linkStore)
for(int i = 0; i < linkStore.count(); ++i)
{
Sector *sector = linkStore[i];
if(int result = callback(sector, context))
return result;
}
Expand All @@ -1733,8 +1735,9 @@ int Map::lineTouchingMobjIterator(Line *line, int (*callback) (mobj_t *, void *)
linkStore.append(reinterpret_cast<mobj_t *>(ln[nix].ptr));
}

foreach(mobj_t *mobj, linkStore)
for(int i = 0; i < linkStore.count(); ++i)
{
mobj_t *mobj = linkStore[i];
if(int result = callback(mobj, context))
return result;
}
Expand Down Expand Up @@ -1775,8 +1778,9 @@ int Map::sectorTouchingMobjIterator(Sector *sector,
}

// Process all collected mobjs.
foreach(mobj_t *mobj, linkStore)
for(int i = 0; i < linkStore.count(); ++i)
{
mobj_t *mobj = linkStore[i];
if(int result = callback(mobj, context))
return result;
}
Expand Down
16 changes: 14 additions & 2 deletions web/plugins/buildrepository/buildrepository.php
Expand Up @@ -36,6 +36,7 @@
define('PID_MAC10_8_X86_64', 4);
define('PID_LINUX_X86', 5);
define('PID_LINUX_X86_64', 6);
define('PID_SOURCE', 7);
///@}

/**
Expand Down Expand Up @@ -76,7 +77,8 @@ class BuildRepositoryPlugin extends Plugin implements Actioner, RequestInterpret
PID_MAC10_6_X86_X86_64 => array('id'=>PID_MAC10_6_X86_X86_64, 'name'=>'mac10_6-x86-x86_64', 'nicename'=>'OS X 10.6+'),
PID_MAC10_8_X86_64 => array('id'=>PID_MAC10_8_X86_64, 'name'=>'mac10_8-x86_64', 'nicename'=>'OS X 10.8+'),
PID_LINUX_X86 => array('id'=>PID_LINUX_X86, 'name'=>'linux-x86', 'nicename'=>'Ubuntu (32bit)'),
PID_LINUX_X86_64 => array('id'=>PID_LINUX_X86_64, 'name'=>'linux-x86_64', 'nicename'=>'Ubuntu (64bit)')
PID_LINUX_X86_64 => array('id'=>PID_LINUX_X86_64, 'name'=>'linux-x86_64', 'nicename'=>'Ubuntu (64bit)'),
PID_SOURCE => array('id'=>PID_SOURCE, 'name'=>'source', 'nicename'=>'Source code')
);
private static $unknownPlatform = array(
'id'=>PID_ANY, 'name'=>'unknown', 'nicename'=>'Unknown');
Expand Down Expand Up @@ -528,6 +530,16 @@ private function populateSymbolicPackages(&$packages)
NULL/*no version*/, 'latestbuild?platform='. $plat['name']. '&unstable');
$packages[] = $pack;

$plat = $this->platform(PID_SOURCE);
$pack = PackageFactory::newDistribution($plat['id'], 'Latest Doomsday',
NULL/*no version*/, 'latestbuild?platform='. $plat['name']);
$packages[] = $pack;

$plat = $this->platform(PID_SOURCE);
$pack = PackageFactory::newDistributionUnstable($plat['id'], 'Latest Doomsday',
NULL/*no version*/, 'latestbuild?platform='. $plat['name']. '&unstable');
$packages[] = $pack;

return TRUE;
}

Expand Down Expand Up @@ -1211,7 +1223,7 @@ private function outputBuildPackageList(&$build)

?></td><td><?php

if($pack instanceof AbstractPackage)
if($pack instanceof AbstractPackage && mb_strlen($pack->compileLogUri()))
{
$logUri = $pack->compileLogUri();

Expand Down

0 comments on commit 10c60ab

Please sign in to comment.