README 4.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127
  1. =========================
  2. External Library README
  3. =========================
  4. This directory contains two kinds of things: external dependencies
  5. specified in package.json (which gets installed into the node_modules
  6. directory), and full copies of third-party code, which we call
  7. embedded code copies.
  8. External dependencies specified in package.json
  9. ===============================================
  10. package.json is a file that specifies external code dependencies. We
  11. download those using the "npm" tool. As a developer of MediaGoblin,
  12. install npm however is convenient for you (for example, apt-get
  13. install npm).
  14. If you are "merely installing" MediaGoblin (and aren't attempting to
  15. change its code), you should know that the MediaGoblin team's main
  16. release download, also known as the MediaGoblin mulltipack tarball,
  17. contains a copy of all the code specified via package.json.
  18. As a general rule, always specify dependencies in package.json using
  19. "==" to pin to a specific release that you have tested MediaGoblin
  20. with. The MediaGoblin team always welcomes patches that merely change
  21. the version of a dependency so long as you have tested that the app
  22. works. Doing this is a valuable and significant contribution to the
  23. project.
  24. Other notes about the contents of package.json:
  25. * Inconsolata is available in the npm repositories, but it does not
  26. include the OTF font format, and at the time of writing it appears
  27. that PIL needs OTF/TTF and cannot accept a WOFF font file. For this
  28. reason, we have avoided using the Inconsolata package from npm.
  29. * Lato is available in NPM as connect-fonts-lato, but the font file
  30. has a different hash than the file currently in extlib, so we are
  31. sticking with our extlib version until someone has time to test
  32. the NPM version. (That could be you!)
  33. Embedded code copies
  34. ====================
  35. DO NOT "FIX" CODE IN THIS DIRECTORY.
  36. ONLY UPSTREAM VERSIONS OF SOFTWARE GO IN THIS DIRECTORY.
  37. This directory is provided as a courtesy to our users who might be
  38. unable or unwilling to find and install libraries we depend on.
  39. If we "fix" software in this directory, we hamstring users who do the
  40. right thing and keep a single version of upstream libraries in a
  41. system-wide library. We introduce subtle and maddening bugs where
  42. our code is "accidentally" using the "wrong" library version. We may
  43. unwittingly interfere with other software that depends on the
  44. canonical release versions of those same libraries!
  45. Forking upstream software for trivial reasons makes us bad citizens in
  46. the Free Software community and adds unnecessary heartache for our
  47. users. Don't make us "that" project.
  48. FAQ
  49. ===
  50. :Q: What should we do when we find a bug in upstream software?
  51. :A: First and foremost, REPORT THE BUG, and if possible send in a patch.
  52. Watch for a release of the upstream software and integrate with it
  53. when it's released.
  54. In the meantime, work around the bug, if at all possible. Usually,
  55. it's quite possible, if slightly harder or less efficient.
  56. :Q: What if the bug can't be worked around?
  57. :A: If the upstream developers have accepted a bug patch, it's
  58. undesirable but acceptable to apply that patch to the library in
  59. the ``extlib/`` dir. Ideally, use a release version for upstream or a
  60. version control system snapshot.
  61. Note that this is a last resort.
  62. :Q: What if upstream is unresponsive or won't accept a patch?
  63. :A: Try again.
  64. :Q: I tried again, and upstream is still unresponsive and nobody's
  65. checked on my patch. Now what?
  66. :A: If the upstream project is moribund and there's a way to adopt it,
  67. propose having the MediaGoblin dev team adopt the project. Or, adopt
  68. it yourself.
  69. :Q: What if there's no upstream authority and it can't be adopted?
  70. :A: Then we fork it. Make a new name and a new version. Include it in
  71. ``lib/`` instead of ``extlib/``, and use the GMG_* prefix to change
  72. the namespace to avoid collisions (or something like that).
  73. This is a last resort; consult with the rest of the dev group
  74. before taking this radical step.
  75. :Q: What about submodules?
  76. :A: pdf.js is supplied as a submodule, and other software may use that too,
  77. to add a new submodule:
  78. git submodule add <git-repo-of-fun-project> extlib/fun-project
  79. Use it just like a snapshotted extlib directory. When a new clone of mediagoblin
  80. is made you need to run
  81. git submodule init
  82. git submodule update
  83. As noted in HackingHowto
  84. Thanks
  85. ======
  86. This policy originally copied from Status.net. Many many thanks to them
  87. for working out such a nice system for doing things.