From b025b630b77012275ec4b4681adcf454d47789ba Mon Sep 17 00:00:00 2001 From: Ryan Kelly Date: Thu, 13 Jan 2011 23:13:23 +1100 Subject: [PATCH] implement build-time dependencies and conflict dependencies --- TODO.txt | 4 +- myppy/envs/base.py | 52 +++++++++++++++-- myppy/envs/linux.py | 11 +++- myppy/envs/macosx.py | 6 ++ myppy/recipes/base.py | 124 +++++++++++++++++++++++----------------- myppy/recipes/linux.py | 47 +++++++++------ myppy/recipes/macosx.py | 8 ++- 7 files changed, 170 insertions(+), 82 deletions(-) diff --git a/TODO.txt b/TODO.txt index 1bfc32b..e7e42d7 100644 --- a/TODO.txt +++ b/TODO.txt @@ -1,3 +1,3 @@ - * concept of "build deps" that are installed for building, but removed - on cleanup. Make fontconfig and freetype builddeps for wx and qt. + + * settable build vars, e.g. lib_qt4.static diff --git a/myppy/envs/base.py b/myppy/envs/base.py index b05f035..9675b17 100644 --- a/myppy/envs/base.py +++ b/myppy/envs/base.py @@ -107,7 +107,7 @@ def SITE_PACKAGES(self): def init(self): """Build the base myppy python environment.""" for dep in self.DEPENDENCIES: - self.install(dep,initialising=True) + self.install(dep,initialising=True,explicit=False) def clean(self): """Clean out temporary built files and the like.""" @@ -115,6 +115,10 @@ def clean(self): shutil.rmtree(self.builddir) if os.path.exists(self.cachedir): shutil.rmtree(self.cachedir) + q = "SELECT DISTINCT recipe FROM installed_files" + for row in self._db.execute(q): + if not self.is_explicitly_installed(row[0]): + self.uninstall(row[0]) for fpath in self.find_new_files(): if os.path.isfile(fpath) or os.path.islink(fpath): os.unlink(fpath) @@ -126,6 +130,9 @@ def do(self,*cmdline,**kwds): stdin = kwds.pop("stdin",None) if stdin is None: stdin = sys.stdin + for (k,v) in env.iteritems(): + if not isinstance(v,basestring): + raise ValueError("NONSTRING %r => %r " % (k,v,)) subprocess.check_call(cmdline,env=env,stdin=stdin,**kwds) def bt(self,*cmdline,**kwds): @@ -154,19 +161,41 @@ def is_initialised(self): return True def is_installed(self,recipe): - q = "SELECT filepath FROM installed_files WHERE recipe=?"\ - " LIMIT 1" + q = "SELECT filepath FROM installed_files WHERE recipe=? LIMIT 1" return (self._db.execute(q,(recipe,)).fetchone() is not None) + + def is_explicitly_installed(self,recipe): + deps = set(self.DEPENDENCIES) + for row in self._db.execute("SELECT recipe FROM installed_recipes"): + deps.add(row[0]) + todo = list(deps) + while todo: + r = self.load_recipe(todo.pop(0)) + for dep in r.DEPENDENCIES: + if dep not in deps: + deps.add(dep) + todo.append(dep) + return recipe in deps - def install(self,recipe,initialising=False): + def install(self,recipe,initialising=False,explicit=True): """Install the named recipe into this myppy env.""" if not self.is_installed(recipe): r = self.load_recipe(recipe) if not initialising and not self.is_initialised(): self.init() + for conflict in r.CONFLICTS_WITH: + if self.is_explicitly_installed(conflict): + msg = "Recipe %r conflicts with %r, " + msg += "which is already installed" + msg %= (recipe,conflict,) + raise RuntimeError(msg) + self.uninstall(conflict) for dep in r.DEPENDENCIES: if dep != recipe: - self.install(dep,initialising=initialising) + self.install(dep,initialising=initialising,explicit=False) + for dep in r.BUILD_DEPENDENCIES: + if dep != recipe: + self.install(dep,initialising=initialising,explicit=False) print "FETCHING", recipe r.fetch() with self: @@ -178,11 +207,16 @@ def install(self,recipe,initialising=False): files = list(self.find_new_files()) self.record_files(recipe,files) print "INSTALLED", recipe + if explicit and not self.is_explicitly_installed(recipe): + q = "INSERT INTO installed_recipes VALUES (?)" + self._db.execute(q,(recipe,)) def uninstall(self,recipe): """Uninstall the named recipe from this myppy env.""" # TODO: remove things depending on it with self: + q = "DELETE FROM installed_recipes WHERE recipe=?" + self._db.execute(q,(recipe,)) q = "SELECT filepath FROM installed_files WHERE recipe=?"\ " ORDER BY filepath DESC" files = [r[0] for r in self._db.execute(q,(recipe,))] @@ -190,6 +224,9 @@ def uninstall(self,recipe): self._db.execute(q,(recipe,)) for file in files: assert util.relpath(file) == file + if self._old_files_cache is not None: + self._old_files_cache.remove(file) + for file in files: filepath = os.path.join(self.rootdir,file) if not os.path.exists(filepath): continue @@ -238,7 +275,6 @@ def _is_oldfile(self,file): self._old_files_cache = set() for r in self._db.execute("SELECT filepath FROM installed_files"): self._old_files_cache.add(r[0]) - q = "SELECT * FROM installed_files WHERE filepath=?" file = file[len(self.rootdir)+1:] assert util.relpath(file) == file if file in self._old_files_cache: @@ -278,6 +314,7 @@ def find_new_files(self): yield fpath def record_files(self,recipe,files): + """Record the given list of files as installed for the given recipe.""" files = list(files) assert files, "recipe '%s' didn't install any files" % (recipe,) for file in files: @@ -289,6 +326,9 @@ def record_files(self,recipe,files): self._old_files_cache.add(file) def _initdb(self): + self._db.execute("CREATE TABLE IF NOT EXISTS installed_recipes (" + " recipe STRING NOT NULL" + ")") self._db.execute("CREATE TABLE IF NOT EXISTS installed_files (" " recipe STRING NOT NULL," " filepath STRING NOT NULL" diff --git a/myppy/envs/linux.py b/myppy/envs/linux.py index b114ea9..65e6d91 100644 --- a/myppy/envs/linux.py +++ b/myppy/envs/linux.py @@ -4,6 +4,7 @@ from __future__ import with_statement import os +import stat from myppy.envs import base @@ -34,15 +35,21 @@ def record_files(self,recipe,files): if recipe not in self._RECIPES_WITH_APGCC_PROBLEMS: if fnm.endswith(".so") or ".so." in fnm: self._check_glibc_symbols(fpath) - self.do("strip",fpath) + self._strip(fpath) self._adjust_rpath(fpath) elif "." not in fnm: fileinfo = self.bt("file",fpath) if "executable" in fileinfo and "ELF" in fileinfo: - self.do("strip",fpath) + self._strip(fpath) self._adjust_rpath(fpath) super(MyppyEnv,self).record_files(recipe,files) + def _strip(self,fpath): + mod = os.stat(fpath).st_mode + os.chmod(fpath,stat.S_IRUSR | stat.S_IWUSR | stat.S_IXUSR) + self.do("strip",fpath) + os.chmod(fpath,mod) + def _check_glibc_symbols(self,fpath): print "VERIFYING GLIBC SYMBOLS", fpath for ln in self.bt("objdump","-T",fpath).split("\n"): diff --git a/myppy/envs/macosx.py b/myppy/envs/macosx.py index 9edd17f..e071a37 100644 --- a/myppy/envs/macosx.py +++ b/myppy/envs/macosx.py @@ -75,6 +75,12 @@ def _adjust_static_lib(self,recipe,fpath): self._check_lib_has_all_archs(fpath) def _adjust_dynamic_lib(self,recipe,fpath): + mod = os.stat(fpath).st_mode + try: + os.chmod(fpath,0x700) + self.do("strip",fpath) + finally: + os.chmod(fpath,mod) self._check_lib_has_all_archs(fpath) self._check_lib_uses_correct_sdk(fpath) self._adjust_linker_paths(fpath) diff --git a/myppy/recipes/base.py b/myppy/recipes/base.py index 52bd2af..4bf418b 100644 --- a/myppy/recipes/base.py +++ b/myppy/recipes/base.py @@ -19,17 +19,27 @@ class _RecipeMetaclass(type): + DEPENDENCIES = [] + BUILD_DEPENDENCIES = [] + CONFLICTS_WITH = [] + def __new__(mcls,name,bases,attrs): - DEPENDENCIES = list(attrs.get("DEPENDENCIES",[])) + mcls._merge_dep_attr("DEPENDENCIES",bases,attrs) + mcls._merge_dep_attr("BUILD_DEPENDENCIES",bases,attrs) + mcls._merge_dep_attr("CONFLICTS_WITH",bases,attrs) + return super(_RecipeMetaclass,mcls).__new__(mcls,name,bases,attrs) + + @staticmethod + def _merge_dep_attr(attrnm,bases,attrs): + deps = list(attrs.get(attrnm,[])) for base in bases: if not isinstance(base,_RecipeMetaclass): continue - for dep in base.DEPENDENCIES: - if dep not in DEPENDENCIES: - DEPENDENCIES.append(dep) - attrs["DEPENDENCIES"] = DEPENDENCIES - return super(_RecipeMetaclass,mcls).__new__(mcls,name,bases,attrs) + for dep in getattr(base,attrnm): + if dep not in deps: + deps.append(dep) + attrs[attrnm] = deps @@ -39,6 +49,9 @@ class Recipe(object): __metaclass__ = _RecipeMetaclass DEPENDENCIES = [] + BUILD_DEPENDENCIES = [] + CONFLICTS_WITH = [] + SOURCE_URL = "http://source.url.is/missing.txt" SOURCE_MD5 = None @@ -204,12 +217,13 @@ def install(self): class CMakeRecipe(Recipe): - DEPENDENCIES = ["cmake"] + BUILD_DEPENDENCIES = ["cmake"] def _configure(self): self._generic_cmake() def _generic_cmake(self,relpath=".",args=[],env={}): cmd = ["cmake"] - cmd.append("-DCMAKE_INSTALL_PREFIX=%s" % (self.PREFIX,)) + cmd.append("-DCMAKE_INSTALL_PREFIX=%s" % (self.INSTALL_PREFIX,)) + cmd.append("-DCMAKE_MODULE_PATH=%s" % (os.path.join(self.PREFIX,"share","cmake"),)) cmd.append("-DCMAKE_VERBOSE_MAKEFILE=ON") cmd.append("-DBUILD_TESTS=False") cmd.append("-DCMAKE_BUILD_TYPE=MinSizeRel") @@ -404,7 +418,7 @@ def dont_copy_dylib(lines): class lib_png(Recipe): - SOURCE_URL = "http://sourceforge.net/projects/libpng/files/01-libpng-master/1.4.2/libpng-1.4.2.tar.gz/download" + SOURCE_URL = "http://downloads.sourceforge.net/project/libpng/libpng14/1.4.5/libpng-1.4.5.tar.xz" class lib_jpeg(Recipe): @@ -518,7 +532,7 @@ def install(self): # We build two builds of Qt: a full-featured one for running the various # tools, and then a stripped-down one for linking into the PySide binary. -class lib_qt4_xmlpatterns(Recipe): +class _lib_qt4_base(Recipe): DEPENDENCIES = ["lib_jpeg","lib_png","lib_tiff","lib_zlib"] #SOURCE_URL = "http://get.qt.nokia.com/qt/source/qt-everywhere-opensource-src-4.7.1.tar.gz" #SOURCE_MD5 = "6f88d96507c84e9fea5bf3a71ebeb6d7" @@ -527,28 +541,27 @@ class lib_qt4_xmlpatterns(Recipe): DISABLE_FEATURES = [] @property def CFLAGS(self): - flags = super(lib_qt4_xmlpatterns,self).CFLAGS + flags = super(_lib_qt4_base,self).CFLAGS if "-static" in self.CONFIGURE_ARGS: flags += " -fdata-sections -ffunction-sections -Wl,--gc-sections" return flags @property def CXXFLAGS(self): - flags = super(lib_qt4_xmlpatterns,self).CXXFLAGS + flags = super(_lib_qt4_base,self).CXXFLAGS if "-static" in self.CONFIGURE_ARGS: flags += " -fdata-sections -ffunction-sections -Wl,--gc-sections" return flags @property def LDFLAGS(self): - flags = super(lib_qt4_xmlpatterns,self).LDFLAGS - if "-static" in self.CONFIGURE_ARGS: - flags += " --gc-sections" + flags = super(_lib_qt4_base,self).LDFLAGS + flags += " --gc-sections" return flags @property def CONFIGURE_ARGS(self): args = [] for feature in self.DISABLE_FEATURES: args.append("-no-feature-" + feature.lower()) - args.extend(["-no-pch","-no-cups","-no-openssl","-no-declarative","-system-libpng","-system-libjpeg","-system-libtiff","-system-zlib","-system-sqlite","-no-phonon","-no-multimedia","-no-qt3support","-no-webkit","-no-opengl","-no-javascript-jit","-no-scripttools","-no-libmng","-no-dbus","-no-svg","-no-nis","-shared","-opensource","-release","-no-separate-debug-info","-nomake","examples","-nomake","demos","-nomake","docs","-nomake","tools","-I",os.path.join(self.PREFIX,"include"),"-L",os.path.join(self.PREFIX,"lib")]) + args.extend(["-no-pch","-no-cups","-no-openssl","-no-declarative","-system-libpng","-system-libjpeg","-system-libtiff","-system-zlib","-system-sqlite","-no-phonon","-no-multimedia","-no-qt3support","-no-webkit","-no-opengl","-no-javascript-jit","-no-scripttools","-no-libmng","-no-dbus","-no-svg","-no-nis","-opensource","-release","-no-separate-debug-info","-nomake","examples","-nomake","demos","-nomake","docs","-nomake","tools","-I",os.path.join(self.PREFIX,"include"),"-L",os.path.join(self.PREFIX,"lib")]) return args def _unpack(self): # clean up the workdir after building other qt versions @@ -558,13 +571,13 @@ def _unpack(self): pass else: shutil.rmtree(workdir) - super(lib_qt4_xmlpatterns,self)._unpack() + super(_lib_qt4_base,self)._unpack() def _configure(self): # automatically accept the LGPL with chstdin("yes"): - super(lib_qt4_xmlpatterns,self)._configure() + super(_lib_qt4_base,self)._configure() def _patch(self): - super(lib_qt4_xmlpatterns,self)._patch() + super(_lib_qt4_base,self)._patch() def optimize_for_size(lines): for ln in lines: yield ln.replace("-O2","-Os").replace("-O3","-Os") @@ -573,29 +586,29 @@ def optimize_for_size(lines): for filenm in filenms: filepath = os.path.join(dirnm,filenm) self._patch_file(filepath,optimize_for_size) - def install(self): - super(lib_qt4_xmlpatterns,self).install() - # Remove anything that's not a QtXml* library. - # We'll recompile the rest with -fno-exceptions. - for filepath in self.target.find_new_files(): - if "QtXml" not in filepath: - if os.path.isfile(filepath) or os.path.islink(filepath): - os.unlink(filepath) - elif os.path.isdir(filepath): - prune_dir(filepath) - - -class lib_qt4(lib_qt4_xmlpatterns): - DEPENDENCIES = ["lib_qt4_xmlpatterns"] + + +class lib_qt4(_lib_qt4_base): @property def CONFIGURE_ARGS(self): - args = super(lib_qt4,self).CONFIGURE_ARGS - args.insert(1,"-no-exceptions") - args.insert(2,"-no-xmlpatterns") + args = list(super(lib_qt4,self).CONFIGURE_ARGS) + args.insert(1,"-shared") + #args.insert(1,"-static") + args.insert(2,"-no-exceptions") + args.insert(3,"-no-xmlpatterns") + return args + + +class lib_qt4_full(_lib_qt4_base): + CONFLICTS_WITH = ["lib_qt4"] + @property + def INSTALL_PREFIX(self): + return os.path.join(self.target.PREFIX,"qt4-full") + @property + def CONFIGURE_ARGS(self): + args = list(super(lib_qt4_full,self).CONFIGURE_ARGS) + args.insert(1,"-static") return args - def install(self): - # Skip removal of non-xml modules, this is the real install. - super(lib_qt4_xmlpatterns,self).install() class py_wxpython(PyRecipe): @@ -606,28 +619,42 @@ def install(self): class lib_apiextractor(CMakeRecipe): - DEPENDENCIES = ["lib_xslt","lib_qt4"] - SOURCE_URL = "http://www.pyside.org/files/apiextractor-0.9.1.tar.bz2" + DEPENDENCIES = ["lib_xslt"] + BUILD_DEPENDENCIES = ["lib_qt4_full"] + CONFLICTS_WITH = [] + SOURCE_URL = "http://www.pyside.org/files/apiextractor-0.9.2.tar.bz2" + + def _configure(self): + qmake = os.path.join(lib_qt4_full(self.target).INSTALL_PREFIX, + "bin","qmake") + args = ("-DQT_QMAKE_EXECUTABLE="+qmake,) + self._generic_cmake(args=args) class lib_generatorrunner(CMakeRecipe): DEPENDENCIES = ["lib_apiextractor"] + BUILD_DEPENDENCIES = ["lib_qt4_full"] SOURCE_URL = "http://www.pyside.org/files/generatorrunner-0.6.3.tar.bz2" + def _configure(self): + qmake = os.path.join(lib_qt4_full(self.target).INSTALL_PREFIX, + "bin","qmake") + args = ("-DQT_QMAKE_EXECUTABLE="+qmake,) + self._generic_cmake(args=args) class lib_shiboken(PyCMakeRecipe): DEPENDENCIES = ["lib_generatorrunner"] - SOURCE_URL = "http://www.pyside.org/files/shiboken-1.0.0~beta2.tar.bz2" + BUILD_DEPENDENCIES = ["lib_qt4"] + SOURCE_URL = "http://www.pyside.org/files/shiboken-1.0.0~beta3.tar.bz2" class py_pyside(PyCMakeRecipe): - DEPENDENCIES = ["lib_shiboken",] - SOURCE_URL = "http://www.pyside.org/files/pyside-qt4.7+1.0.0~beta2.tar.bz2" + DEPENDENCIES = ["lib_shiboken","lib_qt4"] + SOURCE_URL = "http://www.pyside.org/files/pyside-qt4.7+1.0.0~beta3.tar.bz2" @property def CFLAGS(self): flags = super(py_pyside,self).CFLAGS - if "-static" in lib_qt4(self.target).CONFIGURE_ARGS: - flags += " -Wl,--gc-sections" + flags += " -Wl,--gc-sections" return flags @property def CXXFLAGS(self): @@ -639,11 +666,6 @@ def LDFLAGS(self): flags = super(py_pyside,self).LDFLAGS flags += " --gc-sections" return flags - def _configure(self): - args = ("-DPYTHON_EXECUTABLE="+self.target.PYTHON_EXECUTABLE, - "-DPYTHON_INCLUDE_DIR="+self.target.PYTHON_HEADERS, - "-DPYTHON_LIBRARY="+self.target.PYTHON_LIBRARY) - self._generic_cmake(args=args) def _patch(self): super(py_pyside,self)._patch() def dont_build_extra_modules(lines): diff --git a/myppy/recipes/linux.py b/myppy/recipes/linux.py index 3c68538..7667bc3 100644 --- a/myppy/recipes/linux.py +++ b/myppy/recipes/linux.py @@ -269,22 +269,22 @@ def undisable_deprecated(lines): self._patch_file(fnm,undisable_deprecated) -class lib_qt4_xmlpatterns(base.lib_qt4_xmlpatterns,Recipe): - # Build against an older version of fontconfig, so it doesn't suck - # in symbols that aren't available on older linuxen. - DEPENDENCIES = ["lib_fontconfig"] +class _lib_qt4_base(base._lib_qt4_base,Recipe): + # Build against an older version of fontconfig and freetype, so we + # don't suck in symbols that aren't available on older linuxen. + BUILD_DEPENDENCIES = ["lib_fontconfig_ft"] @property def DISABLE_FEATURES(self): - features = super(lib_qt4_xmlpatterns,self).DISABLE_FEATURES + features = super(_lib_qt4_base,self).DISABLE_FEATURES features.append("inotify") return features @property def CONFIGURE_ARGS(self): - args = list(super(lib_qt4_xmlpatterns,self).CONFIGURE_ARGS) + args = list(super(_lib_qt4_base,self).CONFIGURE_ARGS) args.append("-no-glib") return args def _patch(self): - super(lib_qt4_xmlpatterns,self)._patch() + super(_lib_qt4_base,self)._patch() # Disable some functions only available on newer linuxes. # Fortunately qt provides runtime fallbacks for these. def dont_use_newer_funcs(lines): @@ -312,7 +312,10 @@ def dont_use_pthread_cleanup(lines): self._patch_build_file("src/corelib/thread/qthread_unix.cpp",dont_use_pthread_cleanup) -class lib_qt4(base.lib_qt4,lib_qt4_xmlpatterns): +class lib_qt4(base.lib_qt4,_lib_qt4_base): + pass + +class lib_qt4_full(base.lib_qt4_full,_lib_qt4_base): pass @@ -325,11 +328,11 @@ class lib_wxwidgets_base(base.lib_wxwidgets_base,Recipe): class lib_sparsehash(Recipe): - """Google sparehash, using old hash function APIs. + """Google sparehash, using old C++ hash function APIs. This installs a private copy of the google sparsehash library, tricked into sucking in old definitions for hash_fun.h rather than the ones provided by - tr1. Other libraries can then avoid sucking in the tr1 symbols. + C++ tr1. Other libraries can then avoid sucking in the tr1 symbols. """ SOURCE_URL = "http://google-sparsehash.googlecode.com/files/sparsehash-1.9.tar.gz" def _patch(self): @@ -362,8 +365,8 @@ def CXXFLAGS(self): @property def LDFLAGS(self): flags = super(lib_shiboken,self).LDFLAGS - if "-static" in lib_qt4(self.target).CONFIGURE_ARGS: - flags += " -lpthread -lrt -lz -ldl -lQtNetwork -lQtCore -ljpeg -ltiff -lpng14 -lz -lX11 -lXrender -lXrandr -lXext -lfontconfig -lSM -lICE" + libdir = os.path.join(lib_qt4(self.target).INSTALL_PREFIX,"lib") + flags = ("-L%s -lpthread -lrt -lz -ldl -lQtNetwork -lQtCore -ljpeg -ltiff -lpng14 -lz -lX11 -lXrender -lXrandr -lXext -lfontconfig -lSM -lICE " % (libdir,)) + flags return flags def _patch(self): super(lib_shiboken,self)._patch() @@ -485,12 +488,18 @@ class lib_freetype(Recipe): class lib_fontconfig(Recipe): # This is intentionally an old version. We don't dsitribute it, # but it's API compatible back to some old Linux distros. - DEPENDENCIES = ["lib_freetype"] + SOURCE_URL = "http://fontconfig.org/release/fontconfig-2.4.1.tar.gz" + + +class lib_fontconfig_ft(lib_fontconfig): + BUILD_DEPENDENCIES = ["lib_freetype"] + # This is intentionally an old version. We don't dsitribute it, + # but it's API compatible back to some old Linux distros. SOURCE_URL = "http://fontconfig.org/release/fontconfig-2.4.1.tar.gz" class lib_pango(Recipe): - DEPENDENCIES = ["lib_fontconfig"] + BUILD_DEPENDENCIES = ["lib_fontconfig"] SOURCE_URL = "http://ftp.acc.umu.se/pub/gnome/sources/pango/1.12/pango-1.12.0.tar.bz2" class lib_glib(Recipe): @@ -505,16 +514,16 @@ class lib_apiextractor(base.lib_apiextractor,CMakeRecipe): @property def LDFLAGS(self): flags = super(lib_apiextractor,self).LDFLAGS - if "-static" in lib_qt4(self.target).CONFIGURE_ARGS: - flags += " -lpthread -lrt -lz -ldl -lQtNetwork -lQtCore -ljpeg -ltiff -lpng14 -lz -lX11 -lXrender -lXrandr -lXext -lfontconfig -lSM -lICE" + libdir = os.path.join(lib_qt4_full(self.target).INSTALL_PREFIX,"lib") + flags = ("-L%s -lpthread -lrt -lz -ldl -lQtNetwork -lQtCore -ljpeg -ltiff -lpng14 -lz -lX11 -lXrender -lXrandr -lXext -lfontconfig -lSM -lICE " % (libdir,)) + flags return flags class lib_generatorrunner(base.lib_generatorrunner,CMakeRecipe): @property def LDFLAGS(self): flags = super(lib_generatorrunner,self).LDFLAGS - if "-static" in lib_qt4(self.target).CONFIGURE_ARGS: - flags += " -lpthread -lrt -lz -ldl -lQtNetwork -lQtCore -ljpeg -ltiff -lpng14 -lz -lX11 -lXrender -lXrandr -lXext -lfontconfig -lSM -lICE" + libdir = os.path.join(lib_qt4_full(self.target).INSTALL_PREFIX,"lib") + flags = ("-L%s -lpthread -lrt -lz -ldl -lQtNetwork -lQtCore -ljpeg -ltiff -lpng14 -lz -lX11 -lXrender -lXrandr -lXext -lfontconfig -lSM -lICE " % (libdir,)) + flags return flags class py_pyside(base.py_pyside,PyCMakeRecipe): @@ -522,7 +531,7 @@ class py_pyside(base.py_pyside,PyCMakeRecipe): def LDFLAGS(self): flags = super(py_pyside,self).LDFLAGS if "-static" in lib_qt4(self.target).CONFIGURE_ARGS: - flags += " -lpthread -lrt -lz -ldl -lQtNetwork -lQtCore -ljpeg -ltiff -lpng14 -lz -lX11 -lXrender -lXrandr -lXext -lfontconfig -lSM -lICE" + flags = " -lpthread -lrt -lz -ldl -lQtNetwork -lQtCore -ljpeg -ltiff -lpng14 -lz -lX11 -lXrender -lXrandr -lXext -lfontconfig -lSM -lICE " + flags return flags diff --git a/myppy/recipes/macosx.py b/myppy/recipes/macosx.py index d50bd15..d5ddb5e 100644 --- a/myppy/recipes/macosx.py +++ b/myppy/recipes/macosx.py @@ -384,7 +384,7 @@ class lib_bz2(base.lib_bz2,NWayRecipe): pass -class lib_qt4_xmlpatterns(base.lib_qt4_xmlpatterns,Recipe): +class _lib_qt4_base(base._lib_qt4_base,Recipe): DEPENDENCIES = ["lib_icu"] @property def CONFIGURE_ARGS(self): @@ -395,7 +395,7 @@ def CONFIGURE_ARGS(self): return args -class lib_qt4(base.lib_qt4,lib_qt4_xmlpatterns): +class lib_qt4(base.lib_qt4,_lib_qt4_base): def install(self): super(lib_qt4,self).install() # Copy the menu.nib bundle into the app resource directory. @@ -406,6 +406,10 @@ def install(self): shutil.copytree(menunib_in,menunib_out) +class lib_qt4_full(base.lib_qt4_full,_lib_qt4_base): + pass + + class lib_icu(Recipe): # TODO: hardcode charset to utf8 for extra performance SOURCE_URL = "http://download.icu-project.org/files/icu4c/4.4.2/icu4c-4_4_2-src.tgz"