aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMax Kellermann <max@duempel.org>2015-11-21 00:36:54 +0100
committerMax Kellermann <max@duempel.org>2015-11-21 00:36:54 +0100
commit89d5d480d722ebed7a9e7d88fd63d2dabd4b96b0 (patch)
treeccb62ab51798a7977789fb30b5134950535fd271
parentfbcacb590beb981d252e9f46baec9461ff1e7fd9 (diff)
downloadmpd-89d5d480d722ebed7a9e7d88fd63d2dabd4b96b0.tar.gz
mpd-89d5d480d722ebed7a9e7d88fd63d2dabd4b96b0.tar.xz
mpd-89d5d480d722ebed7a9e7d88fd63d2dabd4b96b0.zip
{android,win32}/build.py: move class FfmpegProject to build/ffmpeg.py
Diffstat (limited to '')
-rwxr-xr-xandroid/build.py46
-rw-r--r--python/build/ffmpeg.py48
-rwxr-xr-xwin32/build.py49
3 files changed, 50 insertions, 93 deletions
diff --git a/android/build.py b/android/build.py
index 6555b1f21..4ff9ec71e 100755
--- a/android/build.py
+++ b/android/build.py
@@ -115,53 +115,9 @@ class AndroidNdkToolchain:
from build.project import Project
from build.autotools import AutotoolsProject
+from build.ffmpeg import FfmpegProject
from build.boost import BoostProject
-class FfmpegProject(Project):
- def __init__(self, url, md5, installed, configure_args=[],
- cppflags='',
- **kwargs):
- Project.__init__(self, url, md5, installed, **kwargs)
- self.configure_args = configure_args
- self.cppflags = cppflags
-
- def build(self, toolchain):
- src = self.unpack(toolchain)
- build = self.make_build_path(toolchain)
-
- if toolchain.is_arm:
- arch = 'arm'
- else:
- arch = 'x86'
-
- if toolchain.is_windows:
- target_os = 'mingw32'
- else:
- target_os = 'linux'
-
- configure = [
- os.path.join(src, 'configure'),
- '--cc=' + toolchain.cc,
- '--cxx=' + toolchain.cxx,
- '--nm=' + toolchain.nm,
- '--extra-cflags=' + toolchain.cflags + ' ' + toolchain.cppflags + ' ' + self.cppflags,
- '--extra-cxxflags=' + toolchain.cxxflags + ' ' + toolchain.cppflags + ' ' + self.cppflags,
- '--extra-ldflags=' + toolchain.ldflags,
- '--extra-libs=' + toolchain.libs,
- '--ar=' + toolchain.ar,
- '--enable-cross-compile',
- '--arch=' + arch,
- '--target-os=' + target_os,
- '--prefix=' + toolchain.install_prefix,
- ] + self.configure_args
-
- if toolchain.is_armv7:
- configure.append('--cpu=cortex-a8')
-
- subprocess.check_call(configure, cwd=build, env=toolchain.env)
- subprocess.check_call(['/usr/bin/make', '--quiet', '-j12'], cwd=build, env=toolchain.env)
- subprocess.check_call(['/usr/bin/make', '--quiet', 'install'], cwd=build, env=toolchain.env)
-
# a list of third-party libraries to be used by MPD on Android
thirdparty_libs = [
AutotoolsProject(
diff --git a/python/build/ffmpeg.py b/python/build/ffmpeg.py
new file mode 100644
index 000000000..b3ed215a2
--- /dev/null
+++ b/python/build/ffmpeg.py
@@ -0,0 +1,48 @@
+import os.path, subprocess
+
+from build.project import Project
+
+class FfmpegProject(Project):
+ def __init__(self, url, md5, installed, configure_args=[],
+ cppflags='',
+ **kwargs):
+ Project.__init__(self, url, md5, installed, **kwargs)
+ self.configure_args = configure_args
+ self.cppflags = cppflags
+
+ def build(self, toolchain):
+ src = self.unpack(toolchain)
+ build = self.make_build_path(toolchain)
+
+ if toolchain.is_arm:
+ arch = 'arm'
+ else:
+ arch = 'x86'
+
+ if toolchain.is_windows:
+ target_os = 'mingw32'
+ else:
+ target_os = 'linux'
+
+ configure = [
+ os.path.join(src, 'configure'),
+ '--cc=' + toolchain.cc,
+ '--cxx=' + toolchain.cxx,
+ '--nm=' + toolchain.nm,
+ '--extra-cflags=' + toolchain.cflags + ' ' + toolchain.cppflags + ' ' + self.cppflags,
+ '--extra-cxxflags=' + toolchain.cxxflags + ' ' + toolchain.cppflags + ' ' + self.cppflags,
+ '--extra-ldflags=' + toolchain.ldflags,
+ '--extra-libs=' + toolchain.libs,
+ '--ar=' + toolchain.ar,
+ '--enable-cross-compile',
+ '--arch=' + arch,
+ '--target-os=' + target_os,
+ '--prefix=' + toolchain.install_prefix,
+ ] + self.configure_args
+
+ if toolchain.is_armv7:
+ configure.append('--cpu=cortex-a8')
+
+ subprocess.check_call(configure, cwd=build, env=toolchain.env)
+ subprocess.check_call(['/usr/bin/make', '--quiet', '-j12'], cwd=build, env=toolchain.env)
+ subprocess.check_call(['/usr/bin/make', '--quiet', 'install'], cwd=build, env=toolchain.env)
diff --git a/win32/build.py b/win32/build.py
index ccdef3053..ece62d25e 100755
--- a/win32/build.py
+++ b/win32/build.py
@@ -63,6 +63,7 @@ class CrossGccToolchain:
from build.project import Project
from build.autotools import AutotoolsProject
+from build.ffmpeg import FfmpegProject
from build.boost import BoostProject
class ZlibProject(Project):
@@ -84,54 +85,6 @@ class ZlibProject(Project):
'BINARY_PATH=bin', 'SHARED_MODE=1'],
cwd=src, env=toolchain.env)
-class FfmpegProject(Project):
- def __init__(self, url, md5, installed, configure_args=[],
- cppflags='',
- **kwargs):
- Project.__init__(self, url, md5, installed, **kwargs)
- self.configure_args = configure_args
- self.cppflags = cppflags
-
- def build(self, toolchain):
- src = self.unpack(toolchain)
- build = self.make_build_path(toolchain)
-
- if toolchain.is_arm:
- arch = 'arm'
- else:
- arch = 'x86'
-
- if toolchain.is_windows:
- target_os = 'mingw32'
- else:
- target_os = 'linux'
-
- configure = [
- os.path.join(src, 'configure'),
- '--cc=' + toolchain.cc,
- '--cxx=' + toolchain.cxx,
- '--nm=' + toolchain.nm,
- '--extra-cflags=' + toolchain.cflags + ' ' + toolchain.cppflags + ' ' + self.cppflags,
- '--extra-cxxflags=' + toolchain.cxxflags + ' ' + toolchain.cppflags + ' ' + self.cppflags,
- '--extra-ldflags=' + toolchain.ldflags,
- '--extra-libs=' + toolchain.libs,
- '--ar=' + toolchain.ar,
- '--enable-cross-compile',
- '--arch=' + arch,
- '--target-os=' + target_os,
- '--cross-prefix=' + toolchain.arch + '-',
- '--prefix=' + toolchain.install_prefix,
- ] + self.configure_args
-
- if toolchain.is_armv7:
- configure.append('--cpu=cortex-a8')
-
- subprocess.check_call(configure, cwd=build, env=toolchain.env)
- subprocess.check_call(['/usr/bin/make', '--quiet', '-j12'],
- cwd=build, env=toolchain.env)
- subprocess.check_call(['/usr/bin/make', '--quiet', 'install'],
- cwd=build, env=toolchain.env)
-
# a list of third-party libraries to be used by MPD on Android
thirdparty_libs = [
AutotoolsProject(