Skip to content

fix some install issues #73

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 6 commits into from
Aug 27, 2014
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 18 additions & 4 deletions SConstruct
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,23 @@ import ConfigParser
mymode = ARGUMENTS.get('mode', 'release')

if not (mymode in ['debug', 'release']):
print "Error: expected 'debug' or 'release', found: " + mymode
Exit(1)
raise Exception("Can't select build mode ['debug', 'release']")

avTranscoderVersion = ARGUMENTS.get('version', None)

if not avTranscoderVersion:
import git
# Get version from last tag of git repository
repo = git.Repo( "." )
tags = repo.tags
if tags:
lastTag = tags[-1]
avTranscoderVersion = lastTag.name[1:]
else:
raise Exception( "Can't get last version of AvTranscoder." )

if not avTranscoderVersion:
raise Exception( "Can't get last version of AvTranscoder." )

config = ConfigParser.RawConfigParser()

Expand All @@ -18,7 +33,6 @@ config.read( [

commonInclude = []
commonLibDir = []
installPrefix = "/usr/local"

splitChar = ";"

Expand Down Expand Up @@ -190,9 +204,9 @@ if mymode == "debug":
Export( "env" )
Export( "envJava" )
Export( "envPy" )
Export( "installPrefix" )
Export( "resampleLibraryName" )
Export( "mymode" )
Export( "avTranscoderVersion" )

VariantDir( 'build/'+mymode+'/src', 'src', duplicate = 0 )
VariantDir( 'build/'+mymode+'/app', 'app', duplicate = 0 )
Expand Down
53 changes: 36 additions & 17 deletions app/cpp/SConscript
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,12 @@ import platform

Import( 'AvTranscoder' )
Import( 'sAvTranscoder' )
#Import( 'AvTranscoder_jar' )
Import( 'installPrefix' )
Import( "resampleLibraryName" )

env = Environment().Clone()

Import( 'resampleLibraryName' )
Import( 'avTranscoderVersion' )
Import( 'env' )

avinfo = env.Program(
'avinfo',
'avinfo-' + avTranscoderVersion,
Glob( 'avInfo/*.cpp' ),
LIBS = [
sAvTranscoder,
Expand All @@ -25,7 +21,7 @@ avinfo = env.Program(
)

avmeta = env.Program(
'avmeta',
'avmeta-' + avTranscoderVersion,
Glob( 'avMeta/*.cpp' ),
LIBS = [
sAvTranscoder,
Expand All @@ -38,7 +34,7 @@ avmeta = env.Program(
)

avtransform = env.Program(
'av++',
'av++-' + avTranscoderVersion,
Glob( 'avTranscoder/*.cpp' ),
LIBS = [
sAvTranscoder,
Expand All @@ -51,7 +47,7 @@ avtransform = env.Program(
)

avprocessor = env.Program(
'avprocessor',
'avprocessor-' + avTranscoderVersion,
Glob( 'genericProcessor/*.cpp' ),
LIBS = [
sAvTranscoder,
Expand All @@ -68,7 +64,7 @@ avprocessor = env.Program(

if platform.system() != 'Windows':
avplayer = env.Program(
'avplayer',
'avplayer-' + avTranscoderVersion,
Glob( 'avplay/*.cpp' ),
LIBS = [
sAvTranscoder,
Expand All @@ -83,7 +79,7 @@ if platform.system() != 'Windows':
)

avprofiles = env.Program(
'avprofiles',
'avprofiles-' + avTranscoderVersion,
Glob( 'presetChecker/*.cpp' ),
LIBS = [
sAvTranscoder,
Expand All @@ -98,8 +94,8 @@ if platform.system() != 'Windows':
],
)

avprofiles = env.Program(
'avoptions',
avoptions = env.Program(
'avoptions-' + avTranscoderVersion,
Glob( 'optionChecker/*.cpp' ),
LIBS = [
sAvTranscoder,
Expand All @@ -116,6 +112,29 @@ if platform.system() != 'Windows':

env.Depends( avmeta, sAvTranscoder )

env.Alias( "install", env.Install(os.path.join( installPrefix, "bin" ), avmeta ) )
env.Alias( "install", env.Install(os.path.join( installPrefix, "bin" ), avprocessor ) )
env.Alias( "install", env.Install(os.path.join( installPrefix, "bin" ), avtransform ) )
env.Alias( "install", env.Install("bin", avinfo) )
env.Alias( "install", env.Install("bin", avmeta) )
env.Alias( "install", env.Install("bin", avprocessor) )
env.Alias( "install", env.Install("share/man/man1", File("avInfo/avinfo.man") ) )
env.Alias( "install", env.Install("share/man/man1", File("avMeta/avmeta.man") ) )
env.Alias( "install", env.Install("share/man/man1", File("genericProcessor/avprocessor.man") ) )
if platform.system() != 'Windows':
env.Alias( "install", env.Install("bin", avplayer) )
env.Alias( "install", env.Install("bin", avprofiles) )
env.Alias( "install", env.Install("share/man/man1", File("avplay/avplayer.man") ) )
env.Alias( "install", env.Install("share/man/man1", File("presetChecker/avprofiles.man") ) )

def SymLink(target, source, env):
os.symlink(os.path.basename(str(source[0])), str(target[0]))

avinfolink = env.Command( 'avinfo', avinfo, SymLink )
avmetalink = env.Command( 'avmeta', avmeta, SymLink )
avprocessorlink = env.Command( 'avprocessor', avprocessor, SymLink )
avplayerlink = env.Command( 'avplayer', avplayer, SymLink )
avprofileslink = env.Command( 'avprofiles', avprofiles, SymLink )

env.Alias( "install", env.Install("bin", avinfolink) )
env.Alias( "install", env.Install("bin", avmetalink) )
env.Alias( "install", env.Install("bin", avprocessorlink) )
env.Alias( "install", env.Install("bin", avplayerlink) )
env.Alias( "install", env.Install("bin", avprofileslink) )
2 changes: 1 addition & 1 deletion app/cpp/avInfo/avinfo.man
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
.\" Manpage for avmeta.
.\" Manpage for avinfo.
.\" Contact arnaud.marcantoine@gmail.com to correct errors or typos.
.TH man 1 "21 May 2014" "1.0" "avinfo man page"
.SH NOM
Expand Down
11 changes: 11 additions & 0 deletions app/cpp/avplay/avplayer.man
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
.\" Manpage for avplayer.
.\" Contact arnaud.marcantoine@gmail.com to correct errors or typos.
.TH man 1 "21 May 2014" "1.0" "avinfo man page"
.SH NOM
avplayer - play media file
.SH SYNOPSIS
avplayer inputfile.ext
.SH AUTHOR
Written by Marc-Antoine ARNAUD (arnaud.marcantoine@gmail.com)
.SH COPYRIGHT
Licence GPL-v3.0+
11 changes: 11 additions & 0 deletions app/cpp/presetChecker/avprofiles.man
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
.\" Manpage for avprofiles.
.\" Contact arnaud.marcantoine@gmail.com to correct errors or typos.
.TH man 1 "21 May 2014" "1.0" "avinfo man page"
.SH NOM
avprofiles - check options for each profile detected
.SH SYNOPSIS
avprofiles
.SH AUTHOR
Written by Marc-Antoine ARNAUD (arnaud.marcantoine@gmail.com)
.SH COPYRIGHT
Licence GPL-v3.0+
1 change: 0 additions & 1 deletion app/java/SConscript
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ Import( 'envJava' )
Import( 'mymode' )
Import( 'jAvTranscoder' )
Import( 'jAvTranscoderClass' )
Import( 'installPrefix' )

if jAvTranscoderClass:
envJava.Append(
Expand Down
47 changes: 21 additions & 26 deletions src/SConscript
Original file line number Diff line number Diff line change
@@ -1,22 +1,12 @@
import glob, re
import os
import sys
import git

Import( "env" )
Import( "envJava" )
Import( "envPy" )
Import( "installPrefix" )
Import( "resampleLibraryName" )

# Get version from last tag of git repository
repo = git.Repo( "." )
tags = repo.tags
if tags:
lastTag = tags[-1]
avTranscoderVersion = lastTag.name[1:]
else:
raise Exception( "Can't get last version of AvTranscoder." )
Import( "avTranscoderVersion" )

env.Append(
SHLIBVERSION = avTranscoderVersion
Expand Down Expand Up @@ -89,6 +79,9 @@ pythonAvTranscoder = envPy.SharedLibrary(
SHLIBVERSION = avTranscoderVersion,
)

initFile = envPy.Command( os.path.join( 'AvTranscoder/__init__.py' ), '', Touch('$TARGET') )
envPy.Requires( pythonAvTranscoder, initFile )

javaAvTranscoder_class = env.Java(
target = 'jAvTranscoderClass',
source = Glob( envJava['JARCHDIR'] )
Expand All @@ -104,26 +97,28 @@ else:
source = javaAvTranscoder_class
)
env.Depends( javaAvTranscoder_jar, javaAvTranscoder_class )
env.Alias( "install", env.Install( os.path.join( installPrefix, "jar" ), javaAvTranscoder_jar ) )
env.Alias( "install", env.Install( os.path.join("share", "java"), javaAvTranscoder_jar ) )

Export( { 'sAvTranscoder' : staticAvTranscoder } )
Export( { 'AvTranscoder' : sharedAvTranscoder } )
Export( { 'jAvTranscoder' : javaAvTranscoder } )
Export( { 'pyAvTranscoder' : pythonAvTranscoder } )
Export( { 'jAvTranscoderClass' : javaAvTranscoder_class } )

env.Alias( "install", env.InstallVersionedLib( os.path.join( installPrefix, "lib" ), sharedAvTranscoder) )
env.Alias( "install", env.Install( os.path.join( installPrefix, "lib" ), staticAvTranscoder ) )
env.Alias( "install", env.InstallVersionedLib( os.path.join( installPrefix, "lib" ), javaAvTranscoder ) )
env.Alias( "install", env.InstallVersionedLib( os.path.join( installPrefix, "lib" ), pythonAvTranscoder ) )
env.Alias( "install", env.InstallVersionedLib( "lib", sharedAvTranscoder) )
env.Alias( "install", env.Install( "lib", staticAvTranscoder ) )
env.Alias( "install", env.InstallVersionedLib( "lib", javaAvTranscoder ) )
env.Alias( "install", env.InstallVersionedLib( "lib", pythonAvTranscoder ) )

env.Alias( "install", env.Install(os.path.join( installPrefix, "include/AvTranscoder" ), Glob( 'AvTranscoder/*.hpp' ) ) )
env.Alias( "install", env.Install(os.path.join( installPrefix, "include/AvTranscoder/CodedStream" ), Glob( 'AvTranscoder/CodedStream/*.hpp' ) ) )
env.Alias( "install", env.Install(os.path.join( installPrefix, "include/AvTranscoder/CodedStructures" ), Glob( 'AvTranscoder/CodedStructures/*.hpp' ) ) )
env.Alias( "install", env.Install(os.path.join( installPrefix, "include/AvTranscoder/EssenceStream" ), Glob( 'AvTranscoder/EssenceStream/*.hpp' ) ) )
env.Alias( "install", env.Install(os.path.join( installPrefix, "include/AvTranscoder/EssenceStructures" ), Glob( 'AvTranscoder/EssenceStructures/*.hpp' ) ) )
env.Alias( "install", env.Install(os.path.join( installPrefix, "include/AvTranscoder/EssenceTransform" ), Glob( 'AvTranscoder/EssenceTransform/*.hpp' ) ) )
env.Alias( "install", env.Install(os.path.join( installPrefix, "include/AvTranscoder/File" ), Glob( 'AvTranscoder/File/*.hpp' ) ) )
env.Alias( "install", env.Install(os.path.join( installPrefix, "include/AvTranscoder/Metadatas" ), Glob( 'AvTranscoder/Metadatas/MediaMetadatasStructures.hpp' ) ) )
env.Alias( "install", env.Install(os.path.join( installPrefix, "include/AvTranscoder/Metadatas" ), Glob( 'AvTranscoder/Metadatas/Print.hpp' ) ) )
env.Alias( "install", env.Install(os.path.join( installPrefix, "include/AvTranscoder/Transcoder" ), Glob( 'AvTranscoder/Transcoder/*.hpp' ) ) )
env.Alias( "install", env.Install("include/AvTranscoder", Glob( 'AvTranscoder/*.hpp' ) ) )
env.Alias( "install", env.Install("include/AvTranscoder/CodedStream", Glob( 'AvTranscoder/CodedStream/*.hpp' ) ) )
env.Alias( "install", env.Install("include/AvTranscoder/CodedStructures", Glob( 'AvTranscoder/CodedStructures/*.hpp' ) ) )
env.Alias( "install", env.Install("include/AvTranscoder/EssenceStream", Glob( 'AvTranscoder/EssenceStream/*.hpp' ) ) )
env.Alias( "install", env.Install("include/AvTranscoder/EssenceStructures", Glob( 'AvTranscoder/EssenceStructures/*.hpp' ) ) )
env.Alias( "install", env.Install("include/AvTranscoder/EssenceTransform", Glob( 'AvTranscoder/EssenceTransform/*.hpp' ) ) )
env.Alias( "install", env.Install("include/AvTranscoder/File", Glob( 'AvTranscoder/File/*.hpp' ) ) )
env.Alias( "install", env.Install("include/AvTranscoder/Metadatas", Glob( 'AvTranscoder/Metadatas/MediaMetadatasStructures.hpp' ) ) )
env.Alias( "install", env.Install("include/AvTranscoder/Metadatas", Glob( 'AvTranscoder/Metadatas/Print.hpp' ) ) )
env.Alias( "install", env.Install("include/AvTranscoder/Transcoder", Glob( 'AvTranscoder/Transcoder/*.hpp' ) ) )
env.Alias( "install", env.Install(os.path.join("lib/python2.7/site-packages/AvTranscoder"), initFile ) )
env.Alias( "install", env.Install(os.path.join("lib/python2.7/site-packages/AvTranscoder"), Glob('AvTranscoder/AvTranscoder.py') ) )