compizconfig-python: Changes to 'upstream-unstable'
Rebased ref, commits from common ancestor:
commit 5ccb653eb22428318c25b355b5143e695d33f0c7
Author: Guillaume Seguin <guillaume@segu.in>
Date: Fri Feb 18 15:29:33 2011 +0800
Don't drop the stderr since it might give a message to the user
that could actually be quite useful (eg, adjust PKG_CONFIG_PATH)
diff --git a/setup.py b/setup.py
index 1002067..a364eed 100644
--- a/setup.py
+++ b/setup.py
@@ -25,7 +25,7 @@ def pkgconfig(*packages, **kw):
flag_map = {'-I': 'include_dirs', '-L': 'library_dirs', '-l': 'libraries', '-R': 'runtime_library_dirs'}
cmd = ['pkg-config', '--libs', '--cflags']
- tokens = subprocess.Popen (cmd + list(packages), stdout=subprocess.PIPE, stderr=open(os.devnull, 'w')).communicate()[0].split ()
+ tokens = subprocess.Popen (cmd + list(packages), stdout=subprocess.PIPE).communicate()[0].split ()
for t in tokens:
if '-L' in t[:2]:
commit c6019ee880d3e9e1ea9f0d4d01d7e9172e2ed520
Author: Sam Spilsbury <sam.spilsbury@canonical.com>
Date: Fri Feb 18 15:26:38 2011 +0800
Add packges and list directly
diff --git a/setup.py b/setup.py
index 26af394..1002067 100644
--- a/setup.py
+++ b/setup.py
@@ -25,10 +25,7 @@ def pkgconfig(*packages, **kw):
flag_map = {'-I': 'include_dirs', '-L': 'library_dirs', '-l': 'libraries', '-R': 'runtime_library_dirs'}
cmd = ['pkg-config', '--libs', '--cflags']
- for i in packages:
- cmd.append (i)
-
- tokens = subprocess.Popen (cmd, stdout=subprocess.PIPE, stderr=open(os.devnull, 'w')).communicate()[0].split ()
+ tokens = subprocess.Popen (cmd + list(packages), stdout=subprocess.PIPE, stderr=open(os.devnull, 'w')).communicate()[0].split ()
for t in tokens:
if '-L' in t[:2]:
commit 65a2c0115b1e784b2639dc7b12de4396f1be5d3d
Author: Sam Spilsbury <sam.spilsbury@canonical.com>
Date: Fri Feb 18 15:10:10 2011 +0800
Adjust for subprocess syntax
diff --git a/setup.py b/setup.py
index 85f64eb..26af394 100644
--- a/setup.py
+++ b/setup.py
@@ -23,9 +23,13 @@ if "=" in version:
def pkgconfig(*packages, **kw):
flag_map = {'-I': 'include_dirs', '-L': 'library_dirs', '-l': 'libraries', '-R': 'runtime_library_dirs'}
+ cmd = ['pkg-config', '--libs', '--cflags']
+
+ for i in packages:
+ cmd.append (i)
+
+ tokens = subprocess.Popen (cmd, stdout=subprocess.PIPE, stderr=open(os.devnull, 'w')).communicate()[0].split ()
- tokens = subprocess.Popen (['pkg-config', '--libs', '--cflags %s' % ' '.join (packages)], stdout=subprocess.PIPE, stderr=open(os.devnull, 'w')).communicate()[0].split ()
-
for t in tokens:
if '-L' in t[:2]:
kw.setdefault (flag_map.get ("-L"), []).append (t[2:])
commit 28c6874942fb19da27d7a8aa2148956a13380902
Author: Sam Spilsbury <sam.spilsbury@canonical.com>
Date: Sat Feb 12 23:13:55 2011 +0800
Use subprocess instead of commands and print () instead of print
because they are deprecated in Python 3.0
diff --git a/setup.py b/setup.py
index 9cfb05f..85f64eb 100644
--- a/setup.py
+++ b/setup.py
@@ -7,7 +7,6 @@ from distutils.command.sdist import sdist as _sdist
from distutils.extension import Extension
import os
import subprocess
-import commands
# If src/compizconfig.pyx exists, build using Cython
if os.path.exists ("src/compizconfig.pyx"):
@@ -25,7 +24,7 @@ if "=" in version:
def pkgconfig(*packages, **kw):
flag_map = {'-I': 'include_dirs', '-L': 'library_dirs', '-l': 'libraries', '-R': 'runtime_library_dirs'}
- tokens = commands.getoutput("pkg-config --libs --cflags %s" % ' '.join(packages)).split()
+ tokens = subprocess.Popen (['pkg-config', '--libs', '--cflags %s' % ' '.join (packages)], stdout=subprocess.PIPE, stderr=open(os.devnull, 'w')).communicate()[0].split ()
for t in tokens:
if '-L' in t[:2]:
@@ -44,8 +43,8 @@ VERSION_FILE = os.path.join (os.path.dirname (__file__), "VERSION")
pkgconfig_libs = subprocess.Popen (["pkg-config", "--libs", "libcompizconfig"], stdout=subprocess.PIPE, stderr=open(os.devnull, 'w')).communicate ()[0]
if len (pkgconfig_libs) is 0:
- print "CompizConfig Python [ERROR]: No libcompizconfig.pc found in the pkg-config search path"
- print "Ensure that libcompizonfig is installed or libcompizconfig.pc is in your $PKG_CONFIG_PATH"
+ print ("CompizConfig Python [ERROR]: No libcompizconfig.pc found in the pkg-config search path")
+ print ("Ensure that libcompizonfig is installed or libcompizconfig.pc is in your $PKG_CONFIG_PATH")
exit (1);
libs = pkgconfig_libs[2:].split (" ")[0]
@@ -105,7 +104,7 @@ class uninstall (_install):
for counter in xrange (len (files)):
files[counter] = prepend + files[counter].rstrip ()
for file in files:
- print "Uninstalling %s" % file
+ print ("Uninstalling %s" % file)
try:
os.unlink (file)
except:
commit 53d5da274e4d6327b75ed233d3e6f74c8b123296
Author: Sam Spilsbury <sam.spilsbury@canonical.com>
Date: Sat Feb 12 23:13:08 2011 +0800
Use __cinit__ instead of __new__ since its removed in Cython 0.14
diff --git a/src/compizconfig.pyx b/src/compizconfig.pyx
index d31f372..146f02b 100644
--- a/src/compizconfig.pyx
+++ b/src/compizconfig.pyx
@@ -570,7 +570,7 @@ cdef class Setting:
cdef object extendedStrRestrictions
cdef object baseStrRestrictions
- def __new__ (self, Plugin plugin, name):
+ def __cinit__ (self, Plugin plugin, name):
cdef CCSSettingType t
cdef CCSSettingInfo * i
@@ -674,7 +674,7 @@ cdef class Setting:
cdef class SSGroup:
cdef object screen
- def __new__ (self, screen):
+ def __cinit__ (self, screen):
self.screen = screen
property Screen:
@@ -692,7 +692,7 @@ cdef class Plugin:
cdef object ranking
cdef object hasExtendedString
- def __new__ (self, Context context, name):
+ def __cinit__ (self, Context context, name):
self.ccsPlugin = ccsFindPlugin (context.ccsContext, name)
self.context = context
self.screen = {}
@@ -1007,7 +1007,7 @@ cdef class Profile:
cdef Context context
cdef char * name
- def __new__ (self, Context context, name):
+ def __cinit__ (self, Context context, name):
self.context = context
self.name = strdup (name)
@@ -1029,7 +1029,7 @@ cdef class Backend:
cdef Bool profileSupport
cdef Bool integrationSupport
- def __new__ (self, Context context, info):
+ def __cinit__ (self, Context context, info):
self.context = context
self.name = strdup (info[0])
self.shortDesc = strdup (info[1])
@@ -1072,7 +1072,7 @@ cdef class Context:
cdef object currentBackend
cdef Bool integration
- def __new__ (self, screenNum = 0, plugins = [], basic_metadata = False):
+ def __cinit__ (self, screenNum = 0, plugins = [], basic_metadata = False):
cdef CCSPlugin * pl
cdef CCSList * pll
if basic_metadata:
commit 41fb7785fdaada4611061e1c398c72183e62ffa7
Author: Sam Spilsbury <sam.spilsbury@canonical.com>
Date: Thu Dec 2 23:09:25 2010 +0800
Don't use tabs/spaces in the pkgconfig block
diff --git a/setup.py b/setup.py
index bccd0d1..9cfb05f 100644
--- a/setup.py
+++ b/setup.py
@@ -28,14 +28,14 @@ def pkgconfig(*packages, **kw):
tokens = commands.getoutput("pkg-config --libs --cflags %s" % ' '.join(packages)).split()
for t in tokens:
- if '-L' in t[:2]:
- kw.setdefault (flag_map.get ("-L"), []).append (t[2:])
- if not os.getenv ("COMPIZ_DISABLE_RPATH") is "1":
- kw.setdefault (flag_map.get ("-R"), []).append (t[2:])
- elif '-I' in t[:2]:
- kw.setdefault (flag_map.get ("-I"), []).append (t[2:])
- elif '-l' in t[:2]:
- kw.setdefault (flag_map.get ("-l"), []).append (t[2:])
+ if '-L' in t[:2]:
+ kw.setdefault (flag_map.get ("-L"), []).append (t[2:])
+ if not os.getenv ("COMPIZ_DISABLE_RPATH") is "1":
+ kw.setdefault (flag_map.get ("-R"), []).append (t[2:])
+ elif '-I' in t[:2]:
+ kw.setdefault (flag_map.get ("-I"), []).append (t[2:])
+ elif '-l' in t[:2]:
+ kw.setdefault (flag_map.get ("-l"), []).append (t[2:])
return kw
commit 3713fc7fd269ebcc9540dc145b70be0d9b916429
Author: Sam Spilsbury <smspillaz@gmail.com>
Date: Sat Nov 6 20:49:06 2010 +0800
Update NEWS for 0.9.2.1 Release
diff --git a/NEWS b/NEWS
index 97c70ef..9b503d5 100644
--- a/NEWS
+++ b/NEWS
@@ -9,3 +9,7 @@ Update for libcompizconfig API changes
Release 0.9.2 (2010-10-24 Sam Spilsbury <smspillaz@gmail.com>)
==============================================================
Development release.
+
+Release 0.9.2.1 (2010-11-06 Sam Spilsbury <sam.spilsbury@canonical.com>)
+========================================================================
+Bugfix release.
commit ea21e66299a881f1962fbd5e97939f7e31d09972
Author: Sam Spilsbury <smspillaz@gmail.com>
Date: Sat Nov 6 20:40:42 2010 +0800
Update to 0.9.2.1
diff --git a/VERSION b/VERSION
index f626ec2..5d08606 100644
--- a/VERSION
+++ b/VERSION
@@ -1 +1 @@
-VERSION=0.9.0
+VERSION=0.9.2.1
commit d70e7b9f873484991dcf92641e12f091ce3e598d
Author: Sam Spilsbury <smspillaz@gmail.com>
Date: Sun Oct 24 22:53:22 2010 +0800
Update NEWS for 0.9.2 release
diff --git a/NEWS b/NEWS
index b9c231c..97c70ef 100644
--- a/NEWS
+++ b/NEWS
@@ -4,4 +4,8 @@ Development release.
Added simple setuptools/cython based buildsystem.
-Update for libcompizconfig API changes
\ No newline at end of file
+Update for libcompizconfig API changes
+
+Release 0.9.2 (2010-10-24 Sam Spilsbury <smspillaz@gmail.com>)
+==============================================================
+Development release.
commit 2351cfd3c1ba1d1cc1c9b18093df8b47603a5fcc
Author: Guillaume Seguin <guillaume@segu.in>
Date: Sun Jul 4 03:49:21 2010 -0400
Whitespace fix
diff --git a/setup.py b/setup.py
index 717c93f..bccd0d1 100644
--- a/setup.py
+++ b/setup.py
@@ -136,11 +136,11 @@ setup (
license = "GPL",
maintainer = "Guillaume Seguin",
maintainer_email = "guillaume@segu.in",
- cmdclass = {"uninstall" : uninstall,
- "install" : install,
- "install_data" : install_data,
- "build_ext" : build_ext,
- "sdist" : sdist},
+ cmdclass = {"uninstall" : uninstall,
+ "install" : install,
+ "install_data" : install_data,
+ "build_ext" : build_ext,
+ "sdist" : sdist},
ext_modules=[
Extension ("compizconfig", [ext_module_src],
**pkgconfig("libcompizconfig"))
commit 3356da1785ff27286d1e476c85e7e894396623c1
Author: Guillaume Seguin <guillaume@segu.in>
Date: Sun Jul 4 03:48:45 2010 -0400
Distribute C file
diff --git a/setup.py b/setup.py
index 1b01b65..717c93f 100644
--- a/setup.py
+++ b/setup.py
@@ -3,12 +3,20 @@ from distutils.core import setup
from distutils.command.build import build as _build
from distutils.command.install import install as _install
from distutils.command.install_data import install_data as _install_data
+from distutils.command.sdist import sdist as _sdist
from distutils.extension import Extension
-from Cython.Distutils import build_ext
import os
import subprocess
import commands
+# If src/compizconfig.pyx exists, build using Cython
+if os.path.exists ("src/compizconfig.pyx"):
+ from Cython.Distutils import build_ext
+ ext_module_src = "src/compizconfig.pyx"
+else: # Otherwise build directly from C source
+ from distutils.command.build_ext import build_ext
+ ext_module_src = "src/compizconfig.c"
+
version_file = open ("VERSION", "r")
version = version_file.read ().strip ()
if "=" in version:
@@ -103,6 +111,23 @@ class uninstall (_install):
except:
self.warn ("Could not remove file %s" % file)
+class sdist (_sdist):
+
+ def run (self):
+ # Build C file
+ if os.path.exists ("src/compizconfig.pyx"):
+ from Cython.Compiler.Main import compile as cython_compile
+ cython_compile ("src/compizconfig.pyx")
+ # Run regular sdist
+ _sdist.run (self)
+
+ def add_defaults (self):
+ _sdist.add_defaults (self)
+ # Remove pyx source and add c source
+ if os.path.exists ("src/compizconfig.pyx"):
+ self.filelist.exclude_pattern ("src/compizconfig.pyx")
+ self.filelist.append ("src/compizconfig.c")
+
setup (
name = "compizconfig-python",
version = version,
@@ -114,9 +139,10 @@ setup (
cmdclass = {"uninstall" : uninstall,
"install" : install,
"install_data" : install_data,
- "build_ext" : build_ext},
+ "build_ext" : build_ext,
+ "sdist" : sdist},
ext_modules=[
- Extension ("compizconfig", ["src/compizconfig.pyx"],
+ Extension ("compizconfig", [ext_module_src],
**pkgconfig("libcompizconfig"))
]
)
commit 22b38c0469aba0e2825a75815bc29b63027d7945
Author: Sam Spilsbury <smspillaz@gmail.com>
Date: Sun Jul 4 09:12:26 2010 +0800
Update NEWS for 0.9.0 release
diff --git a/NEWS b/NEWS
index e69de29..b9c231c 100644
--- a/NEWS
+++ b/NEWS
@@ -0,0 +1,7 @@
+Release 0.9.0 (2010-07-03 Sam Spilsbury <smspillaz@gmail.com>)
+==============================================================
+Development release.
+
+Added simple setuptools/cython based buildsystem.
+
+Update for libcompizconfig API changes
\ No newline at end of file
commit 02598cc4da040ad73dbd21f20ad46756a6a20b27
Author: Sam Spilsbury <smspillaz@gmail.com>
Date: Sun Jul 4 08:13:37 2010 +0800
Add maintainer and maintainer email fields
diff --git a/setup.py b/setup.py
index b90dc78..1b01b65 100644
--- a/setup.py
+++ b/setup.py
@@ -109,6 +109,8 @@ setup (
description = "CompizConfig Python",
url = "http://www.compiz.org/",
license = "GPL",
+ maintainer = "Guillaume Seguin",
+ maintainer_email = "guillaume@segu.in",
cmdclass = {"uninstall" : uninstall,
"install" : install,
"install_data" : install_data,
commit 0725bc314d268d16e2bcff6e7c16201dde9fa511
Author: Guillaume Seguin <guillaume@segu.in>
Date: Sun Jul 4 02:57:16 2010 -0400
Add MANIFEST.in
diff --git a/MANIFEST.in b/MANIFEST.in
new file mode 100644
index 0000000..0c7af39
--- /dev/null
+++ b/MANIFEST.in
@@ -0,0 +1 @@
+include TODO README INSTALL AUTHORS COPYING NEWS VERSION ChangeLog
commit b94163bee79e74daa2c514256b3022590bffe334
Author: Sam Spilsbury <smspillaz@gmail.com>
Date: Sun Jul 4 08:00:22 2010 +0800
Add MANIFEST.in to get correct files for sdist and simple Makefile
as a wrapper around setuptools
diff --git a/MANIFEST.in b/MANIFEST.in
new file mode 100644
index 0000000..25fd94f
--- /dev/null
+++ b/MANIFEST.in
@@ -0,0 +1,2 @@
+include TODO README INSTALL AUTHORS COPYING LICENSE NEWS VERSION ChangeLog
+include Makefile MANIFEST.in
\ No newline at end of file
diff --git a/Makefile b/Makefile
new file mode 100644
index 0000000..a86f93a
--- /dev/null
+++ b/Makefile
@@ -0,0 +1,11 @@
+all:
+ @python setup.py build --prefix=${PREFIX}
+
+install: all
+ @python setup.py install --prefix=${PREFIX}
+
+uninstall:
+ @python setup.py uninstall --prefix=${PREFIX}
+
+clean:
+ rm -rf build/
commit b3a78843449903404c4729056185eb54229e40df
Author: Sam Spilsbury <smspillaz@gmail.com>
Date: Sun Jul 4 07:45:05 2010 +0800
Better version reading and update package info
diff --git a/setup.py b/setup.py
index ea0939f..b90dc78 100644
--- a/setup.py
+++ b/setup.py
@@ -9,6 +9,11 @@ import os
import subprocess
import commands
+version_file = open ("VERSION", "r")
+version = version_file.read ().strip ()
+if "=" in version:
+ version = version.split ("=")[1]
+
def pkgconfig(*packages, **kw):
flag_map = {'-I': 'include_dirs', '-L': 'library_dirs', '-l': 'libraries', '-R': 'runtime_library_dirs'}
@@ -100,7 +105,10 @@ class uninstall (_install):
setup (
name = "compizconfig-python",
- version = open (VERSION_FILE).read ().split ("=")[1],
+ version = version,
+ description = "CompizConfig Python",
+ url = "http://www.compiz.org/",
+ license = "GPL",
cmdclass = {"uninstall" : uninstall,
"install" : install,
"install_data" : install_data,
commit 82de00eff013f71abb6691018c1637d4171f22df
Author: Sam Spilsbury <smspillaz@gmail.com>
Date: Sun Jul 4 07:25:16 2010 +0800
Bump version
diff --git a/VERSION b/VERSION
index 9b265c0..f626ec2 100644
--- a/VERSION
+++ b/VERSION
@@ -1 +1 @@
-VERSION=0.8.3
+VERSION=0.9.0
commit e1f98d2e12510d6a560427f38330678ceeea45aa
Author: Sam Spilsbury <smspillaz@gmail.com>
Date: Sat Jun 19 01:17:16 2010 +0800
Add a better rpath on/off switch
diff --git a/setup.py b/setup.py
index bb12194..ea0939f 100644
--- a/setup.py
+++ b/setup.py
@@ -10,13 +10,19 @@ import subprocess
import commands
def pkgconfig(*packages, **kw):
- if os.getenv ("COMPIZ_DISABLE_RPATH") is "1":
- flag_map = {'-I': 'include_dirs', '-L': 'library_dirs', '-l': 'libraries'}
- else:
- flag_map = {'-I': 'include_dirs', '-L': 'library_dirs', '-l': 'libraries', '-L': 'runtime_library_dirs'}
+ flag_map = {'-I': 'include_dirs', '-L': 'library_dirs', '-l': 'libraries', '-R': 'runtime_library_dirs'}
- for token in commands.getoutput("pkg-config --libs --cflags %s" % ' '.join(packages)).split():
- kw.setdefault(flag_map.get(token[:2]), []).append(token[2:])
+ tokens = commands.getoutput("pkg-config --libs --cflags %s" % ' '.join(packages)).split()
+
+ for t in tokens:
+ if '-L' in t[:2]:
+ kw.setdefault (flag_map.get ("-L"), []).append (t[2:])
+ if not os.getenv ("COMPIZ_DISABLE_RPATH") is "1":
+ kw.setdefault (flag_map.get ("-R"), []).append (t[2:])
+ elif '-I' in t[:2]:
+ kw.setdefault (flag_map.get ("-I"), []).append (t[2:])
+ elif '-l' in t[:2]:
+ kw.setdefault (flag_map.get ("-l"), []).append (t[2:])
return kw
commit c1ba6b3be1335f35a74f6d1183163d35122946b4
Author: Sam Spilsbury <SmSpillaz@gmail.com>
Date: Sun Jun 6 22:45:40 2010 +0800
Added new method to get pkgconfig bits and also added COMPIZ_DISABLE_RPATH env variable
diff --git a/setup.py b/setup.py
index b77f1a7..bb12194 100644
--- a/setup.py
+++ b/setup.py
@@ -1,11 +1,24 @@
# -*- coding: utf-8 -*-
from distutils.core import setup
+from distutils.command.build import build as _build
from distutils.command.install import install as _install
from distutils.command.install_data import install_data as _install_data
from distutils.extension import Extension
from Cython.Distutils import build_ext
import os
import subprocess
+import commands
+
+def pkgconfig(*packages, **kw):
+ if os.getenv ("COMPIZ_DISABLE_RPATH") is "1":
+ flag_map = {'-I': 'include_dirs', '-L': 'library_dirs', '-l': 'libraries'}
+ else:
+ flag_map = {'-I': 'include_dirs', '-L': 'library_dirs', '-l': 'libraries', '-L': 'runtime_library_dirs'}
+
+ for token in commands.getoutput("pkg-config --libs --cflags %s" % ' '.join(packages)).split():
+ kw.setdefault(flag_map.get(token[:2]), []).append(token[2:])
+
+ return kw
VERSION_FILE = os.path.join (os.path.dirname (__file__), "VERSION")
@@ -14,7 +27,7 @@ pkgconfig_libs = subprocess.Popen (["pkg-config", "--libs", "libcompizconfig"],
if len (pkgconfig_libs) is 0:
print "CompizConfig Python [ERROR]: No libcompizconfig.pc found in the pkg-config search path"
print "Ensure that libcompizonfig is installed or libcompizconfig.pc is in your $PKG_CONFIG_PATH"
-
+ exit (1);
libs = pkgconfig_libs[2:].split (" ")[0]
INSTALLED_FILES = "installed_files"
@@ -82,14 +95,13 @@ class uninstall (_install):
setup (
name = "compizconfig-python",
version = open (VERSION_FILE).read ().split ("=")[1],
- ext_modules=[
- Extension ("compizconfig", ["src/compizconfig.pyx"],
- library_dirs = [libs],
- libraries = ["compizconfig"])
- ],
cmdclass = {"uninstall" : uninstall,
"install" : install,
"install_data" : install_data,
- "build_ext" : build_ext}
+ "build_ext" : build_ext},
+ ext_modules=[
+ Extension ("compizconfig", ["src/compizconfig.pyx"],
+ **pkgconfig("libcompizconfig"))
+ ]
)
commit 40815af866d1543d6ad44d0c84c9a731fc9d8c92
Author: Dominique Leuenberger <dimstar@opensuse.org>
Date: Sun Jun 6 15:12:20 2010 +0200
No RPATH to a relative path. In fact, we link to libcompizconfig.so.0, which typically is in %libdir
diff --git a/setup.py b/setup.py
index 3dafd0a..b77f1a7 100644
--- a/setup.py
+++ b/setup.py
@@ -85,7 +85,6 @@ setup (
ext_modules=[
Extension ("compizconfig", ["src/compizconfig.pyx"],
library_dirs = [libs],
- runtime_library_dirs = [libs],
libraries = ["compizconfig"])
],
cmdclass = {"uninstall" : uninstall,
commit 0234e60ccd7f20e69c6466bd15a841ad799ee6e3
Author: Sam Spilsbury <SmSpillaz@gmail.com>
Date: Sun May 23 23:19:52 2010 +0800
Pick up bits of the ccsm buildsystem, particularly uninstall support
diff --git a/setup.py b/setup.py
index 54a12ab..3dafd0a 100644
--- a/setup.py
+++ b/setup.py
@@ -1,5 +1,7 @@
# -*- coding: utf-8 -*-
from distutils.core import setup
+from distutils.command.install import install as _install
+from distutils.command.install_data import install_data as _install_data
from distutils.extension import Extension
from Cython.Distutils import build_ext
import os
@@ -15,6 +17,68 @@ if len (pkgconfig_libs) is 0:
libs = pkgconfig_libs[2:].split (" ")[0]
+INSTALLED_FILES = "installed_files"
+
+class install (_install):
+
+ def run (self):
+ _install.run (self)
+ outputs = self.get_outputs ()
+ length = 0
+ if self.root:
+ length += len (self.root)
+ if self.prefix:
+ length += len (self.prefix)
+ if length:
+ for counter in xrange (len (outputs)):
+ outputs[counter] = outputs[counter][length:]
+ data = "\n".join (outputs)
+ try:
+ file = open (INSTALLED_FILES, "w")
+ except:
+ self.warn ("Could not write installed files list %s" % \
+ INSTALLED_FILES)
+ return
+ file.write (data)
+ file.close ()
+
+class install_data (_install_data):
+
+ def run (self):
+ def chmod_data_file (file):
+ try:
+ os.chmod (file, S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH)
+ except:
+ self.warn ("Could not chmod data file %s" % file)
+ _install_data.run (self)
+ map (chmod_data_file, self.get_outputs ())
+
+class uninstall (_install):
+
+ def run (self):
+ try:
+ file = open (INSTALLED_FILES, "r")
+ except:
+ self.warn ("Could not read installed files list %s" % \
+ INSTALLED_FILES)
+ return
+ files = file.readlines ()
+ file.close ()
+ prepend = ""
+ if self.root:
+ prepend += self.root
+ if self.prefix:
+ prepend += self.prefix
+ if len (prepend):
+ for counter in xrange (len (files)):
+ files[counter] = prepend + files[counter].rstrip ()
+ for file in files:
+ print "Uninstalling %s" % file
+ try:
+ os.unlink (file)
+ except:
+ self.warn ("Could not remove file %s" % file)
+
setup (
name = "compizconfig-python",
version = open (VERSION_FILE).read ().split ("=")[1],
@@ -24,6 +88,9 @@ setup (
runtime_library_dirs = [libs],
libraries = ["compizconfig"])
],
- cmdclass = {'build_ext': build_ext}
+ cmdclass = {"uninstall" : uninstall,
+ "install" : install,
+ "install_data" : install_data,
+ "build_ext" : build_ext}
)
commit fde749c172cae824679f7bc3cb2ff1ebc5631477
Author: Sam Spilsbury <SmSpillaz@gmail.com>
Date: Mon May 17 23:13:53 2010 +0800
Add more meaningful install instructions
diff --git a/INSTALL b/INSTALL
new file mode 100644
index 0000000..14ca24d
--- /dev/null
+++ b/INSTALL
@@ -0,0 +1,38 @@
+Installation Instructions
+*************************
+
+Copyright (C) 2010 Sam Spilsbury.
+
+ This file is free documentation under the GNU GFDL; I hereby give
+unlimited permission to copy, distribute and modify it.
+
+Basic Installation
+==================
+
+ CompizConfig Python Bindings use the distutils buildsystem to translate,
+build and install the bindings.
+
+ See the Distutils documentation for more information on how to use the
+specifics of the buildsystem. At the moment, you probably just want to issue
+something like:
+
+ # python setup.py install
+
+Command Line Arguments
+======================
+
+ If you want to install to a particular prefix (eg /opt) then you would use
+ the '--prefix' switch:
+
+ # python setup.py --prefix=/opt install
+
+Environment Variables
+=====================
+
+ CompizConfig Python Bindings might require some environment variables
+ if you installed LibCompizConfig to a non-standard location. Currently,
+ only PKG_CONFIG_PATH is supported, and this is used to find the
+ pkgconfig file to determine the libcompizconfig install location for
+ linking
+
+ # PKG_CONFIG_PATH=/opt/lib/pkgconfig python setup.py install
commit dfd4d8e01c6dcd50efe029de462230c8f98a9a4f
Author: Sam Spilsbury <smspillaz@gmail.com>
Date: Sun May 2 11:06:01 2010 -0400
Parse libcompizconfig pkg-config file and set linker path and runtime library path
diff --git a/setup.py b/setup.py
index ddcb18d..54a12ab 100644
--- a/setup.py
+++ b/setup.py
@@ -1,15 +1,27 @@
+# -*- coding: utf-8 -*-
from distutils.core import setup
from distutils.extension import Extension
from Cython.Distutils import build_ext
import os
+import subprocess
VERSION_FILE = os.path.join (os.path.dirname (__file__), "VERSION")
+pkgconfig_libs = subprocess.Popen (["pkg-config", "--libs", "libcompizconfig"], stdout=subprocess.PIPE, stderr=open(os.devnull, 'w')).communicate ()[0]
+
+if len (pkgconfig_libs) is 0:
+ print "CompizConfig Python [ERROR]: No libcompizconfig.pc found in the pkg-config search path"
+ print "Ensure that libcompizonfig is installed or libcompizconfig.pc is in your $PKG_CONFIG_PATH"
+
+libs = pkgconfig_libs[2:].split (" ")[0]
+
setup (
name = "compizconfig-python",
version = open (VERSION_FILE).read ().split ("=")[1],
ext_modules=[
Extension ("compizconfig", ["src/compizconfig.pyx"],
+ library_dirs = [libs],
+ runtime_library_dirs = [libs],
libraries = ["compizconfig"])
],
cmdclass = {'build_ext': build_ext}
commit f96303738894f5889c5c2d8e96cfa46218a6adcb
Author: Sam Spilsbury <smspillaz@gmail.com>
Date: Tue Apr 27 08:23:02 2010 +0000
Just use distutils
diff --git a/CMakeLists.txt b/CMakeLists.txt
deleted file mode 100644
index 0de34a1..0000000
--- a/CMakeLists.txt
+++ /dev/null
@@ -1,29 +0,0 @@
-project (compizconfig-python)
-
-find_package (Compiz REQUIRED)
-find_package (CompizConfig REQUIRED)
-find_package (PythonInterp REQUIRED)
-find_package (PythonLibs REQUIRED)
-
-include (CompizCommon)
-
-set (CCS_PYTHON_REQUIRES
- libcompizconfig
- glib-2.0
- )
-
-compiz_pkg_check_modules (CCS_PYTHON REQUIRED ${CCS_PYTHON_REQUIRES})
-
-find_program (HAVE_PYREX pyrexc)
-
-if (NOT HAVE_PYREX)
- message (FATAL_ERROR "Couldn't find pyrexc")
-endif ()
-
-compiz_configure_file (${CMAKE_SOURCE_DIR}/compizconfig-python.pc.in
- ${CMAKE_BINARY_DIR}/compizconfig-python.pc)
-
-add_subdirectory (src)
-
-install (FILES ${CMAKE_BINARY_DIR}/compizconfig-python.pc
- DESTINATION ${CMAKE_INSTALL_PREFIX}/lib/pkgconfig)
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
deleted file mode 100644
index af71b57..0000000
--- a/src/CMakeLists.txt
+++ /dev/null
@@ -1,38 +0,0 @@
-exec_program (${HAVE_PYREX} ${CMAKE_SOURCE_DIR}/src
- ARGS "compizconfig.pyx")
-
-include_directories (
- ${CCS_PYTHON_INCLUDE_DIRS}
- ${PYTHON_INCLUDE_DIRS}
-)
-
-set (CCS_PYTHON_LIBS "")
-foreach (_val ${CCS_PYTHON_LDFLAGS})
- set (CCS_PYTHON_LIBS "${CCS_PYTHON_LIBS}${_val} ")
-endforeach (_val ${CCS_PYTHON_LDFLAGS})
-
-set (CCS_PYTHON_CFLAGS "")
-foreach (_val ${CCS_PYTHON_CFLAGS})
- set (CCS_PYTHON_CFLAGS "${CCS_PYTHON_CFLAGS}${_val} ")
-endforeach (_val ${CCS_PYTHON_CFLAGS})
-
-link_directories (
- ${CCS_PYTHON_LIBRARY_DIRS}
-)
-
-add_library (pycompizconfig SHARED
- compizconfig.c)
-
-target_link_libraries (
- pycompizconfig
- ${CCS_PYTHON_LIBRARIES}
- ${COMPIZCONFIG_LIBRARIES}
- ${PYTHON_LIBRARIES}
-)
-
-exec_program ("mv" ${CMAKE_BINARY_DIR}/src ARGS "libpycompizconfig.so compizconfig.so")
-
-install (
- FILES ${CMAKE_BINARY_DIR}/src/compizconfig.so
- DESTINATION ${CMAKE_INSTALL_PATH}/lib/python2.6/site-packages
-)
commit 00b85453fd388f9342661be22e670fd633b0645e
Author: Sam Spilsbury <smspillaz@gmail.com>
Date: Tue Apr 27 08:10:05 2010 +0000
Remove autotools buildsystem
diff --git a/Makefile.am b/Makefile.am
deleted file mode 100644
index b5275f7..0000000
--- a/Makefile.am
+++ /dev/null
@@ -1,8 +0,0 @@
-SUBDIRS = src
-
-EXTRA_DIST = \
- compizconfig-python.pc.in \
- VERSION
-
-pkgconfigdir = $(libdir)/pkgconfig
-pkgconfig_DATA = compizconfig-python.pc
diff --git a/acinclude.m4 b/acinclude.m4
deleted file mode 100644
index 7afdd15..0000000
--- a/acinclude.m4
+++ /dev/null
@@ -1,141 +0,0 @@
-# Copyright 1999, 2000, 2001, 2002, 2003 Free Software Foundation, 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, 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.
-
-# AM_PATH_PYTHON_VERSION(ABI-VERSION1, [MINIMUM-VERSION1 [, ABI-VERSION2, [MINIMUM-VERSION2 ...]]])
-#
-# An alternative to AM_PATH_PYTHON that checks for specific python ABI/version pairs.
-# Example:
-# AM_PATH_PYTHON_VERSION(2.3, 2.3.5, 2.4, 2.4.0)
-# checks for a python2.3 binary returning python version >= 2.3.5, and
-# if that fails it looks for python2.4 containing version >= 2.4.0
-# It aborts configure with an error if no statisfying version is found.
-# Env. var. PYTHON can be used to point a specific/laternate version to configure.
-
-AC_DEFUN([AM_PATH_PYTHON_VERSION],
- [
- m4_pattern_allow([m4_shift])
- _python_save="$PYTHON"
- dnl Find a Python interpreter with corresponding ABI version.
-
- m4_define(PYTHON_var, PYTHON[]m4_translit($1,[.],[_]))
-
- if test -z "$PYTHON"; then
- AC_PATH_PROG(PYTHON_var, python$1, [])
- else
- PYTHON_var="$PYTHON"
- fi
-
- PYTHON="$PYTHON_var"
- AC_SUBST(PYTHON)
-
- if test -n "$PYTHON"; then
-
- m4_if([$2],[],[
- ], [
- dnl A version check is needed.
- AC_MSG_CHECKING([whether $PYTHON version is >= $2])
- AM_PYTHON_CHECK_VERSION([$PYTHON], [$2],
- [AC_MSG_RESULT(yes)],
- [AC_MSG_RESULT([no]); PYTHON=""])
- ])
-
- fi
-
- if test -z "$PYTHON"; then
- dnl if more arguments, shift/recurse, else fail
- m4_if([$3],[],[
- AC_MSG_ERROR([no suitable Python interpreter found])
- ], [
- PYTHON="$_python_save"
- AM_PATH_PYTHON_VERSION(m4_shift(m4_shift($@)))
- ])
-
- else
-
Reply to: