Skip to content

Commit eed6076

Browse files
committed
Merge pull request #73 from MarcAntoine-Arnaud/master
Fix some install issues: * Jar. * Python module * versioning apps * update man pages of apps
2 parents b1fca1d + 178d66d commit eed6076

File tree

7 files changed

+98
-49
lines changed

7 files changed

+98
-49
lines changed

SConstruct

Lines changed: 18 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,23 @@ import ConfigParser
77
mymode = ARGUMENTS.get('mode', 'release')
88

99
if not (mymode in ['debug', 'release']):
10-
print "Error: expected 'debug' or 'release', found: " + mymode
11-
Exit(1)
10+
raise Exception("Can't select build mode ['debug', 'release']")
11+
12+
avTranscoderVersion = ARGUMENTS.get('version', None)
13+
14+
if not avTranscoderVersion:
15+
import git
16+
# Get version from last tag of git repository
17+
repo = git.Repo( "." )
18+
tags = repo.tags
19+
if tags:
20+
lastTag = tags[-1]
21+
avTranscoderVersion = lastTag.name[1:]
22+
else:
23+
raise Exception( "Can't get last version of AvTranscoder." )
24+
25+
if not avTranscoderVersion:
26+
raise Exception( "Can't get last version of AvTranscoder." )
1227

1328
config = ConfigParser.RawConfigParser()
1429

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

1934
commonInclude = []
2035
commonLibDir = []
21-
installPrefix = "/usr/local"
2236

2337
splitChar = ";"
2438

@@ -190,9 +204,9 @@ if mymode == "debug":
190204
Export( "env" )
191205
Export( "envJava" )
192206
Export( "envPy" )
193-
Export( "installPrefix" )
194207
Export( "resampleLibraryName" )
195208
Export( "mymode" )
209+
Export( "avTranscoderVersion" )
196210

197211
VariantDir( 'build/'+mymode+'/src', 'src', duplicate = 0 )
198212
VariantDir( 'build/'+mymode+'/app', 'app', duplicate = 0 )

app/cpp/SConscript

Lines changed: 36 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -3,16 +3,12 @@ import platform
33

44
Import( 'AvTranscoder' )
55
Import( 'sAvTranscoder' )
6-
#Import( 'AvTranscoder_jar' )
7-
Import( 'installPrefix' )
8-
Import( "resampleLibraryName" )
9-
10-
env = Environment().Clone()
11-
6+
Import( 'resampleLibraryName' )
7+
Import( 'avTranscoderVersion' )
128
Import( 'env' )
139

