Hi! After hours of compiling all dependencies, I put together emerge scripts for R (utilizing the binary installer) and RKWard (compilation from SVN sources). See the attached diff.
Last time I was asking (and ranting) about how to distribute windows binaries, I was told to go this way. I must admit, I still don't quite understand, whether or not, or under what circumstances "external" projects can become part of the "official" kde-win-installer, but ultimately that is my goal. Please let me know, whether I am on track for that, what else I would need to provide, or what I should aim for, instead. Some more detailed questions: 1. Which section should this go to (in "testing" right now)? "contributed"? 2. Both emerge scripts contain some portions that seem rather hackish to me. See the comments contained within the diff. Any guidance on that? 3. Is it ok to commit this? 4. Will this get part of the nightly builds? An issue report: At least strigi and kdelibs look for libbz2. On my system a LIBBZ2.DLL was already installed in c:\windows\system32 . Despite %KDEROOT% sitting earlier in the PATH, cmake picked up this DLL. The build then failed when trying to link it. Temporarily moving c:\windows\system32\LIBBZ2.DLL out of the way solved the problem. Regards Thomas
Index: testing/r-base/r-base-2.10.1.py =================================================================== --- testing/r-base/r-base-2.10.1.py (revision 0) +++ testing/r-base/r-base-2.10.1.py (revision 0) @@ -0,0 +1,65 @@ +# -*- coding: utf-8 -*- +import info +import utils + +PACKAGE_CRAN_MIRROR = 'http://ftp5.gwdg.de/pub/misc/cran' +PACKAGE_PATH = '/bin/windows/base/' +PACKAGE_VERSION = '2.10.1' +PACKAGE_URL = PACKAGE_CRAN_MIRROR + PACKAGE_PATH + 'R-' + PACKAGE_VERSION + '-win32.exe' + +class subinfo(info.infoclass): + def setDependencies( self ): + self.hardDependencies['gnuwin32/wget'] = 'default' + + def setTargets( self ): + self.targets[PACKAGE_VERSION] = PACKAGE_URL + self.defaultTarget = PACKAGE_VERSION + +from Package.BinaryPackageBase import * + +# Installation approach based on expat-src-2.0.1.py. +# This basically just runs the upstream binary installer, then moves files to the KDE dir. +# Installation goes to dstdir/lib/R, since R comes with *a lot* of files in several subdirectories. +# This approach is also taken in the Debian packages, and probably other *n*x distributions. +# A convenience R.bat is added to dstdir/bin to have "R" in the path. +# Compiling R from source is possible, but terribly complex on Windows. See +# http://cran.r-project.org/doc/manuals/R-admin.html#Installing-R-under-Windows for details. +# +# TODO: +# - adding icons would really be nice +# - is there a way to run updatePackages() after an update? +class Package(BinaryPackageBase): + def __init__( self ): + self.subinfo = subinfo() + BinaryPackageBase.__init__( self ) + # don't use shortcut to unpack into imageDir() + self.buildSystemType = 'custom' + # create combined package + self.subinfo.options.package.withCompiler = None + + def unpack( self ): + # hopefully only one... + for filename in self.localFileNames(): + self.system( os.path.join( self.downloadDir(), filename ) + " /DIR=\"" + self.workDir() + "\" /SILENT") + return True + + def install( self ): + srcdir = self.sourceDir() + dstdir = self.installDir() + + utils.cleanDirectory( dstdir ) + os.makedirs (os.path.join (dstdir, "lib", "R")) + os.makedirs (os.path.join (dstdir, "bin")) + + # place everything in dstdir/lib/R (similar to debian packaging) + utils.copyDir (srcdir, os.path.join (dstdir, "lib", "R")) + + # create a shortcut in dstdir/bin + f = open(os.path.join (dstdir, "bin", "R.bat"), "w") + f.write("REM redirect to R.exe, autocreated during installation\n" + os.path.join ("%~dsp0", "..", "lib", "R", "bin", "R.exe") + " %1 %2 %3 %4 %5 %6 %7 %8 %9\n") + f.close() + + return True + +if __name__ == '__main__': + Package().execute() Index: testing/rkward/rkward-0.5.2.py =================================================================== --- testing/rkward/rkward-0.5.2.py (revision 0) +++ testing/rkward/rkward-0.5.2.py (revision 0) @@ -0,0 +1,53 @@ +# -*- coding: utf-8 -*- +import base +import utils +import os +import sys +import info + +class subinfo(info.infoclass): + def setTargets( self ): + self.svnTargets['svnHEAD'] = 'http://rkward.svn.sourceforge.net/svnroot/rkward/trunk/rkward/' + self.defaultTarget = 'svnHEAD' + + def setDependencies( self ): + self.hardDependencies['testing/r-base'] = 'default' + self.hardDependencies['kde/kdebase-runtime'] = 'default' + +class subclass(base.baseclass): + def __init__( self, **args ): + base.baseclass.__init__( self, args=args ) + self.subinfo = subinfo() + + # What is the recommended way to fetch SVN sources from a repository that is not on the KDE SVN server? + def fetch( self ): + ok = utils.svnFetch (self.subinfo.svnTargets['svnHEAD'], self.svndir) + # This is plainly wrong, but somehow ok is False even though the checkout/update succeeded + return True + + def realSvnPath( self ): + return os.path.join (self.svndir, "rkward") + + def unpack( self ): + utils.cleanDirectory( self.workdir ) # side-effect of creating the dir, if needed + return True + + def compile( self ): + self.kde.sourcePath = self.realSvnPath() + return self.kde.kdeCompile(" -DR_EXECUTABLE=" + self.rootdir + "/lib/R/bin/R.exe") + + def install( self ): + return self.kde.kdeInstall() + + def make_package( self ): + # I'm sure this is not the right way to do it, but then, what is the right way? + self.kde.kdesvndir = "" + self.kde.kdeSvnPath = self.realSvnPath + + if not self.buildTarget == 'svnHEAD': + return self.doPackaging( "rkward", self.buildTarget, True ) + else: + return self.doPackaging( "rkward", os.path.basename(sys.argv[0]).replace("rkward-", "").replace(".py", "") + "svn", True ) + +if __name__ == '__main__': + subclass().execute()
signature.asc
Description: This is a digitally signed message part.
_______________________________________________ Kde-windows mailing list [email protected] https://mail.kde.org/mailman/listinfo/kde-windows
