From 2d7655878901a64871a21d4919edd1f36273c865 Mon Sep 17 00:00:00 2001 From: Timothy Redaelli Date: Sun, 15 Jan 2012 16:02:01 +0000 Subject: [PATCH] updated on Sun Jan 15 16:02:00 UTC 2012 --- adjustable-clock-plasmoid/PKGBUILD | 6 +- air-video-server/PKGBUILD | 6 +- air-video-server/air-video-server.service | 13 + audacious-git/PKGBUILD | 9 +- audacious-git/install | 6 +- audacious-plugins-git/PKGBUILD | 9 +- borneo/PKGBUILD | 4 +- bumblebee-git/PKGBUILD | 4 +- bumblebee-git/bumblebeed.in | 14 +- corsix-th/PKGBUILD | 5 +- dart-editor/Changelog | 10 + dart-editor/PKGBUILD | 32 +- dmenu-xft/PKGBUILD | 20 +- dmenu-xft/dmenu-4.4-xft.patch | 371 ---- dmenu-xft/dmenu-4.5-xft.diff | 418 ++++ glances-git/PKGBUILD | 90 +- google-glog/PKGBUILD | 4 +- gqview-devel/PKGBUILD | 4 +- gstreamer0.10-bad-git/PKGBUILD | 4 +- gstreamer0.10-ffmpeg-git/PKGBUILD | 82 +- gstreamer0.10-ugly-git/PKGBUILD | 102 +- hda-jack-retask-bzr/Changelog | 6 + hda-jack-retask-bzr/PKGBUILD | 26 +- hda-jack-retask-bzr/hda-jack-retask-bzr.install | 9 + jmeter-plugins/PKGBUILD | 4 +- kindlegen/PKGBUILD | 6 +- mbeancmd/PKGBUILD | 8 +- metslib/PKGBUILD | 16 +- mingw32-jsoncpp/PKGBUILD | 9 +- mingw32-jsoncpp/jsoncpp.patch | 42 + ...Use-_stati64-under-WIN32-to-get-file-size.patch | 59 - .../02-Report-empty-files-when-verifying.patch | 51 - ...or-in-Par2CreatorSourceFile-UpdateHashes-.patch | 11 - ...-always-be-updated-even-when-progress-is-.patch | 13 - ...-is-specified-to-be-scanned-but-it-dooen-.patch | 59 - ...conditional-compilation-to-speed-up-thing.patch | 31 - par2cmdline/07-Optimization-by-inlining.patch | 152 -- .../08-Allowing-commandline-passing-of-files.patch | 34 - ...essing-of-the-first-file-parameter-the-ou.patch | 20 - par2cmdline/10-Pack-and-simplify-MD5Hash.patch | 69 - .../11-Use-autogenerated-methods-in-letype.patch | 148 -- par2cmdline/12-Fix-headers-in-par2cmdline.h.patch | 22 - par2cmdline/13-hardlinks.patch | 15 - par2cmdline/14-fixes-stupid-warnings.patch | 106 - par2cmdline/PKGBUILD | 104 +- pure-fastcgi/PKGBUILD | 18 + python-sqlparse/PKGBUILD | 7 +- qap/PKGBUILD | 25 +- qpass/PKGBUILD | 4 +- rss-guard-git/PKGBUILD | 27 +- samplicator/PKGBUILD | 50 +- samplicator/maxpdu.patch | 11 + shutter-bzr/PKGBUILD | 7 +- sunrise-commander/PKGBUILD | 4 +- texmaker-nowebkit/PKGBUILD | 12 +- texmaker-nowebkit/browser.cpp | 3 +- texmaker-nowebkit/browser.h | 4 +- ttf-droid-sans/PKGBUILD | 42 +- ttf-roboto/PKGBUILD | 15 +- urxvt-autocomplete-all-the-things-git/PKGBUILD | 37 + .../autocomplete-ALL-the-things.install | 12 + vim-x-py/PKGBUILD | 4 +- vim-x/PKGBUILD | 17 +- vim-x/urxvt-mouse.diff | 35 - warsow-openbox/PKGBUILD | 93 + warsow-openbox/warsow.desktop | 11 + warsow-openbox/warsow.launcher | 5 + warsow-openbox/warsowopenboxfs.patch | 2043 ++++++++++++++++++++ warsow-openbox/wsw-server.launcher | 5 + warsow-openbox/wswtv-server.launcher | 5 + wine-laa/PKGBUILD | 8 +- wine-laa/wine-laa.patch | 278 +++ wine-rt/PKGBUILD | 4 +- xqf/PKGBUILD | 9 +- 74 files changed, 3449 insertions(+), 1579 deletions(-) create mode 100644 air-video-server/air-video-server.service delete mode 100644 dmenu-xft/dmenu-4.4-xft.patch create mode 100644 dmenu-xft/dmenu-4.5-xft.diff rewrite glances-git/PKGBUILD (64%) rewrite gstreamer0.10-ffmpeg-git/PKGBUILD (88%) rewrite gstreamer0.10-ugly-git/PKGBUILD (86%) create mode 100644 hda-jack-retask-bzr/hda-jack-retask-bzr.install create mode 100644 mingw32-jsoncpp/jsoncpp.patch delete mode 100644 par2cmdline/01-Use-_stati64-under-WIN32-to-get-file-size.patch delete mode 100644 par2cmdline/02-Report-empty-files-when-verifying.patch delete mode 100644 par2cmdline/03-Correct-error-in-Par2CreatorSourceFile-UpdateHashes-.patch delete mode 100644 par2cmdline/04-offset-must-always-be-updated-even-when-progress-is-.patch delete mode 100644 par2cmdline/05-When-a-file-is-specified-to-be-scanned-but-it-dooen-.patch delete mode 100644 par2cmdline/06-Introduced-conditional-compilation-to-speed-up-thing.patch delete mode 100644 par2cmdline/07-Optimization-by-inlining.patch delete mode 100644 par2cmdline/08-Allowing-commandline-passing-of-files.patch delete mode 100644 par2cmdline/09-Fixing-processing-of-the-first-file-parameter-the-ou.patch delete mode 100644 par2cmdline/10-Pack-and-simplify-MD5Hash.patch delete mode 100644 par2cmdline/11-Use-autogenerated-methods-in-letype.patch delete mode 100644 par2cmdline/12-Fix-headers-in-par2cmdline.h.patch delete mode 100644 par2cmdline/13-hardlinks.patch delete mode 100644 par2cmdline/14-fixes-stupid-warnings.patch rewrite par2cmdline/PKGBUILD (88%) create mode 100644 pure-fastcgi/PKGBUILD rewrite samplicator/PKGBUILD (82%) create mode 100644 samplicator/maxpdu.patch rewrite ttf-droid-sans/PKGBUILD (73%) create mode 100644 urxvt-autocomplete-all-the-things-git/PKGBUILD create mode 100644 urxvt-autocomplete-all-the-things-git/autocomplete-ALL-the-things.install delete mode 100644 vim-x/urxvt-mouse.diff create mode 100644 warsow-openbox/PKGBUILD create mode 100755 warsow-openbox/warsow.desktop create mode 100755 warsow-openbox/warsow.launcher create mode 100644 warsow-openbox/warsowopenboxfs.patch create mode 100755 warsow-openbox/wsw-server.launcher create mode 100755 warsow-openbox/wswtv-server.launcher diff --git a/adjustable-clock-plasmoid/PKGBUILD b/adjustable-clock-plasmoid/PKGBUILD index 7faab605e..7ab934bd5 100644 --- a/adjustable-clock-plasmoid/PKGBUILD +++ b/adjustable-clock-plasmoid/PKGBUILD @@ -1,8 +1,8 @@ # Contributor: Carl Mueller arch at carlm e4ward com pkgname=adjustable-clock-plasmoid -pkgver=2.8 -pkgrel=2 +pkgver=3.0 +pkgrel=1 pkgdesc="Customizable kdeplasma clock plasmoid." arch=(i686 x86_64) url="http://www.kde-look.org/content/show.php/Adjustable+Clock?content=92825" @@ -11,7 +11,7 @@ depends=('kdebase-workspace') makedepends=('cmake' 'automoc4') conflicts=(kde-extragear-plasmoids) source=(http://www.kde-look.org/CONTENT/content-files/92825-adjustableclock-$pkgver.tar.bz2) -md5sums=('07f5c07ed253ec0eab0aee116f5f4297') +md5sums=('cfe84573db8814edbfec5bcf8a29f4ee') build() { cd $srcdir/adjustableclock-$pkgver mkdir build diff --git a/air-video-server/PKGBUILD b/air-video-server/PKGBUILD index f2c0fd35c..a69a28b5b 100644 --- a/air-video-server/PKGBUILD +++ b/air-video-server/PKGBUILD @@ -1,10 +1,11 @@ # Contributor: Joeny Ang # Contributor: Lukas Nagl # Contributor: DocterD +# Contributor: benwbooth pkgname=air-video-server pkgver=alpha6 -pkgrel=3 +pkgrel=4 pkgdesc="Air Video is a Client/Server-Mediaplayer, which allows you to stream videos directly from your PC to your iPhone" arch=('i686' 'x86_64') url="http://www.inmethod.com/air-video/index.html" @@ -19,6 +20,7 @@ source=(http://inmethod.com/air-video/download/ffmpeg-for-2.4.5-beta6.tar.bz2 ${pkgname}.sh ${pkgname}.rc ${pkgname}.autostart + ${pkgname}.service mp4creator.sh LICENSE) noextract=('AirVideoServerLinux.jar') @@ -28,6 +30,7 @@ md5sums=('241844e9d41bbd9f8852955291490910' '0dd2a26625ca5754380c346dc34a871b' '2b738be41e70fe1aac3259b4f9584f29' '702f82c153faf742ab451bf2f26500ea' + 'e099a2317c599d99d75a9af2f8ba6fd0' '6e9403f1dd14654844ece68a3cc35f7e' '44dd1b2e8cf08cb372ba51217d267ad5') @@ -57,6 +60,7 @@ package() { install -Dm755 ${pkgname}.rc ${pkgdir}/etc/rc.d/${pkgname} install -Dm644 ${pkgname}.properties ${pkgdir}/etc/conf.d/${pkgname} install -Dm644 ${pkgname}.autostart ${pkgdir}/etc/xdg/autostart/${pkgname}.desktop + install -Dm644 ${pkgname}.service ${pkgdir}/etc/avahi/services/${pkgname}.service install -m755 -d ${pkgdir}/usr/share/licenses/${pkgname} install -m644 LICENSE ${pkgdir}/usr/share/licenses/${pkgname}/ diff --git a/air-video-server/air-video-server.service b/air-video-server/air-video-server.service new file mode 100644 index 000000000..0b352bd0a --- /dev/null +++ b/air-video-server/air-video-server.service @@ -0,0 +1,13 @@ + + + + + + + %h + + + _airvideoserver._tcp + 45631 + + diff --git a/audacious-git/PKGBUILD b/audacious-git/PKGBUILD index 0c51d2365..fe6f00d2a 100644 --- a/audacious-git/PKGBUILD +++ b/audacious-git/PKGBUILD @@ -5,9 +5,9 @@ # Contributor: Giovanni Scafora pkgname=audacious-git -pkgver=20111209 +pkgver=20120115 pkgrel=1 -pkgdesc="Lightweight, GTK-based advanced audio player focused on audio quality." +pkgdesc="Lightweight, GTK-based advanced audio player focused on audio quality" url="http://audacious-media-player.org/" license=('GPL3') arch=('i686' 'x86_64') @@ -22,6 +22,9 @@ install=install _gitroot="git://github.com/audacious-media-player/audacious.git" _gitname="audacious" +# Choose between 'master' (devel) and '3.2.x' (stable) +_version="master" + build() { msg "Connecting to GIT server..." @@ -29,7 +32,7 @@ build() { ( cd ${_gitname} && git pull origin ) msg "The local files are updated." else - git clone ${_gitroot} + git clone -b ${_version} ${_gitroot} fi msg "GIT checkout done or server timeout" diff --git a/audacious-git/install b/audacious-git/install index 946ef37bd..662c30ca0 100644 --- a/audacious-git/install +++ b/audacious-git/install @@ -1,6 +1,6 @@ post_install() { update-desktop-database -q - gtk-update-icon-cache -q -t -f usr/share/icons/hicolor + gtk-update-icon-cache -q -t -f /usr/share/icons/hicolor echo echo "------------------------------------------------" echo " You need to install audacious-plugins-git now. " @@ -13,10 +13,10 @@ post_install() { post_upgrade() { update-desktop-database -q - gtk-update-icon-cache -q -t -f usr/share/icons/hicolor + gtk-update-icon-cache -q -t -f /usr/share/icons/hicolor } post_remove() { update-desktop-database -q - gtk-update-icon-cache -q -t -f usr/share/icons/hicolor + gtk-update-icon-cache -q -t -f /usr/share/icons/hicolor } diff --git a/audacious-plugins-git/PKGBUILD b/audacious-plugins-git/PKGBUILD index b23fbceb7..4219ac439 100644 --- a/audacious-plugins-git/PKGBUILD +++ b/audacious-plugins-git/PKGBUILD @@ -5,14 +5,14 @@ # Contributor: William Rea pkgname=audacious-plugins-git -pkgver=20111209 +pkgver=20120115 pkgrel=1 pkgdesc="Plugins for Audacious" url="http://audacious-media-player.org/" license=('GPL3') arch=('i686' 'x86_64') -makedepends=("audacious-git>=${pkgver}" +makedepends=('audacious-git>=${pkgver}' 'oss' 'alsa-lib' 'pulseaudio' 'jack2' 'lame' 'libvorbis' 'flac' 'mpg123' 'faad2' 'ffmpeg' 'libmodplug' 'fluidsynth' 'libcdio' 'libsidplay' 'wavpack' 'libnotify' 'lirc-utils' 'curl' 'libmtp' @@ -50,6 +50,9 @@ conflicts=('audacious-plugins' 'audacious-plugins-hg') _gitroot="git://github.com/audacious-media-player/audacious-plugins.git" _gitname="audacious-plugins" +# Choose between 'master' and '3.2.x' +_version="master" + build() { msg "Connecting to GIT server..." @@ -57,7 +60,7 @@ build() { ( cd ${_gitname} && git pull origin ) msg "The local files are updated." else - git clone ${_gitroot} + git clone -b ${_version} ${_gitroot} fi msg "GIT checkout done or server timeout" diff --git a/borneo/PKGBUILD b/borneo/PKGBUILD index db184bdf6..185574b64 100644 --- a/borneo/PKGBUILD +++ b/borneo/PKGBUILD @@ -1,7 +1,7 @@ # Contributor: Adria Arrufat pkgname=borneo -pkgver=0.3.2 +pkgver=0.3.3 pkgrel=1 pkgdesc="A very simple and lightweight web browser, based on Qt framework" arch=('i686' 'x86_64') @@ -10,7 +10,7 @@ depends=('qtwebkit') makedepends=() source=(http://kde-apps.org/CONTENT/content-files/148119-Borneo-${pkgver}.tar.gz) license=('BSD') -md5sums=('750753ae0cc4fc340343dd8b11c3d192') +md5sums=('9849b7c7d1d27ad6d7b23b217686ced6') build() { cd ${srcdir}/Borneo qmake diff --git a/bumblebee-git/PKGBUILD b/bumblebee-git/PKGBUILD index defb18a69..0089aa3e4 100644 --- a/bumblebee-git/PKGBUILD +++ b/bumblebee-git/PKGBUILD @@ -3,7 +3,7 @@ # Maintainer: Samsagax pkgname=bumblebee-git -pkgver=20120114 +pkgver=20120115 pkgrel=1 pkgdesc="Develop branch of Bumblebee. Optimus Support for Linux Through VirtualGL. You need to install proper drivers separately. Can be used with Nouveau or Nvidia" arch=('i686' 'x86_64') @@ -20,7 +20,7 @@ conflicts=('bumblebee') provides=('bumblebee') backup=('etc/bumblebee/bumblebee.conf') source=('bumblebeed.in') -md5sums=('4ccc7eb0e1141dac18812586d27c8fb6') +md5sums=('8b05da760e9236ecff2c6820616119f7') _gitroot="git://github.com/Bumblebee-Project/bumblebeed.git" _gitname="bumblebeed" diff --git a/bumblebee-git/bumblebeed.in b/bumblebee-git/bumblebeed.in index 84166db3f..1f53abe9b 100644 --- a/bumblebee-git/bumblebeed.in +++ b/bumblebee-git/bumblebeed.in @@ -13,10 +13,11 @@ PIDFILE=/var/run/$NAME.pid start() { # Start the daemon only if there is not another instance running stat_busy "Starting Bumblebee" - "$CLIENT" --status >/dev/null 2>&1 + local pid="$(cat "$PIDFILE" 2>/dev/null)" + kill -0 $pid >/dev/null 2>&1 case $? in 0) ;; # already running - 1) # Can be started + *) # Can be started "$BIN" --daemon >/dev/null add_daemon $NAME stat_done @@ -30,7 +31,8 @@ start() { stop() { # Stop the daemon only if there is an instance running stat_busy "Stopping Bumblebee" - "$CLIENT" --status >/dev/null 2>&1 + local pid="$(cat "$PIDFILE" 2>/dev/null)" + kill -0 $pid >/dev/null 2>&1 case $? in 0) # Alive and running local pid="$(cat "$PIDFILE" 2>/dev/null)" @@ -39,7 +41,7 @@ stop() { local retries=10 while [ $retries -gt 0 ]; do retries=$(expr $retries - 1) - "$CLIENT" --status >/dev/null 2>&1 + kill -0 $pid >/dev/null 2>&1 case $? in 0) # not ready sleep .5 @@ -50,7 +52,7 @@ stop() { esac done # ... otherwhise just terminate it. - "$CLIENT" --status >/dev/null 2>&1 + kill -0 $pid >/dev/null 2>&1 case $? in 0) # still alive > Kill kill -KILL $pid >/dev/null @@ -61,7 +63,7 @@ stop() { rm_daemon $NAME stat_done ;; - 1) # Not started + *) # Not started stat_done ;; esac diff --git a/corsix-th/PKGBUILD b/corsix-th/PKGBUILD index 34ab85ee6..2bf6f0a6e 100644 --- a/corsix-th/PKGBUILD +++ b/corsix-th/PKGBUILD @@ -2,12 +2,12 @@ pkgname=corsix-th pkgver=Beta8 -pkgrel=1 +pkgrel=2 pkgdesc='Reimplementation of the game engine of Theme Hospital' arch=('i686' 'x86_64') url='http://corsix-th.googlecode.com/' license=('MIT') -depends=('sdl_mixer' 'lua' 'timidity++') +depends=('lua' 'sdl_mixer' 'sdl_ttf' 'timidity++') makedepends=('cmake') source=("${url}files/CorsixTH-${pkgver}-Source.tar.gz" 'bin') @@ -21,6 +21,7 @@ build() { cmake \ -D CMAKE_INSTALL_PREFIX=/usr/share/ \ -D CMAKE_BUILD_TYPE=Release \ + -D WITH_FREETYPE2=ON \ -Wno-dev . } diff --git a/dart-editor/Changelog b/dart-editor/Changelog index 6f4c8ec94..999c8a99b 100644 --- a/dart-editor/Changelog +++ b/dart-editor/Changelog @@ -1,3 +1,13 @@ +2012-01-15 Julien Nicoulaud + + * 0.1.0.3101-1 : + New upstream release. + Add dependency on desktop-file-utils. + Mark dependency on java-runtime >= 6. + Fix broken symlinks. + Add links to doc at /usr/share/doc/dart-editor. + Add backup for /opt/${pkgname}/${_pkgname}.ini. + 2011-11-18 Julien Nicoulaud * 0.1.0.1584-1 : diff --git a/dart-editor/PKGBUILD b/dart-editor/PKGBUILD index fd1a533c2..dd6d6be55 100644 --- a/dart-editor/PKGBUILD +++ b/dart-editor/PKGBUILD @@ -1,20 +1,20 @@ # Maintainer: Julien Nicoulaud # Source: https://github.com/nicoulaj/archlinux-packages pkgname=dart-editor -_pgname=DartEditor -pkgver=0.1.0.2380 -_build=2380 +_pkgname=DartEditor +pkgver=0.1.0.3101 +_build=3101 pkgrel=1 pkgdesc="Editor for the Dart programming language." -arch=(i686 x86_64) +arch=(x86 x86_64) url="http://www.dartlang.org/docs/getting-started/editor/index-linux.html" license=(EPL) -depends=(java-runtime gtk2) +depends=('java-runtime>=6' 'bash' 'desktop-file-utils') +backup=(opt/${pkgname}/${_pkgname}.ini) changelog=Changelog -if [[ ${CARCH} = x86_64 ]]; then - _arch=x86_64 && md5sums=('c5be9545a7478e1b2423ce0442187b5f') -else - _arch=x86 && md5sums=('bfb48f860c56fd7bb7feb16756977863') +if [[ ${CARCH} = x86_64 ]]; + then _arch=x86_64; md5sums=('7ccb241249af55f232f8e7f4a261a1c5') + else _arch=x86; md5sums=('5f48ea527e443a9ab54271e7326c6ef3') fi source=(http://gsdview.appspot.com/dart-editor-archive-integration/${_build}/DartBuild-linux.gtk.${_arch}.zip) @@ -40,12 +40,18 @@ package() { cp -a "${srcdir}"/dart/* "${pkgdir}"/opt/${pkgname} msg2 "Install links to the executables in /usr/bin..." - install -dm755 "${pkgdir}"/usr/bin - ln -s /opt/${pkgname}/${_pgname} "${pkgdir}"/usr/bin/${pkgname} + install -dm755 "${pkgdir}"/usr/bin + ln -s /opt/${pkgname}/${_pkgname} "${pkgdir}"/usr/bin/${pkgname} + + msg2 "Install links to the documentation resources in /usr/share/doc/${pkgname}..." + install -dm755 "${pkgdir}"/usr/share/doc/${pkgname} + ln -s /opt/${pkgname}/samples "${pkgdir}"/usr/share/doc/${pkgname}/ + ln -s /opt/${pkgname}/about.html "${pkgdir}"/usr/share/doc/${pkgname}/ + ln -s /opt/${pkgname}/about_files "${pkgdir}"/usr/share/doc/${pkgname}/ msg2 "Install link to the config file in /etc..." - install -dm755 "${pkgdir}"/etc - ln -s /opt/${pkgname}/${_pgname}.ini "${pkgdir}"/etc/${pkgname}.ini + install -dm755 "${pkgdir}"/etc + ln -s /opt/${pkgname}/${_pkgname}.ini "${pkgdir}"/etc/${pkgname}.ini msg2 "Install desktop application entry in /usr/share/applications..." install -Dm644 "${srcdir}"/${pkgname}.desktop "${pkgdir}"/usr/share/applications/${pkgname}.desktop diff --git a/dmenu-xft/PKGBUILD b/dmenu-xft/PKGBUILD index 1440fb68d..1506f3c42 100644 --- a/dmenu-xft/PKGBUILD +++ b/dmenu-xft/PKGBUILD @@ -1,7 +1,7 @@ # Maintainer: Bharani Deepan pkgname=dmenu-xft -pkgver=4.4 -pkgrel=2 +pkgver=4.5 +pkgrel=1 pkgdesc="Dynamic X menu - with xft support" url="http://tools.suckless.org/dmenu/" arch=('i686' 'x86_64') @@ -10,21 +10,19 @@ depends=('sh' 'libxinerama' 'libxft') conflicts=('dmenu') provides=('dmenu') source=(http://dl.suckless.org/tools/dmenu-$pkgver.tar.gz - dmenu-$pkgver-xft.patch) -md5sums=('ae1902fc37716f739836fddce6123ebc' - '93909033bd4d007e465c2a6592162069') + dmenu-4.5-xft.diff) +md5sums=('9c46169ed703732ec52ed946c27d84b4' + '0c73d595eb78f159bea83f33bba15e80') build() { cd $srcdir/dmenu-$pkgver - patch -p1 < ../dmenu-$pkgver-xft.patch + patch -p1 < ../dmenu-$pkgver-xft.diff make } package() { cd "$srcdir/dmenu-$pkgver" - make DESTDIR=$pkgdir PREFIX=/usr install || return 1 - mkdir -p $pkgdir/usr/share/licenses/$pkgname || return 1 - cp LICENSE $pkgdir/usr/share/licenses/$pkgname/ || return 1 + make DESTDIR=$pkgdir PREFIX=/usr install + install -Dm644 LICENSE "$pkgdir/usr/share/licenses/$pkgname/LICENSE" + } - - diff --git a/dmenu-xft/dmenu-4.4-xft.patch b/dmenu-xft/dmenu-4.4-xft.patch deleted file mode 100644 index 302e55e69..000000000 --- a/dmenu-xft/dmenu-4.4-xft.patch +++ /dev/null @@ -1,371 +0,0 @@ -diff -rup dmenu-4.4/config.mk dmenu-4.4-xft/config.mk ---- dmenu-4.4/config.mk 2011-07-20 02:01:28.000000000 +0530 -+++ dmenu-4.4-xft/config.mk 2011-08-03 21:46:43.767914223 +0530 -@@ -2,19 +2,24 @@ - VERSION = 4.4 - - # paths --PREFIX = /usr/local -+PREFIX = /usr - MANPREFIX = ${PREFIX}/share/man - - X11INC = /usr/X11R6/include - X11LIB = /usr/X11R6/lib - -+# Xft, comment if you don't want it -+XFTINC = /usr/include/freetype2 -+XFTLIBS = -lXft -lXrender -lfreetype -lz -lfontconfig -+ -+ - # Xinerama, comment if you don't want it - XINERAMALIBS = -lXinerama - XINERAMAFLAGS = -DXINERAMA - - # includes and libs --INCS = -I${X11INC} --LIBS = -L${X11LIB} -lX11 ${XINERAMALIBS} -+INCS = -I${X11INC} -I${XFTINC} -+LIBS = -L${X11LIB} -lX11 ${XINERAMALIBS} ${XFTLIBS} - - # flags - CPPFLAGS = -D_BSD_SOURCE -DVERSION=\"${VERSION}\" ${XINERAMAFLAGS} -Only in dmenu-4.4-xft: dmenu -diff -rup dmenu-4.4/dmenu.c dmenu-4.4-xft/dmenu.c ---- dmenu-4.4/dmenu.c 2011-07-20 02:01:28.000000000 +0530 -+++ dmenu-4.4-xft/dmenu.c 2011-08-03 21:38:49.000000000 +0530 -@@ -16,6 +16,8 @@ - #define INRECT(x,y,rx,ry,rw,rh) ((x) >= (rx) && (x) < (rx)+(rw) && (y) >= (ry) && (y) < (ry)+(rh)) - #define MIN(a,b) ((a) < (b) ? (a) : (b)) - #define MAX(a,b) ((a) > (b) ? (a) : (b)) -+#define DEFFONT "fixed" /* xft example: "Monospace-11" */ -+ - - typedef struct Item Item; - struct Item { -@@ -49,8 +51,8 @@ static const char *normbgcolor = "#ccccc - static const char *normfgcolor = "#000000"; - static const char *selbgcolor = "#0066ff"; - static const char *selfgcolor = "#ffffff"; --static unsigned long normcol[ColLast]; --static unsigned long selcol[ColLast]; -+static ColorSet *normcol; -+static ColorSet *selcol; - static Atom utf8; - static Bool topbar = True; - static DC *dc; -@@ -102,7 +104,9 @@ main(int argc, char *argv[]) { - usage(); - - dc = initdc(); -- initfont(dc, font); -+ initfont(dc, font ? font : DEFFONT); -+ normcol = initcolor(dc, normfgcolor, normbgcolor); -+ selcol = initcolor(dc, selfgcolor, selbgcolor); - - if(fast) { - grabkeyboard(); -@@ -165,7 +169,8 @@ drawmenu(void) { - dc->x = 0; - dc->y = 0; - dc->h = bh; -- drawrect(dc, 0, 0, mw, mh, True, BG(dc, normcol)); -+ drawrect(dc, 0, 0, mw, mh, True, normcol->BG); -+ - - if(prompt) { - dc->w = promptw; -@@ -175,7 +180,7 @@ drawmenu(void) { - dc->w = (lines > 0 || !matches) ? mw - dc->x : inputw; - drawtext(dc, text, normcol); - if((curpos = textnw(dc, text, cursor) + dc->h/2 - 2) < dc->w) -- drawrect(dc, curpos, 2, 1, dc->h - 4, True, FG(dc, normcol)); -+ drawrect(dc, curpos, 2, 1, dc->h - 4, True, normcol->FG); - - if(lines > 0) { - dc->w = mw - dc->x; -@@ -479,11 +484,12 @@ setup(void) { - XineramaScreenInfo *info; - #endif - -+ /* - normcol[ColBG] = getcolor(dc, normbgcolor); - normcol[ColFG] = getcolor(dc, normfgcolor); - selcol[ColBG] = getcolor(dc, selbgcolor); - selcol[ColFG] = getcolor(dc, selfgcolor); -- -+*/ - utf8 = XInternAtom(dc->dpy, "UTF8_STRING", False); - - /* menu geometry */ -Only in dmenu-4.4-xft: dmenu.o -diff -rup dmenu-4.4/draw.c dmenu-4.4-xft/draw.c ---- dmenu-4.4/draw.c 2011-07-20 02:01:28.000000000 +0530 -+++ dmenu-4.4-xft/draw.c 2011-08-03 21:38:49.000000000 +0530 -@@ -5,13 +5,11 @@ - #include - #include - #include -+#include - #include "draw.h" - - #define MAX(a, b) ((a) > (b) ? (a) : (b)) - #define MIN(a, b) ((a) < (b) ? (a) : (b)) --#define DEFAULTFN "fixed" -- --static Bool loadfont(DC *dc, const char *fontstr); - - void - drawrect(DC *dc, int x, int y, unsigned int w, unsigned int h, Bool fill, unsigned long color) { -@@ -23,7 +21,7 @@ drawrect(DC *dc, int x, int y, unsigned - } - - void --drawtext(DC *dc, const char *text, unsigned long col[ColLast]) { -+drawtext(DC *dc, const char *text, ColorSet *col) { - char buf[BUFSIZ]; - size_t mn, n = strlen(text); - -@@ -35,19 +33,25 @@ drawtext(DC *dc, const char *text, unsig - if(mn < n) - for(n = MAX(mn-3, 0); n < mn; buf[n++] = '.'); - -- drawrect(dc, 0, 0, dc->w, dc->h, True, BG(dc, col)); -+drawrect(dc, 0, 0, dc->w, dc->h, True, col->BG); -+ - drawtextn(dc, buf, mn, col); - } - - void --drawtextn(DC *dc, const char *text, size_t n, unsigned long col[ColLast]) { -+drawtextn(DC *dc, const char *text, size_t n, ColorSet *col) { - int x = dc->x + dc->font.height/2; - int y = dc->y + dc->font.ascent+1; - -- XSetForeground(dc->dpy, dc->gc, FG(dc, col)); -- if(dc->font.set) -- XmbDrawString(dc->dpy, dc->canvas, dc->font.set, dc->gc, x, y, text, n); -- else { -+ XSetForeground(dc->dpy, dc->gc, col->FG); -+ if(dc->font.xft_font) { -+ if (!dc->xftdraw) -+ eprintf("error, xft drawable does not exist"); -+ XftDrawStringUtf8(dc->xftdraw, &col->FG_xft, -+ dc->font.xft_font, x, y, (unsigned char*)text, n); -+ } else if(dc->font.set) { -+ XmbDrawString(dc->dpy, dc->canvas, dc->font.set, dc->gc, x, y, text, n); -+ } else { - XSetFont(dc->dpy, dc->gc, dc->font.xfont->fid); - XDrawString(dc->dpy, dc->canvas, dc->gc, x, y, text, n); - } -@@ -68,19 +72,53 @@ eprintf(const char *fmt, ...) { - exit(EXIT_FAILURE); - } - -+ void -+freecol(DC *dc, ColorSet *col) { -+ if(col) { -+ if(&col->FG_xft) -+ XftColorFree(dc->dpy, DefaultVisual(dc->dpy, DefaultScreen(dc->dpy)), -+ DefaultColormap(dc->dpy, DefaultScreen(dc->dpy)), &col->FG_xft); -+ free(col); -+ } -+} -+ -+ - void - freedc(DC *dc) { -+ if(dc->font.xft_font) { -+ XftFontClose(dc->dpy, dc->font.xft_font); -+ XftDrawDestroy(dc->xftdraw); -+ } - if(dc->font.set) - XFreeFontSet(dc->dpy, dc->font.set); - if(dc->font.xfont) - XFreeFont(dc->dpy, dc->font.xfont); - if(dc->canvas) - XFreePixmap(dc->dpy, dc->canvas); -- XFreeGC(dc->dpy, dc->gc); -- XCloseDisplay(dc->dpy); -- free(dc); -+ if(dc->gc) -+ XFreeGC(dc->dpy, dc->gc); -+ if(dc->dpy) -+ XCloseDisplay(dc->dpy); -+ if(dc) -+ free(dc); -+ -+} -+ -+ColorSet * -+initcolor(DC *dc, const char * foreground, const char * background) { -+ ColorSet * col = (ColorSet *)malloc(sizeof(ColorSet)); -+ if(!col) -+ eprintf("error, cannot allocate memory for color set"); -+ col->BG = getcolor(dc, background); -+ col->FG = getcolor(dc, foreground); -+ if(dc->font.xft_font) -+ if(!XftColorAllocName(dc->dpy, DefaultVisual(dc->dpy, DefaultScreen(dc->dpy)), -+ DefaultColormap(dc->dpy, DefaultScreen(dc->dpy)), foreground, &col->FG_xft)) -+ eprintf("error, cannot allocate xft font color '%s'\n", foreground); -+ return col; - } - -+ - unsigned long - getcolor(DC *dc, const char *colstr) { - Colormap cmap = DefaultColormap(dc->dpy, DefaultScreen(dc->dpy)); -@@ -101,6 +139,9 @@ initdc(void) { - eprintf("cannot malloc %u bytes:", sizeof *dc); - if(!(dc->dpy = XOpenDisplay(NULL))) - eprintf("cannot open display\n"); -+ dc->font.xft_font = NULL; -+ dc->xftdraw = NULL; -+ - - dc->gc = XCreateGC(dc->dpy, DefaultRootWindow(dc->dpy), 0, NULL); - XSetLineAttributes(dc->dpy, dc->gc, 1, LineSolid, CapButt, JoinMiter); -@@ -109,27 +150,21 @@ initdc(void) { - - void - initfont(DC *dc, const char *fontstr) { -- if(!loadfont(dc, fontstr ? fontstr : DEFAULTFN)) { -- if(fontstr != NULL) -- fprintf(stderr, "cannot load font '%s'\n", fontstr); -- if(fontstr == NULL || !loadfont(dc, DEFAULTFN)) -- eprintf("cannot load font '%s'\n", DEFAULTFN); -- } -- dc->font.height = dc->font.ascent + dc->font.descent; --} -- --Bool --loadfont(DC *dc, const char *fontstr) { -- char *def, **missing, **names; -+ char *def, **missing=NULL, **names; - int i, n = 1; - XFontStruct **xfonts; - -- if(!*fontstr) -- return False; - if((dc->font.set = XCreateFontSet(dc->dpy, fontstr, &missing, &n, &def))) - n = XFontsOfFontSet(dc->font.set, &xfonts, &names); - else if((dc->font.xfont = XLoadQueryFont(dc->dpy, fontstr))) - xfonts = &dc->font.xfont; -+ else if((dc->font.xft_font = XftFontOpenName(dc->dpy, -+ DefaultScreen(dc->dpy), fontstr))) { -+ dc->font.ascent = dc->font.xft_font->ascent; -+ dc->font.descent = dc->font.xft_font->descent; -+ dc->font.height = dc->font.ascent + dc->font.descent; -+ return; -+ } - else - n = 0; - -@@ -140,7 +175,7 @@ loadfont(DC *dc, const char *fontstr) { - } - if(missing) - XFreeStringList(missing); -- return (dc->font.set || dc->font.xfont); -+ dc->font.height = dc->font.ascent + dc->font.descent; - } - - void -@@ -150,6 +185,7 @@ mapdc(DC *dc, Window win, unsigned int w - - void - resizedc(DC *dc, unsigned int w, unsigned int h) { -+ int screen = DefaultScreen(dc->dpy); - if(dc->canvas) - XFreePixmap(dc->dpy, dc->canvas); - -@@ -157,17 +193,30 @@ resizedc(DC *dc, unsigned int w, unsigne - dc->h = h; - dc->canvas = XCreatePixmap(dc->dpy, DefaultRootWindow(dc->dpy), w, h, - DefaultDepth(dc->dpy, DefaultScreen(dc->dpy))); -+ -+ if(dc->font.xft_font && !(dc->xftdraw)) { -+ dc->xftdraw = XftDrawCreate(dc->dpy, dc->canvas, DefaultVisual(dc->dpy,screen), DefaultColormap(dc->dpy,screen)); -+ if(!(dc->xftdraw)) -+ eprintf("error, cannot create xft drawable\n"); -+ } -+ - } - - int - textnw(DC *dc, const char *text, size_t len) { -- if(dc->font.set) { -+ if(dc->font.xft_font) { -+ XGlyphInfo gi; -+ XftTextExtentsUtf8(dc->dpy, dc->font.xft_font, (const FcChar8*)text, len, &gi); -+ return gi.width; -+ } else if(dc->font.set) { - XRectangle r; - - XmbTextExtents(dc->font.set, text, len, NULL, &r); - return r.width; -- } -- return XTextWidth(dc->font.xfont, text, len); -+ } else { -+ return XTextWidth(dc->font.xfont, text, len); -+ } -+ - } - - int -diff -rup dmenu-4.4/draw.h dmenu-4.4-xft/draw.h ---- dmenu-4.4/draw.h 2011-07-20 02:01:28.000000000 +0530 -+++ dmenu-4.4-xft/draw.h 2011-08-03 21:38:49.000000000 +0530 -@@ -1,9 +1,9 @@ - /* See LICENSE file for copyright and license details. */ - --#define FG(dc, col) ((col)[(dc)->invert ? ColBG : ColFG]) --#define BG(dc, col) ((col)[(dc)->invert ? ColFG : ColBG]) - --enum { ColBG, ColFG, ColBorder, ColLast }; -+ -+#include -+ - - typedef struct { - int x, y, w, h; -@@ -11,6 +11,7 @@ typedef struct { - Display *dpy; - GC gc; - Pixmap canvas; -+ XftDraw *xftdraw; - struct { - int ascent; - int descent; -@@ -18,12 +19,21 @@ typedef struct { - int width; - XFontSet set; - XFontStruct *xfont; -+ XftFont *xft_font; - } font; - } DC; /* draw context */ - -+typedef struct { -+ unsigned long FG; -+ XftColor FG_xft; -+ unsigned long BG; -+} ColorSet; -+ -+ - void drawrect(DC *dc, int x, int y, unsigned int w, unsigned int h, Bool fill, unsigned long color); --void drawtext(DC *dc, const char *text, unsigned long col[ColLast]); --void drawtextn(DC *dc, const char *text, size_t n, unsigned long col[ColLast]); -+void drawtext(DC *dc, const char *text, ColorSet *col); -+void drawtextn(DC *dc, const char *text, size_t n, ColorSet *col); -+void freecol(DC *dc, ColorSet *col); - void eprintf(const char *fmt, ...); - void freedc(DC *dc); - unsigned long getcolor(DC *dc, const char *colstr); -@@ -33,3 +43,6 @@ void mapdc(DC *dc, Window win, unsigned - void resizedc(DC *dc, unsigned int w, unsigned int h); - int textnw(DC *dc, const char *text, size_t len); - int textw(DC *dc, const char *text); -+ColorSet *initcolor(DC *dc, const char *foreground, const char *background); -+ -+ -Only in dmenu-4.4-xft: draw.o -Only in dmenu-4.4-xft: lsx -Only in dmenu-4.4-xft: lsx.o diff --git a/dmenu-xft/dmenu-4.5-xft.diff b/dmenu-xft/dmenu-4.5-xft.diff new file mode 100644 index 000000000..ff93337ca --- /dev/null +++ b/dmenu-xft/dmenu-4.5-xft.diff @@ -0,0 +1,418 @@ +diff -upr a/config.mk b/config.mk +--- a/config.mk 2012-01-10 19:03:22.000000000 +0200 ++++ b/config.mk 2012-01-10 19:03:38.000000000 +0200 +@@ -12,9 +12,13 @@ X11LIB = /usr/X11R6/lib + XINERAMALIBS = -lXinerama + XINERAMAFLAGS = -DXINERAMA + ++# Xft, comment if you don't want it ++XFTINC = -I/usr/include/freetype2 ++XFTLIBS = -lXft -lXrender -lfreetype -lz -lfontconfig ++ + # includes and libs +-INCS = -I${X11INC} +-LIBS = -L${X11LIB} -lX11 ${XINERAMALIBS} ++INCS = -I${X11INC} ${XFTINC} ++LIBS = -L${X11LIB} -lX11 ${XINERAMALIBS} ${XFTLIBS} + + # flags + CPPFLAGS = -D_BSD_SOURCE -D_POSIX_C_SOURCE=2 -DVERSION=\"${VERSION}\" ${XINERAMAFLAGS} +diff -upr a/dmenu.1 b/dmenu.1 +--- a/dmenu.1 2012-01-10 19:14:19.000000000 +0200 ++++ b/dmenu.1 2012-01-10 19:14:23.000000000 +0200 +@@ -53,7 +53,7 @@ dmenu lists items vertically, with the g + defines the prompt to be displayed to the left of the input field. + .TP + .BI \-fn " font" +-defines the font or font set used. ++defines the font or font set used. eg. "fixed" or "Monospace-12:normal" (an xft font) + .TP + .BI \-nb " color" + defines the normal background color. +diff -upr a/dmenu.c b/dmenu.c +--- a/dmenu.c 2012-01-10 19:14:19.000000000 +0200 ++++ b/dmenu.c 2012-01-10 19:24:39.000000000 +0200 +@@ -17,6 +17,7 @@ + * MAX(0, MIN((y)+(h),(r).y_org+(r).height) - MAX((y),(r).y_org))) + #define MIN(a,b) ((a) < (b) ? (a) : (b)) + #define MAX(a,b) ((a) > (b) ? (a) : (b)) ++#define DEFFONT "fixed" /* xft example: "Monospace-11" */ + + typedef struct Item Item; + struct Item { +@@ -26,6 +27,7 @@ struct Item { + + static void appenditem(Item *item, Item **list, Item **last); + static void calcoffsets(void); ++static void cleanup(void); + static char *cistrstr(const char *s, const char *sub); + static void drawmenu(void); + static void grabkeyboard(void); +@@ -50,10 +52,12 @@ static const char *normfgcolor = "#bbbbb + static const char *selbgcolor = "#005577"; + static const char *selfgcolor = "#eeeeee"; + static unsigned int lines = 0; +-static unsigned long normcol[ColLast]; +-static unsigned long selcol[ColLast]; ++static ColorSet *normcol; ++static ColorSet *selcol; + static Atom clip, utf8; + static Bool topbar = True; ++static Bool running = True; ++static int ret = 0; + static DC *dc; + static Item *items = NULL; + static Item *matches, *matchend; +@@ -104,7 +108,9 @@ main(int argc, char *argv[]) { + usage(); + + dc = initdc(); +- initfont(dc, font); ++ initfont(dc, font ? font : DEFFONT); ++ normcol = initcolor(dc, normfgcolor, normbgcolor); ++ selcol = initcolor(dc, selfgcolor, selbgcolor); + + if(fast) { + grabkeyboard(); +@@ -117,7 +123,8 @@ main(int argc, char *argv[]) { + setup(); + run(); + +- return 1; /* unreachable */ ++ cleanup(); ++ return ret; + } + + void +@@ -160,6 +167,15 @@ cistrstr(const char *s, const char *sub) + } + + void ++cleanup(void) { ++ freecol(dc, normcol); ++ freecol(dc, selcol); ++ XDestroyWindow(dc->dpy, win); ++ XUngrabKeyboard(dc->dpy, CurrentTime); ++ freedc(dc); ++} ++ ++void + drawmenu(void) { + int curpos; + Item *item; +@@ -167,7 +183,7 @@ drawmenu(void) { + dc->x = 0; + dc->y = 0; + dc->h = bh; +- drawrect(dc, 0, 0, mw, mh, True, BG(dc, normcol)); ++ drawrect(dc, 0, 0, mw, mh, True, normcol->BG); + + if(prompt) { + dc->w = promptw; +@@ -178,7 +194,7 @@ drawmenu(void) { + dc->w = (lines > 0 || !matches) ? mw - dc->x : inputw; + drawtext(dc, text, normcol); + if((curpos = textnw(dc, text, cursor) + dc->h/2 - 2) < dc->w) +- drawrect(dc, curpos, 2, 1, dc->h - 4, True, FG(dc, normcol)); ++ drawrect(dc, curpos, 2, 1, dc->h - 4, True, normcol->FG); + + if(lines > 0) { + /* draw vertical list */ +@@ -321,7 +337,8 @@ keypress(XKeyEvent *ev) { + sel = matchend; + break; + case XK_Escape: +- exit(EXIT_FAILURE); ++ ret = EXIT_FAILURE; ++ running = False; + case XK_Home: + if(sel == matches) { + cursor = 0; +@@ -359,7 +376,8 @@ keypress(XKeyEvent *ev) { + case XK_Return: + case XK_KP_Enter: + puts((sel && !(ev->state & ShiftMask)) ? sel->text : text); +- exit(EXIT_SUCCESS); ++ ret = EXIT_SUCCESS; ++ running = False; + case XK_Right: + if(text[cursor] != '\0') { + cursor = nextrune(+1); +@@ -490,7 +508,7 @@ void + run(void) { + XEvent ev; + +- while(!XNextEvent(dc->dpy, &ev)) { ++ while(running && !XNextEvent(dc->dpy, &ev)) { + if(XFilterEvent(&ev, win)) + continue; + switch(ev.type) { +@@ -524,11 +542,6 @@ setup(void) { + XineramaScreenInfo *info; + #endif + +- normcol[ColBG] = getcolor(dc, normbgcolor); +- normcol[ColFG] = getcolor(dc, normfgcolor); +- selcol[ColBG] = getcolor(dc, selbgcolor); +- selcol[ColFG] = getcolor(dc, selfgcolor); +- + clip = XInternAtom(dc->dpy, "CLIPBOARD", False); + utf8 = XInternAtom(dc->dpy, "UTF8_STRING", False); + +@@ -582,7 +595,7 @@ setup(void) { + + /* create menu window */ + swa.override_redirect = True; +- swa.background_pixel = normcol[ColBG]; ++ swa.background_pixel = normcol->BG; + swa.event_mask = ExposureMask | KeyPressMask | VisibilityChangeMask; + win = XCreateWindow(dc->dpy, root, x, y, mw, mh, 0, + DefaultDepth(dc->dpy, screen), CopyFromParent, +diff -upr a/draw.c b/draw.c +--- a/draw.c 2012-01-10 19:14:19.000000000 +0200 ++++ b/draw.c 2012-01-10 19:14:23.000000000 +0200 +@@ -9,9 +9,6 @@ + + #define MAX(a, b) ((a) > (b) ? (a) : (b)) + #define MIN(a, b) ((a) < (b) ? (a) : (b)) +-#define DEFAULTFN "fixed" +- +-static Bool loadfont(DC *dc, const char *fontstr); + + void + drawrect(DC *dc, int x, int y, unsigned int w, unsigned int h, Bool fill, unsigned long color) { +@@ -23,7 +20,7 @@ drawrect(DC *dc, int x, int y, unsigned + } + + void +-drawtext(DC *dc, const char *text, unsigned long col[ColLast]) { ++drawtext(DC *dc, const char *text, ColorSet *col) { + char buf[BUFSIZ]; + size_t mn, n = strlen(text); + +@@ -35,19 +32,24 @@ drawtext(DC *dc, const char *text, unsig + if(mn < n) + for(n = MAX(mn-3, 0); n < mn; buf[n++] = '.'); + +- drawrect(dc, 0, 0, dc->w, dc->h, True, BG(dc, col)); ++ drawrect(dc, 0, 0, dc->w, dc->h, True, col->BG); + drawtextn(dc, buf, mn, col); + } + + void +-drawtextn(DC *dc, const char *text, size_t n, unsigned long col[ColLast]) { ++drawtextn(DC *dc, const char *text, size_t n, ColorSet *col) { + int x = dc->x + dc->font.height/2; + int y = dc->y + dc->font.ascent+1; + +- XSetForeground(dc->dpy, dc->gc, FG(dc, col)); +- if(dc->font.set) ++ XSetForeground(dc->dpy, dc->gc, col->FG); ++ if(dc->font.xft_font) { ++ if (!dc->xftdraw) ++ eprintf("error, xft drawable does not exist"); ++ XftDrawStringUtf8(dc->xftdraw, &col->FG_xft, ++ dc->font.xft_font, x, y, (unsigned char*)text, n); ++ } else if(dc->font.set) { + XmbDrawString(dc->dpy, dc->canvas, dc->font.set, dc->gc, x, y, text, n); +- else { ++ } else { + XSetFont(dc->dpy, dc->gc, dc->font.xfont->fid); + XDrawString(dc->dpy, dc->canvas, dc->gc, x, y, text, n); + } +@@ -69,16 +71,33 @@ eprintf(const char *fmt, ...) { + } + + void ++freecol(DC *dc, ColorSet *col) { ++ if(col) { ++ if(&col->FG_xft) ++ XftColorFree(dc->dpy, DefaultVisual(dc->dpy, DefaultScreen(dc->dpy)), ++ DefaultColormap(dc->dpy, DefaultScreen(dc->dpy)), &col->FG_xft); ++ free(col); ++ } ++} ++ ++void + freedc(DC *dc) { ++ if(dc->font.xft_font) { ++ XftFontClose(dc->dpy, dc->font.xft_font); ++ XftDrawDestroy(dc->xftdraw); ++ } + if(dc->font.set) + XFreeFontSet(dc->dpy, dc->font.set); +- if(dc->font.xfont) ++ if(dc->font.xfont) + XFreeFont(dc->dpy, dc->font.xfont); +- if(dc->canvas) ++ if(dc->canvas) + XFreePixmap(dc->dpy, dc->canvas); +- XFreeGC(dc->dpy, dc->gc); +- XCloseDisplay(dc->dpy); +- free(dc); ++ if(dc->gc) ++ XFreeGC(dc->dpy, dc->gc); ++ if(dc->dpy) ++ XCloseDisplay(dc->dpy); ++ if(dc) ++ free(dc); + } + + unsigned long +@@ -91,6 +110,20 @@ getcolor(DC *dc, const char *colstr) { + return color.pixel; + } + ++ColorSet * ++initcolor(DC *dc, const char * foreground, const char * background) { ++ ColorSet * col = (ColorSet *)malloc(sizeof(ColorSet)); ++ if(!col) ++ eprintf("error, cannot allocate memory for color set"); ++ col->BG = getcolor(dc, background); ++ col->FG = getcolor(dc, foreground); ++ if(dc->font.xft_font) ++ if(!XftColorAllocName(dc->dpy, DefaultVisual(dc->dpy, DefaultScreen(dc->dpy)), ++ DefaultColormap(dc->dpy, DefaultScreen(dc->dpy)), foreground, &col->FG_xft)) ++ eprintf("error, cannot allocate xft font color '%s'\n", foreground); ++ return col; ++} ++ + DC * + initdc(void) { + DC *dc; +@@ -109,39 +142,33 @@ initdc(void) { + + void + initfont(DC *dc, const char *fontstr) { +- if(!loadfont(dc, fontstr ? fontstr : DEFAULTFN)) { +- if(fontstr != NULL) +- fprintf(stderr, "cannot load font '%s'\n", fontstr); +- if(fontstr == NULL || !loadfont(dc, DEFAULTFN)) +- eprintf("cannot load font '%s'\n", DEFAULTFN); +- } +- dc->font.height = dc->font.ascent + dc->font.descent; +-} +- +-Bool +-loadfont(DC *dc, const char *fontstr) { + char *def, **missing, **names; + int i, n; + XFontStruct **xfonts; + +- if(!*fontstr) +- return False; +- if((dc->font.set = XCreateFontSet(dc->dpy, fontstr, &missing, &n, &def))) { ++ missing = NULL; ++ if((dc->font.xfont = XLoadQueryFont(dc->dpy, fontstr))) { ++ dc->font.ascent = dc->font.xfont->ascent; ++ dc->font.descent = dc->font.xfont->descent; ++ dc->font.width = dc->font.xfont->max_bounds.width; ++ } else if((dc->font.set = XCreateFontSet(dc->dpy, fontstr, &missing, &n, &def))) { + n = XFontsOfFontSet(dc->font.set, &xfonts, &names); + for(i = 0; i < n; i++) { + dc->font.ascent = MAX(dc->font.ascent, xfonts[i]->ascent); + dc->font.descent = MAX(dc->font.descent, xfonts[i]->descent); + dc->font.width = MAX(dc->font.width, xfonts[i]->max_bounds.width); + } +- } +- else if((dc->font.xfont = XLoadQueryFont(dc->dpy, fontstr))) { +- dc->font.ascent = dc->font.xfont->ascent; +- dc->font.descent = dc->font.xfont->descent; +- dc->font.width = dc->font.xfont->max_bounds.width; ++ } else if((dc->font.xft_font = XftFontOpenName(dc->dpy, DefaultScreen(dc->dpy), fontstr))) { ++ dc->font.ascent = dc->font.xft_font->ascent; ++ dc->font.descent = dc->font.xft_font->descent; ++ dc->font.width = dc->font.xft_font->max_advance_width; ++ } else { ++ eprintf("cannot load font '%s'\n", fontstr); + } + if(missing) + XFreeStringList(missing); +- return dc->font.set || dc->font.xfont; ++ dc->font.height = dc->font.ascent + dc->font.descent; ++ return; + } + + void +@@ -151,20 +178,29 @@ mapdc(DC *dc, Window win, unsigned int w + + void + resizedc(DC *dc, unsigned int w, unsigned int h) { ++ int screen = DefaultScreen(dc->dpy); + if(dc->canvas) + XFreePixmap(dc->dpy, dc->canvas); + + dc->w = w; + dc->h = h; + dc->canvas = XCreatePixmap(dc->dpy, DefaultRootWindow(dc->dpy), w, h, +- DefaultDepth(dc->dpy, DefaultScreen(dc->dpy))); ++ DefaultDepth(dc->dpy, screen)); ++ if(dc->font.xft_font && !(dc->xftdraw)) { ++ dc->xftdraw = XftDrawCreate(dc->dpy, dc->canvas, DefaultVisual(dc->dpy,screen), DefaultColormap(dc->dpy,screen)); ++ if(!(dc->xftdraw)) ++ eprintf("error, cannot create xft drawable\n"); ++ } + } + + int + textnw(DC *dc, const char *text, size_t len) { +- if(dc->font.set) { ++ if(dc->font.xft_font) { ++ XGlyphInfo gi; ++ XftTextExtentsUtf8(dc->dpy, dc->font.xft_font, (const FcChar8*)text, len, &gi); ++ return gi.width; ++ } else if(dc->font.set) { + XRectangle r; +- + XmbTextExtents(dc->font.set, text, len, NULL, &r); + return r.width; + } +diff -upr a/draw.h b/draw.h +--- a/draw.h 2012-01-10 19:14:19.000000000 +0200 ++++ b/draw.h 2012-01-10 19:14:23.000000000 +0200 +@@ -1,9 +1,6 @@ + /* See LICENSE file for copyright and license details. */ + +-#define FG(dc, col) ((col)[(dc)->invert ? ColBG : ColFG]) +-#define BG(dc, col) ((col)[(dc)->invert ? ColFG : ColBG]) +- +-enum { ColBG, ColFG, ColBorder, ColLast }; ++#include + + typedef struct { + int x, y, w, h; +@@ -11,6 +8,7 @@ typedef struct { + Display *dpy; + GC gc; + Pixmap canvas; ++ XftDraw *xftdraw; + struct { + int ascent; + int descent; +@@ -18,15 +16,24 @@ typedef struct { + int width; + XFontSet set; + XFontStruct *xfont; ++ XftFont *xft_font; + } font; + } DC; /* draw context */ + ++typedef struct { ++ unsigned long FG; ++ XftColor FG_xft; ++ unsigned long BG; ++} ColorSet; ++ + void drawrect(DC *dc, int x, int y, unsigned int w, unsigned int h, Bool fill, unsigned long color); +-void drawtext(DC *dc, const char *text, unsigned long col[ColLast]); +-void drawtextn(DC *dc, const char *text, size_t n, unsigned long col[ColLast]); ++void drawtext(DC *dc, const char *text, ColorSet *col); ++void drawtextn(DC *dc, const char *text, size_t n, ColorSet *col); ++void freecol(DC *dc, ColorSet *col); + void eprintf(const char *fmt, ...); + void freedc(DC *dc); + unsigned long getcolor(DC *dc, const char *colstr); ++ColorSet *initcolor(DC *dc, const char *foreground, const char *background); + DC *initdc(void); + void initfont(DC *dc, const char *fontstr); + void mapdc(DC *dc, Window win, unsigned int w, unsigned int h); diff --git a/glances-git/PKGBUILD b/glances-git/PKGBUILD dissimilarity index 64% index 7b43c2728..a0824a758 100644 --- a/glances-git/PKGBUILD +++ b/glances-git/PKGBUILD @@ -1,43 +1,47 @@ -pkgname=glances-git -pkgver=20111205 -pkgrel=1 -pkgdesc="Curses-based system monitor" -arch=('i686' 'x86_64') -url="https://github.com/nicolargo/" -license=('LGPL') -depends=('ncurses' 'pystatgrab') -provides=('glances') - -_gitroot="https://github.com/nicolargo/glances.git" -_gitname="glances" - -build() { - cd $srcdir - - if [ -d $_gitname ]; then - cd $_gitname && git pull origin || return 1 - else - git clone $_gitroot || return 1 - fi - - cp -r $srcdir/$_gitname{,-build} - cd $srcdir/$_gitname-build - - ./configure --prefix=/usr PYTHON=/usr/bin/python2 --docdir=/usr/share/doc || return 1 - - sed -i 's/python/env python2/' $srcdir/$_gitname-build/src/glances.py - sed -i 's/glances.py/glances/' $srcdir/$_gitname-build/src/glances.py - - make || return 1 - -} - -package() { - cd $srcdir/$_gitname-build - - make DESTDIR=$pkgdir install || return 1 - - mv $pkgdir/usr/bin/glances{.py,} -} - -# vim:ts=2:sw=2:et: +pkgname=glances-git +pkgver=20120114 +pkgrel=1 +pkgdesc="Curses-based system monitor" +arch=('any') +url="https://github.com/nicolargo/" +license=('GPL') +depends=('ncurses' 'pystatgrab') +provides=('glances') + +_gitroot="https://github.com/nicolargo/glances.git" +_gitname="glances" + +build() { + cd "${srcdir}" + msg "Connecting to GIT server...." + if [ -d ${_gitname} ] ; then + cd ${_gitname} && git pull origin + msg "The local files are updated." + else + git clone ${_gitroot} ${_gitname} + fi + + msg "GIT checkout done or server timeout" + rm -rf "${srcdir}/${_gitname}-build" + git clone "${srcdir}/${_gitname}" "${srcdir}/${_gitname}-build" + cd "${srcdir}/${_gitname}-build" + + ./autogen.sh --prefix=/usr --datadir=/usr/share + + sed -i 's/python$/python2/' $srcdir/$_gitname-build/src/glances.py + sed -i 's/glances\.py/glances/' $srcdir/$_gitname-build/src/glances.py + + make + +} + +package() { + cd "${srcdir}/${_gitname}-build" + + make DESTDIR=$pkgdir install + + mv $pkgdir/usr/bin/glances{.py,} +} + +# vim:ts=2:sw=2:et: + diff --git a/google-glog/PKGBUILD b/google-glog/PKGBUILD index 189b1942a..35ad9ddb8 100644 --- a/google-glog/PKGBUILD +++ b/google-glog/PKGBUILD @@ -1,6 +1,6 @@ # Maintainer: Ian Yang pkgname=google-glog -pkgver=0.3.1 +pkgver=0.3.2 pkgrel=0 pkgdesc="Logging library for C++" arch=(i686 x86_64) @@ -10,7 +10,7 @@ depends=('gcc-libs') makedepends=('make' 'gcc') options=('!libtool') source=(http://google-glog.googlecode.com/files/glog-${pkgver}.tar.gz) -md5sums=('91ccd3db0ae5a3614df6db0bcfd4e142') +md5sums=('897fbff90d91ea2b6d6e78c8cea641cc') build() { cd ${startdir}/src/glog-${pkgver} diff --git a/gqview-devel/PKGBUILD b/gqview-devel/PKGBUILD index 857564e93..f5fe1aea3 100644 --- a/gqview-devel/PKGBUILD +++ b/gqview-devel/PKGBUILD @@ -4,7 +4,7 @@ pkgname=gqview-devel _pkgname=gqview pkgver=2.1.5 -pkgrel=2 +pkgrel=3 pkgdesc="An image browser and viewer" arch=('i686' 'x86_64') url="http://gqview.sourceforge.net/" @@ -16,7 +16,7 @@ source=(http://downloads.sourceforge.net/${_pkgname}/${_pkgname}-${pkgver}.tar.g md5sums=('4644187d9b14b1dc11ac3bb146f262ea') build() { cd "$srcdir/${_pkgname}-$pkgver" - ./configure --prefix=/usr + LDFLAGS+=-lm ./configure --prefix=/usr make } diff --git a/gstreamer0.10-bad-git/PKGBUILD b/gstreamer0.10-bad-git/PKGBUILD index 7743930e0..7bcf183a6 100644 --- a/gstreamer0.10-bad-git/PKGBUILD +++ b/gstreamer0.10-bad-git/PKGBUILD @@ -23,7 +23,7 @@ _gitname=gst-plugins-bad build() { cd "${srcdir}" if [ -d "${_gitname}" ] ; then - cd "${_gitname}" && git pull + cd "${_gitname}" && git pull && cd .. else git clone --depth 1 "${_gitroot}" cd "${_gitname}" && git checkout 0.10 && cd .. @@ -68,4 +68,4 @@ package_gstreamer0.10-bad-plugins-git() { make -C ext DESTDIR="${pkgdir}" install make -C sys DESTDIR="${pkgdir}" install -} \ No newline at end of file +} diff --git a/gstreamer0.10-ffmpeg-git/PKGBUILD b/gstreamer0.10-ffmpeg-git/PKGBUILD dissimilarity index 88% index bb9da8813..d5b55f1df 100644 --- a/gstreamer0.10-ffmpeg-git/PKGBUILD +++ b/gstreamer0.10-ffmpeg-git/PKGBUILD @@ -1,38 +1,44 @@ -# Maintainer: Thijs Vermeir - -_realname=gstreamer0.10-ffmpeg -_upname=gst-ffmpeg -_upver=0.10.8.1 -pkgname=${_realname}-git -pkgver=20090820 -pkgrel=1 -pkgdesc="GStreamer Multimedia Framework Ffmpeg plugins" -arch=(i686 x86_64) -license=('GPL') -depends=('gstreamer0.10-base-git' 'bzip2') -makedepends=('pkgconfig') -conflicts=("${_realname}" "${_realname}-plugins") -provides=("${_realname}=${_upver}" "${_realname}-plugins=${_upver}") -options=(!libtool) -url="http://gstreamer.freedesktop.org/" -source=() -md5sums=() -groups=('gstreamer') - -_gitroot=git://anongit.freedesktop.org/gstreamer/${_upname} -_gitname=master - -build() { - cd "${srcdir}" - if [ -d "${_upname}" ] ; then - cd "${_upname}" && git pull --rebase || return 1 - else - git clone --depth 1 "${_gitroot}" || return 1 - cd "${_upname}" - fi - sh autogen.sh --prefix=/usr --sysconfdir=/etc --localstatedir=/var \ - --disable-static || return 1 - make || return 1 - make DESTDIR="${pkgdir}" install || return 1 -} - +# Maintainer: Jesse Jaara + +pkgname=gstreamer0.10-ffmpeg-git +pkgver=20120115 +pkgrel=1 +pkgdesc="Gstreamer FFMpeg Plugin git version" +arch=('i686' 'x86_64') +license=('GPL') +depends=('gstreamer0.10-base-git' 'bzip2') +makedepends=('pkgconfig' 'yasm' 'sdl') +url="http://www.gstreamer.net" +groups=('gstreamer0.10-plugins') +options=('!libtool') + +_gitname=gst-ffmpeg +_gitroot=git://anongit.freedesktop.org/gstreamer/${_gitname} + + +build() { + cd "${srcdir}" + + if [ -d "${_gitname}" ] ; then + cd "${_gitname}" && git pull && cd .. + else + git clone --depth 1 "${_gitroot}" + fi + + rm -rf build + cp -r ${_gitname} build + cd build + + unset CFLAGS + unset CXXFLAGS + ./autogen.sh --noconfigure + ./configure --prefix=/usr --sysconfdir=/etc --localstatedir=/var --disable-static --with-ffmpeg-extra-configure="--enable-runtime-cpudetect" + + make +} + +package() { + cd "${srcdir}/build" + + make DESTDIR="${pkgdir}" install +} diff --git a/gstreamer0.10-ugly-git/PKGBUILD b/gstreamer0.10-ugly-git/PKGBUILD dissimilarity index 86% index 96a493e85..7ef45fb14 100644 --- a/gstreamer0.10-ugly-git/PKGBUILD +++ b/gstreamer0.10-ugly-git/PKGBUILD @@ -1,38 +1,64 @@ -# Maintainer: Thijs Vermeir - -_realname=gstreamer0.10-ugly -_upname=gst-plugins-ugly -_upver=0.10.15.1 -pkgname=${_realname}-git -pkgver=20100719 -pkgrel=1 -pkgdesc="GStreamer Multimedia Framework Ugly plugins" -arch=(i686 x86_64) -license=('LGPL') -depends=('gstreamer0.10-base-git' 'libdvdread' 'lame' 'libmpeg2' 'a52dec' 'libid3tag' 'libcdio' 'libmad' 'x264' 'libsidplay') -makedepends=('pkgconfig') -conflicts=("${_realname}" "${_realname}-plugins") -provides=("${_realname}=${_upver}" "${_realname}-plugins=${_upver}") -options=(!libtool) -url="http://gstreamer.freedesktop.org/" -source=() -md5sums=() -groups=('gstreamer') - -_gitroot=git://anongit.freedesktop.org/gstreamer/${_upname} -_gitname=master - -build() { - cd "${srcdir}" - if [ -d "${_upname}" ] ; then - cd "${_upname}" && git pull --rebase || return 1 - else - git clone --depth 1 "${_gitroot}" || return 1 - cd "${_upname}" - fi - sh autogen.sh --prefix=/usr --sysconfdir=/etc --localstatedir=/var \ - --disable-static || return 1 - make || return 1 - make DESTDIR="${pkgdir}" install || return 1 -} - +# Maintainer: Jesse Jaara + +_upver=0.10.18 +pkgbase=('gstreamer0.10-ugly-git') +pkgname=gstreamer0.10-ugly-git +true && pkgname=('gstreamer0.10-ugly-git' 'gstreamer0.10-ugly-plugins-git') +pkgver=20120115 +pkgrel=1 +pkgdesc="GStreamer Multimedia Framework ugly plugins" +arch=(i686 x86_64) +license=('LGPL') +makedepends=('pkgconfig' 'gstreamer0.10-base-git' 'libdvdread' 'lame' 'libmpeg2' 'a52dec' 'libmad' 'libsidplay' 'libcdio' 'x264' 'opencore-amr') +options=(!libtool) +url="http://gstreamer.freedesktop.org/" + + +_gitroot=git://anongit.freedesktop.org/gstreamer/${_gitname} +_gitname=gst-plugins-ugly + +build() { + cd "${srcdir}" + if [ -d "${_gitname}" ] ; then + cd "${_gitname}" && git pull && cd .. + else + git clone --depth 1 "${_gitroot}" + cd "${_gitname}" && git checkout 0.10 && cd .. + fi + + rm -rf build + cp -r ${_gitname} build + cd build + + ./autogen.sh --noconfigure + ./configure --prefix=/usr --sysconfdir=/etc --localstatedir=/var \ + --disable-static --enable-experimental \ + --with-package-name="GStreamer Bad Plugins (Archlinux)" \ + --with-package-origin="http://www.archlinux.org/" + + make +} + + +package_gstreamer0.10-ugly-git() { + pkgdesc="GStreamer Multimedia Framework Bad Plugin libraries (gst-plugins-ugly)" + depends=('gstreamer0.10-base-git') + conflicts=('gstreamer0.10-ugly') + provides=("gstreamer0.10-ugly=${_upver}") + groups=('gstreamer0.10-plugins') + + cd "${srcdir}/build" + make DESTDIR="${pkgdir}" install + make -C ext DESTDIR="${pkgdir}" uninstall +} + +package_gstreamer0.10-ugly-plugins-git() { + pkgdesc="GStreamer Multimedia Framework Bad Plugins (gst-plugins-ugly)" + depends=("gstreamer0.10-ugly-git=${pkgver}" 'libdvdread' 'lame' 'libmpeg2' 'a52dec' 'libmad' 'libsidplay' 'libcdio' 'x264' 'opencore-amr') + conflicts=('gstreamer0.10-ugly-plugins') + provides=("gstreamer0.10-ugly-plugins=${_upver}") + groups=('gstreamer0.10-plugins') + + cd "${srcdir}/build" + make -C ext DESTDIR="${pkgdir}" install +} diff --git a/hda-jack-retask-bzr/Changelog b/hda-jack-retask-bzr/Changelog index 869086255..5dd9ccc07 100644 --- a/hda-jack-retask-bzr/Changelog +++ b/hda-jack-retask-bzr/Changelog @@ -1,3 +1,9 @@ +2012-01-15 Julien Nicoulaud + + * 9-1 : + Update from upstream. + Deploy desktop application entry. + 2011-11-30 Julien Nicoulaud * 6-1 : diff --git a/hda-jack-retask-bzr/PKGBUILD b/hda-jack-retask-bzr/PKGBUILD index e5ecebf98..a60caf473 100644 --- a/hda-jack-retask-bzr/PKGBUILD +++ b/hda-jack-retask-bzr/PKGBUILD @@ -1,15 +1,17 @@ # Maintainer: Julien Nicoulaud # Source: https://github.com/nicoulaj/archlinux-packages pkgname=hda-jack-retask-bzr -pkgver=6 +_pkgname=hda-jack-retask +pkgver=9 pkgrel=1 pkgdesc="Retask your jack plugs (eg. turn your microphone jack plug into a headphone one)." -arch=('x86' 'x86_64') +arch=(x86 x86_64) url="https://code.launchpad.net/~diwic/+junk/hda-jack-retask" license=(GPL2) -depends=(gtk3) +depends=(gtk3 desktop-file-utils) makedepends=(bzr) changelog=Changelog +install=${pkgname}.install _bzrtrunk="https://code.launchpad.net/~diwic/+junk/hda-jack-retask" _bzrmod="hda-jack-retask" @@ -28,10 +30,26 @@ build() { msg2 "Building..." cd "${srcdir}/${_bzrmod}" - make + make || return 1 + + msg2 "Generate desktop application entry..." + cat > "${srcdir}"/${_pkgname}.desktop << EOF +[Desktop Entry] +Name=HDA jack retask +Comment=${pkgdesc} +Exec=/usr/bin/hda-jack-retask +Terminal=false +Icon=applications-system +Type=Application +Categories=Settings;HardwareSettings; +EOF } package() { + msg2 "Installing..." cd "${srcdir}/${_bzrmod}" make install DESTDIR="${pkgdir}" + + msg2 "Install desktop application entry in /usr/share/applications..." + install -Dm644 "${srcdir}"/${_pkgname}.desktop "${pkgdir}"/usr/share/applications/${_pkgname}.desktop } diff --git a/hda-jack-retask-bzr/hda-jack-retask-bzr.install b/hda-jack-retask-bzr/hda-jack-retask-bzr.install new file mode 100644 index 000000000..1f1acc3d5 --- /dev/null +++ b/hda-jack-retask-bzr/hda-jack-retask-bzr.install @@ -0,0 +1,9 @@ +post_install() { + update-desktop-database -q +} + +post_upgrade() { + post_install $1 +} + +# vim:set ts=2 sw=2 et: diff --git a/jmeter-plugins/PKGBUILD b/jmeter-plugins/PKGBUILD index 868d1ca0c..680a9f369 100644 --- a/jmeter-plugins/PKGBUILD +++ b/jmeter-plugins/PKGBUILD @@ -3,7 +3,7 @@ # TODO Add serverAgent stuff to the package. pkgname=jmeter-plugins _pkgname=JMeterPlugins -pkgver=0.5.0 +pkgver=0.5.1 pkgrel=1 pkgdesc="Custom set of plugins for Apache JMeter." arch=(any) @@ -14,7 +14,7 @@ optdepends=('zsh-completions:auto-completion for the jmeter-plugins command on Z changelog=Changelog options=(!strip) source=(http://${pkgname}.googlecode.com/files/${_pkgname}-${pkgver}.zip) -md5sums=('e2dcc8242bcfbfe1ce942e88fb0da6c6') +md5sums=('db7ffbb06991317bc7b3761402ec7087') build() { msg2 "Generate executable script for /usr/bin..." diff --git a/kindlegen/PKGBUILD b/kindlegen/PKGBUILD index 304d6321b..03a5e1367 100644 --- a/kindlegen/PKGBUILD +++ b/kindlegen/PKGBUILD @@ -1,14 +1,14 @@ # Contributor: Valentin-Costel Haloiu pkgname=kindlegen -pkgver=1.2 -pkgrel=2 +pkgver=2 +pkgrel=1 pkgdesc="KindleGen is a command line tool used to build eBooks that can be sold through Amazon's Kindle platform." arch=('i686' 'x86_64') url="http://www.amazon.com/gp/feature.html?docId=1000234621" license=(custom) source=("http://s3.amazonaws.com/kindlegen/${pkgname}_linux_2.6_i386_v${pkgver}.tar.gz") -md5sums=('3bbd7ee6d3e60863e4237ba315c39d23') +md5sums=('7bba7e904a116ca10daa20c1e78a2e82') build() { install -D -m755 $srcdir/kindlegen $pkgdir/usr/bin/kindlegen diff --git a/mbeancmd/PKGBUILD b/mbeancmd/PKGBUILD index 1390d09c9..2600d4532 100644 --- a/mbeancmd/PKGBUILD +++ b/mbeancmd/PKGBUILD @@ -1,17 +1,17 @@ # Maintainer: Julien Nicoulaud # Source: https://github.com/nicoulaj/archlinux-packages pkgname=mbeancmd -pkgver=2.3.1 +pkgver=2.3.2 pkgrel=1 pkgdesc="A command-line tool written in Java for interacting with MBeans on any J2EE server." arch=(any) url="http://wiki.jasmine.ow2.org/xwiki/bin/view/Documentation/MBeanCmd" -license=(LGPL2.1) -depends=(java-runtime) +license=(LGPL) +depends=(java-runtime bash) changelog=Changelog source=("${pkgname}.jar::http://search.maven.org/remotecontent?filepath=org/ow2/jasmine/${pkgname}-assemblies-core/${pkgver}/${pkgname}-assemblies-core-${pkgver}-bin.jar") noextract=(${pkgname}.jar) -md5sums=('c41539cfc30acfc5e1f83d5558f7aba3') +md5sums=('fc68609cb0f133287359df7a2d6b5e16') build() { msg2 "Generate executable script..." diff --git a/metslib/PKGBUILD b/metslib/PKGBUILD index 760dd8e53..5b6ec72da 100644 --- a/metslib/PKGBUILD +++ b/metslib/PKGBUILD @@ -1,25 +1,25 @@ -# Maintainer: kfgz +# Maintainer: kfgz pkgname=metslib -pkgver=0.4.3 +pkgver=0.5.3 pkgrel=1 pkgdesc="An OO (Object Oriented) metaheuristics optimization framework in C++" arch=('i686' 'x86_64') url="https://projects.coin-or.org/metslib" -license=('GPLv3') +license=('GPL3') conflicts=('metslib-svn' 'metslib-newest') -provides=('metslib') +#provides=("metslib=${pkgver}") source=(http://www.coin-or.org/download/source/${pkgname}/${pkgname}-${pkgver}.tgz) -md5sums=('5fcb6385f94fb1d895c907a80179f967') +md5sums=('abe958de95754786e9d3bcce30d997e7') build() { - cd ${srcdir}/${pkgname}-${pkgver} + cd "${srcdir}"/${pkgname}-${pkgver} sed -i "s/-O3/-O2/g" configure ./configure --prefix=/usr make } package() { - cd ${srcdir}/${pkgname}-${pkgver} - make DESTDIR=${pkgdir} install + cd "${srcdir}"/${pkgname}-${pkgver} + make DESTDIR="${pkgdir}" install } diff --git a/mingw32-jsoncpp/PKGBUILD b/mingw32-jsoncpp/PKGBUILD index cc3388c69..e87d7d101 100644 --- a/mingw32-jsoncpp/PKGBUILD +++ b/mingw32-jsoncpp/PKGBUILD @@ -10,13 +10,15 @@ url="http://jsoncpp.sourceforge.net/" license=('Public') makedepends=('scons' 'gcc') depends=('gcc-libs') -source=("http://sourceforge.net/projects/jsoncpp/files/jsoncpp/0.5.0/jsoncpp-src-${pkgver}.tar.gz/download") -md5sums=('24482b67c1cb17aac1ed1814288a3a8f') +source=("http://sourceforge.net/projects/jsoncpp/files/jsoncpp/0.5.0/jsoncpp-src-${pkgver}.tar.gz/download" "jsoncpp.patch") +md5sums=('24482b67c1cb17aac1ed1814288a3a8f' 'e3fc74224d01c8d03cda68e1f989e4dd') options=('!strip' '!buildflags') build() { cd ${srcdir}/jsoncpp-src-${pkgver} + patch -Np1 -i ../jsoncpp.patch + touch src/lib_json/json_mingw_libmt.def scons platform=mingw } @@ -25,9 +27,10 @@ package(){ mkdir -p ${pkgdir}/usr/i486-mingw32/include cp -r include/json ${pkgdir}/usr/i486-mingw32/include/json mkdir -p ${pkgdir}/usr/i486-mingw32/lib - cp buildscons/mingw/src/lib_json/libjson_mingw_libmt.a ${pkgdir}/usr/i486-mingw32/lib/ + cp buildscons/mingw/src/lib_json/libjson_mingw_libmt.* ${pkgdir}/usr/i486-mingw32/lib/ cd ${pkgdir}/usr/i486-mingw32/lib/ ln -sf libjson_mingw_libmt.a libjsoncpp.a + ln -sf libjson_mingw_libmt.so libjsoncpp.so cd ${pkgdir}/usr/i486-mingw32/include/ mv json jsoncpp } diff --git a/mingw32-jsoncpp/jsoncpp.patch b/mingw32-jsoncpp/jsoncpp.patch new file mode 100644 index 000000000..11932dd09 --- /dev/null +++ b/mingw32-jsoncpp/jsoncpp.patch @@ -0,0 +1,42 @@ +diff -aur jsoncpp-src-0.5.0/SConstruct jsoncpp-src-0.5.0.new/SConstruct +--- jsoncpp-src-0.5.0/SConstruct 2010-03-12 08:31:04.000000000 +0100 ++++ jsoncpp-src-0.5.0.new/SConstruct 2012-01-15 15:01:02.000000000 +0100 +@@ -33,6 +33,15 @@ + LD_LIBRARY_PATH = "%s:libs/%s" %(LD_LIBRARY_PATH, platform) + os.environ['LD_LIBRARY_PATH'] = LD_LIBRARY_PATH + print "LD_LIBRARY_PATH =", LD_LIBRARY_PATH ++# XXX[patch] ++ elif platform == 'mingw': ++ CXX = 'i486-mingw32-g++' ++ import commands ++ version = commands.getoutput('%s -dumpversion' %CXX) ++ print "Using platform '%s'" %platform ++ LD_LIBRARY_PATH = os.environ.get('LD_LIBRARY_PATH', '') ++ os.environ['LD_LIBRARY_PATH'] = LD_LIBRARY_PATH ++ print "LD_LIBRARY_PATH =", LD_LIBRARY_PATH + except KeyError: + print 'You must specify a "platform"' + sys.exit(2) +@@ -104,6 +113,11 @@ + elif platform == 'mingw': + env.Tool( 'mingw' ) + env.Append( CPPDEFINES=[ "WIN32", "NDEBUG", "_MT" ] ) ++# XXX[patch] ++ env['SHARED_LIB_ENABLED'] = True ++ env["CXX"] = CXX ++ env["AR"] = 'i486-mingw32-ar' ++ env["RANLIB"] = 'i486-mingw32-ranlib' + elif platform.startswith('linux-gcc'): + env.Tool( 'default' ) + env.Append( LIBS = ['pthread'], CCFLAGS = "-Wall" ) +@@ -228,8 +242,7 @@ + """.split() ) + env.Alias( 'src-dist', srcdist_cmd ) + +-buildProjectInDirectory( 'src/jsontestrunner' ) ++#buildProjectInDirectory( 'src/jsontestrunner' ) + buildProjectInDirectory( 'src/lib_json' ) +-buildProjectInDirectory( 'src/test_lib_json' ) ++#buildProjectInDirectory( 'src/test_lib_json' ) + #print env.Dump() +- diff --git a/par2cmdline/01-Use-_stati64-under-WIN32-to-get-file-size.patch b/par2cmdline/01-Use-_stati64-under-WIN32-to-get-file-size.patch deleted file mode 100644 index 65e5d61cc..000000000 --- a/par2cmdline/01-Use-_stati64-under-WIN32-to-get-file-size.patch +++ /dev/null @@ -1,59 +0,0 @@ ---- a/diskfile.cpp -+++ b/diskfile.cpp -@@ -340,7 +340,18 @@ list* DiskFile::FindFiles(string path, string wildcard) - return matches; - } - -- -+u64 DiskFile::GetFileSize(string filename) -+{ -+ struct _stati64 st; -+ if ((0 == _stati64(filename.c_str(), &st)) && (0 != (st.st_mode & S_IFREG))) -+ { -+ return st.st_size; -+ } -+ else -+ { -+ return 0; -+ } -+} - - - ///////////////////////////////////////////////////////////////////////////////////////////////////////////////// -@@ -689,6 +700,18 @@ list* DiskFile::FindFiles(string path, string wildcard) - return matches; - } - -+u64 DiskFile::GetFileSize(string filename) -+{ -+ struct stat st; -+ if ((0 == stat(filename.c_str(), &st)) && (0 != (st.st_mode & S_IFREG))) -+ { -+ return st.st_size; -+ } -+ else -+ { -+ return 0; -+ } -+} - ///////////////////////////////////////////////////////////////////////////////////////////////////////////////// - #endif - -@@ -802,18 +825,6 @@ bool DiskFile::FileExists(string filename) - return ((0 == stat(filename.c_str(), &st)) && (0 != (st.st_mode & S_IFREG))); - } - --u64 DiskFile::GetFileSize(string filename) --{ -- struct stat st; -- if ((0 == stat(filename.c_str(), &st)) && (0 != (st.st_mode & S_IFREG))) -- { -- return st.st_size; -- } -- else -- { -- return 0; -- } --} - - diff --git a/par2cmdline/02-Report-empty-files-when-verifying.patch b/par2cmdline/02-Report-empty-files-when-verifying.patch deleted file mode 100644 index 3e751c09d..000000000 --- a/par2cmdline/02-Report-empty-files-when-verifying.patch +++ /dev/null @@ -1,51 +0,0 @@ ---- a/par1repairer.cpp -+++ b/par1repairer.cpp -@@ -710,7 +710,13 @@ bool Par1Repairer::VerifyDataFile(DiskFile *diskfile, Par1RepairerSourceFile *so - u64 filesize = diskfile->FileSize(); - - if (filesize == 0) -+ { -+ if (noiselevel > CommandLine::nlSilent) -+ { -+ cout << "Target: \"" << name << "\" - empty." << endl; -+ } - return true; -+ } - - // Search for the first file that is the correct size - vector::iterator sourceiterator = sourcefiles.begin(); ---- a/par2repairer.cpp -+++ b/par2repairer.cpp -@@ -1415,17 +1415,28 @@ bool Par2Repairer::ScanDataFile(DiskFile *diskfile, // [in] - - matchtype = eNoMatch; - -+ string path; -+ string name; -+ DiskFile::SplitFilename(diskfile->FileName(), path, name); -+ - // Is the file empty - if (diskfile->FileSize() == 0) - { - // If the file is empty, then just return -+ if (noiselevel > CommandLine::nlSilent) -+ { -+ if (originalsourcefile != 0) -+ { -+ cout << "Target: \"" << name << "\" - empty." << endl; -+ } -+ else -+ { -+ cout << "File: \"" << name << "\" - empty." << endl; -+ } -+ } - return true; - } - -- string path; -- string name; -- DiskFile::SplitFilename(diskfile->FileName(), path, name); -- - string shortname; - if (name.size() > 56) - { diff --git a/par2cmdline/03-Correct-error-in-Par2CreatorSourceFile-UpdateHashes-.patch b/par2cmdline/03-Correct-error-in-Par2CreatorSourceFile-UpdateHashes-.patch deleted file mode 100644 index 2367c4d71..000000000 --- a/par2cmdline/03-Correct-error-in-Par2CreatorSourceFile-UpdateHashes-.patch +++ /dev/null @@ -1,11 +0,0 @@ ---- a/par2creatorsourcefile.cpp -+++ b/par2creatorsourcefile.cpp -@@ -319,7 +319,7 @@ void Par2CreatorSourceFile::UpdateHashes(u32 blocknumber, const void *buffer, si - - - // Update the full file hash, but don't go beyond the end of the file -- if (length > filesize - blocknumber * length) -+ if ((u64)length > filesize - blocknumber * (u64)length) - { - length = (size_t)(filesize - blocknumber * (u64)length); - } diff --git a/par2cmdline/04-offset-must-always-be-updated-even-when-progress-is-.patch b/par2cmdline/04-offset-must-always-be-updated-even-when-progress-is-.patch deleted file mode 100644 index 38c4a1fb8..000000000 --- a/par2cmdline/04-offset-must-always-be-updated-even-when-progress-is-.patch +++ /dev/null @@ -1,13 +0,0 @@ ---- a/par2creatorsourcefile.cpp -+++ b/par2creatorsourcefile.cpp -@@ -224,6 +224,10 @@ bool Par2CreatorSourceFile::Open(CommandLine::NoiseLevel noiselevel, const Comma - cout << newfraction/10 << '.' << newfraction%10 << "%\r" << flush; - } - } -+ else -+ { -+ offset += want; -+ } - } - - // Did we finish the last block diff --git a/par2cmdline/05-When-a-file-is-specified-to-be-scanned-but-it-dooen-.patch b/par2cmdline/05-When-a-file-is-specified-to-be-scanned-but-it-dooen-.patch deleted file mode 100644 index a58502ead..000000000 --- a/par2cmdline/05-When-a-file-is-specified-to-be-scanned-but-it-dooen-.patch +++ /dev/null @@ -1,59 +0,0 @@ ---- a/commandline.cpp -+++ b/commandline.cpp -@@ -642,30 +642,34 @@ bool CommandLine::Parse(int argc, char *argv[]) - } - else - { -- // All other files must exist -+ // Originally, all specified files were supposed to exist, or the program -+ // would stop with an error message. This was not practical, for example in -+ // a directory with files appearing and disappearing (an active download directory). -+ // So the new rule is: when a specified file doesn't exist, it is silently skipped. - if (!DiskFile::FileExists(filename)) - { -- cerr << "The source file does not exist: " << filename << endl; -- return false; -- } -- -- u64 filesize = DiskFile::GetFileSize(filename); -- -- // Ignore all 0 byte files -- if (filesize > 0) -- { -- extrafiles.push_back(ExtraFile(filename, filesize)); -- -- // track the total size of the source files and how -- // big the largest one is. -- totalsourcesize += filesize; -- if (largestsourcesize < filesize) -- largestsourcesize = filesize; -- } -- else -- { -- cout << "Skipping 0 byte file: " << filename << endl; -- } -+ cout << "Ignoring non-existent source file: " << filename << endl; -+ } -+ else -+ { -+ u64 filesize = DiskFile::GetFileSize(filename); -+ -+ // Ignore all 0 byte files -+ if (filesize > 0) -+ { -+ extrafiles.push_back(ExtraFile(filename, filesize)); -+ -+ // track the total size of the source files and how -+ // big the largest one is. -+ totalsourcesize += filesize; -+ if (largestsourcesize < filesize) -+ largestsourcesize = filesize; -+ } -+ else -+ { -+ cout << "Skipping 0 byte file: " << filename << endl; -+ } -+ } //end file exists - } - - ++fn; diff --git a/par2cmdline/06-Introduced-conditional-compilation-to-speed-up-thing.patch b/par2cmdline/06-Introduced-conditional-compilation-to-speed-up-thing.patch deleted file mode 100644 index 77b0cdecd..000000000 --- a/par2cmdline/06-Introduced-conditional-compilation-to-speed-up-thing.patch +++ /dev/null @@ -1,31 +0,0 @@ ---- a/par2creatorsourcefile.cpp -+++ b/par2creatorsourcefile.cpp -@@ -213,21 +213,22 @@ bool Par2CreatorSourceFile::Open(CommandLine::NoiseLevel noiselevel, const Comma - } - } - -+ // Define MPDL to skip reporting; speeds up things considerably -+#ifndef MPDL - if (noiselevel > CommandLine::nlQuiet) - { - // Display progress - u32 oldfraction = (u32)(1000 * offset / filesize); -- offset += want; -- u32 newfraction = (u32)(1000 * offset / filesize); -+ // The original source had here: offset += want; -+ // That's definitely an error, because offset must always be incremented! -+ u32 newfraction = (u32)(1000 * (offset + want) / filesize); - if (oldfraction != newfraction) - { - cout << newfraction/10 << '.' << newfraction%10 << "%\r" << flush; - } - } -- else -- { -- offset += want; -- } -+#endif -+ offset += want; - } - - // Did we finish the last block diff --git a/par2cmdline/07-Optimization-by-inlining.patch b/par2cmdline/07-Optimization-by-inlining.patch deleted file mode 100644 index 70577f672..000000000 --- a/par2cmdline/07-Optimization-by-inlining.patch +++ /dev/null @@ -1,152 +0,0 @@ ---- a/reedsolomon.cpp -+++ b/reedsolomon.cpp -@@ -51,7 +51,7 @@ u32 gcd(u32 a, u32 b) - } - } - --bool ReedSolomon::SetInput(const vector &present) -+template<> bool ReedSolomon::SetInput(const vector &present) - { - inputcount = (u32)present.size(); - -@@ -80,7 +80,7 @@ bool ReedSolomon::SetInput(const vector &present) - return true; - } - --bool ReedSolomon::SetInput(u32 count) -+template<> bool ReedSolomon::SetInput(u32 count) - { - inputcount = count; - -@@ -101,15 +101,8 @@ bool ReedSolomon::SetInput(u32 count) - return true; - } - --bool ReedSolomon::Process(size_t size, u32 inputindex, const void *inputbuffer, u32 outputindex, void *outputbuffer) -+template<> bool ReedSolomon::InternalProcess(const Galois8 &factor, size_t size, const void *inputbuffer, void *outputbuffer) - { -- // Look up the appropriate element in the RS matrix -- Galois8 factor = leftmatrix[outputindex * (datapresent + datamissing) + inputindex]; -- -- // Do nothing if the factor happens to be 0 -- if (factor == 0) -- return eSuccess; -- - #ifdef LONGMULTIPLY - // The 8-bit long multiplication tables - Galois8 *table = glmt->tables; -@@ -189,7 +182,7 @@ bool ReedSolomon::Process(size_t size, u32 inputindex, const void *inpu - - // Set which of the source files are present and which are missing - // and compute the base values to use for the vandermonde matrix. --bool ReedSolomon::SetInput(const vector &present) -+template<> bool ReedSolomon::SetInput(const vector &present) - { - inputcount = (u32)present.size(); - -@@ -233,7 +226,7 @@ bool ReedSolomon::SetInput(const vector &present) - - // Record that the specified number of source files are all present - // and compute the base values to use for the vandermonde matrix. --bool ReedSolomon::SetInput(u32 count) -+template<> bool ReedSolomon::SetInput(u32 count) - { - inputcount = count; - -@@ -267,15 +260,8 @@ bool ReedSolomon::SetInput(u32 count) - return true; - } - --bool ReedSolomon::Process(size_t size, u32 inputindex, const void *inputbuffer, u32 outputindex, void *outputbuffer) -+template<> bool ReedSolomon::InternalProcess(const Galois16 &factor, size_t size, const void *inputbuffer, void *outputbuffer) - { -- // Look up the appropriate element in the RS matrix -- -- Galois16 factor = leftmatrix[outputindex * (datapresent + datamissing) + inputindex]; -- // Do nothing if the factor happens to be 0 -- if (factor == 0) -- return eSuccess; -- - #ifdef LONGMULTIPLY - // The 8-bit long multiplication tables - Galois16 *table = glmt->tables; ---- a/reedsolomon.h -+++ b/reedsolomon.h -@@ -64,7 +64,8 @@ public: - const void *inputbuffer, // Buffer containing input data - u32 outputindex, // The row in the RS matrix - void *outputbuffer); // Buffer containing output data -- -+private: -+ bool InternalProcess(const g &factor, size_t size, const void *inputbuffer, void *outputbuffer); // Optimization - protected: - // Perform Gaussian Elimination - bool GaussElim(CommandLine::NoiseLevel noiselevel, -@@ -146,6 +147,20 @@ inline ReedSolomon::~ReedSolomon(void) - #endif - } - -+template -+inline bool ReedSolomon::Process(size_t size, u32 inputindex, const void *inputbuffer, u32 outputindex, void *outputbuffer) -+{ -+ // Optimization: it occurs frequently the function exits early on, so inline the start. -+ // This resulted in a speed gain of approx. 8% in repairing. -+ -+ // Look up the appropriate element in the RS matrix -+ g factor = leftmatrix[outputindex * (datapresent + datamissing) + inputindex]; -+ // Do nothing if the factor happens to be 0 -+ if (factor == 0) -+ return eSuccess; -+ return this->InternalProcess (factor, size, inputbuffer, outputbuffer); -+} -+ - u32 gcd(u32 a, u32 b); - - // Record whether the recovery block with the specified -@@ -242,11 +257,14 @@ inline bool ReedSolomon::Compute(CommandLine::NoiseLevel noiselevel) - // One row for each present recovery block that will be used for a missing data block - for (unsigned int row=0; row CommandLine::nlQuiet) - { - int progress = row * 1000 / (datamissing+parmissing); - cout << "Constructing: " << progress/10 << '.' << progress%10 << "%\r" << flush; - } -+#endif - - // Get the exponent of the next present recovery block - while (!outputrow->present) -@@ -286,11 +304,14 @@ inline bool ReedSolomon::Compute(CommandLine::NoiseLevel noiselevel) - outputrow = outputrows.begin(); - for (unsigned int row=0; row CommandLine::nlQuiet) - { - int progress = (row+datamissing) * 1000 / (datamissing+parmissing); - cout << "Constructing: " << progress/10 << '.' << progress%10 << "%\r" << flush; - } -+#endif - - // Get the exponent of the next missing recovery block - while (outputrow->present) -@@ -420,6 +441,8 @@ inline bool ReedSolomon::GaussElim(CommandLine::NoiseLevel noiselevel, unsign - // For every other row in the matrix - for (unsigned int row2=0; row2 CommandLine::nlQuiet) - { - int newprogress = (row*rows+row2) * 1000 / (datamissing*rows); -@@ -429,6 +452,7 @@ inline bool ReedSolomon::GaussElim(CommandLine::NoiseLevel noiselevel, unsign - cout << "Solving: " << progress/10 << '.' << progress%10 << "%\r" << flush; - } - } -+#endif - - if (row != row2) - { diff --git a/par2cmdline/08-Allowing-commandline-passing-of-files.patch b/par2cmdline/08-Allowing-commandline-passing-of-files.patch deleted file mode 100644 index 6d0a0249b..000000000 --- a/par2cmdline/08-Allowing-commandline-passing-of-files.patch +++ /dev/null @@ -1,34 +0,0 @@ ---- a/commandline.cpp -+++ b/commandline.cpp -@@ -537,21 +537,18 @@ bool CommandLine::Parse(int argc, char *argv[]) - else - { - list *filenames; -+ filenames = new list; - -- // If the argument includes wildcard characters, -- // search the disk for matching files -- if (strchr(argv[0], '*') || strchr(argv[0], '?')) -+ if (argv[0][0] == '-') - { -- string path; -- string name; -- DiskFile::SplitFilename(argv[0], path, name); -- -- filenames = DiskFile::FindFiles(path, name); -- } -- else -- { -- filenames = new list; -- filenames->push_back(argv[0]); -+ while(true) -+ { -+ string filename; -+ if (std::getline(cin, filename)) -+ filenames->push_back(filename); -+ else -+ break; -+ } - } - - list::iterator fn = filenames->begin(); diff --git a/par2cmdline/09-Fixing-processing-of-the-first-file-parameter-the-ou.patch b/par2cmdline/09-Fixing-processing-of-the-first-file-parameter-the-ou.patch deleted file mode 100644 index 4c1bf3334..000000000 --- a/par2cmdline/09-Fixing-processing-of-the-first-file-parameter-the-ou.patch +++ /dev/null @@ -1,20 +0,0 @@ ---- a/commandline.cpp -+++ b/commandline.cpp -@@ -539,7 +539,7 @@ bool CommandLine::Parse(int argc, char *argv[]) - list *filenames; - filenames = new list; - -- if (argv[0][0] == '-') -+ if (argv[0][0] == '-' && argv[0][1] == '\0') - { - while(true) - { -@@ -550,6 +550,8 @@ bool CommandLine::Parse(int argc, char *argv[]) - break; - } - } -+ else -+ filenames->push_back(argv[0]); - - list::iterator fn = filenames->begin(); - while (fn != filenames->end()) diff --git a/par2cmdline/10-Pack-and-simplify-MD5Hash.patch b/par2cmdline/10-Pack-and-simplify-MD5Hash.patch deleted file mode 100644 index 9126f07c9..000000000 --- a/par2cmdline/10-Pack-and-simplify-MD5Hash.patch +++ /dev/null @@ -1,69 +0,0 @@ ---- a/md5.h -+++ b/md5.h -@@ -20,6 +20,13 @@ - #ifndef __MD5_H__ - #define __MD5_H__ - -+#ifdef WIN32 -+#pragma pack(push, 1) -+#define PACKED -+#else -+#define PACKED __attribute__ ((packed)) -+#endif -+ - // This file defines the MD5Hash and MD5Context objects which are used - // to compute and manipulate the MD5 Hash values for a block of data. - -@@ -35,12 +42,11 @@ - - // MD5 Hash value - --class MD5Hash --{ --public: -- // Constructor does not initialise the value -- MD5Hash(void) {}; -+struct MD5Hash; -+ostream& operator<<(ostream &s, const MD5Hash &hash); - -+struct MD5Hash -+{ - // Comparison operators - bool operator==(const MD5Hash &other) const; - bool operator!=(const MD5Hash &other) const; -@@ -54,13 +60,8 @@ public: - friend ostream& operator<<(ostream &s, const MD5Hash &hash); - string print(void) const; - -- // Copy and assignment -- MD5Hash(const MD5Hash &other); -- MD5Hash& operator=(const MD5Hash &other); -- --public: - u8 hash[16]; // 16 byte MD5 Hash value --}; -+} PACKED; - - // Intermediate computation state - -@@ -144,16 +145,9 @@ inline bool MD5Hash::operator<=(const MD5Hash &other) const - return !other.operator<(*this); - } - --inline MD5Hash::MD5Hash(const MD5Hash &other) --{ -- memcpy(&hash, &other.hash, sizeof(hash)); --} -- --inline MD5Hash& MD5Hash::operator=(const MD5Hash &other) --{ -- memcpy(&hash, &other.hash, sizeof(hash)); -- -- return *this; --} -+#ifdef WIN32 -+#pragma pack(pop) -+#endif -+#undef PACKED - - #endif // __MD5_H__ diff --git a/par2cmdline/11-Use-autogenerated-methods-in-letype.patch b/par2cmdline/11-Use-autogenerated-methods-in-letype.patch deleted file mode 100644 index 62d26fd47..000000000 --- a/par2cmdline/11-Use-autogenerated-methods-in-letype.patch +++ /dev/null @@ -1,148 +0,0 @@ ---- a/letype.h -+++ b/letype.h -@@ -28,44 +28,15 @@ typedef u64 leu64; - - #else - --class leu16 -+struct leu16 - { --public: -- leu16(void); -- -- leu16(const leu16 &other); -- leu16& operator=(const leu16 &other); -- -- leu16(const u16 &other); - leu16& operator=(const u16 &other); - - operator u16(void) const; - --protected: - u16 value; - }; - --inline leu16::leu16(void) --{ --} -- --inline leu16::leu16(const leu16 &other) --: value(other.value) --{ --} -- --inline leu16& leu16::operator =(const leu16 &other) --{ -- value = other.value; -- return *this; --} -- --inline leu16::leu16(const u16 &other) --{ -- ((unsigned char*)&value)[0] = (unsigned char)((other >> 0) & 0xff); -- ((unsigned char*)&value)[1] = (unsigned char)((other >> 8) & 0xff); --} -- - inline leu16& leu16::operator=(const u16 &other) - { - ((unsigned char*)&value)[0] = (unsigned char)((other >> 0) & 0xff); -@@ -81,46 +52,15 @@ inline leu16::operator u16(void) const - } - - --class leu32 -+struct leu32 - { --public: -- leu32(void); -- -- leu32(const leu32 &other); -- leu32& operator=(const leu32 &other); -- -- leu32(const u32 &other); - leu32& operator=(const u32 &other); - - operator u32(void) const; - --protected: - u32 value; - }; - --inline leu32::leu32(void) --{ --} -- --inline leu32::leu32(const leu32 &other) --: value(other.value) --{ --} -- --inline leu32& leu32::operator =(const leu32 &other) --{ -- value = other.value; -- return *this; --} -- --inline leu32::leu32(const u32 &other) --{ -- ((unsigned char*)&value)[0] = (unsigned char)((other >> 0) & 0xff); -- ((unsigned char*)&value)[1] = (unsigned char)((other >> 8) & 0xff); -- ((unsigned char*)&value)[2] = (unsigned char)((other >> 16) & 0xff); -- ((unsigned char*)&value)[3] = (unsigned char)((other >> 24) & 0xff); --} -- - inline leu32& leu32::operator=(const u32 &other) - { - ((unsigned char*)&value)[0] = (unsigned char)((other >> 0) & 0xff); -@@ -140,50 +80,15 @@ inline leu32::operator u32(void) const - } - - --class leu64 -+struct leu64 - { --public: -- leu64(void); -- -- leu64(const leu64 &other); -- leu64& operator=(const leu64 &other); -- -- leu64(const u64 &other); - leu64& operator=(const u64 &other); - - operator u64(void) const; - --protected: - u64 value; - }; - --inline leu64::leu64(void) --{ --} -- --inline leu64::leu64(const leu64 &other) --: value(other.value) --{ --} -- --inline leu64& leu64::operator =(const leu64 &other) --{ -- value = other.value; -- return *this; --} -- --inline leu64::leu64(const u64 &other) --{ -- ((unsigned char*)&value)[0] = (unsigned char)((other >> 0) & 0xff); -- ((unsigned char*)&value)[1] = (unsigned char)((other >> 8) & 0xff); -- ((unsigned char*)&value)[2] = (unsigned char)((other >> 16) & 0xff); -- ((unsigned char*)&value)[3] = (unsigned char)((other >> 24) & 0xff); -- ((unsigned char*)&value)[4] = (unsigned char)((other >> 32) & 0xff); -- ((unsigned char*)&value)[5] = (unsigned char)((other >> 40) & 0xff); -- ((unsigned char*)&value)[6] = (unsigned char)((other >> 48) & 0xff); -- ((unsigned char*)&value)[7] = (unsigned char)((other >> 56) & 0xff); --} -- - inline leu64& leu64::operator=(const u64 &other) - { - ((unsigned char*)&value)[0] = (unsigned char)((other >> 0) & 0xff); diff --git a/par2cmdline/12-Fix-headers-in-par2cmdline.h.patch b/par2cmdline/12-Fix-headers-in-par2cmdline.h.patch deleted file mode 100644 index dbc073a13..000000000 --- a/par2cmdline/12-Fix-headers-in-par2cmdline.h.patch +++ /dev/null @@ -1,22 +0,0 @@ ---- a/par2cmdline.h -+++ b/par2cmdline.h -@@ -132,6 +132,10 @@ typedef unsigned int u32; - typedef unsigned long long u64; - #endif - -+// FIXME: this is not done right w/ autoconf -+#include -+#include -+ - #if HAVE_SYS_STAT_H - # include - #endif -@@ -179,6 +183,8 @@ typedef unsigned long long u64; - #include - #include - #include -+#include -+#include - #include - #include - diff --git a/par2cmdline/13-hardlinks.patch b/par2cmdline/13-hardlinks.patch deleted file mode 100644 index 06138194b..000000000 --- a/par2cmdline/13-hardlinks.patch +++ /dev/null @@ -1,15 +0,0 @@ ---- a/Makefile.am -+++ b/Makefile.am -@@ -55,9 +55,9 @@ EXTRA_DIST = PORTING ROADMAP par2cmdline.sln par2cmdline.vcproj \ - TESTS = pretest test1 test2 test3 test4 test5 test6 posttest - - install-exec-hook : -- ln -f $(DESTDIR)$(bindir)/par2$(EXEEXT) $(DESTDIR)$(bindir)/par2create$(EXEEXT) -- ln -f $(DESTDIR)$(bindir)/par2$(EXEEXT) $(DESTDIR)$(bindir)/par2verify$(EXEEXT) -- ln -f $(DESTDIR)$(bindir)/par2$(EXEEXT) $(DESTDIR)$(bindir)/par2repair$(EXEEXT) -+ ln -sf $(bindir)/par2$(EXEEXT) $(DESTDIR)$(bindir)/par2create$(EXEEXT) -+ ln -sf $(bindir)/par2$(EXEEXT) $(DESTDIR)$(bindir)/par2verify$(EXEEXT) -+ ln -sf $(bindir)/par2$(EXEEXT) $(DESTDIR)$(bindir)/par2repair$(EXEEXT) - - uninstall-hook : - rm -f $(DESTDIR)$(bindir)/par2create$(EXEEXT) diff --git a/par2cmdline/14-fixes-stupid-warnings.patch b/par2cmdline/14-fixes-stupid-warnings.patch deleted file mode 100644 index 8662a9e26..000000000 --- a/par2cmdline/14-fixes-stupid-warnings.patch +++ /dev/null @@ -1,106 +0,0 @@ ---- a/verificationhashtable.h 2003-06-03 13:48:52.000000000 +0200 -+++ b/verificationhashtable.h.new 2010-02-10 20:48:50.425580166 +0100 -@@ -66,11 +66,11 @@ public: - // Comparison operators for searching - bool operator <(const VerificationHashEntry &r) const - { -- return crc < r.crc || crc == r.crc && hash < r.hash; -+ return crc < r.crc || ( crc == r.crc && hash < r.hash ); - } - bool operator >(const VerificationHashEntry &r) const - { -- return crc > r.crc || crc == r.crc && hash > r.hash; -+ return crc > r.crc || ( crc == r.crc && hash > r.hash ); - } - bool operator ==(const VerificationHashEntry &r) const - { -@@ -183,11 +183,11 @@ inline const VerificationHashEntry* Veri - - while (entry) - { -- if (entry->crc < crc || entry->crc == crc && entry->hash < hash) -+ if (entry->crc < crc || ( entry->crc == crc && entry->hash < hash ) ) - { - entry = entry->right; - } -- else if (entry->crc > crc || entry->crc == crc && entry->hash > hash) -+ else if (entry->crc > crc || ( entry->crc == crc && entry->hash > hash ) ) - { - entry = entry->left; - } -@@ -402,14 +402,14 @@ inline const VerificationHashEntry* Veri - // have already been matched, or ones that are the wrong length - while (currententry && (currententry->SourceFile() != sourcefile || - currententry->IsSet() || -- checksummer.ShortBlock() && checksummer.BlockLength() != currententry->GetDataBlock()->GetLength() -+ ( checksummer.ShortBlock() && checksummer.BlockLength() != currententry->GetDataBlock()->GetLength() ) - ) - ) - { - // If we found an unused entry (which was presumably for the wrong - // source file) remember it (providing it is the correct length). -- if (0 == nextentry && !(currententry->IsSet() || -- checksummer.ShortBlock() && checksummer.BlockLength() != currententry->GetDataBlock()->GetLength() -+ if ( ( ( 0 == nextentry && !(currententry->IsSet() ) ) || -+ ( checksummer.ShortBlock() && checksummer.BlockLength() != currententry->GetDataBlock()->GetLength() ) - ) - ) - { -@@ -425,8 +425,8 @@ inline const VerificationHashEntry* Veri - } - - // Check for an unused entry which is the correct length -- while (nextentry && (nextentry->IsSet() || -- checksummer.ShortBlock() && checksummer.BlockLength() != nextentry->GetDataBlock()->GetLength() -+ while ( ( ( nextentry && (nextentry->IsSet() ) ) || -+ ( checksummer.ShortBlock() && checksummer.BlockLength() != nextentry->GetDataBlock()->GetLength() ) - ) - ) - { ---- a/par1repairer.cpp 2004-04-15 15:40:48.000000000 +0200 -+++ b/par1repairer.cpp.new 2010-02-10 21:04:43.288702325 +0100 -@@ -324,7 +324,7 @@ bool Par1Repairer::LoadRecoveryFile(stri - || - (fileheader.datasize && (fileheader.dataoffset < sizeof(fileheader) || fileheader.dataoffset + fileheader.datasize > filesize)) - || -- (fileheader.datasize && (fileheader.filelistoffset <= fileheader.dataoffset && fileheader.dataoffset < fileheader.filelistoffset+fileheader.filelistsize || fileheader.dataoffset <= fileheader.filelistoffset && fileheader.filelistoffset < fileheader.dataoffset + fileheader.datasize))) -+ (fileheader.datasize && ( ( fileheader.filelistoffset <= fileheader.dataoffset && fileheader.dataoffset < fileheader.filelistoffset+fileheader.filelistsize ) || ( fileheader.dataoffset <= fileheader.filelistoffset && fileheader.filelistoffset < fileheader.dataoffset + fileheader.datasize ) ))) - break; - - // Check the size of the file list -@@ -518,9 +518,9 @@ bool Par1Repairer::LoadOtherRecoveryFile - // Check the the file extension is the correct form - if ((tail[0] == 'P' || tail[0] == 'p') && - ( -- (tail[1] == 'A' || tail[1] == 'a') && (tail[2] == 'R' || tail[2] == 'r') -+ ( (tail[1] == 'A' || tail[1] == 'a') && (tail[2] == 'R' || tail[2] == 'r') ) - || -- isdigit(tail[1]) && isdigit(tail[2]) -+ ( isdigit(tail[1]) && isdigit(tail[2]) ) - )) - { - LoadRecoveryFile(filename); -@@ -549,9 +549,9 @@ bool Par1Repairer::LoadExtraRecoveryFile - // Check the the file extension is the correct form - if ((tail[0] == 'P' || tail[0] == 'p') && - ( -- (tail[1] == 'A' || tail[1] == 'a') && (tail[2] == 'R' || tail[2] == 'r') -+ ( (tail[1] == 'A' || tail[1] == 'a') && (tail[2] == 'R' || tail[2] == 'r') ) - || -- isdigit(tail[1]) && isdigit(tail[2]) -+ ( isdigit(tail[1]) && isdigit(tail[2]) ) - )) - { - LoadRecoveryFile(filename); -@@ -652,9 +652,9 @@ bool Par1Repairer::VerifyExtraFiles(cons - // Check the the file extension is the correct form - if ((tail[0] == 'P' || tail[0] == 'p') && - ( -- (tail[1] == 'A' || tail[1] == 'a') && (tail[2] == 'R' || tail[2] == 'r') -+ ( (tail[1] == 'A' || tail[1] == 'a') && (tail[2] == 'R' || tail[2] == 'r') ) - || -- isdigit(tail[1]) && isdigit(tail[2]) -+ ( isdigit(tail[1]) && isdigit(tail[2]) ) - )) - { - skip = true; diff --git a/par2cmdline/PKGBUILD b/par2cmdline/PKGBUILD dissimilarity index 88% index fcc3d5022..d644a0f0b 100644 --- a/par2cmdline/PKGBUILD +++ b/par2cmdline/PKGBUILD @@ -1,77 +1,27 @@ -# Maintainer: BlackEagle < ike DOT devolder AT gmail DOT com > -pkgname=par2cmdline -pkgver=0.4 -pkgrel=18 -pkgdesc="Providing a tool to apply the data-recovery capability concepts of RAID-like systems to the posting & recovery of multi-part archives on Usenet." -url="http://sourceforge.net/projects/parchive/" -license="GPL" -depends=('gcc-libs') -makedepends=() -arch=('i686' 'x86_64') -source=( - "http://downloads.sourceforge.net/sourceforge/parchive/${pkgname}-${pkgver}.tar.gz" - "01-Use-_stati64-under-WIN32-to-get-file-size.patch" - "02-Report-empty-files-when-verifying.patch" - "03-Correct-error-in-Par2CreatorSourceFile-UpdateHashes-.patch" - "04-offset-must-always-be-updated-even-when-progress-is-.patch" - "05-When-a-file-is-specified-to-be-scanned-but-it-dooen-.patch" - "06-Introduced-conditional-compilation-to-speed-up-thing.patch" - "07-Optimization-by-inlining.patch" - "08-Allowing-commandline-passing-of-files.patch" - "09-Fixing-processing-of-the-first-file-parameter-the-ou.patch" - "10-Pack-and-simplify-MD5Hash.patch" - "11-Use-autogenerated-methods-in-letype.patch" - "12-Fix-headers-in-par2cmdline.h.patch" - "13-hardlinks.patch" - "14-fixes-stupid-warnings.patch" -) -sha256sums=( - '9e32b7dbcf7bca8249f98824757d4868714156fe2276516504cd26f736e9f677' - 'ece2cacec41d820d697e8fb5838b39e5ea1be1ced2a4cbe93d739a05a94db33a' - 'd4976200ea20b44d0efbc8225ed510157a59b921b710a9cf353052df8f7d2175' - '1024c6dbfc7b8993a683c28a91d156552190ae33c925b217864ea874c8135eeb' - 'f6e6c1bb8fbc6eb40947dbc9f14fcf4856de840fa970d3482900408d9aaa2f43' - '00efeff75f8a8cf61d47763b9a86ba92c68a7201d1ec50915830802b08f466e2' - 'a472bc0321cde509d0bfe1d0887a3209ba4997673d7e5a49c31cf225546da802' - 'ff9aba8c2b5e5050f811e11331637241db2fed48c2bbf5a34c970b70d45b6179' - '3076b42f152c447a24f119b5586ef702a994efa6f4fbb3a3a51d1122effef435' - '4e5c70345b1bd40019c58c0f334a76d9ece5bbb3cd08e1fb1a16b614c8e2e0cb' - '4f562411d3d431af99560789cfd69f4d6c72ca82986d4999f8ab7e6c0db7f912' - '3b7c0644143b6498ca21cb6b892b645346092f79aa5d0bc0e56fbd6181eb2e31' - '13ce51e827cd6c959a6cd92322e79df26e59f4177d831530239be491b8ffc9ff' - 'a1f6f551acf5d05f2173d6ac328a30044f2af2f2f15e87547e69fad5250a2653' - '0c2413f0d1c024127063b5cbb0a403fe12555ec820190f7981db4a5a82be7b62' -) - -build() { - cd ${pkgname}-${pkgver} - for patch in ${startdir}/[0-9][0-9]*.patch; do - msg ${patch} - patch -Np1 -i ${patch} - done - msg "remove old files" - rm -f Makefile.in \ - aclocal.m4 \ - config.guess \ - config.h.in \ - config.sub \ - configure \ - depcomp \ - install-sh \ - missing \ - mkinstalldirs - msg "run autotools stuff" - aclocal --force - autoconf --force - autoheader --force - automake --foreign --add-missing --copy --force-missing - msg "Configure" - ./configure --prefix=/usr - msg "Make" - make -} - -package() { - cd ${pkgname}-${pkgver} - make DESTDIR=$startdir/pkg install -} +# Maintainer: BlackEagle < ike DOT devolder AT gmail DOT com > +pkgname=par2cmdline +pkgver=0.5 +pkgrel=1 +pkgdesc="A file verification and repair tool" +url="https://github.com/eMPee584/par2cmdline" +license="GPL" +depends=('gcc-libs') +makedepends=() +arch=('i686' 'x86_64') +source=( + "https://github.com/downloads/eMPee584/par2cmdline/${pkgname}-${pkgver}.tar.xz" +) +sha256sums=( + '44a54d81959d802af767e0c530a89c448fffd98921245e27652e5a0faff366aa' +) + +build() { + msg "Configure" + ./configure --prefix=/usr + msg "Make" + make +} + +package() { + make DESTDIR=$startdir/pkg install +} diff --git a/pure-fastcgi/PKGBUILD b/pure-fastcgi/PKGBUILD new file mode 100644 index 000000000..d89f65c90 --- /dev/null +++ b/pure-fastcgi/PKGBUILD @@ -0,0 +1,18 @@ +pkgname=pure-fastcgi +pkgver=0.5 +pkgrel=1 +pkgdesc="Pure FastCGI interface" +arch=("i686" "x86_64") +license=('custom') +url="http://code.google.com/p/pure-lang" +depends=('pure' "fcgi") +makedepends=('make' 'gcc') +source=("http://pure-lang.googlecode.com/files/$pkgname-$pkgver.tar.gz") +sha1sums=('a4ecf993cf77ce7bfd421e96c5fe6753e08104cb') + +build() { + cd $startdir/src/$pkgname-$pkgver + + make || return 1 + make DESTDIR=$startdir/pkg install || return 1 +} diff --git a/python-sqlparse/PKGBUILD b/python-sqlparse/PKGBUILD index f4acc9542..05e133ac9 100644 --- a/python-sqlparse/PKGBUILD +++ b/python-sqlparse/PKGBUILD @@ -1,18 +1,17 @@ # Contributor: Kozec pkgname=python-sqlparse -pkgver=0.1.2 +pkgver=0.1.3 pkgrel=1 pkgdesc="Non-validating SQL parser for Python" arch=(i686 x86_64) url="http://code.google.com/p/python-sqlparse/" license=('BSD') depends=('python2') -makedepends=() -md5sums=('aa9852ad81822723adcd9f96838de14e') +md5sums=('f7e01e8ff3eeddf9bc7be8b8a1cef730') source=("http://python-sqlparse.googlecode.com/files/sqlparse-$pkgver.tar.gz") build() { cd $srcdir/sqlparse-$pkgver - python2 setup.py install --root=$pkgdir/ --optimize=1 || return 1 + python2.7 setup.py install --root=$pkgdir/ --optimize=1 || return 1 } diff --git a/qap/PKGBUILD b/qap/PKGBUILD index 67f0f3ffd..a0801c258 100644 --- a/qap/PKGBUILD +++ b/qap/PKGBUILD @@ -1,26 +1,27 @@ -# Maintainer: +# Maintainer: pkgname=qap -pkgver=0.5.0 +_examples_ver=0.5.3 +pkgver=0.5.2 pkgrel=1 pkgdesc="Quadratic assignment problem solver" arch=('i686' 'x86_64') url="https://projects.coin-or.org/metslib/wiki/QuadraticAssignmentProblem" -license=('GPLv3') -depends=('metslib-newest') -source=(http://www.coin-or.org/download/source/metslib/Examples-0.5.0.tgz) -md5sums=('29b364e9d69a2b535de152539f5f9505') +license=('GPL3') +depends=('metslib') +source=(http://www.coin-or.org/download/source/metslib/Examples-${_examples_ver}.tgz) +md5sums=('33614bbfc74a3e52007de0c643c7d4a0') build() { - cd ${srcdir}/Examples-${pkgver}/qap + cd "${srcdir}"/Examples-${_examples_ver}/qap-${pkgver} ./configure --prefix=/usr make } package() { - cd ${srcdir}/Examples-${pkgver}/qap - make DESTDIR=${pkgdir} install - install -dm755 ${pkgdir}/usr/share/qap/examples - install -m644 data/* ${pkgdir}/usr/share/qap/examples - rm ${pkgdir}/usr/share/qap/examples/Makefile* + cd "${srcdir}"/Examples-${_examples_ver}/qap-${pkgver} + make DESTDIR="${pkgdir}" install + install -dm755 "${pkgdir}"/usr/share/qap/examples + install -m644 data/* "${pkgdir}"/usr/share/qap/examples + rm "${pkgdir}"/usr/share/qap/examples/Makefile* } diff --git a/qpass/PKGBUILD b/qpass/PKGBUILD index dd291ae03..f3cc0039e 100644 --- a/qpass/PKGBUILD +++ b/qpass/PKGBUILD @@ -1,6 +1,6 @@ # Maintainer: Mateusz Piekos pkgname=qpass -pkgver=1.2.0 +pkgver=1.2.1 pkgrel=1 pkgdesc="Easy to use password manager with built-in password generator" arch=('i686' 'x86_64') @@ -8,7 +8,7 @@ url="http://qpass.sourceforge.net" depends=('qt>=4.7' 'libgcrypt') license=('GPL3') source=(http://downloads.sourceforge.net/project/qpass/source/$pkgname-$pkgver.tar.bz2) -md5sums=('b6c624e10c0fff2a8b544189252bcb37') +md5sums=('cfbf957e47b1b38a5fb8cd757c135f1b') install=qpass.install build() { diff --git a/rss-guard-git/PKGBUILD b/rss-guard-git/PKGBUILD index ab444109c..d8617460b 100755 --- a/rss-guard-git/PKGBUILD +++ b/rss-guard-git/PKGBUILD @@ -2,14 +2,14 @@ # Contributor: Petr Vanek pkgname=rss-guard-git -pkgver=20120113 +pkgver=20120115 pkgrel=4 pkgdesc='A (very) tiny RSS & ATOM reader developed using Qt framework.' arch=('i686' 'x86_64') url="http://code.google.com/p/rss-guard/" license=('GPL3') depends=(qt qtwebkit hicolor-icon-theme) -makedepends=(gcc git) +makedepends=(gcc git cmake) conflicts=(rss-guard) _gitname=rss-guard @@ -29,16 +29,27 @@ build() { msg "Git checkout done or server timeout..." cd "$srcdir/$_gitname" - msg "Preparing files with qmake..." - qmake -makefile -Wall -recursive - qmake *.pro + if [ ! -d "build" ]; then + mkdir "build" + fi + + cd "build" + + msg "Preparing files with CMake..." + cmake ../ -DCMAKE_INSTALL_PREFIX=$pkgdir/usr -DCMAKE_BUILD_TYPE=release + + msg "Preparing translation files..." + make lupdate + msg "Compiling translation files..." + make lrelease msg "Compiling files..." - make + make -j3 + msg "All files were successfully compiled..." } package() { - cd "$srcdir/$_gitname" - make install INSTALL_ROOT=$pkgdir + cd "$srcdir/$_gitname/build" + make install } diff --git a/samplicator/PKGBUILD b/samplicator/PKGBUILD dissimilarity index 82% index 61cafe896..5c1673c0b 100644 --- a/samplicator/PKGBUILD +++ b/samplicator/PKGBUILD @@ -1,20 +1,30 @@ -# $Id: PKGBUILD,v 1.4 2006/05/27 16:44:06 andyrtr Exp $ -# Maintainer: dorphell -# Contributor: Tom Newsom - -pkgname=samplicator -pkgver=1.3.2 -pkgrel=1 -pkgdesc="UDP Samplicator receives UDP datagrams on a given port and resends those datagrams to a specified set of receivers" -arch=(i686 x86_64) -license=('GPL2') -source=(http://www.switch.ch/network/downloads/tf-tant/samplicator/old/$pkgname-$pkgver.tar.gz) -md5sums=('39f0999db9082beecb371a2ec720f56e') -url="http://www.switch.ch/tf-tant/floma/sw/samplicator/" - -build() { -cd $startdir/src/$pkgname-$pkgver -./configure --prefix=/usr -make || return 1 -make prefix=$startdir/pkg/usr install -} +# Maintainer: Viliam Pucik +# Contributor: Tom Newsom + +pkgname=samplicator +pkgver=1.3.6 +pkgrel=2 +pkgdesc="An UDP datagrams receiver and forwarder with option to spoof the source IP address" +arch=(i686 x86_64) +url='http://code.google.com/p/samplicator/' +license=('GPL2') +depends=(glibc) +makedepends=() +source=("maxpdu.patch" + "http://samplicator.googlecode.com/files/${pkgname}-${pkgver}.tar.gz") +md5sums=('22ee6e76ead265f1972ce80b3d8bde59' + '8924d7de9bad725e898a0f40e0497e1f') +sha512sums=('46a96e1ca2364264fd7f94f0e942013003b46e1d7d0cb8f55b739f2d77a96322dd810871c51ae85b27f2c28d2da883ae7bd66c041977302d9b1337dbee78ff0a' + 'a4023344ec911d3dc6992ddce139e6f1c86a67bd9948a3f92a995dc26aeda1753becea4b0f5d9ad45a06d628029bffc0a77c28fbd277da9faf42100c01d55f31') + +build() { + cd "$srcdir/$pkgname-$pkgver" + patch -p1 < "$srcdir/maxpdu.patch" + ./configure --prefix=/usr + make +} + +package() { + cd "$srcdir/$pkgname-$pkgver" + make DESTDIR="$pkgdir/" install +} diff --git a/samplicator/maxpdu.patch b/samplicator/maxpdu.patch new file mode 100644 index 000000000..5470bba91 --- /dev/null +++ b/samplicator/maxpdu.patch @@ -0,0 +1,11 @@ +--- samplicator-1.3.6.org/samplicate.c 2012-01-15 15:34:23.546275859 +0100 ++++ samplicator-1.3.6/samplicate.c 2012-01-15 15:34:54.276136164 +0100 +@@ -36,7 +36,7 @@ + + #include "rawsend.h" + +-#define PDU_SIZE 1500 ++#define PDU_SIZE 65536 + + #define FLOWPORT 2000 + diff --git a/shutter-bzr/PKGBUILD b/shutter-bzr/PKGBUILD index 190445b15..554b73724 100644 --- a/shutter-bzr/PKGBUILD +++ b/shutter-bzr/PKGBUILD @@ -3,8 +3,8 @@ pkgname=shutter-bzr _realname=shutter -pkgver=1164 -pkgrel=3 +pkgver=1187 +pkgrel=1 pkgdesc="A featureful screenshot tool (formerly gscrot) - Mario Kemper's Experimental branch" arch=('i686' 'x86_64') url="http://shutter-project.org/" @@ -23,7 +23,8 @@ optdepends=('gnome-web-photo: web screenshot support' 'perl-net-dbus-glib: Ubuntu One support' 'perl-net-dropbox-api: Dropbox upload support' 'perl-path-class: Dropbox upload support' - 'perl-lwp-protocol-https: Dropbox upload support') + 'perl-lwp-protocol-https: Dropbox upload support' + 'bc: 3D Rotate and 3D Reflection plugins support') provides=('gscrot' 'shutter') conflicts=('shutter') replaces=('gscrot') diff --git a/sunrise-commander/PKGBUILD b/sunrise-commander/PKGBUILD index 484bd0c79..306d6dfed 100644 --- a/sunrise-commander/PKGBUILD +++ b/sunrise-commander/PKGBUILD @@ -1,6 +1,6 @@ # Maintainer: Stefan Husmann pkgname=sunrise-commander -pkgver=5r406 +pkgver=5r407 pkgrel=1 pkgdesc="a two panel filemanager for emacs" arch=('any') @@ -9,7 +9,7 @@ license=('GPL') depends=('emacs' 'avfs' 'fuse') optdepends=('zip: support for zip files' 'unzip: support for zip files') source=(http://www.emacswiki.org/emacs/download/sunrise-commander.el) -md5sums=('780c77017dad5fe6586308d02760f5e8') +md5sums=('b18336bef8f35dba939b2b0376b6945e') build() { cd "$srcdir" diff --git a/texmaker-nowebkit/PKGBUILD b/texmaker-nowebkit/PKGBUILD index 08aebce36..48d74f2f6 100644 --- a/texmaker-nowebkit/PKGBUILD +++ b/texmaker-nowebkit/PKGBUILD @@ -1,9 +1,9 @@ # PKGBUILD derived from texmaker-oxygen-icons by damian01w pkgname=texmaker-nowebkit _pkgname=texmaker -pkgver=3.2.1 +pkgver=3.2.2 pkgrel=1 -pkgdesc="The famous free cross-platform latex editor, stripped of browser/QtWebKit module." +pkgdesc="Free cross-platform latex editor, stripped of browser/QtWebKit module." arch=('i686' 'x86_64') url="http://www.xm1math.net/texmaker/index.html" license=('GPL') @@ -15,10 +15,10 @@ source=(http://www.xm1math.net/texmaker/$_pkgname-$pkgver.tar.bz2 \ browser.cpp \ browser.h \ ) -md5sums=('3d54fe9e5530f5cd8f9365bf9fb2e910' +md5sums=('aa04c37a0117a6f924c0f7eed5732fe2' '48ca54ffd5eb98a83cbf3626205b8639' - '445c4f825ef92a99fcd45445a7097d10' - 'aa331bfadd09e39042be09d2021ba046' + '67773649c1621d08049e16308de3f369' + '736c40e26e48cd549c15fadb21b423bf' ) build() { @@ -32,7 +32,7 @@ build() { cp -f $startdir/browser.* . # run qmake; generate Makefile - qmake -unix PREFIX=//usr texmaker.pro + qmake PREFIX=//usr texmaker.pro make || return 1 } diff --git a/texmaker-nowebkit/browser.cpp b/texmaker-nowebkit/browser.cpp index bb776d052..19ced0f4a 100644 --- a/texmaker-nowebkit/browser.cpp +++ b/texmaker-nowebkit/browser.cpp @@ -37,7 +37,7 @@ void Browser::finishLoading(bool) { } - +/* void Browser::Index() { @@ -52,3 +52,4 @@ void Browser::Find() { } +*/ diff --git a/texmaker-nowebkit/browser.h b/texmaker-nowebkit/browser.h index 1b26a6664..3b5374032 100644 --- a/texmaker-nowebkit/browser.h +++ b/texmaker-nowebkit/browser.h @@ -25,10 +25,10 @@ protected slots: void adjustTitle(); void setProgress(int p); void finishLoading(bool); -private slots: +/*private slots: void Index(); void Print(); - void Find(); + void Find();*/ }; #endif diff --git a/ttf-droid-sans/PKGBUILD b/ttf-droid-sans/PKGBUILD dissimilarity index 73% index 9e56cbabb..fcfe1a472 100644 --- a/ttf-droid-sans/PKGBUILD +++ b/ttf-droid-sans/PKGBUILD @@ -1,18 +1,24 @@ -# Maintainer: graysky - -pkgname=ttf-droid-sans -pkgver=1.0 -pkgrel=2 -pkgdesc="Droid Sans is a humanist sans serif typeface designed by Steve Matteson." -arch=('any') -url="http://www.google.com/webfonts/specimen/Droid+Sans" -license=('Apache v2') -depends=('fontconfig' 'xorg-fonts-encodings' 'xorg-font-utils') -install=readme.install -source=("http://www.fontsquirrel.com/fonts/download/Droid-Sans/Droid-Sans.zip") -sha256sums=('82e6af6e0898ccd739cf08803ae5e57f09e8b8b3e63891d3e70287b4302371bb') - -package() { - install -Dm644 "$srcdir/DroidSans.ttf" "$pkgdir/usr/share/fonts/TTF/DroidSans.ttf" - install -Dm644 "$srcdir/DroidSans-Bold.ttf" "$pkgdir/usr/share/fonts/TTF/DroidSans-Bold.ttf" -} +# Maintainer: graysky +# Contributor: Vladyslav Chyzhevskyi + +pkgname=ttf-droid-sans +pkgver=2.0 +pkgrel=1 +pkgdesc="DroidSans is a beautiful font designed by Steve Matteson for the Open Handset Alliance platform, Android." +arch=('any') +url="http://www.droidfonts.com/droidfonts" +license=('Apache') +depends=('fontconfig' 'xorg-fonts-encodings' 'xorg-font-utils') +conflicts=('ttf-droid') +install=readme.install +source=("http://archive.ubuntu.com/ubuntu/pool/universe/t/ttf-droid/ttf-droid_20101110+git.orig.tar.gz") +sha256sums=('77043baefdeaecbf36d85a1031ab2ebcb0198183d42ca0c1b978c8325dceabbc') + +package() { +cd "$srcdir" +fonts="DroidSans-Bold.ttf DroidSansMono.ttf DroidSans.ttf" + +for font in $fonts; do + install -Dm644 $font "$pkgdir"/usr/share/fonts/TTF/$font +done +} diff --git a/ttf-roboto/PKGBUILD b/ttf-roboto/PKGBUILD index fe8a79f68..d09c8b7f3 100644 --- a/ttf-roboto/PKGBUILD +++ b/ttf-roboto/PKGBUILD @@ -1,21 +1,22 @@ # Maintainer: Michael Duell PGP-Key: 6EE23EBE pkgname=ttf-roboto -pkgver=4.0r14 # same as SDK -pkgrel=1 +pkgver=20110115 +pkgrel=4 pkgdesc='The new system font of Android 4, Codename "Ice Cream Sandwich".' arch=('any') -license=('GPL') # See https://groups.google.com/group/android-building/browse_thread/thread/ade6fcd847fbb3fb +license=('Apache') url="http://developer.android.com/sdk" depends=('fontconfig' 'xorg-fonts-encodings' 'xorg-font-utils') install=$pkgname.install -source=("http://iowolf.de/roboto.zip") # this might change in the future. +source=("http://developer.android.com/design/static/download/Roboto_Hinted_20111129.zip") # this might change in the future. package() { - install -d $pkgdir/usr/share/fonts/TTF/ - install -m644 *.ttf $pkgdir/usr/share/fonts/TTF/ + cd "$srcdir/Roboto_Hinted_20111129" + install -d $pkgdir/usr/share/fonts/TTF/ + install -m644 *.ttf $pkgdir/usr/share/fonts/TTF/ } -sha512sums=('6f387b56cfe80c0a374558d469e9c9415c49b5f5666cd1347caec6fa7420a8db98e899296408a8320923d516c1a8c79c83653c022ea5671f8a9f4cc0d794b855') +sha512sums=('2c576d9d166f929d20eeb9679b804cd549790ad3087bc91ddc5836b75393ebf1ad7aa450e024a43492bb5d05a84c0cdb788aecab0f401453e2ecd83afa03139c') diff --git a/urxvt-autocomplete-all-the-things-git/PKGBUILD b/urxvt-autocomplete-all-the-things-git/PKGBUILD new file mode 100644 index 000000000..2f825cf68 --- /dev/null +++ b/urxvt-autocomplete-all-the-things-git/PKGBUILD @@ -0,0 +1,37 @@ +# Maintainer: Wojciech Siewierski +# Contributor: Wojciech Siewierski +pkgname=urxvt-autocomplete-all-the-things-git +pkgver=20120115 +pkgrel=1 +pkgdesc="an urxvt plugin allowing user to easily complete words" +url="https://github.com/Vifon/autocomplete-ALL-the-things" +arch=('any') +license=('GPL') +depends=('rxvt-unicode') +makedepends=('git') +install='autocomplete-ALL-the-things.install' + +_gitroot="git://github.com/Vifon/autocomplete-ALL-the-things.git" +_gitname="autocomplete-ALL-the-things" + +build() { + cd "$srcdir" + msg "Connecting to GIT server...." + + if [ -d $_gitname ]; then + cd $_gitname && git pull origin --depth=1 + msg "The local files are updated." + else + git clone $_gitroot $_gitname --depth=1 + fi + + msg "GIT checkout done or server timeout" + rm -rf "$srcdir/$_gitname-build" + cp -r "$srcdir/$_gitname" "$srcdir/$_gitname-build" + cd "$srcdir/$_gitname-build" +} + +package() { + cd "$srcdir/$_gitname-build" + install -D -m 644 autocomplete-ALL-the-things $pkgdir/usr/lib/urxvt/perl/autocomplete-ALL-the-things +} diff --git a/urxvt-autocomplete-all-the-things-git/autocomplete-ALL-the-things.install b/urxvt-autocomplete-all-the-things-git/autocomplete-ALL-the-things.install new file mode 100644 index 000000000..bb4621765 --- /dev/null +++ b/urxvt-autocomplete-all-the-things-git/autocomplete-ALL-the-things.install @@ -0,0 +1,12 @@ +post_install () +{ + echo "==> To enable autocomplete-ALL-the-things," + echo "==> add the following to your ~/.Xresources (or ~/.Xdefaults):" + echo "==> URxvt.perl-ext-common: [your previous plugins],autocomplete-ALL-the-things" + echo "==> URxvt.keysym.M-slash: perl:aAtt:complete" +} + +post_upgrade () +{ + post_install $1 +} diff --git a/vim-x-py/PKGBUILD b/vim-x-py/PKGBUILD index 0d0651681..f3484ab8e 100644 --- a/vim-x-py/PKGBUILD +++ b/vim-x-py/PKGBUILD @@ -5,14 +5,14 @@ pkgname=vim-x-py pkgdesc='Vi Improved, a highly configurable, improved version of the vi text editor. With X and pyton2 support.' pkgver=7.3.401 -pkgrel=1 +pkgrel=2 arch=('i686' 'x86_64') license=('custom:vim') url="http://www.vim.org" depends=("vim-runtime" 'gpm') makedepends=('gpm' 'libxt') conflicts=('gvim' 'vim') -provides=('vim') +provides=('vim=7.3') source=(ftp://ftp.archlinux.org/other/vim/vim-${pkgver}.tar.xz) md5sums=('75fe4772a97917f5eb4c919882fc44bd') diff --git a/vim-x/PKGBUILD b/vim-x/PKGBUILD index 8126a2b3c..821eee4d7 100644 --- a/vim-x/PKGBUILD +++ b/vim-x/PKGBUILD @@ -6,11 +6,11 @@ pkgname=vim-x pkgdesc='Vi Improved, a highly configurable, improved version of the vi text editor. With X support.' _topver=7.3 -_patchlevel=353 -__hgrev=379a6398d462 +_patchlevel=401 +__hgrev=0dabc2ce136c _versiondir="vim${_topver//./}" pkgver=${_topver}.${_patchlevel} -pkgrel=2 +pkgrel=1 arch=('i686' 'x86_64') license=('custom:vim') url="http://www.vim.org" @@ -20,7 +20,7 @@ conflicts=('gvim' 'vim') provides=('vim') source=(ftp://ftp.archlinux.org/other/vim/vim-${pkgver}.tar.xz pythoncomplete.vim::http://www.vim.org/scripts/download_script.php\?src_id=10872 - vimrc archlinux.vim urxvt-mouse.diff) + vimrc archlinux.vim) # source PKGBUILD && mksource mksource() { @@ -50,8 +50,6 @@ mksource() { build() { cd "${srcdir}" - (cd vim-${pkgver}; patch -p1 -i ../urxvt-mouse.diff) - cp -a vim-${pkgver} vim-build # define the place for the global (g)vimrc file (set to /etc/vimrc) @@ -76,7 +74,7 @@ build() { make } -package_vim-x() { +package() { cd "${srcdir}"/vim-build make -j1 VIMRCLOC=/etc DESTDIR="${pkgdir}" install @@ -101,8 +99,7 @@ package_vim-x() { # vim:set sw=2 sts=2 et: -md5sums=('3a7fb107699b741a7a1a86ff5ec3b83e' +md5sums=('75fe4772a97917f5eb4c919882fc44bd' '6e7adfbd5d26c1d161030ec203a7f243' 'e57777374891063b9ca48a1fe392ac05' - '10353a61aadc3f276692d0e17db1478e' - '863ccff820a9c54eff7aed8b920222f2') + '10353a61aadc3f276692d0e17db1478e') diff --git a/vim-x/urxvt-mouse.diff b/vim-x/urxvt-mouse.diff deleted file mode 100644 index 5603587cc..000000000 --- a/vim-x/urxvt-mouse.diff +++ /dev/null @@ -1,35 +0,0 @@ -diff --git a/src/term.c b/src/term.c ---- a/src/term.c -+++ b/src/term.c -@@ -1996,6 +1996,7 @@ - # define HMT_DEC 4 - # define HMT_JSBTERM 8 - # define HMT_PTERM 16 -+# define HMT_URXVT 32 - static int has_mouse_termcode = 0; - # endif - -@@ -2031,6 +2032,11 @@ - has_mouse_termcode |= HMT_PTERM; - else - # endif -+# ifdef FEAT_MOUSE_URXVT -+ if (n == KS_URXVT_MOUSE) -+ has_mouse_termcode |= HMT_URXVT; -+ else -+# endif - has_mouse_termcode |= HMT_NORMAL; - # endif - } -@@ -2068,6 +2074,11 @@ - has_mouse_termcode &= ~HMT_PTERM; - else - # endif -+# ifdef FEAT_MOUSE_URXVT -+ if (n == KS_URXVT_MOUSE) -+ has_mouse_termcode &= ~HMT_URXVT; -+ else -+# endif - has_mouse_termcode &= ~HMT_NORMAL; - # endif - } diff --git a/warsow-openbox/PKGBUILD b/warsow-openbox/PKGBUILD new file mode 100644 index 000000000..3b19b0a54 --- /dev/null +++ b/warsow-openbox/PKGBUILD @@ -0,0 +1,93 @@ +# $Id$ +# Maintainer: Ivo Nunes +# Patch created by K1ll from the Warsow forums + +pkgname=warsow-openbox +pkgver=0.62 +pkgrel=2 +pkgdesc="A free online multiplayer competitive FPS based on the Qfusion engine. This package applies a patch to fix fullscreen under Openbox." +url="http://www.warsow.net/" +license=('GPL') +arch=('i686' 'x86_64') +depends=('curl' 'libjpeg' 'libvorbis' 'libxinerama' 'libxxf86dga' +'libxxf86vm' 'sdl' 'warsow-data') +makedepends=('mesa' 'openal' 'unzip') +optdepends=('openal: for openal audio support') +source=('warsow.desktop' 'warsow.launcher' 'wsw-server.launcher' +'wswtv-server.launcher' 'warsowopenboxfs.patch' \ +"http://www.zcdn.org/dl/warsow_${pkgver}_sdk.zip") +noextract=("warsow_${pkgver}_sdk.zip") +md5sums=('f9bf60c80820237f7097c4e50a9582cd' + 'ec00081d81ad9802a8ca42fc2eac5498' + 'f73e10c26197178df71b941b10bf83d7' + 'd7e4a69835bbcf801e58307e9d6b951e' + '0a69ded6ac1c432173e5052732e17401' + '649568447e938efded07e77cdfb3accb') + +build() { + unset CFLAGS + unset CXXFLAGS + + # Extract Game Source Code + unzip -o warsow_${pkgver}_sdk.zip -d $srcdir/warsow-src + + # Patch Makefile to use correct program to query for system information + sed -i 's:openal-config:pkg-config:g' $srcdir/warsow-src/source/Makefile + + # Patch Makefile to correctly pass on ld opts + sed -i 's:--as-needed:-Wc,--as-needed:g' $srcdir/warsow-src/source/Makefile + + # Patch Sound Code to point to base openal library + sed -i 's:libopenal.so.0:libopenal.so:g' $srcdir/warsow-src/source/snd_openal/snd_main.c + + # Patch for libjpeg8 + sed -i 's/jpeg_mem_src/_jpeg_mem_src/g' $srcdir/warsow-src/source/ref_gl/r_image.c + + # Patch AngelScript so it compiles correctly on i686 + if [ "$CARCH" == "i686" ]; then + sed -i 's:CXXFLAGS = \(.*\):CXXFLAGS = -march=i686 \1:' \ + $srcdir/warsow-src/libsrcs/angelscript/angelSVN/sdk/angelscript/projects/gnuc/makefile + fi + + # Patch game for Openbox so fullscreen works + cd $srcdir/warsow-src/source/unix/ + cp ../../../../warsowopenboxfs.patch $srcdir/warsow-src/source/unix/ + patch -p2 < warsowopenboxfs.patch + + # Compile Warsow + cd $srcdir/warsow-src/source/ + make -j1 +} + +package() { + cd $srcdir/warsow-src/source/ + + # Create Destination Directories + install -d $pkgdir/opt/warsow/ + + # Move Compiled Data to Destination Directory + cp -r $srcdir/warsow-src/source/release/* \ + $pkgdir/opt/warsow + + # Install Client Game Launcher + install -D -m 0755 $srcdir/warsow.launcher \ + $pkgdir/usr/bin/warsow + + # Install Server Game Launcher + install -D -m 0755 $srcdir/wsw-server.launcher \ + $pkgdir/usr/bin/wsw-server + + # Install WSWTV Server Launcher + install -D -m 0755 $srcdir/wswtv-server.launcher \ + $pkgdir/usr/bin/wswtv-server + + # Install Client Desktop Shortcut + install -D -m 0644 $srcdir/warsow.desktop \ + $pkgdir/usr/share/applications/warsow.desktop + + # Install Icon + install -D -m 0644 $srcdir/warsow-src/source/win32/warsow.ico \ + $pkgdir/usr/share/pixmaps/warsow.ico +} + +# vim: ts=2:sw=2 diff --git a/warsow-openbox/warsow.desktop b/warsow-openbox/warsow.desktop new file mode 100755 index 000000000..839e13e02 --- /dev/null +++ b/warsow-openbox/warsow.desktop @@ -0,0 +1,11 @@ +[Desktop Entry] +Encoding=UTF-8 +Name=Warsow +GenericName=Warsow +Comment=Online Multiplayer Competitive FPS +Icon=/usr/share/pixmaps/warsow.ico +Exec=/usr/bin/warsow +Terminal=false +Type=Application +Categories=Application;Game +StartupNotify=true diff --git a/warsow-openbox/warsow.launcher b/warsow-openbox/warsow.launcher new file mode 100755 index 000000000..64dac4188 --- /dev/null +++ b/warsow-openbox/warsow.launcher @@ -0,0 +1,5 @@ +#!/bin/bash + +cd "/opt/warsow" +./warsow $* +exit $? diff --git a/warsow-openbox/warsowopenboxfs.patch b/warsow-openbox/warsowopenboxfs.patch new file mode 100644 index 000000000..a4fdc1fb8 --- /dev/null +++ b/warsow-openbox/warsowopenboxfs.patch @@ -0,0 +1,2043 @@ +diff -ru a/unix/unix_glw.c b/unix/unix_glw.c +--- a/unix/unix_glw.c 2011-04-29 14:42:24.000000000 +0200 ++++ b/unix/unix_glw.c 2011-10-03 22:11:02.000000000 +0200 +@@ -1,941 +1,1070 @@ +-/* +- Copyright (C) 1997-2001 Id Software, Inc. +- +- This program is free software; you can redistribute it and/or +- modify it under the terms of the GNU General Public License +- as published by the Free Software Foundation; either version 2 +- of the License, or (at your option) any later version. +- +- This program is distributed in the hope that it will be useful, +- but WITHOUT ANY WARRANTY; without even the implied warranty of +- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. +- +- See the GNU General Public License for more details. +- +- You should have received a copy of the GNU General Public License +- along with this program; if not, write to the Free Software +- Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +- +- */ +-/* +-** GLW_IMP.C +-** +-** This file contains ALL Linux specific stuff having to do with the +-** OpenGL refresh. When a port is being made the following functions +-** must be implemented by the port: +-** +-** GLimp_EndFrame +-** GLimp_Init +-** GLimp_Shutdown +-** GLimp_SwitchFullscreen +-** +-*/ +- +-#include +-#include +-#include +-#include +-#include +-#include +-#include +-#include +- +-#include "../ref_gl/r_local.h" +-#include "../client/keys.h" +- +-#include "x11.h" +- +-#include "unix_glw.h" +- +-#define DISPLAY_MASK ( VisibilityChangeMask | StructureNotifyMask | ExposureMask | PropertyChangeMask ) +-#define INIT_MASK ( KeyPressMask | KeyReleaseMask | ButtonPressMask | ButtonReleaseMask | PointerMotionMask | FocusChangeMask | DISPLAY_MASK ) +- +-x11display_t x11display; +- +-glwstate_t glw_state; +- +-static qboolean _xf86_vidmodes_supported = qfalse; +-static int default_dotclock, default_viewport[2]; +-static XF86VidModeModeLine default_modeline; +-static XF86VidModeModeInfo **_xf86_vidmodes; +-static int _xf86_vidmodes_num; +-static qboolean _xf86_vidmodes_active = qfalse; +-static qboolean _xf86_xinerama_supported = qfalse; +- +-static void _xf86_VidmodesInit( void ) +-{ +- int MajorVersion = 0, MinorVersion = 0; +- +- // Get video mode list +- if( XF86VidModeQueryVersion( x11display.dpy, &MajorVersion, &MinorVersion ) ) +- { +- Com_Printf( "..XFree86-VidMode Extension Version %d.%d\n", MajorVersion, MinorVersion ); +- XF86VidModeGetViewPort( x11display.dpy, x11display.scr, &default_viewport[0], &default_viewport[1] ); +- XF86VidModeGetModeLine( x11display.dpy, x11display.scr, &default_dotclock, &default_modeline ); +- XF86VidModeGetAllModeLines( x11display.dpy, x11display.scr, &_xf86_vidmodes_num, &_xf86_vidmodes ); +- _xf86_vidmodes_supported = qtrue; +- } +- else +- { +- Com_Printf( "..XFree86-VidMode Extension not available\n" ); +- _xf86_vidmodes_supported = qfalse; +- } +-} +- +-static void _xf86_VidmodesFree( void ) +-{ +- if( _xf86_vidmodes_supported ) XFree( _xf86_vidmodes ); +- +- _xf86_vidmodes_supported = qfalse; +-} +- +-static void _xf86_XineramaInit( void ) +-{ +- int MajorVersion = 0, MinorVersion = 0; +- +- if( ( XineramaQueryVersion( x11display.dpy, &MajorVersion, &MinorVersion ) ) && ( XineramaIsActive( x11display.dpy ) ) ) +- { +- Com_Printf( "..XFree86-Xinerama Extension Version %d.%d\n", MajorVersion, MinorVersion ); +- _xf86_xinerama_supported = qtrue; +- } +- else +- { +- Com_Printf( "..XFree86-Xinerama Extension not available\n" ); +- _xf86_xinerama_supported = qfalse; +- } +-} +- +-static void _xf86_XineramaFree( void ) +-{ +- _xf86_xinerama_supported = qfalse; +-} +- +-static qboolean _xf86_XineramaFindBest( int *x, int *y, int *width, int *height, qboolean silent ) +-{ +- int i, screens, head; +- int best_dist, dist; +- XineramaScreenInfo *xinerama; +- +- assert( _xf86_xinerama_supported ); +- +- if( vid_multiscreen_head->integer == 0 ) +- return qfalse; +- +- xinerama = XineramaQueryScreens( x11display.dpy, &screens ); +- if( screens <= 1 ) +- return qfalse; +- +- head = -1; +- if( vid_multiscreen_head->integer > 0 ) +- { +- for( i = 0; i < screens; i++ ) +- { +- if( xinerama[i].screen_number == vid_multiscreen_head->integer - 1 ) +- { +- head = i; +- break; +- } +- } +- if( head == -1 && !silent ) +- Com_Printf( "Xinerama: Head %i not found, using best fit\n", vid_multiscreen_head->integer ); +- if( *width > xinerama[head].width || *height > xinerama[head].height ) +- { +- head = -1; +- if( !silent ) +- Com_Printf( "Xinerama: Window doesn't fit into head %i, using best fit\n", vid_multiscreen_head->integer ); +- } +- } +- +- if( head == -1 ) // find best fit +- { +- best_dist = 999999999; +- for( i = 0; i < screens; i++ ) +- { +- if( *width <= xinerama[i].width && *height <= xinerama[i].height ) +- { +- if( xinerama[i].width - *width > xinerama[i].height - *height ) +- { +- dist = xinerama[i].height - *height; +- } +- else +- { +- dist = xinerama[i].width - *width; +- } +- +- if( dist < 0 ) +- dist = -dist; // Only positive number please +- +- if( dist < best_dist ) +- { +- best_dist = dist; +- head = i; +- } +- } +- } +- if( head < -1 ) +- { +- if( !silent ) +- Com_Printf( "Xinerama: No fitting head found" ); +- return qfalse; +- } +- } +- +- *x = xinerama[head].x_org; +- *y = xinerama[head].y_org; +- *width = xinerama[head].width; +- *height = xinerama[head].height; +- +- if( !silent ) +- Com_Printf( "Xinerama: Using screen %d: %dx%d+%d+%d\n", xinerama[head].screen_number, xinerama[head].width, xinerama[head].height, xinerama[head].x_org, xinerama[head].y_org ); +- +- return qtrue; +-} +- +-static void _xf86_VidmodesSwitch( int mode ) +-{ +- if( _xf86_vidmodes_supported ) +- { +- XF86VidModeSwitchToMode( x11display.dpy, x11display.scr, _xf86_vidmodes[mode] ); +- XF86VidModeSetViewPort( x11display.dpy, x11display.scr, 0, 0 ); +- } +- +- _xf86_vidmodes_active = qtrue; +-} +- +-static void _xf86_VidmodesSwitchBack( void ) +-{ +- if( _xf86_vidmodes_supported && _xf86_vidmodes_active ) +- { +- XF86VidModeModeInfo modeinfo; +- +- modeinfo.dotclock = default_dotclock; +- modeinfo.hdisplay = default_modeline.hdisplay; +- modeinfo.hsyncstart = default_modeline.hsyncstart; +- modeinfo.hsyncend = default_modeline.hsyncend; +- modeinfo.htotal = default_modeline.htotal; +- modeinfo.vdisplay = default_modeline.vdisplay; +- modeinfo.vsyncstart = default_modeline.vsyncstart; +- modeinfo.vsyncend = default_modeline.vsyncend; +- modeinfo.vtotal = default_modeline.vtotal; +- modeinfo.flags = default_modeline.flags; +- modeinfo.privsize = default_modeline.privsize; +- modeinfo.private = default_modeline.private; +- +- XF86VidModeSwitchToMode( x11display.dpy, x11display.scr, &modeinfo ); +- XF86VidModeSetViewPort( x11display.dpy, x11display.scr, default_viewport[0], default_viewport[1] ); +- } +- +- _xf86_vidmodes_active = qfalse; +-} +- +-static void _xf86_VidmodesFindBest( int *mode, int *pwidth, int *pheight, qboolean silent ) +-{ +- int i, best_fit, best_dist, dist, x, y; +- +- best_fit = -1; +- best_dist = 999999999; +- +- if( _xf86_vidmodes_supported ) +- { +- for( i = 0; i < _xf86_vidmodes_num; i++ ) +- { +- if( _xf86_vidmodes[i]->hdisplay < *pwidth || _xf86_vidmodes[i]->vdisplay < *pheight ) +- continue; +- +- x = _xf86_vidmodes[i]->hdisplay - *pwidth; +- y = _xf86_vidmodes[i]->vdisplay - *pheight; +- +- if( x > y ) dist = y; +- else dist = x; +- +- if( dist < 0 ) dist = -dist; // Only positive number please +- +- if( dist < best_dist ) +- { +- best_dist = dist; +- best_fit = i; +- } +- +- if( !silent ) +- Com_Printf( "%ix%i -> %ix%i: %i\n", *pwidth, *pheight, _xf86_vidmodes[i]->hdisplay, _xf86_vidmodes[i]->vdisplay, dist ); +- } +- +- if( best_fit >= 0 ) +- { +- if( !silent ) +- Com_Printf( "%ix%i selected\n", _xf86_vidmodes[best_fit]->hdisplay, _xf86_vidmodes[best_fit]->vdisplay ); +- +- *pwidth = _xf86_vidmodes[best_fit]->hdisplay; +- *pheight = _xf86_vidmodes[best_fit]->vdisplay; +- } +- } +- +- *mode = best_fit; +-} +- +-static void _x11_SetNoResize( Window w, int width, int height ) +-{ +- XSizeHints *hints; +- +- if( x11display.dpy ) +- { +- hints = XAllocSizeHints(); +- +- if( hints ) +- { +- hints->min_width = hints->max_width = width; +- hints->min_height = hints->max_height = height; +- +- hints->flags = PMaxSize | PMinSize; +- +- XSetWMNormalHints( x11display.dpy, w, hints ); +- XFree( hints ); +- } +- } +-} +- +-/*****************************************************************************/ +- +-/* +- ================= +- Sys_GetClipboardData +- +- Orginally from EzQuake +- There should be a smarter place to put this +- ================= +- */ +-char *Sys_GetClipboardData( qboolean primary ) +-{ +- Window win; +- Atom type; +- int format, ret; +- unsigned long nitems, bytes_after, bytes_left; +- unsigned char *data; +- char *buffer; +- Atom atom; +- +- if( !x11display.dpy ) +- return NULL; +- +- if( primary ) +- { +- atom = XInternAtom( x11display.dpy, "PRIMARY", True ); +- } +- else +- { +- atom = XInternAtom( x11display.dpy, "CLIPBOARD", True ); +- } +- if( atom == None ) +- return NULL; +- +- win = XGetSelectionOwner( x11display.dpy, atom ); +- if( win == None ) +- return NULL; +- +- XConvertSelection( x11display.dpy, atom, XA_STRING, atom, win, CurrentTime ); +- XFlush( x11display.dpy ); +- +- XGetWindowProperty( x11display.dpy, win, atom, 0, 0, False, AnyPropertyType, &type, &format, &nitems, &bytes_left, +- &data ); +- if( bytes_left <= 0 ) +- return NULL; +- +- ret = XGetWindowProperty( x11display.dpy, win, atom, 0, bytes_left, False, AnyPropertyType, &type, +- &format, &nitems, &bytes_after, &data ); +- if( ret == Success ) +- { +- buffer = Q_malloc( bytes_left + 1 ); +- Q_strncpyz( buffer, (char *)data, bytes_left + 1 ); +- } +- else +- { +- buffer = NULL; +- } +- +- XFree( data ); +- +- return buffer; +-} +- +- +-/* +-* Sys_SetClipboardData +-*/ +-qboolean Sys_SetClipboardData( char *data ) +-{ +- return qfalse; +-} +- +-/* +- ================= +- Sys_FreeClipboardData +- ================= +- */ +-void Sys_FreeClipboardData( char *data ) +-{ +- Q_free( data ); +-} +- +-/* +-* _NET_WM_CHECK_SUPPORTED +-*/ +-static qboolean _NET_WM_CHECK_SUPPORTED( Atom NET_ATOM ) +-{ +- qboolean issupported = qfalse; +- unsigned char *atomdata; +- Atom *atoms; +- int status, real_format; +- Atom real_type; +- unsigned long items_read, items_left, i; +- int result = 1; +- Atom _NET_SUPPORTED; +- +- _NET_SUPPORTED = XInternAtom( x11display.dpy, "_NET_SUPPORTED", 0 ); +- +- status = XGetWindowProperty( x11display.dpy, x11display.root, _NET_SUPPORTED, +- 0L, 8192L, False, XA_ATOM, &real_type, &real_format, +- &items_read, &items_left, &atomdata ); +- +- if( status != Success ) +- return qfalse; +- +- atoms = (Atom *)atomdata; +- for( i = 0; result && i < items_read; i++ ) +- { +- if( atoms[i] == NET_ATOM ) +- { +- issupported = qtrue; +- break; +- } +- } +- +- XFree( atomdata ); +- return issupported; +-} +- +-/* +-* _NET_WM_STATE_FULLSCREEN_SUPPORTED +-*/ +-static qboolean _NET_WM_STATE_FULLSCREEN_SUPPORTED( void ) +-{ +- Atom _NET_WM_STATE_FULLSCREEN = XInternAtom( x11display.dpy, "_NET_WM_STATE_FULLSCREEN", 0 ); +- return _NET_WM_CHECK_SUPPORTED( _NET_WM_STATE_FULLSCREEN ); +- +-} +- +-/* +-* _NETWM_CHECK_FULLSCREEN +-*/ +-qboolean _NETWM_CHECK_FULLSCREEN( void ) +-{ +- qboolean isfullscreen = qfalse; +- unsigned char *atomdata; +- Atom *atoms; +- int status, real_format; +- Atom real_type; +- unsigned long items_read, items_left, i; +- int result = 1; +- Atom _NET_WM_STATE; +- Atom _NET_WM_STATE_FULLSCREEN; +- +- if( !x11display.features.wmStateFullscreen ) +- return qfalse; +- +- _NET_WM_STATE = XInternAtom( x11display.dpy, "_NET_WM_STATE", 0 ); +- _NET_WM_STATE_FULLSCREEN = XInternAtom( x11display.dpy, "_NET_WM_STATE_FULLSCREEN", 0 ); +- +- status = XGetWindowProperty( x11display.dpy, x11display.win, _NET_WM_STATE, +- 0L, 8192L, False, XA_ATOM, &real_type, &real_format, +- &items_read, &items_left, &atomdata ); +- +- if( status != Success ) +- return qfalse; +- +- atoms = (Atom *)atomdata; +- for( i = 0; result && i < items_read; i++ ) +- { +- if( atoms[i] == _NET_WM_STATE_FULLSCREEN ) +- { +- isfullscreen = qtrue; +- break; +- } +- } +- +- if( isfullscreen ) +- { +- Cvar_SetValue( "vid_fullscreen", 1 ); +- vid_fullscreen->modified = qfalse; +- } +- else +- { +- Cvar_SetValue( "vid_fullscreen", 0 ); +- vid_fullscreen->modified = qfalse; +- } +- +- XFree( atomdata ); +- return isfullscreen; +-} +- +-/* +-* _NETWM_SET_FULLSCREEN +-* +-* Tell Window-Manager to toggle fullscreen +-*/ +-void _NETWM_SET_FULLSCREEN( qboolean fullscreen ) +-{ +- XEvent xev; +- Atom wm_state; +- Atom wm_fullscreen; +- +- if( !x11display.features.wmStateFullscreen ) +- return; +- +- wm_state = XInternAtom( x11display.dpy, "_NET_WM_STATE", False ); +- wm_fullscreen = XInternAtom( x11display.dpy, "_NET_WM_STATE_FULLSCREEN", False ); +- +- memset(&xev, 0, sizeof(xev)); +- xev.type = ClientMessage; +- xev.xclient.window = x11display.win; +- xev.xclient.message_type = wm_state; +- xev.xclient.format = 32; +- xev.xclient.data.l[0] = fullscreen ? 1 : 0; +- xev.xclient.data.l[1] = wm_fullscreen; +- xev.xclient.data.l[2] = 0; +- +- XSendEvent( x11display.dpy, DefaultRootWindow( x11display.dpy ), False, +- SubstructureNotifyMask, &xev ); +-} +- +-/*****************************************************************************/ +- +-static void GLimp_SetXPMIcon( const int *xpm_icon ) +-{ +- int width, height; +- size_t i, cardinalSize; +- long *cardinalData; +- Atom NET_WM_ICON; +- Atom CARDINAL; +- +- // allocate memory for icon data: width + height + width * height pixels +- // note: sizeof(long) shall be used according to XChangeProperty() man page +- width = xpm_icon[0]; +- height = xpm_icon[1]; +- cardinalSize = width * height + 2; +- cardinalData = Q_malloc( cardinalSize * sizeof( *cardinalData ) ); +- for( i = 0; i < cardinalSize; i++ ) +- cardinalData[i] = xpm_icon[i]; +- +- NET_WM_ICON = XInternAtom( x11display.dpy, "_NET_WM_ICON", False ); +- CARDINAL = XInternAtom( x11display.dpy, "CARDINAL", False ); +- +- XChangeProperty( x11display.dpy, x11display.win, NET_WM_ICON, CARDINAL, 32, +- PropModeReplace, (unsigned char *)cardinalData, cardinalSize ); +- +- Q_free( cardinalData ); +-} +- +-int *parse_xpm_icon ( int num_xpm_elements, char *xpm_data[] ); +- +-static void GLimp_SetApplicationIcon( void ) +-{ +- #include "warsow128x128.xpm" +- +- const int *xpm_icon; +- +- xpm_icon = parse_xpm_icon( sizeof( warsow128x128_xpm ) / sizeof( warsow128x128_xpm[0] ), warsow128x128_xpm ); +- if( xpm_icon ) +- { +- GLimp_SetXPMIcon( xpm_icon ); +- free( ( void * )xpm_icon ); +- } +-} +- +-/*****************************************************************************/ +- +-/* +-** GLimp_SetMode_Real +-* Hack to get rid of the prints when toggling fullscreen +-*/ +-int GLimp_SetMode_Real( int mode, qboolean fullscreen, qboolean silent ) +-{ +- int width, height, screen_x, screen_y, screen_width, screen_height, screen_mode; +- float ratio; +- XSetWindowAttributes wa; +- unsigned long mask; +- qboolean wideScreen; +- +- if( !VID_GetModeInfo( &width, &height, &wideScreen, mode ) ) +- { +- if( !silent ) +- Com_Printf( " invalid mode\n" ); +- return rserr_invalid_mode; +- } +- +- screen_mode = -1; +- screen_x = screen_y = 0; +- screen_width = width; +- screen_height = height; +- +- x11display.old_win = x11display.win; +- +- if( fullscreen ) +- { +- if( !_xf86_xinerama_supported || +- !_xf86_XineramaFindBest( &screen_x, &screen_y, &screen_width, &screen_height, silent ) ) +- { +- _xf86_VidmodesFindBest( &screen_mode, &screen_width, &screen_height, silent ); +- if( screen_mode < 0 ) +- { +- if( !silent ) +- Com_Printf( " no mode found\n" ); +- return rserr_invalid_mode; +- } +- } +- +- if( screen_width < width || screen_height < height ) +- { +- if( width > height ) +- { +- ratio = width / height; +- height = height * ratio; +- width = screen_width; +- } +- else +- { +- ratio = height / width; +- width = width * ratio; +- height = screen_height; +- } +- } +- +- if( !silent ) +- Com_Printf( "...setting fullscreen mode %d:\n", mode ); +- +- /* Create fulscreen window */ +- wa.background_pixel = 0; +- wa.border_pixel = 0; +- wa.event_mask = INIT_MASK; +- wa.backing_store = NotUseful; +- wa.save_under = False; +- +- if( x11display.features.wmStateFullscreen ) +- { +- wa.override_redirect = False; +- mask = CWBackPixel | CWBorderPixel | CWEventMask | CWSaveUnder | CWBackingStore; +- } +- else +- { +- wa.override_redirect = True; +- mask = CWBackPixel | CWBorderPixel | CWEventMask | CWSaveUnder | CWBackingStore | CWOverrideRedirect; +- } +- +- x11display.win = XCreateWindow( x11display.dpy, x11display.root, screen_x, screen_y, screen_width, screen_height, +- 0, CopyFromParent, InputOutput, CopyFromParent, mask, &wa ); +- +- XResizeWindow( x11display.dpy, x11display.gl_win, width, height ); +- XReparentWindow( x11display.dpy, x11display.gl_win, x11display.win, ( screen_width/2 )-( width/2 ), +- ( screen_height/2 )-( height/2 ) ); +- +- x11display.modeset = qtrue; +- +- XMapWindow( x11display.dpy, x11display.gl_win ); +- XMapWindow( x11display.dpy, x11display.win ); +- +- if ( !x11display.features.wmStateFullscreen ) +- _x11_SetNoResize( x11display.win, width, height ); +- else +- _NETWM_SET_FULLSCREEN( qtrue ); +- +- if( screen_mode != -1 ) +- _xf86_VidmodesSwitch( screen_mode ); +- } +- else +- { +- if( !silent ) +- Com_Printf( "...setting mode %d:\n", mode ); +- +- /* Create managed window */ +- wa.background_pixel = 0; +- wa.border_pixel = 0; +- wa.event_mask = INIT_MASK; +- mask = CWBackPixel | CWBorderPixel | CWEventMask; +- +- x11display.win = XCreateWindow( x11display.dpy, x11display.root, 0, 0, screen_width, screen_height, +- 0, CopyFromParent, InputOutput, CopyFromParent, mask, &wa ); +- x11display.wmDeleteWindow = XInternAtom( x11display.dpy, "WM_DELETE_WINDOW", False ); +- XSetWMProtocols( x11display.dpy, x11display.win, &x11display.wmDeleteWindow, 1 ); +- +- XResizeWindow( x11display.dpy, x11display.gl_win, width, height ); +- XReparentWindow( x11display.dpy, x11display.gl_win, x11display.win, 0, 0 ); +- +- x11display.modeset = qtrue; +- +- XMapWindow( x11display.dpy, x11display.gl_win ); +- XMapWindow( x11display.dpy, x11display.win ); +- +- if( !x11display.features.wmStateFullscreen ) +- _x11_SetNoResize( x11display.win, width, height ); +- +- _xf86_VidmodesSwitchBack(); +- } +- +- XSetStandardProperties( x11display.dpy, x11display.win, APPLICATION, None, None, NULL, 0, NULL ); +- +- GLimp_SetApplicationIcon(); +- +- XSetIconName( x11display.dpy, x11display.win, APPLICATION ); +- XStoreName( x11display.dpy, x11display.win, APPLICATION ); +- +- // save the parent window size for mouse use. this is not the gl context window +- x11display.win_width = width; +- x11display.win_height = height; +- +- if( x11display.old_win ) +- { +- XDestroyWindow( x11display.dpy, x11display.old_win ); +- x11display.old_win = 0; +- } +- +- XFlush( x11display.dpy ); +- +- glState.width = width; +- glState.height = height; +- glState.fullScreen = fullscreen; +- glState.wideScreen = wideScreen; +- +- // let the sound and input subsystems know about the new window +- VID_NewWindow( width, height ); +- +- return rserr_ok; +-} +- +-/* +-** GLimp_SetMode +-*/ +-int GLimp_SetMode( int mode, qboolean fullscreen ) +-{ +- return GLimp_SetMode_Real( mode, fullscreen, qfalse ); +-} +- +-/* +-** GLimp_GetCurrentMode +-*/ +-int GLimp_GetCurrentMode( void ) +-{ +- if( x11display.dpy ) +- { +- int width, height; +- +- width = DisplayWidth( x11display.dpy, x11display.scr ); +- height = DisplayHeight( x11display.dpy, x11display.scr ); +- return VID_GetModeNum( width, height ); +- } +- +- return -1; +-} +- +-/* +-** GLimp_Shutdown +-*/ +-void GLimp_Shutdown( void ) +-{ +- if( x11display.dpy ) +- { +- _xf86_VidmodesSwitchBack(); +- _xf86_VidmodesFree(); +- _xf86_XineramaFree(); +- +- if( x11display.cmap ) XFreeColormap( x11display.dpy, x11display.cmap ); +- if( x11display.ctx ) qglXDestroyContext( x11display.dpy, x11display.ctx ); +- if( x11display.gl_win ) XDestroyWindow( x11display.dpy, x11display.gl_win ); +- if( x11display.win ) XDestroyWindow( x11display.dpy, x11display.win ); +- +- XCloseDisplay( x11display.dpy ); +- } +- +- memset(&x11display.features, 0, sizeof(x11display.features)); +- x11display.modeset = qfalse; +- x11display.visinfo = NULL; +- x11display.cmap = 0; +- x11display.ctx = NULL; +- x11display.gl_win = 0; +- x11display.win = 0; +- x11display.dpy = NULL; +-} +- +-static qboolean gotstencil = qfalse; // evil hack! +-static qboolean ChooseVisual( int colorbits, int stencilbits ) +-{ +- int colorsize; +- int depthbits = colorbits; +- +- if( colorbits == 24 ) colorsize = 8; +- else colorsize = 4; +- +- { +- int attributes[] = { +- GLX_RGBA, +- GLX_DOUBLEBUFFER, +- GLX_RED_SIZE, colorsize, +- GLX_GREEN_SIZE, colorsize, +- GLX_BLUE_SIZE, colorsize, +- GLX_DEPTH_SIZE, depthbits, +- GLX_STENCIL_SIZE, stencilbits, +- None +- }; +- +- x11display.visinfo = qglXChooseVisual( x11display.dpy, x11display.scr, attributes ); +- if( !x11display.visinfo ) +- { +- Com_Printf( "..Failed to get colorbits %i, depthbits %i, stencilbits %i\n", colorbits, depthbits, stencilbits ); +- return qfalse; +- } +- else +- { +- Com_Printf( "..Got colorbits %i, depthbits %i, stencilbits %i\n", colorbits, depthbits, stencilbits ); +- if( stencilbits > 0 ) gotstencil = qtrue; +- return qtrue; +- } +- } +-} +- +-/* +-** GLimp_Init +-*/ +-int GLimp_Init( void *hinstance, void *wndproc, void *parenthWnd ) +-{ +- int colorbits, stencilbits; +- XSetWindowAttributes attr; +- unsigned long mask; +- +- hinstance = NULL; +- wndproc = NULL; +- +- // on unix we can change to fullscreen on fly +- vid_fullscreen->flags &= ~( CVAR_LATCH_VIDEO ); +- +- if( x11display.dpy ) +- GLimp_Shutdown(); +- +- Com_Printf( "Display initialization\n" ); +- +- x11display.dpy = XOpenDisplay( NULL ); +- if( !x11display.dpy ) +- { +- Com_Printf( "..Error couldn't open the X display\n" ); +- return 0; +- } +- +- x11display.scr = DefaultScreen( x11display.dpy ); +- if( parenthWnd ) +- x11display.root = (Window )parenthWnd; +- else +- x11display.root = RootWindow( x11display.dpy, x11display.scr ); +- +- x11display.wmState = XInternAtom( x11display.dpy, "WM_STATE", False ); +- x11display.features.wmStateFullscreen = _NET_WM_STATE_FULLSCREEN_SUPPORTED(); +- +- _xf86_VidmodesInit(); +- _xf86_XineramaInit(); +- +- if( r_colorbits->integer == 16 || r_colorbits->integer == 24 ) colorbits = r_colorbits->integer; +- else colorbits = 0; +- +- if( r_stencilbits->integer == 8 || r_stencilbits->integer == 16 ) stencilbits = r_stencilbits->integer; +- else stencilbits = 0; +- +- gotstencil = qfalse; +- if( colorbits > 0 ) +- { +- ChooseVisual( colorbits, stencilbits ); +- if( !x11display.visinfo && stencilbits > 8 ) ChooseVisual( colorbits, 8 ); +- if( !x11display.visinfo && stencilbits > 0 ) ChooseVisual( colorbits, 0 ); +- if( !x11display.visinfo && colorbits > 16 ) ChooseVisual( 16, 0 ); +- } +- else +- { +- ChooseVisual( 24, stencilbits ); +- if( !x11display.visinfo ) ChooseVisual( 16, stencilbits ); +- if( !x11display.visinfo && stencilbits > 8 ) ChooseVisual( 24, 8 ); +- if( !x11display.visinfo && stencilbits > 8 ) ChooseVisual( 16, 8 ); +- if( !x11display.visinfo && stencilbits > 0 ) ChooseVisual( 24, 0 ); +- if( !x11display.visinfo && stencilbits > 0 ) ChooseVisual( 16, 0 ); +- } +- +- if( !x11display.visinfo ) +- { +- GLimp_Shutdown(); // hope this doesn't do anything evil when we don't have window etc. +- Com_Printf( "..Error couldn't set GLX visual\n" ); +- return 0; +- } +- +- glState.stencilEnabled = gotstencil; +- +- x11display.ctx = qglXCreateContext( x11display.dpy, x11display.visinfo, NULL, True ); +- x11display.cmap = XCreateColormap( x11display.dpy, x11display.root, x11display.visinfo->visual, AllocNone ); +- +- attr.colormap = x11display.cmap; +- attr.border_pixel = 0; +- attr.event_mask = DISPLAY_MASK; +- attr.override_redirect = False; +- mask = CWBorderPixel | CWColormap | ExposureMask; +- +- x11display.gl_win = XCreateWindow( x11display.dpy, x11display.root, 0, 0, 1, 1, 0, +- x11display.visinfo->depth, InputOutput, x11display.visinfo->visual, mask, &attr ); +- qglXMakeCurrent( x11display.dpy, x11display.gl_win, x11display.ctx ); +- +- XSync( x11display.dpy, False ); +- +- return 1; +-} +- +-/* +-** GLimp_BeginFrame +-*/ +-void GLimp_BeginFrame( void ) +-{ +-} +- +-/* +-** GLimp_EndFrame +-** +-** Responsible for doing a swapbuffers and possibly for other stuff +-** as yet to be determined. Probably better not to make this a GLimp +-** function and instead do a call to GLimp_SwapBuffers. +-*/ +-void GLimp_EndFrame( void ) +-{ +- qglXSwapBuffers( x11display.dpy, x11display.gl_win ); +- +- if( vid_fullscreen->modified || ( vid_fullscreen->integer && vid_multiscreen_head->modified ) ) +- { +- GLimp_SetMode_Real( r_mode->integer, vid_fullscreen->integer, qtrue ); +- vid_fullscreen->modified = qfalse; +- vid_multiscreen_head->modified = qfalse; +- } +-} +- +-/* +-** GLimp_GetGammaRamp +-*/ +-qboolean GLimp_GetGammaRamp( size_t stride, unsigned short *ramp ) +-{ +- if( XF86VidModeGetGammaRamp( x11display.dpy, x11display.scr, stride, ramp, ramp + stride, ramp + ( stride << 1 ) ) != 0 ) +- return qtrue; +- return qfalse; +-} +- +-/* +-** GLimp_SetGammaRamp +-*/ +-void GLimp_SetGammaRamp( size_t stride, unsigned short *ramp ) +-{ +- XF86VidModeSetGammaRamp( x11display.dpy, x11display.scr, stride, ramp, ramp + stride, ramp + ( stride << 1 ) ); +-} +- +-/* +-** GLimp_AppActivate +-*/ +-void GLimp_AppActivate( qboolean active, qboolean destroy ) +-{ +-} ++/* ++Copyright (C) 1997-2001 Id Software, Inc. ++ ++This program is free software; you can redistribute it and/or ++modify it under the terms of the GNU General Public License ++as published by the Free Software Foundation; either version 2 ++of the License, or (at your option) any later version. ++ ++This program is distributed in the hope that it will be useful, ++but WITHOUT ANY WARRANTY; without even the implied warranty of ++MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. ++ ++See the GNU General Public License for more details. ++ ++You should have received a copy of the GNU General Public License ++along with this program; if not, write to the Free Software ++Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. ++ ++*/ ++/* ++** GLW_IMP.C ++** ++** This file contains ALL Linux specific stuff having to do with the ++** OpenGL refresh. When a port is being made the following functions ++** must be implemented by the port: ++** ++** GLimp_EndFrame ++** GLimp_Init ++** GLimp_Shutdown ++** GLimp_SwitchFullscreen ++** ++*/ ++ ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++ ++#include "../ref_gl/r_local.h" ++#include "../client/keys.h" ++ ++#include "x11.h" ++ ++#include "unix_glw.h" ++ ++#define DISPLAY_MASK ( VisibilityChangeMask | StructureNotifyMask | ExposureMask | PropertyChangeMask ) ++#define INIT_MASK ( KeyPressMask | KeyReleaseMask | ButtonPressMask | ButtonReleaseMask | PointerMotionMask | FocusChangeMask | DISPLAY_MASK ) ++ ++ ++x11display_t x11display; ++ ++glwstate_t glw_state; ++ ++static qboolean _xf86_vidmodes_supported = qfalse; ++static int default_dotclock, default_viewport[2]; ++static XF86VidModeModeLine default_modeline; ++static XF86VidModeModeInfo **_xf86_vidmodes; ++static int _xf86_vidmodes_num; ++static qboolean _xf86_vidmodes_active = qfalse; ++static qboolean _xf86_xinerama_supported = qfalse; ++ ++static void _xf86_VidmodesInit( void ) ++{ ++ int MajorVersion = 0, MinorVersion = 0; ++ ++ // Get video mode list ++ if( XF86VidModeQueryVersion( x11display.dpy, &MajorVersion, &MinorVersion ) ) ++ { ++ Com_Printf( "..XFree86-VidMode Extension Version %d.%d\n", MajorVersion, MinorVersion ); ++ XF86VidModeGetViewPort( x11display.dpy, x11display.scr, &default_viewport[0], &default_viewport[1] ); ++ XF86VidModeGetModeLine( x11display.dpy, x11display.scr, &default_dotclock, &default_modeline ); ++ XF86VidModeGetAllModeLines( x11display.dpy, x11display.scr, &_xf86_vidmodes_num, &_xf86_vidmodes ); ++ _xf86_vidmodes_supported = qtrue; ++ } ++ else ++ { ++ Com_Printf( "..XFree86-VidMode Extension not available\n" ); ++ _xf86_vidmodes_supported = qfalse; ++ } ++} ++ ++static void _xf86_VidmodesFree( void ) ++{ ++ if( _xf86_vidmodes_supported ) XFree( _xf86_vidmodes ); ++ ++ _xf86_vidmodes_supported = qfalse; ++} ++ ++static void _xf86_XineramaInit( void ) ++{ ++ int MajorVersion = 0, MinorVersion = 0; ++ ++ if( ( XineramaQueryVersion( x11display.dpy, &MajorVersion, &MinorVersion ) ) && ( XineramaIsActive( x11display.dpy ) ) ) ++ { ++ Com_Printf( "..XFree86-Xinerama Extension Version %d.%d\n", MajorVersion, MinorVersion ); ++ _xf86_xinerama_supported = qtrue; ++ } ++ else ++ { ++ Com_Printf( "..XFree86-Xinerama Extension not available\n" ); ++ _xf86_xinerama_supported = qfalse; ++ } ++} ++ ++static void _xf86_XineramaFree( void ) ++{ ++ _xf86_xinerama_supported = qfalse; ++} ++ ++static qboolean _xf86_XineramaFindBest( int *x, int *y, int *width, int *height, qboolean silent ) ++{ ++ int i, screens, head; ++ int best_dist, dist; ++ XineramaScreenInfo *xinerama; ++ ++ assert( _xf86_xinerama_supported ); ++ ++ if( vid_multiscreen_head->integer == 0 ) ++ return qfalse; ++ ++ xinerama = XineramaQueryScreens( x11display.dpy, &screens ); ++ if( screens <= 1 ) ++ return qfalse; ++ ++ head = -1; ++ if( vid_multiscreen_head->integer > 0 ) ++ { ++ for( i = 0; i < screens; i++ ) ++ { ++ if( xinerama[i].screen_number == vid_multiscreen_head->integer - 1 ) ++ { ++ head = i; ++ break; ++ } ++ } ++ if( head == -1 && !silent ) ++ Com_Printf( "Xinerama: Head %i not found, using best fit\n", vid_multiscreen_head->integer ); ++ if( *width > xinerama[head].width || *height > xinerama[head].height ) ++ { ++ head = -1; ++ if( !silent ) ++ Com_Printf( "Xinerama: Window doesn't fit into head %i, using best fit\n", vid_multiscreen_head->integer ); ++ } ++ } ++ ++ if( head == -1 ) // find best fit ++ { ++ best_dist = 999999999; ++ for( i = 0; i < screens; i++ ) ++ { ++ if( *width <= xinerama[i].width && *height <= xinerama[i].height ) ++ { ++ if( xinerama[i].width - *width > xinerama[i].height - *height ) ++ { ++ dist = xinerama[i].height - *height; ++ } ++ else ++ { ++ dist = xinerama[i].width - *width; ++ } ++ ++ if( dist < 0 ) ++ dist = -dist; // Only positive number please ++ ++ if( dist < best_dist ) ++ { ++ best_dist = dist; ++ head = i; ++ } ++ } ++ } ++ if( head < -1 ) ++ { ++ if( !silent ) ++ Com_Printf( "Xinerama: No fitting head found" ); ++ return qfalse; ++ } ++ } ++ ++ *x = xinerama[head].x_org; ++ *y = xinerama[head].y_org; ++ *width = xinerama[head].width; ++ *height = xinerama[head].height; ++ ++ if( !silent ) ++ Com_Printf( "Xinerama: Using screen %d: %dx%d+%d+%d\n", xinerama[head].screen_number, xinerama[head].width, xinerama[head].height, xinerama[head].x_org, xinerama[head].y_org ); ++ ++ return qtrue; ++} ++ ++static void _xf86_VidmodesSwitch( int mode ) ++{ ++ if( _xf86_vidmodes_supported ) ++ { ++ XF86VidModeSwitchToMode( x11display.dpy, x11display.scr, _xf86_vidmodes[mode] ); ++ XF86VidModeSetViewPort( x11display.dpy, x11display.scr, 0, 0 ); ++ } ++ ++ _xf86_vidmodes_active = qtrue; ++} ++ ++static void _xf86_VidmodesSwitchBack( void ) ++{ ++ if( _xf86_vidmodes_supported && _xf86_vidmodes_active ) ++ { ++ XF86VidModeModeInfo modeinfo; ++ ++ modeinfo.dotclock = default_dotclock; ++ modeinfo.hdisplay = default_modeline.hdisplay; ++ modeinfo.hsyncstart = default_modeline.hsyncstart; ++ modeinfo.hsyncend = default_modeline.hsyncend; ++ modeinfo.htotal = default_modeline.htotal; ++ modeinfo.vdisplay = default_modeline.vdisplay; ++ modeinfo.vsyncstart = default_modeline.vsyncstart; ++ modeinfo.vsyncend = default_modeline.vsyncend; ++ modeinfo.vtotal = default_modeline.vtotal; ++ modeinfo.flags = default_modeline.flags; ++ modeinfo.privsize = default_modeline.privsize; ++ modeinfo.private = default_modeline.private; ++ ++ XF86VidModeSwitchToMode( x11display.dpy, x11display.scr, &modeinfo ); ++ XF86VidModeSetViewPort( x11display.dpy, x11display.scr, default_viewport[0], default_viewport[1] ); ++ } ++ ++ _xf86_vidmodes_active = qfalse; ++} ++ ++static void _xf86_VidmodesFindBest( int *mode, int *pwidth, int *pheight, qboolean silent ) ++{ ++ int i, best_fit, best_dist, dist, x, y; ++ ++ best_fit = -1; ++ best_dist = 999999999; ++ ++ if( _xf86_vidmodes_supported ) ++ { ++ for( i = 0; i < _xf86_vidmodes_num; i++ ) ++ { ++ if( _xf86_vidmodes[i]->hdisplay < *pwidth || _xf86_vidmodes[i]->vdisplay < *pheight ) ++ continue; ++ ++ x = _xf86_vidmodes[i]->hdisplay - *pwidth; ++ y = _xf86_vidmodes[i]->vdisplay - *pheight; ++ ++ if( x > y ) dist = y; ++ else dist = x; ++ ++ if( dist < 0 ) dist = -dist; // Only positive number please ++ ++ if( dist < best_dist ) ++ { ++ best_dist = dist; ++ best_fit = i; ++ } ++ ++ if( !silent ) ++ Com_Printf( "%ix%i -> %ix%i: %i\n", *pwidth, *pheight, _xf86_vidmodes[i]->hdisplay, _xf86_vidmodes[i]->vdisplay, dist ); ++ } ++ ++ if( best_fit >= 0 ) ++ { ++ if( !silent ) ++ Com_Printf( "%ix%i selected\n", _xf86_vidmodes[best_fit]->hdisplay, _xf86_vidmodes[best_fit]->vdisplay ); ++ ++ *pwidth = _xf86_vidmodes[best_fit]->hdisplay; ++ *pheight = _xf86_vidmodes[best_fit]->vdisplay; ++ } ++ } ++ ++ *mode = best_fit; ++} ++ ++static void _x11_SetNoResize( Window w, int width, int height ) ++{ ++ XSizeHints *hints; ++ ++ if( x11display.dpy ) ++ { ++ hints = XAllocSizeHints(); ++ ++ if( hints ) ++ { ++ hints->min_width = hints->max_width = width; ++ hints->min_height = hints->max_height = height; ++ ++ hints->flags = PMaxSize | PMinSize; ++ ++ XSetWMNormalHints( x11display.dpy, w, hints ); ++ XFree( hints ); ++ } ++ } ++} ++ ++/*****************************************************************************/ ++ ++/* ++* Sys_GetClipboardData ++* ++* Orginally from EzQuake ++* There should be a smarter place to put this ++*/ ++char *Sys_GetClipboardData( qboolean primary ) ++{ ++ Window win; ++ Atom type; ++ int format, ret; ++ unsigned long nitems, bytes_after, bytes_left; ++ unsigned char *data; ++ char *buffer; ++ Atom atom; ++ ++ if( !x11display.dpy ) ++ return NULL; ++ ++ if( primary ) ++ { ++ atom = XInternAtom( x11display.dpy, "PRIMARY", True ); ++ } ++ else ++ { ++ atom = XInternAtom( x11display.dpy, "CLIPBOARD", True ); ++ } ++ if( atom == None ) ++ return NULL; ++ ++ win = XGetSelectionOwner( x11display.dpy, atom ); ++ if( win == None ) ++ return NULL; ++ ++ XConvertSelection( x11display.dpy, atom, XA_STRING, atom, win, CurrentTime ); ++ XFlush( x11display.dpy ); ++ ++ XGetWindowProperty( x11display.dpy, win, atom, 0, 0, False, AnyPropertyType, &type, &format, &nitems, &bytes_left, ++ &data ); ++ if( bytes_left <= 0 ) ++ return NULL; ++ ++ ret = XGetWindowProperty( x11display.dpy, win, atom, 0, bytes_left, False, AnyPropertyType, &type, ++ &format, &nitems, &bytes_after, &data ); ++ if( ret == Success ) ++ { ++ buffer = Q_malloc( bytes_left + 1 ); ++ Q_strncpyz( buffer, (char *)data, bytes_left + 1 ); ++ } ++ else ++ { ++ buffer = NULL; ++ } ++ ++ XFree( data ); ++ ++ return buffer; ++} ++ ++ ++/* ++* Sys_SetClipboardData ++*/ ++qboolean Sys_SetClipboardData( char *data ) ++{ ++ return qfalse; ++} ++ ++/* ++* Sys_FreeClipboardData ++*/ ++void Sys_FreeClipboardData( char *data ) ++{ ++ Q_free( data ); ++} ++ ++/* ++* _NET_WM_CHECK_SUPPORTED ++*/ ++static qboolean _NET_WM_CHECK_SUPPORTED( Atom NET_ATOM ) ++{ ++ qboolean issupported = qfalse; ++ unsigned char *atomdata; ++ Atom *atoms; ++ int status, real_format; ++ Atom real_type; ++ unsigned long items_read, items_left, i; ++ int result = 1; ++ Atom _NET_SUPPORTED; ++ ++ _NET_SUPPORTED = XInternAtom( x11display.dpy, "_NET_SUPPORTED", 0 ); ++ ++ status = XGetWindowProperty( x11display.dpy, x11display.root, _NET_SUPPORTED, ++ 0L, 8192L, False, XA_ATOM, &real_type, &real_format, ++ &items_read, &items_left, &atomdata ); ++ ++ if( status != Success ) ++ return qfalse; ++ ++ atoms = (Atom *)atomdata; ++ for( i = 0; result && i < items_read; i++ ) ++ { ++ if( atoms[i] == NET_ATOM ) ++ { ++ issupported = qtrue; ++ break; ++ } ++ } ++ ++ XFree( atomdata ); ++ return issupported; ++} ++ ++/* ++* _NET_WM_STATE_FULLSCREEN_SUPPORTED ++*/ ++static qboolean _NET_WM_STATE_FULLSCREEN_SUPPORTED( void ) ++{ ++ Atom _NET_WM_STATE_FULLSCREEN = XInternAtom( x11display.dpy, "_NET_WM_STATE_FULLSCREEN", 0 ); ++ return _NET_WM_CHECK_SUPPORTED( _NET_WM_STATE_FULLSCREEN ); ++ ++} ++ ++/* ++* _NETWM_CHECK_FULLSCREEN ++*/ ++qboolean _NETWM_CHECK_FULLSCREEN( void ) ++{ ++ qboolean isfullscreen = qfalse; ++ unsigned char *atomdata; ++ Atom *atoms; ++ int status, real_format; ++ Atom real_type; ++ unsigned long items_read, items_left, i; ++ int result = 1; ++ Atom _NET_WM_STATE; ++ Atom _NET_WM_STATE_FULLSCREEN; ++ ++ if( !x11display.features.wmStateFullscreen ) ++ return qfalse; ++ ++ _NET_WM_STATE = XInternAtom( x11display.dpy, "_NET_WM_STATE", 0 ); ++ _NET_WM_STATE_FULLSCREEN = XInternAtom( x11display.dpy, "_NET_WM_STATE_FULLSCREEN", 0 ); ++ ++ status = XGetWindowProperty( x11display.dpy, x11display.win, _NET_WM_STATE, ++ 0L, 8192L, False, XA_ATOM, &real_type, &real_format, ++ &items_read, &items_left, &atomdata ); ++ ++ if( status != Success ) ++ return qfalse; ++ ++ atoms = (Atom *)atomdata; ++ for( i = 0; result && i < items_read; i++ ) ++ { ++ if( atoms[i] == _NET_WM_STATE_FULLSCREEN ) ++ { ++ isfullscreen = qtrue; ++ break; ++ } ++ } ++ ++ if( isfullscreen ) ++ { ++ Cvar_SetValue( "vid_fullscreen", 1 ); ++ vid_fullscreen->modified = qfalse; ++ } ++ else ++ { ++ Cvar_SetValue( "vid_fullscreen", 0 ); ++ vid_fullscreen->modified = qfalse; ++ } ++ ++ XFree( atomdata ); ++ return isfullscreen; ++} ++ ++/* ++* _NETWM_SET_FULLSCREEN ++* ++* Tell Window-Manager to toggle fullscreen ++*/ ++void _NETWM_SET_FULLSCREEN( qboolean fullscreen ) ++{ ++ XEvent xev; ++ Atom wm_state; ++ Atom wm_fullscreen; ++ ++ if( !x11display.features.wmStateFullscreen ) ++ return; ++ ++ wm_state = XInternAtom( x11display.dpy, "_NET_WM_STATE", False ); ++ wm_fullscreen = XInternAtom( x11display.dpy, "_NET_WM_STATE_FULLSCREEN", False ); ++ ++ memset(&xev, 0, sizeof(xev)); ++ xev.type = ClientMessage; ++ xev.xany.type = ClientMessage; ++ xev.xclient.window = x11display.win; ++ xev.xclient.message_type = wm_state; ++ xev.xclient.format = 32; ++ xev.xclient.data.l[0] = fullscreen ? 1 : 0; ++ xev.xclient.data.l[1] = wm_fullscreen; ++ xev.xclient.data.l[2] = 0l; ++ ++ XSendEvent( x11display.dpy, DefaultRootWindow( x11display.dpy ), False, ++ SubstructureNotifyMask | SubstructureRedirectMask, &xev ); ++} ++ ++/* ++* _NETWM_CHECK_PING ++* ++* Checks if the _NET_WM_PING Atom is already present in WM_PROTOCOLS ++*/ ++qboolean _NETWM_CHECK_PING( void ) ++{ ++ Status status; ++ qboolean present = qfalse; ++ Atom *atoms; ++ int num_atoms, i; ++ ++ status = XGetWMProtocols( x11display.dpy, x11display.win, &atoms, &num_atoms ); ++ ++ if( status == 0 ) ++ return qfalse; ++ ++ for( i = 0; i < num_atoms; i++ ) ++ { ++ if( atoms[i] == x11display.ping ) ++ { ++ present = qtrue; ++ break; ++ } ++ } ++ XFree( atoms ); ++ return present; ++} ++ ++/* ++* _NETWM_SET_HINTS ++* ++* Sets informative hints defined in the ICCCM2/EWMH spec ++*/ ++void _NETWM_SET_HINTS( void ) ++{ ++ Status status; ++ XTextProperty titleprop, iconprop, clientmachineprop; ++ char *title = "Warsow"; //FIXME: Shouldn't be hardcoded ++ char *icon_name = "warsow128x128.xpm"; //FIXME: Shouldn't be hardcoded ++ pid_t warsowpid; //FIXME: Does Warsow already know it's pid? Can it be retrieved from there? ++ char hostname[256]; //FIXME: Is it possible to get the hostname of the client from qcommon/net.c or somewhere else? ++ char* hostnamepointer = &hostname[0]; ++ ++ Atom CARDINAL; ++ Atom UTF8_STRING; ++ ++ Atom NET_WM_PID; ++ Atom NET_WM_NAME; ++ Atom NET_WM_ICON_NAME; ++ Atom NET_WM_WINDOW_TYPE; ++ Atom NET_WM_WINDOW_TYPE_NORMAL; ++ ++ Atom WM_PROTOCOLS; ++ Atom WM_CLIENT_MACHINE; ++ ++ x11display.ping = XInternAtom( x11display.dpy, "_NET_WM_PING", False ); ++ ++ CARDINAL = XInternAtom( x11display.dpy, "CARDINAL", False ); ++ UTF8_STRING = XInternAtom( x11display.dpy, "_UTF8_STRING", False ); ++ ++ NET_WM_PID = XInternAtom( x11display.dpy, "_NET_WM_PID", False ); ++ NET_WM_NAME = XInternAtom( x11display.dpy, "_NET_WM_NAME", False ); ++ NET_WM_ICON_NAME = XInternAtom( x11display.dpy, "_NET_WM_ICON_NAME", False ); ++ NET_WM_WINDOW_TYPE = XInternAtom( x11display.dpy, "_NET_WM_WINDOW_TYPE", False ); ++ NET_WM_WINDOW_TYPE_NORMAL = XInternAtom( x11display.dpy, "_NET_WM_WINDOW_TYPE_NORMAL", False ); ++ ++ WM_PROTOCOLS = XInternAtom( x11display.dpy, "WM_PROTOCOLS", False ); ++ WM_CLIENT_MACHINE = XInternAtom( x11display.dpy, "WM_CLIENT_MACHINE", False ); ++ ++ warsowpid = getpid(); ++ ++ XChangeProperty( x11display.dpy, x11display.win, NET_WM_PID, CARDINAL, 32, ++ PropModeReplace, ++ (unsigned char *)&warsowpid, 1 ); ++ ++ status = XStringListToTextProperty( &title, 1, &titleprop ); ++ ++ if( status ) ++ XSetTextProperty( x11display.dpy, x11display.win, &titleprop, NET_WM_NAME ); ++ ++ status = XStringListToTextProperty( &icon_name, 1, &iconprop ); ++ ++ if( status ) ++ XSetTextProperty( x11display.dpy, x11display.win, &iconprop, NET_WM_ICON_NAME ); ++ ++ XChangeProperty( x11display.dpy, x11display.win, NET_WM_WINDOW_TYPE, XA_ATOM, 32, ++ PropModeReplace, ++ (unsigned char *)&NET_WM_WINDOW_TYPE_NORMAL, 1 ); ++ ++ if( gethostname( hostname, 256 ) == SOCKET_ERROR ) ++ return; ++ ++ status = XStringListToTextProperty( &hostnamepointer, 1, &clientmachineprop ); ++ ++ if( status ) ++ XSetWMClientMachine( x11display.dpy, x11display.win, &clientmachineprop ); ++ else ++ return; ++ ++ if( !_NETWM_CHECK_PING() ) { ++ XChangeProperty( x11display.dpy, x11display.win, WM_PROTOCOLS, XA_ATOM, 32, ++ PropModeAppend, ++ (unsigned char *)&x11display.ping, 1 ); ++ } ++} ++ ++/*****************************************************************************/ ++ ++static void GLimp_SetXPMIcon( const int *xpm_icon ) ++{ ++ int width, height; ++ size_t i, cardinalSize; ++ long *cardinalData; ++ Atom NET_WM_ICON; ++ Atom CARDINAL; ++ ++ // allocate memory for icon data: width + height + width * height pixels ++ // note: sizeof(long) shall be used according to XChangeProperty() man page ++ width = xpm_icon[0]; ++ height = xpm_icon[1]; ++ cardinalSize = width * height + 2; ++ cardinalData = Q_malloc( cardinalSize * sizeof( *cardinalData ) ); ++ for( i = 0; i < cardinalSize; i++ ) ++ cardinalData[i] = xpm_icon[i]; ++ ++ NET_WM_ICON = XInternAtom( x11display.dpy, "_NET_WM_ICON", False ); ++ CARDINAL = XInternAtom( x11display.dpy, "CARDINAL", False ); ++ ++ XChangeProperty( x11display.dpy, x11display.win, NET_WM_ICON, CARDINAL, 32, ++ PropModeReplace, (unsigned char *)cardinalData, cardinalSize ); ++ ++ Q_free( cardinalData ); ++} ++ ++int *parse_xpm_icon ( int num_xpm_elements, char *xpm_data[] ); ++ ++static void GLimp_SetApplicationIcon( void ) ++{ ++#include "warsow128x128.xpm" ++ ++ const int *xpm_icon; ++ ++ xpm_icon = parse_xpm_icon( sizeof( warsow128x128_xpm ) / sizeof( warsow128x128_xpm[0] ), warsow128x128_xpm ); ++ if( xpm_icon ) ++ { ++ GLimp_SetXPMIcon( xpm_icon ); ++ free( ( void * )xpm_icon ); ++ } ++} ++ ++/*****************************************************************************/ ++ ++/* ++** GLimp_SetMode_Real ++* Hack to get rid of the prints when toggling fullscreen ++*/ ++int GLimp_SetMode_Real( int mode, qboolean fullscreen, qboolean silent ) ++{ ++ int width, height, screen_x, screen_y, screen_width, screen_height, screen_mode; ++ float ratio; ++ XSetWindowAttributes wa; ++ unsigned long mask; ++ qboolean wideScreen; ++ ++ if( !VID_GetModeInfo( &width, &height, &wideScreen, mode ) ) ++ { ++ if( !silent ) ++ Com_Printf( " invalid mode\n" ); ++ return rserr_invalid_mode; ++ } ++ ++ screen_mode = -1; ++ screen_x = screen_y = 0; ++ screen_width = width; ++ screen_height = height; ++ ++ x11display.old_win = x11display.win; ++ ++ if( fullscreen ) ++ { ++ if( !_xf86_xinerama_supported || ++ !_xf86_XineramaFindBest( &screen_x, &screen_y, &screen_width, &screen_height, silent ) ) ++ { ++ _xf86_VidmodesFindBest( &screen_mode, &screen_width, &screen_height, silent ); ++ if( screen_mode < 0 ) ++ { ++ if( !silent ) ++ Com_Printf( " no mode found\n" ); ++ return rserr_invalid_mode; ++ } ++ } ++ ++ if( screen_width < width || screen_height < height ) ++ { ++ if( width > height ) ++ { ++ ratio = width / height; ++ height = height * ratio; ++ width = screen_width; ++ } ++ else ++ { ++ ratio = height / width; ++ width = width * ratio; ++ height = screen_height; ++ } ++ } ++ ++ if( !silent ) ++ Com_Printf( "...setting fullscreen mode %d:\n", mode ); ++ ++ /* Create fulscreen window */ ++ wa.background_pixel = 0; ++ wa.border_pixel = 0; ++ wa.event_mask = INIT_MASK; ++ wa.backing_store = NotUseful; ++ wa.save_under = False; ++ ++ if( x11display.features.wmStateFullscreen ) ++ { ++ wa.override_redirect = False; ++ mask = CWBackPixel | CWBorderPixel | CWEventMask | CWSaveUnder | CWBackingStore; ++ } ++ else ++ { ++ wa.override_redirect = True; ++ mask = CWBackPixel | CWBorderPixel | CWEventMask | CWSaveUnder | CWBackingStore | CWOverrideRedirect; ++ } ++ ++ if( ( !x11display.win ) || !x11display.features.wmStateFullscreen ) { ++ x11display.win = XCreateWindow( x11display.dpy, x11display.root, screen_x, screen_y, screen_width, screen_height, ++ 0, CopyFromParent, InputOutput, CopyFromParent, mask, &wa ); ++ x11display.wmDeleteWindow = XInternAtom( x11display.dpy, "WM_DELETE_WINDOW", False ); ++ XSetWMProtocols( x11display.dpy, x11display.win, &x11display.wmDeleteWindow, 1 ); ++ _NETWM_SET_HINTS(); ++ } ++ ++ XResizeWindow( x11display.dpy, x11display.gl_win, width, height ); ++ XReparentWindow( x11display.dpy, x11display.gl_win, x11display.win, ( screen_width/2 )-( width/2 ), ++ ( screen_height/2 )-( height/2 ) ); ++ ++ x11display.modeset = qtrue; ++ ++ XMapWindow( x11display.dpy, x11display.gl_win ); ++ XMapWindow( x11display.dpy, x11display.win ); ++ ++ if ( !x11display.features.wmStateFullscreen ) ++ _x11_SetNoResize( x11display.win, width, height ); ++ else ++ _NETWM_SET_FULLSCREEN( qtrue ); ++ ++ if( screen_mode != -1 ) ++ { ++ _xf86_VidmodesSwitch( screen_mode ); ++ } ++ } ++ else ++ { ++ if( !silent ) ++ Com_Printf( "...setting mode %d:\n", mode ); ++ ++ /* Create managed window */ ++ wa.background_pixel = 0; ++ wa.border_pixel = 0; ++ wa.event_mask = INIT_MASK; ++ mask = CWBackPixel | CWBorderPixel | CWEventMask; ++ ++ if( ( !x11display.win ) || !x11display.features.wmStateFullscreen ) { ++ x11display.win = XCreateWindow( x11display.dpy, x11display.root, 0, 0, screen_width, screen_height, ++ 0, CopyFromParent, InputOutput, CopyFromParent, mask, &wa ); ++ x11display.wmDeleteWindow = XInternAtom( x11display.dpy, "WM_DELETE_WINDOW", False ); ++ XSetWMProtocols( x11display.dpy, x11display.win, &x11display.wmDeleteWindow, 1 ); ++ _NETWM_SET_HINTS(); ++ } ++ ++ XResizeWindow( x11display.dpy, x11display.gl_win, width, height ); ++ XReparentWindow( x11display.dpy, x11display.gl_win, x11display.win, 0, 0 ); ++ ++ x11display.modeset = qtrue; ++ ++ XMapWindow( x11display.dpy, x11display.gl_win ); ++ XMapWindow( x11display.dpy, x11display.win ); ++ ++ if( !x11display.features.wmStateFullscreen ) ++ _x11_SetNoResize( x11display.win, width, height ); ++ else ++ _NETWM_SET_FULLSCREEN( qfalse ); ++ ++ _xf86_VidmodesSwitchBack(); ++ } ++ ++ XSetStandardProperties( x11display.dpy, x11display.win, APPLICATION, None, None, NULL, 0, NULL ); ++ ++ GLimp_SetApplicationIcon(); ++ ++ XSetIconName( x11display.dpy, x11display.win, APPLICATION ); ++ XStoreName( x11display.dpy, x11display.win, APPLICATION ); ++ ++ // save the parent window size for mouse use. this is not the gl context window ++ x11display.win_width = width; ++ x11display.win_height = height; ++ ++ if( x11display.old_win && !x11display.features.wmStateFullscreen ) ++ { ++ XDestroyWindow( x11display.dpy, x11display.old_win ); ++ x11display.old_win = 0; ++ } ++ ++ XFlush( x11display.dpy ); ++ ++ glState.width = width; ++ glState.height = height; ++ glState.fullScreen = fullscreen; ++ glState.wideScreen = wideScreen; ++ ++ // let the sound and input subsystems know about the new window ++ VID_NewWindow( width, height ); ++ ++ return rserr_ok; ++} ++ ++/* ++** GLimp_SetMode ++*/ ++int GLimp_SetMode( int mode, qboolean fullscreen ) ++{ ++ return GLimp_SetMode_Real( mode, fullscreen, qfalse ); ++} ++ ++/* ++** GLimp_GetCurrentMode ++*/ ++int GLimp_GetCurrentMode( void ) ++{ ++ if( x11display.dpy ) ++ { ++ int width, height; ++ ++ width = DisplayWidth( x11display.dpy, x11display.scr ); ++ height = DisplayHeight( x11display.dpy, x11display.scr ); ++ return VID_GetModeNum( width, height ); ++ } ++ ++ return -1; ++} ++ ++/* ++** GLimp_Shutdown ++*/ ++void GLimp_Shutdown( void ) ++{ ++ if( x11display.dpy ) ++ { ++ _xf86_VidmodesSwitchBack(); ++ _xf86_VidmodesFree(); ++ _xf86_XineramaFree(); ++ ++ if( x11display.cmap ) XFreeColormap( x11display.dpy, x11display.cmap ); ++ if( x11display.ctx ) qglXDestroyContext( x11display.dpy, x11display.ctx ); ++ if( x11display.gl_win ) XDestroyWindow( x11display.dpy, x11display.gl_win ); ++ if( x11display.win ) XDestroyWindow( x11display.dpy, x11display.win ); ++ ++ XCloseDisplay( x11display.dpy ); ++ } ++ ++ memset(&x11display.features, 0, sizeof(x11display.features)); ++ x11display.modeset = qfalse; ++ x11display.visinfo = NULL; ++ x11display.cmap = 0; ++ x11display.ctx = NULL; ++ x11display.gl_win = 0; ++ x11display.win = 0; ++ x11display.dpy = NULL; ++} ++ ++static qboolean gotstencil = qfalse; // evil hack! ++static qboolean ChooseVisual( int colorbits, int stencilbits ) ++{ ++ int colorsize; ++ int depthbits = colorbits; ++ ++ if( colorbits == 24 ) colorsize = 8; ++ else colorsize = 4; ++ ++ { ++ int attributes[] = { ++ GLX_RGBA, ++ GLX_DOUBLEBUFFER, ++ GLX_RED_SIZE, colorsize, ++ GLX_GREEN_SIZE, colorsize, ++ GLX_BLUE_SIZE, colorsize, ++ GLX_DEPTH_SIZE, depthbits, ++ GLX_STENCIL_SIZE, stencilbits, ++ None ++ }; ++ ++ x11display.visinfo = qglXChooseVisual( x11display.dpy, x11display.scr, attributes ); ++ if( !x11display.visinfo ) ++ { ++ Com_Printf( "..Failed to get colorbits %i, depthbits %i, stencilbits %i\n", colorbits, depthbits, stencilbits ); ++ return qfalse; ++ } ++ else ++ { ++ Com_Printf( "..Got colorbits %i, depthbits %i, stencilbits %i\n", colorbits, depthbits, stencilbits ); ++ if( stencilbits > 0 ) gotstencil = qtrue; ++ return qtrue; ++ } ++ } ++} ++ ++static int _my_x11_error( Display *dpy, XErrorEvent *ev ) ++{ ++ printf("_my_x11_error:\n\ttype: %d\n\terror-code: %d\n\tminor-code: %d\n\trequest-code: %d\n", ++ ev->type, ev->error_code, ev->minor_code, ev->request_code ); ++ ++// assert( 0 ); ++ ++ return 0; ++} ++ ++/* ++** GLimp_Init ++*/ ++int GLimp_Init( void *hinstance, void *wndproc, void *parenthWnd ) ++{ ++ int colorbits, stencilbits; ++ XSetWindowAttributes attr; ++ unsigned long mask; ++ ++ hinstance = NULL; ++ wndproc = NULL; ++ ++ // on unix we can change to fullscreen on fly ++ vid_fullscreen->flags &= ~( CVAR_LATCH_VIDEO ); ++ ++ if( x11display.dpy ) ++ GLimp_Shutdown(); ++ ++ Com_Printf( "Display initialization\n" ); ++ ++ x11display.dpy = XOpenDisplay( NULL ); ++ if( !x11display.dpy ) ++ { ++ Com_Printf( "..Error couldn't open the X display\n" ); ++ return 0; ++ } ++ ++ x11display.scr = DefaultScreen( x11display.dpy ); ++ if( parenthWnd ) ++ x11display.root = (Window )parenthWnd; ++ else ++ x11display.root = RootWindow( x11display.dpy, x11display.scr ); ++ ++ x11display.wmState = XInternAtom( x11display.dpy, "WM_STATE", False ); ++ x11display.features.wmStateFullscreen = _NET_WM_STATE_FULLSCREEN_SUPPORTED(); ++ ++ _xf86_VidmodesInit(); ++ ++ if( r_colorbits->integer == 16 || r_colorbits->integer == 24 ) colorbits = r_colorbits->integer; ++ else colorbits = 0; ++ ++ if( r_stencilbits->integer == 8 || r_stencilbits->integer == 16 ) stencilbits = r_stencilbits->integer; ++ else stencilbits = 0; ++ ++ gotstencil = qfalse; ++ if( colorbits > 0 ) ++ { ++ ChooseVisual( colorbits, stencilbits ); ++ if( !x11display.visinfo && stencilbits > 8 ) ChooseVisual( colorbits, 8 ); ++ if( !x11display.visinfo && stencilbits > 0 ) ChooseVisual( colorbits, 0 ); ++ if( !x11display.visinfo && colorbits > 16 ) ChooseVisual( 16, 0 ); ++ } ++ else ++ { ++ ChooseVisual( 24, stencilbits ); ++ if( !x11display.visinfo ) ChooseVisual( 16, stencilbits ); ++ if( !x11display.visinfo && stencilbits > 8 ) ChooseVisual( 24, 8 ); ++ if( !x11display.visinfo && stencilbits > 8 ) ChooseVisual( 16, 8 ); ++ if( !x11display.visinfo && stencilbits > 0 ) ChooseVisual( 24, 0 ); ++ if( !x11display.visinfo && stencilbits > 0 ) ChooseVisual( 16, 0 ); ++ } ++ ++ if( !x11display.visinfo ) ++ { ++ GLimp_Shutdown(); // hope this doesn't do anything evil when we don't have window etc. ++ Com_Printf( "..Error couldn't set GLX visual\n" ); ++ return 0; ++ } ++ ++ glState.stencilEnabled = gotstencil; ++ ++ x11display.ctx = qglXCreateContext( x11display.dpy, x11display.visinfo, NULL, True ); ++ x11display.cmap = XCreateColormap( x11display.dpy, x11display.root, x11display.visinfo->visual, AllocNone ); ++ ++ attr.colormap = x11display.cmap; ++ attr.border_pixel = 0; ++ attr.event_mask = DISPLAY_MASK; ++ attr.override_redirect = False; ++ mask = CWBorderPixel | CWColormap | ExposureMask; ++ ++ x11display.gl_win = XCreateWindow( x11display.dpy, x11display.root, 0, 0, 1, 1, 0, ++ x11display.visinfo->depth, InputOutput, x11display.visinfo->visual, mask, &attr ); ++ qglXMakeCurrent( x11display.dpy, x11display.gl_win, x11display.ctx ); ++ ++ XSync( x11display.dpy, False ); ++ ++ XSetErrorHandler( _my_x11_error ); ++ ++ return 1; ++} ++ ++/* ++** GLimp_BeginFrame ++*/ ++void GLimp_BeginFrame( void ) ++{ ++} ++ ++/* ++** GLimp_EndFrame ++** ++** Responsible for doing a swapbuffers and possibly for other stuff ++** as yet to be determined. Probably better not to make this a GLimp ++** function and instead do a call to GLimp_SwapBuffers. ++*/ ++void GLimp_EndFrame( void ) ++{ ++ qglXSwapBuffers( x11display.dpy, x11display.gl_win ); ++ ++ if( vid_fullscreen->modified || ( vid_fullscreen->integer && vid_multiscreen_head->modified ) ) ++ { ++ GLimp_SetMode_Real( r_mode->integer, vid_fullscreen->integer, qtrue ); ++ vid_fullscreen->modified = qfalse; ++ vid_multiscreen_head->modified = qfalse; ++ } ++} ++ ++/* ++** GLimp_GetGammaRamp ++*/ ++qboolean GLimp_GetGammaRamp( size_t stride, unsigned short *ramp ) ++{ ++ if( XF86VidModeGetGammaRamp( x11display.dpy, x11display.scr, stride, ramp, ramp + stride, ramp + ( stride << 1 ) ) != 0 ) ++ return qtrue; ++ return qfalse; ++} ++ ++/* ++** GLimp_SetGammaRamp ++*/ ++void GLimp_SetGammaRamp( size_t stride, unsigned short *ramp ) ++{ ++ XF86VidModeSetGammaRamp( x11display.dpy, x11display.scr, stride, ramp, ramp + stride, ramp + ( stride << 1 ) ); ++} ++ ++/* ++** GLimp_AppActivate ++*/ ++void GLimp_AppActivate( qboolean active, qboolean destroy ) ++{ ++} ++ +diff -ru a/unix/unix_input.c b/unix/unix_input.c +--- a/unix/unix_input.c 2011-04-29 14:42:24.000000000 +0200 ++++ b/unix/unix_input.c 2011-10-03 22:13:53.000000000 +0200 +@@ -748,6 +748,13 @@ + case ClientMessage: + if( event.xclient.data.l[0] == x11display.wmDeleteWindow ) + Cbuf_ExecuteText( EXEC_NOW, "quit" ); ++ ++ if( event.xclient.data.l[0] == x11display.ping ) ++ { ++ event.xclient.window = x11display.root; ++ XSendEvent( x11display.dpy, x11display.root, False, ++ (SubstructureNotifyMask|SubstructureRedirectMask), &event ); ++ } + break; + + case MapNotify: +diff -ru a/unix/x11.h b/unix/x11.h +--- a/unix/x11.h 2011-04-29 14:42:24.000000000 +0200 ++++ b/unix/x11.h 2011-10-03 22:11:30.000000000 +0200 +@@ -18,6 +18,7 @@ + GLXContext ctx; + XVisualInfo *visinfo; + Atom wmDeleteWindow; ++ Atom ping; + + Atom wmState; + struct featureset_s { diff --git a/warsow-openbox/wsw-server.launcher b/warsow-openbox/wsw-server.launcher new file mode 100755 index 000000000..5035253e6 --- /dev/null +++ b/warsow-openbox/wsw-server.launcher @@ -0,0 +1,5 @@ +#!/bin/bash + +cd "/opt/warsow" +./wsw_server $* +exit $? diff --git a/warsow-openbox/wswtv-server.launcher b/warsow-openbox/wswtv-server.launcher new file mode 100755 index 000000000..10f70a234 --- /dev/null +++ b/warsow-openbox/wswtv-server.launcher @@ -0,0 +1,5 @@ +#!/bin/bash + +cd "/opt/warsow" +./wswtv_server $* +exit $? diff --git a/wine-laa/PKGBUILD b/wine-laa/PKGBUILD index 7b11557e6..ca5227066 100644 --- a/wine-laa/PKGBUILD +++ b/wine-laa/PKGBUILD @@ -3,15 +3,15 @@ pkgname=wine-laa pkgbasename=wine -pkgver=1.3.36 +pkgver=1.3.37 pkgrel=1 _pkgbasever=${pkgver/rc/-rc} source=(http://ibiblio.org/pub/linux/system/emulators/$pkgbasename/$pkgbasename-$_pkgbasever.tar.bz2 wine-laa.patch) -md5sums=('51e20231aa72a7b9db89aefdae8e92e3' - '8f2ccb8cbfe84a4f1db30fd06b5f327c') +md5sums=('4bf25be22c130765283d9953d03b65c4' + 'c1734f81014654a3b81a5d1c51b140a3') pkgdesc="A compatibility layer for running Windows programs. This version of Wine includes a patch to improve gaming performance." url="http://www.winehq.com" @@ -151,4 +151,4 @@ package() { fi } -# vim:set ts=8 sts=2 sw=2 et: \ No newline at end of file +# vim:set ts=8 sts=2 sw=2 et: diff --git a/wine-laa/wine-laa.patch b/wine-laa/wine-laa.patch index c8ddd660b..b892f45bc 100644 --- a/wine-laa/wine-laa.patch +++ b/wine-laa/wine-laa.patch @@ -29,4 +29,282 @@ diff -urB wine/dlls/ntdll/loader.c wine/dlls/ntdll/loader.c + virtual_release_address_space( IMAGE_FILE_LARGE_ADDRESS_AWARE ); virtual_clear_thread_stack(); wine_switch_to_stack( start_process, kernel_start, NtCurrentTeb()->Tib.StackBase ); + +diff -urB wine/dlls/wined3d/directx.c wine/dlls/wined3d/directx.c +--- wine/dlls/wined3d/directx.c ++++ wine/dlls/wined3d/directx.c +@@ -4673,8 +4673,13 @@ HRESULT CDECL wined3d_get_device_caps(const struct wined3d *wined3d, UINT adapte + caps->MaxUserClipPlanes = gl_info->limits.clipplanes; + caps->MaxActiveLights = gl_info->limits.lights; +- caps->MaxVertexBlendMatrices = gl_info->limits.blends; +- caps->MaxVertexBlendMatrixIndex = 0; ++ if (gl_info->supported[ARB_VERTEX_BLEND]) { ++ caps->MaxVertexBlendMatrices = gl_info->limits.blends; ++ caps->MaxVertexBlendMatrixIndex = 0; ++ } else { ++ caps->MaxVertexBlendMatrices = 4; ++ caps->MaxVertexBlendMatrixIndex = 255; ++ } + + caps->MaxAnisotropy = gl_info->limits.anisotropy; + caps->MaxPointSize = gl_info->limits.pointsize_max; +diff -urB wine/dlls/wined3d/drawprim.c wine/dlls/wined3d/drawprim.c +--- wine/dlls/wined3d/drawprim.c ++++ wine/dlls/wined3d/drawprim.c +@@ -60,6 +60,75 @@ static void drawStridedFast(const struct wined3d_gl_info *gl_info, GLenum primit + } + + /* ++ * Emit a vertex using swoftware vertex blending ++ */ ++static void emitBlendedVertex(struct wined3d_stateblock *stateBlock, ++ const float *weights, int nweights, const BYTE *indices, ++ const float *pos, const float *norm) ++{ ++ const float *m; ++ float vec[4]; ++ float mat[4*4]; ++ float last = 1.f; ++ int i, j; ++ ++ /* compute the weighted sum of the matrices */ ++ m = &stateBlock->state.transforms[WINED3DTS_WORLDMATRIX((indices ? indices[0] : 0))].u.m[0][0]; ++ for (j = 0; j < 16; j++) ++ mat[j] = m[j] * weights[0]; ++ last -= weights[0]; ++ ++ for (i = 1; i < nweights; i++) { ++ if (weights[i]) { ++ m = &stateBlock->state.transforms[WINED3DTS_WORLDMATRIX((indices ? indices[i] : i))].u.m[0][0]; ++ for (j = 0; j < 16; j++) ++ mat[j] += m[j] * weights[i]; ++ last -= weights[i]; ++ } ++ } ++ ++ /* do the last */ ++ if (last) { ++ m = &stateBlock->state.transforms[WINED3DTS_WORLDMATRIX((indices ? indices[i] : i))].u.m[0][0]; ++ for (j = 0; j < 16; j++) ++ mat[j] += m[j] * last; ++ } ++ ++ if (norm) { ++ /* compute the resulting normal */ ++ vec[0] = norm[0] * mat[0] + norm[1] * mat[4] + norm[2] * mat[8]; ++ vec[1] = norm[0] * mat[1] + norm[1] * mat[5] + norm[2] * mat[9]; ++ vec[2] = norm[0] * mat[2] + norm[1] * mat[6] + norm[2] * mat[10]; ++ /* normalize */ ++ vec[3] = vec[0]*vec[0] + vec[1]*vec[1] + vec[2]*vec[2]; ++ if (vec[3]) { ++ vec[3] = 1.f / sqrtf(vec[3]); ++ vec[0] *= vec[3]; ++ vec[1] *= vec[3]; ++ vec[2] *= vec[3]; ++ } ++ ++ glNormal3fv(vec); ++ } ++ ++ if (pos) { ++ /* compute the resulting position */ ++ vec[0] = pos[0] * mat[0] + pos[1] * mat[4] + pos[2] * mat[8] + mat[12]; ++ vec[1] = pos[0] * mat[1] + pos[1] * mat[5] + pos[2] * mat[9] + mat[13]; ++ vec[2] = pos[0] * mat[2] + pos[1] * mat[6] + pos[2] * mat[10] + mat[14]; ++ vec[3] = pos[0] * mat[3] + pos[1] * mat[7] + pos[2] * mat[11] + mat[15]; ++ /* normalize */ ++ if (vec[3]) { ++ vec[0] /= vec[3]; ++ vec[1] /= vec[3]; ++ vec[2] /= vec[3]; ++ } ++ ++ glVertex3fv(vec); ++ } ++} ++ ++/* + * Actually draw using the supplied information. + * Slower GL version which extracts info about each vertex in turn + */ +@@ -78,7 +147,8 @@ static void drawStridedSlow(const struct wined3d_device *device, const struct wi + BOOL pixelShader = use_ps(state); + BOOL specular_fog = FALSE; + const BYTE *texCoords[WINED3DDP_MAXTEXCOORD]; +- const BYTE *diffuse = NULL, *specular = NULL, *normal = NULL, *position = NULL; ++ const BYTE *diffuse = NULL, *specular = NULL, *normal = NULL, *position = NULL, *weights = NULL, *indices = NULL; ++ int nweights = 0; + const struct wined3d_gl_info *gl_info = context->gl_info; + UINT texture_stages = gl_info->limits.texture_stages; + const struct wined3d_stream_info_element *element; +@@ -171,6 +241,31 @@ static void drawStridedSlow(const struct wined3d_device *device, const struct wi + GL_EXTCALL(glSecondaryColor3fEXT)(0, 0, 0); + } + ++ if (device->vertexBlendSW) { ++ if (!si->elements[WINED3D_FFP_BLENDWEIGHT].data.addr) { ++ WARN("vertex blending enabled but blendWeights.data=NULL\n"); ++ } else if (si->elements[WINED3D_FFP_BLENDWEIGHT].format->gl_vtx_type != GL_FLOAT) { ++ FIXME("unsupported blend weights datatype (%d)\n", si->elements[WINED3D_FFP_BLENDWEIGHT].format->id); ++ } else if (position && si->elements[WINED3D_FFP_POSITION].format->emit_idx != WINED3D_FFP_EMIT_FLOAT3) { ++ FIXME("unsupported postion datatype (%d)\n", si->elements[WINED3D_FFP_POSITION].format->id); ++ } else if (normal && si->elements[WINED3D_FFP_NORMAL].format->emit_idx != WINED3D_FFP_EMIT_FLOAT3) { ++ FIXME("unsupported normal datatype (%d)\n", si->elements[WINED3D_FFP_NORMAL].format->id); ++ } else { ++ element = &si->elements[WINED3D_FFP_BLENDWEIGHT]; ++ weights = element->data.addr; ++ nweights = element->format->gl_vtx_format; ++ } ++ ++ if (si->elements[WINED3D_FFP_BLENDINDICES].data.addr) { ++ if (si->elements[WINED3D_FFP_BLENDINDICES].format->emit_idx != WINED3D_FFP_EMIT_UBYTE4) { ++ FIXME("unsupported blend indices datatype (%d)\n", si->elements[WINED3D_FFP_BLENDINDICES].format->id); ++ } else { ++ element = &si->elements[WINED3D_FFP_BLENDINDICES]; ++ indices = element->data.addr; ++ } ++ } ++ } ++ + for (textureNo = 0; textureNo < texture_stages; ++textureNo) + { + int coordIdx = state->texture_states[textureNo][WINED3DTSS_TEXCOORDINDEX]; +@@ -287,17 +382,25 @@ static void drawStridedSlow(const struct wined3d_device *device, const struct wi + } + } + +- /* Normal -------------------------------- */ ++ if (weights) { ++ emitBlendedVertex(device->stateBlock, ++ (const float*)(weights + SkipnStrides * si->elements[WINED3D_FFP_BLENDWEIGHT].stride), nweights, ++ indices ? (indices + SkipnStrides * si->elements[WINED3D_FFP_BLENDINDICES].stride) : NULL, ++ (const float*)(position ? (position + SkipnStrides * si->elements[WINED3D_FFP_POSITION].stride) : NULL), ++ (const float*)(normal ? (normal + SkipnStrides * si->elements[WINED3D_FFP_NORMAL].stride) : NULL)); ++ } else { ++ /* Normal -------------------------------- */ + if (normal) + { +- const void *ptrToCoords = normal + SkipnStrides * si->elements[WINED3D_FFP_NORMAL].stride; ++ const void *ptrToCoords = normal + SkipnStrides * si->elements[WINED3D_FFP_NORMAL].stride; + normal_funcs[si->elements[WINED3D_FFP_NORMAL].format->emit_idx](ptrToCoords); +- } ++ } + +- /* Position -------------------------------- */ +- if (position) { +- const void *ptrToCoords = position + SkipnStrides * si->elements[WINED3D_FFP_POSITION].stride; ++ /* Position -------------------------------- */ ++ if (position) { ++ const void *ptrToCoords = position + SkipnStrides * si->elements[WINED3D_FFP_POSITION].stride; + position_funcs[si->elements[WINED3D_FFP_POSITION].format->emit_idx](ptrToCoords); ++ } + } + + /* For non indexed mode, step onto next parts */ +@@ -696,6 +799,17 @@ void drawPrimitive(struct wined3d_device *device, UINT index_count, UINT StartId + } + emulation = TRUE; + } ++ else if (device->vertexBlendSW) ++ { ++ static BOOL warned; ++ if (!warned) { ++ FIXME("Using software emulation because vertex blending is enabled\n"); ++ warned = TRUE; ++ } else { ++ TRACE("Using software emulation because vertex blending is enabled\n"); ++ } ++ emulation = TRUE; ++ } + + if(emulation) { + stream_info = &stridedlcl; +diff -urB wine/dlls/wined3d/state.c wine/dlls/wined3d/state.c +--- wine/dlls/wined3d/state.c ++++ wine/dlls/wined3d/state.c +@@ -3662,7 +3662,7 @@ static void transform_world(struct wined3d_context *context, const struct wined3 + glLoadIdentity(); + checkGLcall("glLoadIdentity()"); + } +- else ++ else if (!context->swapchain->device->vertexBlendSW) + { + /* In the general case, the view matrix is the identity matrix */ + if (context->swapchain->device->view_ident) +@@ -3677,6 +3677,9 @@ static void transform_world(struct wined3d_context *context, const struct wined3 + glMultMatrixf(&state->transforms[WINED3DTS_WORLDMATRIX(0)].u.m[0][0]); + checkGLcall("glMultMatrixf"); + } ++ } else { ++ glLoadMatrixf(&state->transforms[WINED3DTS_VIEW].u.m[0][0]); ++ checkGLcall("glLoadMatrixf"); + } + } + +@@ -3812,11 +3812,30 @@ static void state_vertexblend_w(struct wined3d_context *context, const struct wi + enum wined3d_vertex_blend_flags f = state->render_states[WINED3D_RS_VERTEXBLEND]; + static unsigned int once; + +- if (f == WINED3D_VBF_DISABLE) +- return; +- +- if (!once++) FIXME("Vertex blend flags %#x not supported.\n", f); +- else WARN("Vertex blend flags %#x not supported.\n", f); ++ switch (f) { ++ case WINED3D_VBF_0WEIGHTS: ++ case WINED3D_VBF_1WEIGHTS: ++ case WINED3D_VBF_2WEIGHTS: ++ case WINED3D_VBF_3WEIGHTS: ++ if(!once) { ++ once = TRUE; ++ FIXME("Vertex blending enabled, but not supported by hardware. Using software emulation.\n"); ++ } ++ if (!context->swapchain->device->vertexBlendSW) { ++ context->swapchain->device->vertexBlendSW = TRUE; ++ transform_world(context, state, state_id); ++ } ++ break; ++ case WINED3D_VBF_TWEENING: ++ WARN("Vertex blend flags %#x not supported.\n", f); ++ /* fall through */ ++ default: ++ if (context->swapchain->device->vertexBlendSW) { ++ context->swapchain->device->vertexBlendSW = FALSE; ++ transform_world(context, state, state_id); ++ } ++ break; ++ } + } + + static void state_vertexblend(struct wined3d_context *context, const struct wined3d_state *state, DWORD state_id) +diff -urB wine/dlls/wined3d/vertexdeclaration.c wine/dlls/wined3d/vertexdeclaration.c +--- wine/dlls/wined3d/vertexdeclaration.c ++++ wine/dlls/wined3d/vertexdeclaration.c +@@ -107,6 +107,15 @@ static BOOL declaration_element_valid_ffp(const WINED3DVERTEXELEMENT *element) + return FALSE; + } + ++ case WINED3DDECLUSAGE_BLENDINDICES: ++ switch(element->format) ++ { ++ case WINED3DFMT_R8G8B8A8_UINT: ++ return TRUE; ++ default: ++ return FALSE; ++ } ++ + case WINED3DDECLUSAGE_NORMAL: + switch(element->format) + { +diff -urB wine/dlls/wined3d/wined3d_private.h wine/dlls/wined3d/wined3d_private.h +--- wine/dlls/wined3d/wined3d_private.h ++++ wine/dlls/wined3d/wined3d_private.h +@@ -1672,6 +1672,7 @@ struct wined3d_device + + WORD view_ident : 1; /* true iff view matrix is identity */ + WORD vertexBlendUsed : 1; /* To avoid needless setting of the blend matrices */ ++ WORD vertexBlendSW : 1; /* vertexBlend software fallback used */ + WORD isRecordingState : 1; + WORD isInDraw : 1; + WORD bCursorVisible : 1; diff --git a/wine-rt/PKGBUILD b/wine-rt/PKGBUILD index 9d0b9d230..3768a4733 100755 --- a/wine-rt/PKGBUILD +++ b/wine-rt/PKGBUILD @@ -5,14 +5,14 @@ # Contributor: Giovanni Scafora pkgname=wine-rt -pkgver=1.3.36 +pkgver=1.3.37 pkgrel=1 _pkgbasever=${pkgver/rc/-rc} source=(http://ibiblio.org/pub/linux/system/emulators/wine/wine-$pkgver.tar.bz2 wine-rt-101107.patch wine-rt.install) install=wine-rt.install -md5sums=('51e20231aa72a7b9db89aefdae8e92e3' +md5sums=('4bf25be22c130765283d9953d03b65c4' '865b770292f5e84cde618fe4beb8748c' 'b2e3ba93933f64bd98a3aa8ec64ffcfd') diff --git a/xqf/PKGBUILD b/xqf/PKGBUILD index 43a942adf..5975fc6c5 100644 --- a/xqf/PKGBUILD +++ b/xqf/PKGBUILD @@ -3,13 +3,13 @@ pkgname=xqf pkgver=1.0.5 -pkgrel=4 +pkgrel=5 pkgdesc="A Quake/Quake World/Quake2/Quake3 server browser and launcher for X11" arch=('i686' 'x86_64') url="http://www.linuxgames.com/xqf/" license=('GPL') depends=('gtk2' 'qstat' 'geoip') -makedepends=('chrpath' 'perl-xml-parser') +makedepends=('perl-xml-parser') source=(http://downloads.sourceforge.net/$pkgname/$pkgname-$pkgver.tar.gz) md5sums=('a88cecba6abb6349107ab135f1009946') @@ -18,10 +18,9 @@ build() { ./configure --prefix=/usr \ --mandir=/usr/share/man \ --enable-gtk2 \ - --enable-geoip + --enable-geoip \ + LIBS='/usr/lib/libX11.so.6 /lib/libdl.so.2' make || return 1 make DESTDIR=$pkgdir install - find $pkgdir -name \*.so -type f -exec chrpath -d {} \; && \ - find $pkgdir -perm /ugo+x -type f -exec chrpath -d {} \; } -- 2.11.4.GIT