More minor linux packaging fixes

This commit is contained in:
rdb 2014-12-29 15:15:29 +01:00
parent 794b00805e
commit be1eb1d812
8 changed files with 28 additions and 68 deletions

0
direct/src/directscripts/profilepaths-osx.command Normal file → Executable file
View File

0
dtool/src/interrogate/interfaceMakerPythonNative.cxx Executable file → Normal file
View File

0
dtool/src/interrogate/interfaceMakerPythonNative.h Executable file → Normal file
View File

View File

@ -12,7 +12,7 @@
# #
######################################################################## ########################################################################
import os, sys, platform, compileall import os, sys, platform
from distutils.sysconfig import get_python_lib from distutils.sysconfig import get_python_lib
from optparse import OptionParser from optparse import OptionParser
from makepandacore import * from makepandacore import *
@ -201,9 +201,9 @@ def InstallPanda(destdir="", prefix="/usr", outputdir="built", libdir=GetLibDir(
WriteKeysFile(destdir+prefix+"/share/mime-info/panda3d.keys", MIME_INFO) WriteKeysFile(destdir+prefix+"/share/mime-info/panda3d.keys", MIME_INFO)
WriteMimeXMLFile(destdir+prefix+"/share/mime/packages/panda3d.xml", MIME_INFO) WriteMimeXMLFile(destdir+prefix+"/share/mime/packages/panda3d.xml", MIME_INFO)
WriteApplicationsFile(destdir+prefix+"/share/application-registry/panda3d.applications", APP_INFO, MIME_INFO) WriteApplicationsFile(destdir+prefix+"/share/application-registry/panda3d.applications", APP_INFO, MIME_INFO)
if os.path.isfile(outputdir+"/bin/pview"):
oscmd("cp makepanda/pview.desktop "+destdir+prefix+"/share/applications/pview.desktop") oscmd("cp makepanda/pview.desktop "+destdir+prefix+"/share/applications/pview.desktop")
oscmd("cp doc/LICENSE "+destdir+prefix+"/share/panda3d/LICENSE")
oscmd("cp doc/LICENSE "+destdir+prefix+"/include/panda3d/LICENSE")
oscmd("cp doc/ReleaseNotes "+destdir+prefix+"/share/panda3d/ReleaseNotes") oscmd("cp doc/ReleaseNotes "+destdir+prefix+"/share/panda3d/ReleaseNotes")
oscmd("echo '"+prefix+"/share/panda3d' > "+destdir+PPATH+"/panda3d.pth") oscmd("echo '"+prefix+"/share/panda3d' > "+destdir+PPATH+"/panda3d.pth")
oscmd("echo '"+libdir+"/panda3d'>> "+destdir+PPATH+"/panda3d.pth") oscmd("echo '"+libdir+"/panda3d'>> "+destdir+PPATH+"/panda3d.pth")
@ -211,22 +211,17 @@ def InstallPanda(destdir="", prefix="/usr", outputdir="built", libdir=GetLibDir(
oscmd("echo '"+libdir+"/panda3d'> "+destdir+"/usr/local/libdata/ldconfig/panda3d") oscmd("echo '"+libdir+"/panda3d'> "+destdir+"/usr/local/libdata/ldconfig/panda3d")
else: else:
oscmd("echo '"+libdir+"/panda3d'> "+destdir+"/etc/ld.so.conf.d/panda3d.conf") oscmd("echo '"+libdir+"/panda3d'> "+destdir+"/etc/ld.so.conf.d/panda3d.conf")
oscmd("chmod +x "+destdir+"/etc/ld.so.conf.d/panda3d.conf")
oscmd("cp "+outputdir+"/bin/* "+destdir+prefix+"/bin/") oscmd("cp "+outputdir+"/bin/* "+destdir+prefix+"/bin/")
for base in os.listdir(outputdir+"/lib"): for base in os.listdir(outputdir+"/lib"):
if (not base.endswith(".a")) or base == "libp3pystub.a": if (not base.endswith(".a")) or base == "libp3pystub.a":
# We really need to specify -R in order not to follow symlinks on non-GNU # We really need to specify -R in order not to follow symlinks on non-GNU
oscmd("cp -R -P "+outputdir+"/lib/"+base+" "+destdir+libdir+"/panda3d/"+base) oscmd("cp -R -P "+outputdir+"/lib/"+base+" "+destdir+libdir+"/panda3d/"+base)
# rpmlint doesn't like it if we compile pyc.
#for base in os.listdir(destdir+prefix+"/share/panda3d/direct"):
# if ((base != "extensions") and (base != "extensions_native")):
# compileall.compile_dir(destdir+prefix+"/share/panda3d/direct/"+base)
#compileall.compile_dir(destdir+prefix+"/share/panda3d/Pmw")
DeleteCVS(destdir+prefix+"/share/panda3d") DeleteVCS(destdir+prefix+"/share/panda3d")
DeleteBuildFiles(destdir+prefix+"/share/panda3d") DeleteBuildFiles(destdir+prefix+"/share/panda3d")
DeleteEmptyDirs(destdir+prefix+"/share/panda3d") DeleteEmptyDirs(destdir+prefix+"/share/panda3d")
DeleteCVS(destdir+prefix+"/include/panda3d") DeleteVCS(destdir+prefix+"/include/panda3d")
DeleteBuildFiles(destdir+prefix+"/include/panda3d") DeleteBuildFiles(destdir+prefix+"/include/panda3d")
DeleteEmptyDirs(destdir+prefix+"/include/panda3d") DeleteEmptyDirs(destdir+prefix+"/include/panda3d")

View File

@ -2583,7 +2583,7 @@ CopyFile(GetOutputDir()+'/include/parser-inc/glew/','dtool/src/parser-inc/glew.h
CopyFile(GetOutputDir()+'/include/parser-inc/Eigen/','dtool/src/parser-inc/Dense') CopyFile(GetOutputDir()+'/include/parser-inc/Eigen/','dtool/src/parser-inc/Dense')
CopyFile(GetOutputDir()+'/include/parser-inc/Eigen/','dtool/src/parser-inc/StdVector') CopyFile(GetOutputDir()+'/include/parser-inc/Eigen/','dtool/src/parser-inc/StdVector')
CopyFile(GetOutputDir()+'/include/parser-inc/Rocket/Core/','dtool/src/parser-inc/RenderInterface.h') CopyFile(GetOutputDir()+'/include/parser-inc/Rocket/Core/','dtool/src/parser-inc/RenderInterface.h')
DeleteCVS(GetOutputDir()+'/include/parser-inc') DeleteVCS(GetOutputDir()+'/include/parser-inc')
######################################################################## ########################################################################
# #
@ -6158,7 +6158,7 @@ Conflicts: panda3d
Replaces: panda3d Replaces: panda3d
Maintainer: rdb <me@rdb.name> Maintainer: rdb <me@rdb.name>
Installed-Size: INSTSIZE Installed-Size: INSTSIZE
Description: The Panda3D free 3D engine SDK Description: Panda3D free 3D engine SDK
Panda3D is a game engine which includes graphics, audio, I/O, collision detection, and other abilities relevant to the creation of 3D games. Panda3D is open source and free software under the revised BSD license, and can be used for both free and commercial game development at no financial cost. Panda3D is a game engine which includes graphics, audio, I/O, collision detection, and other abilities relevant to the creation of 3D games. Panda3D is open source and free software under the revised BSD license, and can be used for both free and commercial game development at no financial cost.
Panda3D's intended game-development language is Python. The engine itself is written in C++, and utilizes an automatic wrapper-generator to expose the complete functionality of the engine in a Python interface. Panda3D's intended game-development language is Python. The engine itself is written in C++, and utilizes an automatic wrapper-generator to expose the complete functionality of the engine in a Python interface.
. .
@ -6285,10 +6285,11 @@ def MakeInstallerLinux():
if os.path.exists("/usr/bin/dpkg-deb"): if os.path.exists("/usr/bin/dpkg-deb"):
# Invoke installpanda.py to install it into a temporary dir # Invoke installpanda.py to install it into a temporary dir
lib_dir = GetDebLibDir()
if RUNTIME: if RUNTIME:
InstallRuntime(destdir="targetroot", prefix="/usr", outputdir=GetOutputDir(), libdir=GetDebLibDir()) InstallRuntime(destdir="targetroot", prefix="/usr", outputdir=GetOutputDir(), libdir=lib_dir)
else: else:
InstallPanda(destdir="targetroot", prefix="/usr", outputdir=GetOutputDir(), libdir=GetDebLibDir()) InstallPanda(destdir="targetroot", prefix="/usr", outputdir=GetOutputDir(), libdir=lib_dir)
oscmd("chmod -R 755 targetroot/usr/share/panda3d") oscmd("chmod -R 755 targetroot/usr/share/panda3d")
oscmd("mkdir -p targetroot/usr/share/man/man1") oscmd("mkdir -p targetroot/usr/share/man/man1")
oscmd("cp doc/man/*.1 targetroot/usr/share/man/man1/") oscmd("cp doc/man/*.1 targetroot/usr/share/man/man1/")
@ -6311,7 +6312,6 @@ def MakeInstallerLinux():
# Determine the package name and the locations that # Determine the package name and the locations that
# dpkg-shlibdeps should look in for executables. # dpkg-shlibdeps should look in for executables.
lib_dir = GetLibDir()
pkg_version = DEBVERSION pkg_version = DEBVERSION
if RUNTIME: if RUNTIME:
pkg_name = "panda3d-runtime" pkg_name = "panda3d-runtime"
@ -6507,7 +6507,7 @@ def MakeInstallerOSX():
oscmd("cp -R samples/* dstroot/samples/Developer/Examples/Panda3D/") oscmd("cp -R samples/* dstroot/samples/Developer/Examples/Panda3D/")
oscmd("chmod -R 0775 dstroot/*") oscmd("chmod -R 0775 dstroot/*")
DeleteCVS("dstroot") DeleteVCS("dstroot")
DeleteBuildFiles("dstroot") DeleteBuildFiles("dstroot")
# We need to be root to perform a chown. Bleh. # We need to be root to perform a chown. Bleh.
# Fortunately PackageMaker does it for us, on 10.5 and above. # Fortunately PackageMaker does it for us, on 10.5 and above.

View File

@ -22,6 +22,8 @@ else:
SUFFIX_INC = [".cxx",".c",".h",".I",".yxx",".lxx",".mm",".rc",".r"] SUFFIX_INC = [".cxx",".c",".h",".I",".yxx",".lxx",".mm",".rc",".r"]
SUFFIX_DLL = [".dll",".dlo",".dle",".dli",".dlm",".mll",".exe",".pyd",".ocx"] SUFFIX_DLL = [".dll",".dlo",".dle",".dli",".dlm",".mll",".exe",".pyd",".ocx"]
SUFFIX_LIB = [".lib",".ilb"] SUFFIX_LIB = [".lib",".ilb"]
VCS_DIRS = set(["CVS", "CVSROOT", ".git", ".hg"])
VCS_FILES = set([".cvsignore", ".gitignore", ".gitmodules", ".hgignore"])
STARTTIME = time.time() STARTTIME = time.time()
MAINTHREAD = threading.currentThread() MAINTHREAD = threading.currentThread()
OUTPUTDIR = "built" OUTPUTDIR = "built"
@ -534,16 +536,6 @@ def oscmd(cmd, ignoreError = False):
## ##
## GetDirectoryContents ## GetDirectoryContents
## ##
## At times, makepanda will use a function like "os.listdir" to process
## all the files in a directory. Unfortunately, that means that any
## accidental addition of a file to a directory could cause makepanda
## to misbehave without warning.
##
## To alleviate this weakness, we created GetDirectoryContents. This
## uses "os.listdir" to fetch the directory contents, but then it
## compares the results to the appropriate CVS/Entries to see if
## they match. If not, it prints a big warning message.
##
######################################################################## ########################################################################
def GetDirectoryContents(dir, filters="*", skip=[]): def GetDirectoryContents(dir, filters="*", skip=[]):
@ -555,33 +547,6 @@ def GetDirectoryContents(dir, filters="*", skip=[]):
for file in fnmatch.filter(files, filter): for file in fnmatch.filter(files, filter):
if (skip.count(file)==0) and (os.path.isfile(dir + "/" + file)): if (skip.count(file)==0) and (os.path.isfile(dir + "/" + file)):
actual[file] = 1 actual[file] = 1
if (os.path.isfile(dir + "/CVS/Entries")):
cvs = {}
srchandle = open(dir + "/CVS/Entries", "r")
files = []
for line in srchandle:
if (line[0]=="/"):
s = line.split("/",2)
if (len(s)==3):
files.append(s[1])
srchandle.close()
for filter in filters:
for file in fnmatch.filter(files, filter):
if (skip.count(file)==0):
cvs[file] = 1
#XXX this happens all the time, do we really need to warn about this?
#for file in actual.keys():
# if (file not in cvs and VERBOSE):
# msg = "%sWARNING: %s is in %s, but not in CVS%s" % (GetColor("red"), ColorText("green", file), ColorText("green", dir), GetColor())
# print msg
# WARNINGS.append(msg)
for file in cvs.keys():
if (file not in actual and VERBOSE):
msg = "%sWARNING: %s is not in %s, but is in CVS%s" % (GetColor("red"), ColorText("green", file), ColorText("green", dir), GetColor())
print(msg)
WARNINGS.append(msg)
results = list(actual.keys()) results = list(actual.keys())
results.sort() results.sort()
@ -1023,16 +988,16 @@ def ConditionalWriteFile(dest, desiredcontents):
sys.stdout.flush() sys.stdout.flush()
WriteFile(dest, desiredcontents) WriteFile(dest, desiredcontents)
def DeleteCVS(dir): def DeleteVCS(dir):
if dir == "": dir = "." if dir == "": dir = "."
for entry in os.listdir(dir): for entry in os.listdir(dir):
subdir = os.path.join(dir, entry) subdir = os.path.join(dir, entry)
if (os.path.isdir(subdir)): if (os.path.isdir(subdir)):
if (entry == "CVS" or entry == "CVSROOT"): if entry in VCS_DIRS:
shutil.rmtree(subdir) shutil.rmtree(subdir)
else: else:
DeleteCVS(subdir) DeleteVCS(subdir)
elif (os.path.isfile(subdir) and (entry == ".cvsignore" or entry.startswith(".#"))): elif (os.path.isfile(subdir) and (entry in VCS_FILES or entry.startswith(".#"))):
os.remove(subdir) os.remove(subdir)
def DeleteBuildFiles(dir): def DeleteBuildFiles(dir):
@ -2432,16 +2397,16 @@ def CopyAllJavaSources(dir, skip=[]):
WriteBinaryFile(dstfile, ReadBinaryFile(srcfile)) WriteBinaryFile(dstfile, ReadBinaryFile(srcfile))
JustBuilt([dstfile], [srcfile]) JustBuilt([dstfile], [srcfile])
def CopyTree(dstdir, srcdir, omitCVS=True): def CopyTree(dstdir, srcdir, omitVCS=True):
if (os.path.isdir(dstdir)): if (os.path.isdir(dstdir)):
for entry in os.listdir(srcdir): for entry in os.listdir(srcdir):
srcpth = os.path.join(srcdir, entry) srcpth = os.path.join(srcdir, entry)
dstpth = os.path.join(dstdir, entry) dstpth = os.path.join(dstdir, entry)
if (os.path.isfile(srcpth)): if (os.path.isfile(srcpth)):
if (not omitCVS or entry != ".cvsignore"): if not omitVCS or entry not in VCS_FILES:
CopyFile(dstpth, srcpth) CopyFile(dstpth, srcpth)
else: else:
if (not omitCVS or entry != "CVS"): if not omitVCS or entry not in VCS_DIRS:
CopyTree(dstpth, srcpth) CopyTree(dstpth, srcpth)
else: else:
if sys.platform == 'win32': if sys.platform == 'win32':
@ -2449,8 +2414,8 @@ def CopyTree(dstdir, srcdir, omitCVS=True):
else: else:
cmd = 'cp -R -f ' + srcdir + ' ' + dstdir cmd = 'cp -R -f ' + srcdir + ' ' + dstdir
oscmd(cmd) oscmd(cmd)
if omitCVS: if omitVCS:
DeleteCVS(dstdir) DeleteVCS(dstdir)
def CopyPythonTree(dstdir, srcdir, lib2to3_fixers=[]): def CopyPythonTree(dstdir, srcdir, lib2to3_fixers=[]):
if (not os.path.isdir(dstdir)): if (not os.path.isdir(dstdir)):
@ -2470,7 +2435,7 @@ def CopyPythonTree(dstdir, srcdir, lib2to3_fixers=[]):
dstpth = os.path.join(dstdir, entry) dstpth = os.path.join(dstdir, entry)
if (os.path.isfile(srcpth)): if (os.path.isfile(srcpth)):
base, ext = os.path.splitext(entry) base, ext = os.path.splitext(entry)
if (entry != ".cvsignore" and ext not in SUFFIX_INC + ['.pyc', '.pyo']): if entry not in VCS_FILES and ext not in SUFFIX_INC + ['.pyc', '.pyo']:
if (NeedsBuild([dstpth], [srcpth])): if (NeedsBuild([dstpth], [srcpth])):
WriteBinaryFile(dstpth, ReadBinaryFile(srcpth)) WriteBinaryFile(dstpth, ReadBinaryFile(srcpth))
@ -2479,7 +2444,7 @@ def CopyPythonTree(dstdir, srcdir, lib2to3_fixers=[]):
else: else:
JustBuilt([dstpth], [srcpth]) JustBuilt([dstpth], [srcpth])
elif (entry != "CVS"): elif entry not in VCS_DIRS:
CopyPythonTree(dstpth, srcpth, lib2to3_fixers) CopyPythonTree(dstpth, srcpth, lib2to3_fixers)
for dstpth, srcpth in refactor: for dstpth, srcpth in refactor:

View File

@ -7,5 +7,5 @@ StartupNotify=true
NoDisplay=true NoDisplay=true
Terminal=false Terminal=false
Type=Application Type=Application
Categories=Game;Viewer; Categories=Game;3DGraphics;Viewer;
MimeType=application/x-panda3d; MimeType=application/x-panda3d;

View File

@ -8,5 +8,5 @@ StartupNotify=true
NoDisplay=true NoDisplay=true
Terminal=true Terminal=true
Type=Application Type=Application
Categories=Viewer; Categories=Graphics;Utility;3DGraphics;Viewer;
MimeType=model/x-egg;model/x-compressed-egg;model/x-bam;model/x-compressed-bam; MimeType=model/x-egg;model/x-compressed-egg;model/x-bam;model/x-compressed-bam;