1410
avinfo = env.Program(
15-
'avinfo',
11+
'avinfo-' + avTranscoderVersion,
1612
Glob( 'avInfo/*.cpp' ),
1713
LIBS = [
1814
sAvTranscoder,
@@ -25,7 +21,7 @@ avinfo = env.Program(
2521
)
2622

2723
avmeta = env.Program(
28-
'avmeta',
24+
'avmeta-' + avTranscoderVersion,
2925
Glob( 'avMeta/*.cpp' ),
3026
LIBS = [
3127
sAvTranscoder,
@@ -38,7 +34,7 @@ avmeta = env.Program(
3834
)
3935

4036
avtransform = env.Program(
41-
'av++',
37+
'av++-' + avTranscoderVersion,
4238
Glob( 'avTranscoder/*.cpp' ),
4339
LIBS = [
4440
sAvTranscoder,
@@ -51,7 +47,7 @@ avtransform = env.Program(
5147
)
5248

5349
avprocessor = env.Program(
54-
'avprocessor',
50+
'avprocessor-' + avTranscoderVersion,
5551
Glob( 'genericProcessor/*.cpp' ),
5652
LIBS = [
5753
sAvTranscoder,
@@ -68,7 +64,7 @@ avprocessor = env.Program(
6864

6965
if platform.system() != 'Windows':
7066
avplayer = env.Program(
71-
'avplayer',
67+
'avplayer-' + avTranscoderVersion,
7268
Glob( 'avplay/*.cpp' ),
7369
LIBS = [
7470
sAvTranscoder,
@@ -83,7 +79,7 @@ if platform.system() != 'Windows':
8379
)
8480

8581
avprofiles = env.Program(
86-
'avprofiles',
82+
'avprofiles-' + avTranscoderVersion,
8783
Glob( 'presetChecker/*.cpp' ),
8884
LIBS = [
8985
sAvTranscoder,
@@ -98,8 +94,8 @@ if platform.system() != 'Windows':
9894
],
9995
)
10096

101-
avprofiles = env.Program(
102-
'avoptions',
97+
avoptions = env.Program(
98+
'avoptions-' + avTranscoderVersion,
10399
Glob( 'optionChecker/*.cpp' ),
104100
LIBS = [
105101
sAvTranscoder,
@@ -116,6 +112,29 @@ if platform.system() != 'Windows':
116112

117113
env.Depends( avmeta, sAvTranscoder )
118114

119-
env.Alias( "install", env.Install(os.path.join( installPrefix, "bin" ), avmeta ) )
120-
env.Alias( "install", env.Install(os.path.join( installPrefix, "bin" ), avprocessor ) )
121-
env.Alias( "install", env.Install(os.path.join( installPrefix, "bin" ), avtransform ) )
115+
env.Alias( "install", env.Install("bin", avinfo) )
116+
env.Alias( "install", env.Install("bin", avmeta) )
117+
env.Alias( "install", env.Install("bin", avprocessor) )
118+
env.Alias( "install", env.Install("share/man/man1", File("avInfo/avinfo.man") ) )
119+
env.Alias( "install", env.Install("share/man/man1", File("avMeta/avmeta.man") ) )
120+
env.Alias( "install", env.Install("share/man/man1", File("genericProcessor/avprocessor.man") ) )
121+
if platform.system() != 'Windows':
122+
env.Alias( "install", env.Install("bin", avplayer) )
123+
env.Alias( "install", env.Install("bin", avprofiles) )
124+
env.Alias( "install", env.Install("share/man/man1", File("avplay/avplayer.man") ) )
125+
env.Alias( "install", env.Install("share/man/man1", File("presetChecker/avprofiles.man") ) )
126+
127+
def SymLink(target, source, env):
128+
os.symlink(os.path.basename(str(source[0])), str(target[0]))
129+
130+
avinfolink = env.Command( 'avinfo', avinfo, SymLink )
131+
avmetalink = env.Command( 'avmeta', avmeta, SymLink )
132+
avprocessorlink = env.Command( 'avprocessor', avprocessor, SymLink )
133+
avplayerlink = env.Command( 'avplayer', avplayer, SymLink )
134+
avprofileslink = env.Command( 'avprofiles', avprofiles, SymLink )
135+
136+
env.Alias( "install", env.Install("bin", avinfolink) )
137+
env.Alias( "install", env.Install("bin", avmetalink) )
138+
env.Alias( "install", env.Install("bin", avprocessorlink) )
139+
env.Alias( "install", env.Install("bin", avplayerlink) )
140+
env.Alias( "install", env.Install("bin", avprofileslink) )

app/cpp/avInfo/avinfo.man

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
.\" Manpage for avmeta.
1+
.\" Manpage for avinfo.
22
.\" Contact arnaud.marcantoine@gmail.com to correct errors or typos.
33
.TH man 1 "21 May 2014" "1.0" "avinfo man page"
44
.SH NOM

app/cpp/avplay/avplayer.man

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
.\" Manpage for avplayer.
2+
.\" Contact arnaud.marcantoine@gmail.com to correct errors or typos.
3+
.TH man 1 "21 May 2014" "1.0" "avinfo man page"
4+
.SH NOM
5+
avplayer - play media file
6+
.SH SYNOPSIS
7+
avplayer inputfile.ext
8+
.SH AUTHOR
9+
Written by Marc-Antoine ARNAUD (arnaud.marcantoine@gmail.com)
10+
.SH COPYRIGHT
11+
Licence GPL-v3.0+

app/cpp/presetChecker/avprofiles.man

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
.\" Manpage for avprofiles.
2+
.\" Contact arnaud.marcantoine@gmail.com to correct errors or typos.
3+
.TH man 1 "21 May 2014" "1.0" "avinfo man page"
4+
.SH NOM
5+
avprofiles - check options for each profile detected
6+
.SH SYNOPSIS
7+
avprofiles
8+
.SH AUTHOR
9+
Written by Marc-Antoine ARNAUD (arnaud.marcantoine@gmail.com)
10+
.SH COPYRIGHT
11+
Licence GPL-v3.0+

app/java/SConscript

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@ Import( 'envJava' )
66
Import( 'mymode' )
77
Import( 'jAvTranscoder' )
88
Import( 'jAvTranscoderClass' )
9-
Import( 'installPrefix' )
109

1110
if jAvTranscoderClass:
1211
envJava.Append(

src/SConscript

Lines changed: 21 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,12 @@
11
import glob, re
22
import os
33
import sys
4-
import git
54

65
Import( "env" )
76
Import( "envJava" )
87
Import( "envPy" )
9-
Import( "installPrefix" )
108
Import( "resampleLibraryName" )
11-
12-
# Get version from last tag of git repository
13-
repo = git.Repo( "." )
14-
tags = repo.tags
15-
if tags:
16-
lastTag = tags[-1]
17-
avTranscoderVersion = lastTag.name[1:]
18-
else:
19-
raise Exception( "Can't get last version of AvTranscoder." )
9+
Import( "avTranscoderVersion" )
2010

2111
env.Append(
2212
SHLIBVERSION = avTranscoderVersion
@@ -89,6 +79,9 @@ pythonAvTranscoder = envPy.SharedLibrary(
8979
SHLIBVERSION = avTranscoderVersion,
9080
)
9181

82+
initFile = envPy.Command( os.path.join( 'AvTranscoder/__init__.py' ), '', Touch('$TARGET') )
83+
envPy.Requires( pythonAvTranscoder, initFile )
84+
9285
javaAvTranscoder_class = env.Java(
9386
target = 'jAvTranscoderClass',
9487
source = Glob( envJava['JARCHDIR'] )
@@ -104,26 +97,28 @@ else:
10497
source = javaAvTranscoder_class
10598
)
10699
env.Depends( javaAvTranscoder_jar, javaAvTranscoder_class )
107-
env.Alias( "install", env.Install( os.path.join( installPrefix, "jar" ), javaAvTranscoder_jar ) )
100+
env.Alias( "install", env.Install( os.path.join("share", "java"), javaAvTranscoder_jar ) )
108101

109102
Export( { 'sAvTranscoder' : staticAvTranscoder } )
110103
Export( { 'AvTranscoder' : sharedAvTranscoder } )
111104
Export( { 'jAvTranscoder' : javaAvTranscoder } )
112105
Export( { 'pyAvTranscoder' : pythonAvTranscoder } )
113106
Export( { 'jAvTranscoderClass' : javaAvTranscoder_class } )
114107

115-
env.Alias( "install", env.InstallVersionedLib( os.path.join( installPrefix, "lib" ), sharedAvTranscoder) )
116-
env.Alias( "install", env.Install( os.path.join( installPrefix, "lib" ), staticAvTranscoder ) )
117-
env.Alias( "install", env.InstallVersionedLib( os.path.join( installPrefix, "lib" ), javaAvTranscoder ) )
118-
env.Alias( "install", env.InstallVersionedLib( os.path.join( installPrefix, "lib" ), pythonAvTranscoder ) )
108+
env.Alias( "install", env.InstallVersionedLib( "lib", sharedAvTranscoder) )
109+
env.Alias( "install", env.Install( "lib", staticAvTranscoder ) )
110+
env.Alias( "install", env.InstallVersionedLib( "lib", javaAvTranscoder ) )
111+
env.Alias( "install", env.InstallVersionedLib( "lib", pythonAvTranscoder ) )
119112

120-
env.Alias( "install", env.Install(os.path.join( installPrefix, "include/AvTranscoder" ), Glob( 'AvTranscoder/*.hpp' ) ) )
121-
env.Alias( "install", env.Install(os.path.join( installPrefix, "include/AvTranscoder/CodedStream" ), Glob( 'AvTranscoder/CodedStream/*.hpp' ) ) )
122-
env.Alias( "install", env.Install(os.path.join( installPrefix, "include/AvTranscoder/CodedStructures" ), Glob( 'AvTranscoder/CodedStructures/*.hpp' ) ) )
123-
env.Alias( "install", env.Install(os.path.join( installPrefix, "include/AvTranscoder/EssenceStream" ), Glob( 'AvTranscoder/EssenceStream/*.hpp' ) ) )
124-
env.Alias( "install", env.Install(os.path.join( installPrefix, "include/AvTranscoder/EssenceStructures" ), Glob( 'AvTranscoder/EssenceStructures/*.hpp' ) ) )
125-
env.Alias( "install", env.Install(os.path.join( installPrefix, "include/AvTranscoder/EssenceTransform" ), Glob( 'AvTranscoder/EssenceTransform/*.hpp' ) ) )
126-
env.Alias( "install", env.Install(os.path.join( installPrefix, "include/AvTranscoder/File" ), Glob( 'AvTranscoder/File/*.hpp' ) ) )
127-
env.Alias( "install", env.Install(os.path.join( installPrefix, "include/AvTranscoder/Metadatas" ), Glob( 'AvTranscoder/Metadatas/MediaMetadatasStructures.hpp' ) ) )
128-
env.Alias( "install", env.Install(os.path.join( installPrefix, "include/AvTranscoder/Metadatas" ), Glob( 'AvTranscoder/Metadatas/Print.hpp' ) ) )
129-
env.Alias( "install", env.Install(os.path.join( installPrefix, "include/AvTranscoder/Transcoder" ), Glob( 'AvTranscoder/Transcoder/*.hpp' ) ) )
113+
env.Alias( "install", env.Install("include/AvTranscoder", Glob( 'AvTranscoder/*.hpp' ) ) )
114+
env.Alias( "install", env.Install("include/AvTranscoder/CodedStream", Glob( 'AvTranscoder/CodedStream/*.hpp' ) ) )
115+
env.Alias( "install", env.Install("include/AvTranscoder/CodedStructures", Glob( 'AvTranscoder/CodedStructures/*.hpp' ) ) )
116+
env.Alias( "install", env.Install("include/AvTranscoder/EssenceStream", Glob( 'AvTranscoder/EssenceStream/*.hpp' ) ) )
117+
env.Alias( "install", env.Install("include/AvTranscoder/EssenceStructures", Glob( 'AvTranscoder/EssenceStructures/*.hpp' ) ) )
118+
env.Alias( "install", env.Install("include/AvTranscoder/EssenceTransform", Glob( 'AvTranscoder/EssenceTransform/*.hpp' ) ) )
119+
env.Alias( "install", env.Install("include/AvTranscoder/File", Glob( 'AvTranscoder/File/*.hpp' ) ) )
120+
env.Alias( "install", env.Install("include/AvTranscoder/Metadatas", Glob( 'AvTranscoder/Metadatas/MediaMetadatasStructures.hpp' ) ) )
121+
env.Alias( "install", env.Install("include/AvTranscoder/Metadatas", Glob( 'AvTranscoder/Metadatas/Print.hpp' ) ) )
122+
env.Alias( "install", env.Install("include/AvTranscoder/Transcoder", Glob( 'AvTranscoder/Transcoder/*.hpp' ) ) )
123+
env.Alias( "install", env.Install(os.path.join("lib/python2.7/site-packages/AvTranscoder"), initFile ) )
124+
env.Alias( "install", env.Install(os.path.join("lib/python2.7/site-packages/AvTranscoder"), Glob('AvTranscoder/AvTranscoder.py') ) )

0 commit comments

Comments
 (0)