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 optparse import OptionParser
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)
WriteMimeXMLFile(destdir+prefix+"/share/mime/packages/panda3d.xml", MIME_INFO)
WriteApplicationsFile(destdir+prefix+"/share/application-registry/panda3d.applications", APP_INFO, MIME_INFO)
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")
if os.path.isfile(outputdir+"/bin/pview"):
oscmd("cp makepanda/pview.desktop "+destdir+prefix+"/share/applications/pview.desktop")
oscmd("cp doc/ReleaseNotes "+destdir+prefix+"/share/panda3d/ReleaseNotes")
oscmd("echo '"+prefix+"/share/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")
else:
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/")
for base in os.listdir(outputdir+"/lib"):
if (not base.endswith(".a")) or base == "libp3pystub.a":
# 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)
# 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")
DeleteEmptyDirs(destdir+prefix+"/share/panda3d")
DeleteCVS(destdir+prefix+"/include/panda3d")
DeleteVCS(destdir+prefix+"/include/panda3d")
DeleteBuildFiles(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/StdVector')
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
Maintainer: rdb <me@rdb.name>
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'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"):
# Invoke installpanda.py to install it into a temporary dir
lib_dir = GetDebLibDir()
if RUNTIME:
InstallRuntime(destdir="targetroot", prefix="/usr", outputdir=GetOutputDir(), libdir=GetDebLibDir())
InstallRuntime(destdir="targetroot", prefix="/usr", outputdir=GetOutputDir(), libdir=lib_dir)
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("mkdir -p 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
# dpkg-shlibdeps should look in for executables.
lib_dir = GetLibDir()
pkg_version = DEBVERSION
if RUNTIME:
pkg_name = "panda3d-runtime"
@ -6507,7 +6507,7 @@ def MakeInstallerOSX():
oscmd("cp -R samples/* dstroot/samples/Developer/Examples/Panda3D/")
oscmd("chmod -R 0775 dstroot/*")
DeleteCVS("dstroot")
DeleteVCS("dstroot")
DeleteBuildFiles("dstroot")
# We need to be root to perform a chown. Bleh.
# 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_DLL = [".dll",".dlo",".dle",".dli",".dlm",".mll",".exe",".pyd",".ocx"]
SUFFIX_LIB = [".lib",".ilb"]
VCS_DIRS = set(["CVS", "CVSROOT", ".git", ".hg"])
VCS_FILES = set([".cvsignore", ".gitignore", ".gitmodules", ".hgignore"])
STARTTIME = time.time()
MAINTHREAD = threading.currentThread()
OUTPUTDIR = "built"
@ -534,16 +536,6 @@ def oscmd(cmd, ignoreError = False):
##
## 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=[]):
@ -555,33 +547,6 @@ def GetDirectoryContents(dir, filters="*", skip=[]):
for file in fnmatch.filter(files, filter):
if (skip.count(file)==0) and (os.path.isfile(dir + "/" + file)):
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.sort()
@ -1023,16 +988,16 @@ def ConditionalWriteFile(dest, desiredcontents):
sys.stdout.flush()
WriteFile(dest, desiredcontents)
def DeleteCVS(dir):
def DeleteVCS(dir):
if dir == "": dir = "."
for entry in os.listdir(dir):
subdir = os.path.join(dir, entry)
if (os.path.isdir(subdir)):
if (entry == "CVS" or entry == "CVSROOT"):
if entry in VCS_DIRS:
shutil.rmtree(subdir)
else:
DeleteCVS(subdir)
elif (os.path.isfile(subdir) and (entry == ".cvsignore" or entry.startswith(".#"))):
DeleteVCS(subdir)
elif (os.path.isfile(subdir) and (entry in VCS_FILES or entry.startswith(".#"))):
os.remove(subdir)
def DeleteBuildFiles(dir):
@ -2432,16 +2397,16 @@ def CopyAllJavaSources(dir, skip=[]):
WriteBinaryFile(dstfile, ReadBinaryFile(srcfile))
JustBuilt([dstfile], [srcfile])
def CopyTree(dstdir, srcdir, omitCVS=True):
def CopyTree(dstdir, srcdir, omitVCS=True):
if (os.path.isdir(dstdir)):
for entry in os.listdir(srcdir):
srcpth = os.path.join(srcdir, entry)
dstpth = os.path.join(dstdir, entry)
if (os.path.isfile(srcpth)):
if (not omitCVS or entry != ".cvsignore"):
if not omitVCS or entry not in VCS_FILES:
CopyFile(dstpth, srcpth)
else:
if (not omitCVS or entry != "CVS"):
if not omitVCS or entry not in VCS_DIRS:
CopyTree(dstpth, srcpth)
else:
if sys.platform == 'win32':
@ -2449,8 +2414,8 @@ def CopyTree(dstdir, srcdir, omitCVS=True):
else:
cmd = 'cp -R -f ' + srcdir + ' ' + dstdir
oscmd(cmd)
if omitCVS:
DeleteCVS(dstdir)
if omitVCS:
DeleteVCS(dstdir)
def CopyPythonTree(dstdir, srcdir, lib2to3_fixers=[]):
if (not os.path.isdir(dstdir)):
@ -2470,7 +2435,7 @@ def CopyPythonTree(dstdir, srcdir, lib2to3_fixers=[]):
dstpth = os.path.join(dstdir, entry)
if (os.path.isfile(srcpth)):
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])):
WriteBinaryFile(dstpth, ReadBinaryFile(srcpth))
@ -2479,7 +2444,7 @@ def CopyPythonTree(dstdir, srcdir, lib2to3_fixers=[]):
else:
JustBuilt([dstpth], [srcpth])
elif (entry != "CVS"):
elif entry not in VCS_DIRS:
CopyPythonTree(dstpth, srcpth, lib2to3_fixers)
for dstpth, srcpth in refactor:

View File

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

View File

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