[jhbuild/desrt/master: 23/23] scripts: add a debian-mkequivs script
- From: Ryan Lortie <desrt src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [jhbuild/desrt/master: 23/23] scripts: add a debian-mkequivs script
- Date: Sat, 3 Jan 2015 06:53:03 +0000 (UTC)
commit 257a72f3228cb6eaeeb322888e05f4448e0bc9ad
Author: Ryan Lortie <desrt desrt ca>
Date: Fri Jan 2 15:27:27 2015 -0500
scripts: add a debian-mkequivs script
Add a neat hack to generate a .deb file that depends on sysdeps of
jhbuild.
This has at least two uses:
- generating a package that people can download and install with gdebi
in order to get all build dependencies satisfied
- generating a package that can be marked as a keeper in debfoster to
keep a large number of jhbuild-required dependencies installed
without too much additional noise
jhbuild/utils/debian_data.py | 17 +-------------
scripts/debian-mkequivs.py | 46 ++++++++++++++++++++++++++++++++++++++++++
scripts/debian-sysdeps.py | 7 ++++-
3 files changed, 53 insertions(+), 17 deletions(-)
---
diff --git a/jhbuild/utils/debian_data.py b/jhbuild/utils/debian_data.py
index c458d36..c572bcb 100644
--- a/jhbuild/utils/debian_data.py
+++ b/jhbuild/utils/debian_data.py
@@ -2,13 +2,10 @@
# scanning 'debian-7'
# warning: debian-7: unable to locate dependency 'c_include:glog/logging.h'
-# warning: debian-7: unable to locate dependency 'pkgconfig:bdw-gc-threaded'
# warning: debian-7: unable to locate dependency 'pkgconfig:gtkspell3-3.0'
-# warning: debian-7: unable to locate dependency 'pkgconfig:gypsy'
# warning: debian-7: unable to locate dependency 'pkgconfig:json-c'
# warning: debian-7: unable to locate dependency 'pkgconfig:libndp'
# warning: debian-7: unable to locate dependency 'pkgconfig:libsystemd'
-# warning: debian-7: unable to locate dependency 'pkgconfig:mozjs-17.0'
# warning: debian-7: unable to locate dependency 'pkgconfig:mozjs-24'
# warning: debian-7: unable to locate dependency 'pkgconfig:presentproto'
# warning: debian-7: unable to locate dependency 'pkgconfig:python2'
@@ -17,21 +14,14 @@
# warning: debian-7: unable to locate dependency 'pkgconfig:webkit2gtk-4.0'
# warning: debian-7: unable to locate dependency 'pkgconfig:xcb-xkb'
# scanning 'debian-8'
-# warning: debian-8: unable to locate dependency 'pkgconfig:bdw-gc-threaded'
-# warning: debian-8: unable to locate dependency 'pkgconfig:gypsy'
-# warning: debian-8: unable to locate dependency 'pkgconfig:mozjs-17.0'
# scanning 'ubuntu-14.04'
-# warning: ubuntu-14.04: unable to locate dependency 'pkgconfig:bdw-gc-threaded'
# warning: ubuntu-14.04: unable to locate dependency 'pkgconfig:libndp'
# warning: ubuntu-14.04: unable to locate dependency 'pkgconfig:libsystemd'
# warning: ubuntu-14.04: unable to locate dependency 'pkgconfig:webkit2gtk-4.0'
# scanning 'ubuntu-14.10'
-# warning: ubuntu-14.10: unable to locate dependency 'pkgconfig:bdw-gc-threaded'
# warning: ubuntu-14.10: unable to locate dependency 'pkgconfig:libsystemd'
# warning: ubuntu-14.10: unable to locate dependency 'pkgconfig:webkit2gtk-4.0'
# scanning 'ubuntu-15.04'
-# warning: ubuntu-15.04: unable to locate dependency 'pkgconfig:bdw-gc-threaded'
-# warning: ubuntu-15.04: unable to locate dependency 'pkgconfig:mozjs-17.0'
package_lists = {
'common': {
@@ -154,6 +144,8 @@ package_lists = {
'pkgconfig:p11-kit-1': ['libp11-kit-dev'],
'pkgconfig:pciaccess': ['libpciaccess-dev'],
'pkgconfig:pixman-1': ['libpixman-1-dev'],
+ 'pkgconfig:polkit-agent-1': ['libpolkit-agent-1-dev'],
+ 'pkgconfig:polkit-gobject-1': ['libpolkit-gobject-1-dev'],
'pkgconfig:poppler-glib': ['libpoppler-glib-dev'],
'pkgconfig:protobuf': ['libprotobuf-dev'],
'pkgconfig:py3cairo': ['python3-cairo-dev'],
@@ -267,11 +259,9 @@ package_lists = {
'pkgconfig:gl': ['libgl1-mesa-dev'],
'pkgconfig:gnutls': ['libgnutls-dev', 'libgnutls28-dev'],
'pkgconfig:gtkspell3-3.0': ['libgtkspell3-3-dev'],
- 'pkgconfig:gypsy': ['libgypsy-dev'],
'pkgconfig:json-c': ['libjson-c-dev'],
'pkgconfig:libgphoto2': ['libgphoto2-dev'],
'pkgconfig:libtasn1': ['libtasn1-6-dev'],
- 'pkgconfig:mozjs-17.0': ['libmozjs-17.0-dev'],
'pkgconfig:mozjs-24': ['libmozjs-24-dev'],
'pkgconfig:ply-boot-client': ['libplymouth-dev'],
'pkgconfig:presentproto': ['x11proto-present-dev'],
@@ -296,12 +286,10 @@ package_lists = {
'pkgconfig:gl': ['libgl1-mesa-dev'],
'pkgconfig:gnutls': ['libgnutls-dev'],
'pkgconfig:gtkspell3-3.0': ['libgtkspell3-3-dev'],
- 'pkgconfig:gypsy': ['libgypsy-dev'],
'pkgconfig:json-c': ['libjson-c-dev'],
'pkgconfig:libgphoto2': ['libgphoto2-dev'],
'pkgconfig:libndp': ['libndp-dev'],
'pkgconfig:libtasn1': ['libtasn1-6-dev'],
- 'pkgconfig:mozjs-17.0': ['libmozjs-17.0-dev'],
'pkgconfig:mozjs-24': ['libmozjs-24-dev'],
'pkgconfig:ply-boot-client': ['libplymouth-dev'],
'pkgconfig:presentproto': ['x11proto-present-dev'],
@@ -326,7 +314,6 @@ package_lists = {
'pkgconfig:gl': ['libgl1-mesa-dev'],
'pkgconfig:gnutls': ['libgnutls-dev'],
'pkgconfig:gtkspell3-3.0': ['libgtkspell3-3-dev'],
- 'pkgconfig:gypsy': ['libgypsy-dev'],
'pkgconfig:json-c': ['libjson-c-dev'],
'pkgconfig:libgphoto2': ['libgphoto2-dev'],
'pkgconfig:libndp': ['libndp-dev'],
diff --git a/scripts/debian-mkequivs.py b/scripts/debian-mkequivs.py
new file mode 100755
index 0000000..fcba573
--- /dev/null
+++ b/scripts/debian-mkequivs.py
@@ -0,0 +1,46 @@
+#!/usr/bin/env python2
+
+from jhbuild.utils import debian_data
+from jhbuild.utils import sysid
+from email.utils import formataddr
+import email.generator
+import email.message
+import subprocess
+import sys
+
+if len(sys.argv) != 2:
+ print "error: must give a Debian package name to create (like 'jhbuild-builddeps')"
+ sys.exit(1)
+
+myid = sysid.get_id()
+
+if not myid in debian_data.package_lists:
+ print "error: don't know about a release called '{}'".format(myid)
+ sys.exit(1)
+
+package_list = dict(debian_data.package_lists[myid])
+package_list.update(debian_data.package_lists['common'])
+depends = []
+
+for line in sys.stdin:
+ dep = line.strip()
+
+ if dep in package_list:
+ depends.append(' | '.join (pkg.split('/')[-1] for pkg in package_list[dep]))
+ else:
+ print "warning: don't know how to satisfy '{}'".format(dep)
+
+
+control = email.message.Message()
+control['Package'] = sys.argv[1]
+control['Depends'] = ', '.join (depends)
+try:
+ control['Maintainer'] = formataddr((subprocess.check_output(['git', 'config', 'user.name']).strip(),
+ subprocess.check_output(['git', 'config', 'user.email']).strip()))
+except: pass
+control['Description'] = 'jhbuild dependencies meta-package\nSee https://wiki.gnome.org/HowDoI/Jhbuild for
more info'
+control['Readme'] = '/dev/null'
+equivs = subprocess.Popen(['equivs-build', '-'], stdin = subprocess.PIPE)
+email.generator.Generator(equivs.stdin).flatten(control)
+equivs.stdin.close()
+equivs.wait()
diff --git a/scripts/debian-sysdeps.py b/scripts/debian-sysdeps.py
index 6d0313e..d490952 100755
--- a/scripts/debian-sysdeps.py
+++ b/scripts/debian-sysdeps.py
@@ -40,13 +40,15 @@ path_paths = ['/usr/bin', '/usr/sbin', '/bin', '/sbin']
python2_paths = ['/usr/lib/python2.7/dist-packages']
# things that we know we won't find, either because we're not clever
-# enough (xml) or because of alternatives (not listed in apt-file)
+# enough (xml), because of alternatives (not listed in apt-file), or
+# because they are not available and not required on Debian
hints = {
'xml:http://docbook.sourceforge.net/release/xsl/current/': ['docbook-xsl'],
'path:cc': ['gcc', 'clang'],
'path:c++': ['g++', 'clang'],
'path:bogofilter': ['bogofilter'],
'path:ruby': ['ruby'], # needed for wheezy
+ 'pkgconfig:bdw-gc-threaded': [], # FreeBSD-only
'' : []
}
@@ -117,7 +119,8 @@ def handle_distro(name, filemap, log = sys.stderr):
for key in sorted(keys):
if key not in result:
if key in hints:
- result[key] = hints[key]
+ if len(hints[key]):
+ result[key] = hints[key]
else:
log.write("# warning: {}: unable to locate dependency '{}'\n".format(name, key))
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]