├── .gitignore ├── COPYING ├── README.md ├── create_links.sh ├── osx_bundle ├── README.rst ├── bootstrap_osx.sh ├── build_osx_installer.sh ├── build_osx_sdk.sh ├── clean_osx.sh ├── env.sh ├── misc │ ├── create_dmg.sh │ ├── fetch_modules.sh │ ├── gtk-osx-jhbuildrc │ ├── jhbuildrc-custom │ ├── list_content.py │ ├── prune_translations.py │ └── svg2icns.py └── modulesets │ ├── patches │ ├── 0001-macos-Fix-gdk_quartz_drag_context_get_dragging_info_.patch │ ├── berkeleydb-atomic.patch │ ├── bison-secure-snprintf.patch │ ├── faad2-2.7-ac-config-headers.patch │ ├── gi-make-shared-library-in-cairo-1.0.gir-an-absolute-pat.patch │ ├── glib-networking-gtls-ca-env-var.patch │ ├── gtk-export-source-context.patch │ ├── gtk-gdk-export.patch │ ├── gtk3-fix-build.patch │ ├── libbs2b-no-bs2bconvert.diff │ ├── pixman-clang5.patch │ ├── pybsddb-autogen.patch │ ├── python2-linkflags.patch │ ├── python2-setup.py-disabled_modules.diff │ ├── python2-setup.py-remove-hardcoded.diff │ └── python2-test_grammar.py-typo.patch │ └── sdk.modules ├── rm_links.sh └── win_installer ├── README.rst ├── _base.sh ├── build_win32_installer.sh ├── build_win32_sdk.sh ├── clean_win32.sh ├── data ├── requirements.txt └── sdk.config └── misc └── prune_translations.py /.gitignore: -------------------------------------------------------------------------------- 1 | 2 | osx_bundle/_home 3 | osx_bundle/_jhbuild 4 | 5 | win_installer/_bin -------------------------------------------------------------------------------- /COPYING: -------------------------------------------------------------------------------- 1 | GNU GENERAL PUBLIC LICENSE 2 | Version 2, June 1991 3 | 4 | Copyright (C) 1989, 1991 Free Software Foundation, Inc. 5 | 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 6 | Everyone is permitted to copy and distribute verbatim copies 7 | of this license document, but changing it is not allowed. 8 | 9 | Preamble 10 | 11 | The licenses for most software are designed to take away your 12 | freedom to share and change it. By contrast, the GNU General Public 13 | License is intended to guarantee your freedom to share and change free 14 | software--to make sure the software is free for all its users. This 15 | General Public License applies to most of the Free Software 16 | Foundation's software and to any other program whose authors commit to 17 | using it. (Some other Free Software Foundation software is covered by 18 | the GNU Library General Public License instead.) You can apply it to 19 | your programs, too. 20 | 21 | When we speak of free software, we are referring to freedom, not 22 | price. Our General Public Licenses are designed to make sure that you 23 | have the freedom to distribute copies of free software (and charge for 24 | this service if you wish), that you receive source code or can get it 25 | if you want it, that you can change the software or use pieces of it 26 | in new free programs; and that you know you can do these things. 27 | 28 | To protect your rights, we need to make restrictions that forbid 29 | anyone to deny you these rights or to ask you to surrender the rights. 30 | These restrictions translate to certain responsibilities for you if you 31 | distribute copies of the software, or if you modify it. 32 | 33 | For example, if you distribute copies of such a program, whether 34 | gratis or for a fee, you must give the recipients all the rights that 35 | you have. You must make sure that they, too, receive or can get the 36 | source code. And you must show them these terms so they know their 37 | rights. 38 | 39 | We protect your rights with two steps: (1) copyright the software, and 40 | (2) offer you this license which gives you legal permission to copy, 41 | distribute and/or modify the software. 42 | 43 | Also, for each author's protection and ours, we want to make certain 44 | that everyone understands that there is no warranty for this free 45 | software. If the software is modified by someone else and passed on, we 46 | want its recipients to know that what they have is not the original, so 47 | that any problems introduced by others will not reflect on the original 48 | authors' reputations. 49 | 50 | Finally, any free program is threatened constantly by software 51 | patents. We wish to avoid the danger that redistributors of a free 52 | program will individually obtain patent licenses, in effect making the 53 | program proprietary. To prevent this, we have made it clear that any 54 | patent must be licensed for everyone's free use or not licensed at all. 55 | 56 | The precise terms and conditions for copying, distribution and 57 | modification follow. 58 | 59 | GNU GENERAL PUBLIC LICENSE 60 | TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION 61 | 62 | 0. This License applies to any program or other work which contains 63 | a notice placed by the copyright holder saying it may be distributed 64 | under the terms of this General Public License. The "Program", below, 65 | refers to any such program or work, and a "work based on the Program" 66 | means either the Program or any derivative work under copyright law: 67 | that is to say, a work containing the Program or a portion of it, 68 | either verbatim or with modifications and/or translated into another 69 | language. (Hereinafter, translation is included without limitation in 70 | the term "modification".) Each licensee is addressed as "you". 71 | 72 | Activities other than copying, distribution and modification are not 73 | covered by this License; they are outside its scope. The act of 74 | running the Program is not restricted, and the output from the Program 75 | is covered only if its contents constitute a work based on the 76 | Program (independent of having been made by running the Program). 77 | Whether that is true depends on what the Program does. 78 | 79 | 1. You may copy and distribute verbatim copies of the Program's 80 | source code as you receive it, in any medium, provided that you 81 | conspicuously and appropriately publish on each copy an appropriate 82 | copyright notice and disclaimer of warranty; keep intact all the 83 | notices that refer to this License and to the absence of any warranty; 84 | and give any other recipients of the Program a copy of this License 85 | along with the Program. 86 | 87 | You may charge a fee for the physical act of transferring a copy, and 88 | you may at your option offer warranty protection in exchange for a fee. 89 | 90 | 2. You may modify your copy or copies of the Program or any portion 91 | of it, thus forming a work based on the Program, and copy and 92 | distribute such modifications or work under the terms of Section 1 93 | above, provided that you also meet all of these conditions: 94 | 95 | a) You must cause the modified files to carry prominent notices 96 | stating that you changed the files and the date of any change. 97 | 98 | b) You must cause any work that you distribute or publish, that in 99 | whole or in part contains or is derived from the Program or any 100 | part thereof, to be licensed as a whole at no charge to all third 101 | parties under the terms of this License. 102 | 103 | c) If the modified program normally reads commands interactively 104 | when run, you must cause it, when started running for such 105 | interactive use in the most ordinary way, to print or display an 106 | announcement including an appropriate copyright notice and a 107 | notice that there is no warranty (or else, saying that you provide 108 | a warranty) and that users may redistribute the program under 109 | these conditions, and telling the user how to view a copy of this 110 | License. (Exception: if the Program itself is interactive but 111 | does not normally print such an announcement, your work based on 112 | the Program is not required to print an announcement.) 113 | 114 | These requirements apply to the modified work as a whole. If 115 | identifiable sections of that work are not derived from the Program, 116 | and can be reasonably considered independent and separate works in 117 | themselves, then this License, and its terms, do not apply to those 118 | sections when you distribute them as separate works. But when you 119 | distribute the same sections as part of a whole which is a work based 120 | on the Program, the distribution of the whole must be on the terms of 121 | this License, whose permissions for other licensees extend to the 122 | entire whole, and thus to each and every part regardless of who wrote it. 123 | 124 | Thus, it is not the intent of this section to claim rights or contest 125 | your rights to work written entirely by you; rather, the intent is to 126 | exercise the right to control the distribution of derivative or 127 | collective works based on the Program. 128 | 129 | In addition, mere aggregation of another work not based on the Program 130 | with the Program (or with a work based on the Program) on a volume of 131 | a storage or distribution medium does not bring the other work under 132 | the scope of this License. 133 | 134 | 3. You may copy and distribute the Program (or a work based on it, 135 | under Section 2) in object code or executable form under the terms of 136 | Sections 1 and 2 above provided that you also do one of the following: 137 | 138 | a) Accompany it with the complete corresponding machine-readable 139 | source code, which must be distributed under the terms of Sections 140 | 1 and 2 above on a medium customarily used for software interchange; or, 141 | 142 | b) Accompany it with a written offer, valid for at least three 143 | years, to give any third party, for a charge no more than your 144 | cost of physically performing source distribution, a complete 145 | machine-readable copy of the corresponding source code, to be 146 | distributed under the terms of Sections 1 and 2 above on a medium 147 | customarily used for software interchange; or, 148 | 149 | c) Accompany it with the information you received as to the offer 150 | to distribute corresponding source code. (This alternative is 151 | allowed only for noncommercial distribution and only if you 152 | received the program in object code or executable form with such 153 | an offer, in accord with Subsection b above.) 154 | 155 | The source code for a work means the preferred form of the work for 156 | making modifications to it. For an executable work, complete source 157 | code means all the source code for all modules it contains, plus any 158 | associated interface definition files, plus the scripts used to 159 | control compilation and installation of the executable. However, as a 160 | special exception, the source code distributed need not include 161 | anything that is normally distributed (in either source or binary 162 | form) with the major components (compiler, kernel, and so on) of the 163 | operating system on which the executable runs, unless that component 164 | itself accompanies the executable. 165 | 166 | If distribution of executable or object code is made by offering 167 | access to copy from a designated place, then offering equivalent 168 | access to copy the source code from the same place counts as 169 | distribution of the source code, even though third parties are not 170 | compelled to copy the source along with the object code. 171 | 172 | 4. You may not copy, modify, sublicense, or distribute the Program 173 | except as expressly provided under this License. Any attempt 174 | otherwise to copy, modify, sublicense or distribute the Program is 175 | void, and will automatically terminate your rights under this License. 176 | However, parties who have received copies, or rights, from you under 177 | this License will not have their licenses terminated so long as such 178 | parties remain in full compliance. 179 | 180 | 5. You are not required to accept this License, since you have not 181 | signed it. However, nothing else grants you permission to modify or 182 | distribute the Program or its derivative works. These actions are 183 | prohibited by law if you do not accept this License. Therefore, by 184 | modifying or distributing the Program (or any work based on the 185 | Program), you indicate your acceptance of this License to do so, and 186 | all its terms and conditions for copying, distributing or modifying 187 | the Program or works based on it. 188 | 189 | 6. Each time you redistribute the Program (or any work based on the 190 | Program), the recipient automatically receives a license from the 191 | original licensor to copy, distribute or modify the Program subject to 192 | these terms and conditions. You may not impose any further 193 | restrictions on the recipients' exercise of the rights granted herein. 194 | You are not responsible for enforcing compliance by third parties to 195 | this License. 196 | 197 | 7. If, as a consequence of a court judgment or allegation of patent 198 | infringement or for any other reason (not limited to patent issues), 199 | conditions are imposed on you (whether by court order, agreement or 200 | otherwise) that contradict the conditions of this License, they do not 201 | excuse you from the conditions of this License. If you cannot 202 | distribute so as to satisfy simultaneously your obligations under this 203 | License and any other pertinent obligations, then as a consequence you 204 | may not distribute the Program at all. For example, if a patent 205 | license would not permit royalty-free redistribution of the Program by 206 | all those who receive copies directly or indirectly through you, then 207 | the only way you could satisfy both it and this License would be to 208 | refrain entirely from distribution of the Program. 209 | 210 | If any portion of this section is held invalid or unenforceable under 211 | any particular circumstance, the balance of the section is intended to 212 | apply and the section as a whole is intended to apply in other 213 | circumstances. 214 | 215 | It is not the purpose of this section to induce you to infringe any 216 | patents or other property right claims or to contest validity of any 217 | such claims; this section has the sole purpose of protecting the 218 | integrity of the free software distribution system, which is 219 | implemented by public license practices. Many people have made 220 | generous contributions to the wide range of software distributed 221 | through that system in reliance on consistent application of that 222 | system; it is up to the author/donor to decide if he or she is willing 223 | to distribute software through any other system and a licensee cannot 224 | impose that choice. 225 | 226 | This section is intended to make thoroughly clear what is believed to 227 | be a consequence of the rest of this License. 228 | 229 | 8. If the distribution and/or use of the Program is restricted in 230 | certain countries either by patents or by copyrighted interfaces, the 231 | original copyright holder who places the Program under this License 232 | may add an explicit geographical distribution limitation excluding 233 | those countries, so that distribution is permitted only in or among 234 | countries not thus excluded. In such case, this License incorporates 235 | the limitation as if written in the body of this License. 236 | 237 | 9. The Free Software Foundation may publish revised and/or new versions 238 | of the General Public License from time to time. Such new versions will 239 | be similar in spirit to the present version, but may differ in detail to 240 | address new problems or concerns. 241 | 242 | Each version is given a distinguishing version number. If the Program 243 | specifies a version number of this License which applies to it and "any 244 | later version", you have the option of following the terms and conditions 245 | either of that version or of any later version published by the Free 246 | Software Foundation. If the Program does not specify a version number of 247 | this License, you may choose any version ever published by the Free Software 248 | Foundation. 249 | 250 | 10. If you wish to incorporate parts of the Program into other free 251 | programs whose distribution conditions are different, write to the author 252 | to ask for permission. For software which is copyrighted by the Free 253 | Software Foundation, write to the Free Software Foundation; we sometimes 254 | make exceptions for this. Our decision will be guided by the two goals 255 | of preserving the free status of all derivatives of our free software and 256 | of promoting the sharing and reuse of software generally. 257 | 258 | NO WARRANTY 259 | 260 | 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY 261 | FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN 262 | OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES 263 | PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED 264 | OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF 265 | MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS 266 | TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE 267 | PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, 268 | REPAIR OR CORRECTION. 269 | 270 | 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING 271 | WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR 272 | REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, 273 | INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING 274 | OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED 275 | TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY 276 | YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER 277 | PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE 278 | POSSIBILITY OF SUCH DAMAGES. 279 | 280 | END OF TERMS AND CONDITIONS 281 | 282 | How to Apply These Terms to Your New Programs 283 | 284 | If you develop a new program, and you want it to be of the greatest 285 | possible use to the public, the best way to achieve this is to make it 286 | free software which everyone can redistribute and change under these terms. 287 | 288 | To do so, attach the following notices to the program. It is safest 289 | to attach them to the start of each source file to most effectively 290 | convey the exclusion of warranty; and each file should have at least 291 | the "copyright" line and a pointer to where the full notice is found. 292 | 293 | 294 | Copyright (C) 295 | 296 | This program is free software; you can redistribute it and/or modify 297 | it under the terms of the GNU General Public License as published by 298 | the Free Software Foundation; either version 2 of the License, or 299 | (at your option) any later version. 300 | 301 | This program is distributed in the hope that it will be useful, 302 | but WITHOUT ANY WARRANTY; without even the implied warranty of 303 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 304 | GNU General Public License for more details. 305 | 306 | You should have received a copy of the GNU General Public License 307 | along with this program; if not, write to the Free Software 308 | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 309 | 310 | 311 | Also add information on how to contact you by electronic and paper mail. 312 | 313 | If the program is interactive, make it output a short notice like this 314 | when it starts in an interactive mode: 315 | 316 | Gnomovision version 69, Copyright (C) year name of author 317 | Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. 318 | This is free software, and you are welcome to redistribute it 319 | under certain conditions; type `show c' for details. 320 | 321 | The hypothetical commands `show w' and `show c' should show the appropriate 322 | parts of the General Public License. Of course, the commands you use may 323 | be called something other than `show w' and `show c'; they could even be 324 | mouse-clicks or menu items--whatever suits your program. 325 | 326 | You should also get your employer (if you work as a programmer) or your 327 | school, if any, to sign a "copyright disclaimer" for the program, if 328 | necessary. Here is a sample; alter the names: 329 | 330 | Yoyodyne, Inc., hereby disclaims all copyright interest in the program 331 | `Gnomovision' (which makes passes at compilers) written by James Hacker. 332 | 333 | , 1 April 1989 334 | Ty Coon, President of Vice 335 | 336 | This General Public License does not permit incorporating your program into 337 | proprietary programs. If your program is a subroutine library, you may 338 | consider it more useful to permit linking proprietary applications with the 339 | library. If this is what you want to do, use the GNU Library General 340 | Public License instead of this License. 341 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | Python + GTK3 + GStreamer SDK 2 | ============================= 3 | 4 | The goal of this SDK is to make it easier to package python applications that 5 | use GTK3+GStreamer. This environment is particularly targeted towards creating 6 | your application packages with pyinstaller, as it works consistently across 7 | OSX and Windows. 8 | 9 | * To build applications for OSX, see the osx_bundle directory 10 | * To build applications for Windows, see the win_installer directory 11 | * To build applications for Linux, this SDK isn't really necessary 12 | 13 | Usage 14 | ----- 15 | 16 | This SDK is designed to be used alongside your application. You set up a 17 | directory with the correct configuration files, then you can run the SDK 18 | from that directory. If you're packaging for OS X, you can run `create_links.sh` 19 | to create symlinks in your application directory for easier bootstrapping: 20 | 21 | ``` 22 | cd my_app/installer 23 | /path/to/sdk/create_links.sh osx 24 | ``` 25 | 26 | If you're packing for Windows, you need to have [MSYS2](http://www.msys2.org/) 27 | set up and running. Unfortunately, MSYS2 doesn't create symlinks by default, 28 | so `create_links.sh` won't help you here. See the `win_installer` directory 29 | for more information. 30 | 31 | Contributing 32 | ============ 33 | 34 | This SDK is still a work in progress, please feel free to fix some bugs or 35 | update documentation -- and issue a pull request! 36 | 37 | Authors 38 | ======= 39 | 40 | This repository + SDK is a fork of the work done by the 41 | [Quod Libet](https://github.com/quodlibet/quodlibet) project. The original 42 | code was copied starting at commit e8f3fcc83db88e6cf69f777ba10f24b7e93ca5e2. 43 | 44 | License 45 | ======= 46 | 47 | The scripts in this SDK are covered under the GNU Public License, but packages 48 | that are installed have their own licenses. If you create an application using 49 | this SDK, the resulting application can have whatever license you wish (subject 50 | to the terms of any software that you may link to). 51 | -------------------------------------------------------------------------------- /create_links.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # 3 | # This creates symlinks from the SDK directory to your project's directory, 4 | # to make it easier to run the various build commands from your project 5 | # 6 | # 7 | 8 | DIR="$( cd "$( dirname "$0" )" && pwd )" 9 | 10 | # Sanity check 11 | if [ "`pwd`" == "$DIR" ]; then 12 | echo "Run this script from within the target project to create the appropriate" 13 | echo "symlinks inside of the project." 14 | echo 15 | echo "Don't run this from the SDK directory." 16 | exit 1 17 | fi 18 | 19 | PLATFORM="$1" 20 | 21 | if [ "$PLATFORM" == "windows" ]; then 22 | echo "Deprecated! MSYS2 does not support symlink by default!" 23 | exit 1 24 | 25 | elif [ "$PLATFORM" == "osx" ]; then 26 | 27 | for file in bootstrap_osx.sh build_osx_sdk.sh build_osx_installer.sh clean_osx.sh env.sh misc; do 28 | [ -h $file ] && rm $file 29 | ln -s "$DIR"/osx_bundle/$file $file 30 | done 31 | 32 | echo "Done! Use ./bootstrap_osx.sh followed by ./build_osx_sdk.sh to create" 33 | echo "your SDK environment!" 34 | 35 | else 36 | echo "Usage: create_links.sh [windows|osx]" 37 | echo 38 | echo "Creates symlinks within the target project to make using the SDK easier" 39 | exit 1 40 | fi 41 | 42 | 43 | 44 | -------------------------------------------------------------------------------- /osx_bundle/README.rst: -------------------------------------------------------------------------------- 1 | ========================= 2 | OS X Bundle Build Scripts 3 | ========================= 4 | 5 | Uses jhbuild [3] and the stable module set provided by gtk-osx [2] with a 6 | customized specific module set overlay to build all needed dependencies for 7 | an application that uses GTK/GStreamer and Python on OSX. Everything will 8 | be downloaded/installed into this directory and your user directory will 9 | not be touched. 10 | 11 | 12 | Creating a development environment 13 | ---------------------------------- 14 | 15 | Prerequisites: `OS X` 10.7+ and a working `Xcode` [0] and `git` [1] 16 | 17 | Verify that Xcode and git is installed and in your ``$PATH`` by invoking ``git 18 | --version`` and ``gcc --version``. Also make sure that other pacakge managers 19 | like homebrew or macports aren't in your ``$PATH``. 20 | 21 | (Tested on OS X 10.12) 22 | 23 | 1) Call ``bootstrap_osx.sh`` to install jhbuild and set up dummy ``$HOME`` as base. 24 | 2) Call ``build_osx_sdk.sh`` to download and build all the dependencies. 25 | This should not lead to errors; if it does please file a bug. 26 | 27 | You may get an error that looks like this: 28 | 29 | EnvironmentError: MacOSX10.12.sdk not found 30 | 31 | It's ok! This means that you don't have an SDK installed that matches your current 32 | version of OSX. This seems to happen when you upgrade XCode. You can override 33 | which SDK is used via the following environment variable: 34 | 35 | export JHBUILD_SDK_VERSION=10.13 36 | 37 | Just replace the SDK version with whatever version is present in your 38 | `/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs` 39 | or `/Library/Developer/CommandLineTools/SDKs` directory. 40 | 41 | Note: pyobjc isn't compatible with the 10.13 SDK at this time, so you may need 42 | to download an old SDK from https://github.com/phracker/MacOSX-SDKs 43 | 44 | Development 45 | ----------- 46 | 47 | * After ``bootstrap_osx.sh`` has finished executing ``source env.sh`` will put you 48 | in the build environment. After that jhbuild can be used directly. 49 | 50 | 51 | Using this as a development environment 52 | --------------------------------------- 53 | 54 | After you've finished running ``build.sh``, all of the generic requirements for 55 | a GTK/GST python application are installed into the jhbuild environment. 56 | 57 | * execute ``source env.sh``, followed by ``jhbuild shell`` to get into the 58 | jhbuild environment 59 | * You should be able to execute your application from here 60 | 61 | Bundling your application 62 | ------------------------- 63 | 64 | After you've finished running ``build.sh``, all of the generic requirements for 65 | a GTK/GST python application are installed into the jhbuild environment. 66 | 67 | * execute ``source env.sh``, followed by ``jhbuild shell`` to get into the 68 | jhbuild environment 69 | * Use ``python -m pip`` to install any python modules that are required to run 70 | your application (there's a bug with the normal pip command) 71 | * Install your application 72 | 73 | Once your app is installed, then you can use something like pyinstaller to 74 | bundle your application. The latest version of pyinstaller should have the 75 | proper hooks included to package GTK/GST applications on OSX. 76 | 77 | Content Description 78 | ------------------- 79 | 80 | * ``modulesets`` contains the gtk-osx stable module set and a 81 | python-gtk3-gst-sdk module which adds new packages and replaces others. 82 | * ``misc``: see each file or directory README for a description. 83 | 84 | Bugs 85 | ---- 86 | 87 | If you get an error similar to "EnvironmentError: MacOSX10.11.sdk not found", 88 | then this means that the SDK corresponding to your OS isn't installed. You can 89 | see the installed SDKs via: 90 | 91 | ls /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/ 92 | 93 | In jhbuildrc-custom, in 'setup_sdk(target="10.9", sdk_version="native")', 94 | replace 'native' with the latest SDK that is installed on your system. 95 | 96 | I've noticed that sometimes python doesn't link properly the first time it gets 97 | built by jhbuild, and links to the system python instead. If you run into this, 98 | try running:: 99 | 100 | source env.sh 101 | jhbuild build -f python 102 | 103 | This has been commonly seen when trying to build itstool. 104 | 105 | | [0] https://developer.apple.com/xcode/downloads/ 106 | | [1] https://git-scm.com/download/mac 107 | | [2] https://git.gnome.org/browse/gtk-osx/ 108 | | [3] https://git.gnome.org/browse/jhbuild/ 109 | -------------------------------------------------------------------------------- /osx_bundle/bootstrap_osx.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | set -e 4 | 5 | source env.sh 6 | 7 | # to allow bootstrapping again, try to delete everything first 8 | rm -Rf "$QL_OSXBUNDLE_JHBUILD_DEST" 9 | rm -Rf "$HOME/.local" 10 | rm -f "$HOME/.jhbuildrc" 11 | rm -f "$HOME/.jhbuildrc-custom" 12 | 13 | JHBUILD_REVISION="fe1552ad15999f023b01bc009dabb1b1956cd9ac" 14 | 15 | mkdir -p "$HOME" 16 | git clone git://git.gnome.org/jhbuild "$QL_OSXBUNDLE_JHBUILD_DEST" 17 | (cd "$QL_OSXBUNDLE_JHBUILD_DEST" && git checkout "$JHBUILD_REVISION" && ./autogen.sh && make -f Makefile.plain DISABLE_GETTEXT=1 install >/dev/null) 18 | cp misc/gtk-osx-jhbuildrc "$HOME/.jhbuildrc" 19 | cp misc/jhbuildrc-custom "$HOME/.jhbuildrc-custom" 20 | 21 | echo "Bootstrap complete. Run ./build_osx_sdk.sh next." -------------------------------------------------------------------------------- /osx_bundle/build_osx_installer.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | source env.sh 4 | 5 | jhbuild run ./_build_osx.sh 6 | 7 | # TODO: automatically build dmg 8 | -------------------------------------------------------------------------------- /osx_bundle/build_osx_sdk.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | set -e 4 | 5 | source env.sh 6 | 7 | jhbuild build meta-bootstrap 8 | jhbuild build sdk 9 | # Everything under here is added 10 | 11 | # Ensure that pip is in the environment 12 | jhbuild run python -m ensurepip 13 | 14 | if [ -f requirements.txt ]; then 15 | # Note that this doesn't execute pip directly... for some reason if you 16 | # run the 'pip' command, it uses the wrong python 17 | jhbuild run python -m pip install -r requirements.txt 18 | fi 19 | -------------------------------------------------------------------------------- /osx_bundle/clean_osx.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # Copyright 2014 Christoph Reiter 3 | # 4 | # This program is free software; you can redistribute it and/or modify 5 | # it under the terms of the GNU General Public License version 2 as 6 | # published by the Free Software Foundation. 7 | 8 | [ -f _clean.sh ] && source _clean.sh 9 | -------------------------------------------------------------------------------- /osx_bundle/env.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | if [ ! -z "$GTK_SDK_VERBOSE" ]; then 4 | set -x 5 | fi 6 | 7 | if [ readlink -f "$0" 2> /dev/null ]; then 8 | BASEDIR="$( cd "$( dirname "$(readlink -f "${BASH_SOURCE[0]}")" )" && pwd )" 9 | else 10 | BASEDIR="$( cd "$( dirname "$(readlink "${BASH_SOURCE[0]}")" )" && pwd )" 11 | fi 12 | 13 | DIR="$(cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd)" 14 | cd "$DIR" 15 | 16 | export HOME="$DIR/_home" 17 | export QL_OSXBUNDLE_JHBUILD_DEST="$DIR/_jhbuild" 18 | 19 | # clean path so that only system things are included 20 | export PATH="$HOME/.local/bin:/usr/bin:/bin:/usr/sbin:/sbin" 21 | export QL_OSXBUNDLE_MODULESETS_DIR="$BASEDIR/modulesets" 22 | 23 | function jhbuild() { 24 | python2.7 "$(which jhbuild)" "$@" 25 | } 26 | export -f jhbuild 27 | -------------------------------------------------------------------------------- /osx_bundle/misc/create_dmg.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | if [ "$1" == "" ]; then 4 | echo "Usage: $0 myprogram.app" 5 | echo 6 | echo "Creates a dmg from an application bundle." 7 | exit 1 8 | fi 9 | 10 | BUNDLE_PATH="$1" 11 | 12 | FILENAME=$(basename "$BUNDLE_PATH") 13 | EXTENSION="${FILENAME##*.}" 14 | FILENAME="${FILENAME%.*}" 15 | 16 | if [ "$EXTENSION" != "app" ]; then 17 | echo "$BUNDLE_PATH is not an app bundle!" 18 | exit 1 19 | fi 20 | 21 | if [ ! -d "$BUNDLE_PATH" ]; then 22 | echo "$BUNDLE_PATH is not a directory, are you sure it's an app bundle?" 23 | exit 1 24 | fi 25 | 26 | 27 | mkdir -p _dmg/"$FILENAME" 28 | 29 | cp -r "$BUNDLE_PATH" _dmg/"$FILENAME" 30 | ln -s /Applications _dmg/"$FILENAME" 31 | 32 | pushd _dmg 33 | hdiutil create -srcfolder "$FILENAME" "$FILENAME"-uncompressed.dmg 34 | 35 | echo "Compressing .dmg..." 36 | hdiutil convert "$FILENAME"-uncompressed.dmg -format UDBZ -o "$FILENAME".dmg 37 | popd 38 | 39 | mv _dmg/"$FILENAME".dmg "$FILENAME".dmg 40 | 41 | rm -rf _dmg 42 | -------------------------------------------------------------------------------- /osx_bundle/misc/fetch_modules.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | set -e 4 | 5 | source ../env.sh 6 | 7 | git clone git://git.gnome.org/gtk-osx _gtk-osx 8 | cp -R _gtk-osx/modulesets-stable/. ./modulesets/ 9 | cp _gtk-osx/jhbuildrc-gtk-osx misc/gtk-osx-jhbuildrc 10 | rm -Rf _gtk-osx 11 | -------------------------------------------------------------------------------- /osx_bundle/misc/gtk-osx-jhbuildrc: -------------------------------------------------------------------------------- 1 | # -*- mode: python -*- 2 | # 3 | # Copyright (C) 2006, 2007, 2008 Imendio AB 4 | # Copyright 2009, 2010, 2011 John Ralls, Fremont, CA 5 | # 6 | # Default setup for building GTK+ on Mac OS X. Note that you should 7 | # normally never need to edit this file. Any custom settings should be 8 | # done in ~/.jhbuildrc-custom. 9 | # 10 | # Specific builds can be set up by creating files named 11 | # ~/.jhbuildrc-. When setting the environment variable JHB to 12 | # such a name, the corresponding rc file will be read (e.g.: 13 | # JHB=mybuild jhbuild shell). 14 | # 15 | # Use .jhbuildrc-custom to override the moduleset, modules to build, 16 | # the source checkout location, installation prefix, or svn usernames 17 | # etc. 18 | # 19 | # Please email richard@imendio.com if you have suggestions for 20 | # improving this setup, or have any patches that you would like to get 21 | # included. 22 | 23 | import sys 24 | import errno 25 | import re 26 | 27 | #some variables we'll need defined later 28 | _default_arch = "" 29 | _osx_version = 0.0 30 | 31 | def _popen(cmd_arg): 32 | from subprocess import Popen, PIPE 33 | devnull = open('/dev/null') 34 | cmd = Popen(cmd_arg, stdout=PIPE, stderr=devnull, shell=True) 35 | retval = cmd.stdout.read().strip() 36 | err = cmd.wait() 37 | cmd.stdout.close() 38 | devnull.close() 39 | if err: 40 | raise RuntimeError, "Failed to close %s stream" % cmd_arg 41 | return retval 42 | 43 | # Register an extra command to get the checkout dir for a module. 44 | # 45 | import jhbuild 46 | class _cmd_get_srcdir(jhbuild.commands.Command): 47 | doc = 'Display information about one or more modules' 48 | 49 | from jhbuild.errors import FatalError 50 | 51 | name = 'gtk-osx-get-srcdir' 52 | usage_args = 'module' 53 | 54 | def run(self, config, options, args): 55 | module_set = jhbuild.moduleset.load(config) 56 | 57 | if args: 58 | modname = args[0] 59 | try: 60 | module = module_set.get_module(modname, ignore_case = True) 61 | except KeyError: 62 | raise FatalError(_('unknown module %s') % modname) 63 | print module.get_srcdir(None) 64 | else: 65 | raise FatalError('no module specified') 66 | 67 | jhbuild.commands.register_command(_cmd_get_srcdir) 68 | 69 | class _getenv(jhbuild.commands.Command): 70 | doc = "Retrieve an environment variable set within jhbuild" 71 | 72 | name = "gtk-osx-getenv" 73 | usage_args = 'envvar' 74 | 75 | def run(self, config, options, args): 76 | # module_set = jhbuild.moduleset.load(config) 77 | 78 | if not args: 79 | raise FatalError("No environment variable") 80 | 81 | var = args[0] 82 | if not os.environ.has_key(var): 83 | raise FatalError("variable " + var + " not defined in jhbuild environment") 84 | print os.environ[var] 85 | 86 | jhbuild.commands.register_command(_getenv) 87 | 88 | # Determine the native system: 89 | def osx_ver(): 90 | global _default_arch, _osx_version 91 | vstring = _popen("uname -r") 92 | mstring = _popen("machine") 93 | exp = re.compile(r'(\d+\.\d+)\.\d+') 94 | vernum = exp.match(vstring) 95 | _osx_version = float(vernum.group(1)) - 4.0 96 | 97 | x64bit = _popen("sysctl hw.cpu64bit_capable").endswith("1") 98 | if x64bit and _osx_version >= 6.0: 99 | _default_arch = "x86_64" 100 | elif mstring.startswith("ppc") : 101 | _default_arch = "ppc" 102 | else: 103 | _default_arch = "i386" 104 | 105 | # Determine the XCode Version: 106 | def xcode_ver(): 107 | ver = _popen("xcodebuild -version") 108 | exp = re.compile(r'Xcode (\d+\.\d+)') 109 | vernum = exp.match(ver) 110 | if vernum: 111 | return float(vernum.group(1)) 112 | else: 113 | return 3.0 114 | 115 | # Some utitily functions used here and in custom files: 116 | # 117 | def environ_append(key, value, separator=' '): 118 | old_value = os.environ.get(key) 119 | if old_value is not None: 120 | value = old_value + separator + value 121 | os.environ[key] = value 122 | 123 | def environ_prepend(key, value, separator=' '): 124 | old_value = os.environ.get(key) 125 | if old_value is not None: 126 | value = value + separator + old_value 127 | os.environ[key] = value 128 | 129 | def environ_remove(key, value, separator=':'): 130 | old_value = os.environ.get(key) 131 | if old_value is not None: 132 | old_value_split = old_value.split(separator) 133 | value_split = [x for x in old_value_split if x != value] 134 | value = separator.join(value_split) 135 | os.environ[key] = value 136 | 137 | def parse_custom_argument(key): 138 | for i, arg in enumerate(sys.argv[:-1]): 139 | if arg == key: 140 | return sys.argv[i+1] 141 | return None 142 | 143 | def append_autogenargs(module, args): 144 | old_value = module_autogenargs.get(module, autogenargs) 145 | module_autogenargs[module] = old_value + " " + args 146 | 147 | def remove_autogenargs(module, args): 148 | arg_string = module_autogenargs.get(module, autogenargs) 149 | module_autogenargs[module] = arg_string.replace(args, "") 150 | 151 | # Call either setup_debug or setup_release in your .jhbuildrc-custom 152 | # or other customization file to get the compilation flags. 153 | def setup_debug(): 154 | global autogenargs 155 | # The enable-debug option generally turns on ASSERTS, which can slow 156 | # down code and in the case of WebKit, breaks it on OSX because of 157 | # threading problems. It's better to set it for individual packages 158 | # with append_autogenargs(). 159 | 160 | # autogenargs = autogenargs + " --enable-debug=yes" 161 | 162 | # Gtk+ crashes in gdk_window_quartz_raise() -- in a call to [NSWindow 163 | # orderFront:] if gcc is passed -O0 for 64-bit compilation. The old 164 | # stabs+ debug format also doesn't work. See Snow Leopard in the Wiki 165 | # for more information about debugging. 166 | environ_prepend('CFLAGS', "-O0 -ggdb3") 167 | environ_prepend('CXXFLAGS', "-O0 -ggdb3") 168 | environ_prepend('OBJCFLAGS', "-O0 -ggdb3") 169 | 170 | def setup_release(): 171 | environ_prepend('CFLAGS', "-O2") 172 | environ_prepend('CXXFLAGS', "-O2") 173 | environ_prepend('OBJCFLAGS', "-O2") 174 | 175 | # Set up the environment for building against particular SDK. 176 | # 177 | 178 | # These first two are just utility functions. 179 | def make_sdk_name(sdk_version): 180 | return "MacOSX" + sdk_version + ".sdk" 181 | 182 | def get_sdkdir(sdk_name, xcodepath, xcodeversion): 183 | platformpath = None 184 | if xcodeversion >= 4.3: 185 | platformpath = os.path.join("Platforms", "MacOSX.platform", "Developer") 186 | if xcodepath and platformpath: 187 | sdkdir = os.path.join(xcodepath, platformpath, "SDKs", sdk_name) 188 | elif xcodepath: 189 | sdkdir = os.path.join(xcodepath, "SDKs", sdk_name) 190 | else: 191 | sdkdir = os.path.join("/Developer", "SDKs", sdk_name) 192 | 193 | if not os.path.exists(sdkdir): 194 | sdkdir = '' 195 | if 'SDKPATH' in os.environ: 196 | try: 197 | sdkdir = [os.path.join(path, sdk_name) for path 198 | in os.environ['SDKPATH'].split(':') 199 | if os.path.exists(os.path.join(path, sdk_name))][0] 200 | except IndexError: 201 | pass 202 | if not sdkdir: 203 | raise EnvironmentError("%s not found" % sdk_name) 204 | return sdkdir 205 | 206 | #We call osx_ver() here so that we can set up _default_arch for setup_sdk: 207 | osx_ver() 208 | 209 | # 210 | # This is the workhorse of the setup. Call this function with the 211 | # target OSX version (10.4, 10.5, 10.6, etc.), the sdk version you want 212 | # to use (10.4u, 10.5, 10.6, etc.), and a list of architectures. As you 213 | # can see, the architectures defaults to a single build of i386 or 214 | # ppc, depending on your machine. I386 is chosen for intel 215 | # architectures as a default to ensure compatibility: 64-bit hasn't 216 | # been tested much on 10.5 and not all dependent packages are ready 217 | # for it (including ige-mac-integration). 218 | # 219 | # Notes on 64-bit compilation: This function does what's required for 220 | # the packages that can be built for 64-bit; unfortunately, there are 221 | # still some issues in the underlying code that the gtk+ devs are 222 | # working on. 223 | # 224 | def setup_sdk(target, sdk_version, architectures=[_default_arch]): 225 | 226 | os.environ["MACOSX_DEPLOYMENT_TARGET"] = target 227 | sdkdir = None 228 | xcodepath = None 229 | xcodeversion = None 230 | 231 | try: 232 | xcodeversion = xcode_ver() 233 | except: 234 | print "Failed to find xcode. Make sure that it's installed and that xcode-select is set properly." 235 | 236 | 237 | #Note: You can use $DEVELOPER_DIR to override the default set with xcode-select. 238 | if _osx_version >= 5.0: 239 | xcodepath = _popen("xcode-select -print-path") 240 | elif os.environ.has_key("DEVELOPER_DIR"): 241 | xcodepath = os.environ["DEVELOPER_DIR"] 242 | 243 | #OSX 10.9 doesn't have /usr/include, so we need to set the sdkdir to XCode.app: 244 | if sdk_version == 'native' and _osx_version >= 9.0: 245 | sdk_version = '10.' + str(int(_osx_version)) 246 | 247 | _toolpath = os.path.join("/usr", "bin") 248 | if xcodepath: 249 | _toolpath = os.path.join(xcodepath, "usr", "bin") 250 | #For XCode4 we need to disable ppc when building perl: 251 | if sdk_version != "native": 252 | sdkdir = get_sdkdir(make_sdk_name(sdk_version), xcodepath, xcodeversion) 253 | # Seems like we need this since many libraries otherwise only look for 254 | # various dependencies (e.g. libiconv) in /usr/lib, hence pulling in 255 | # the wrong -L that doesn't have fat binaries on pre-10.5. 256 | # 257 | environ_prepend("LDFLAGS", "-L" + sdkdir + "/usr/lib") 258 | environ_prepend("CFLAGS", "-I" + sdkdir + "/usr/include") 259 | environ_prepend("CXXFLAGS", "-I" + sdkdir + "/usr/include") 260 | environ_prepend("OBJCFLAGS", "-I" + sdkdir + "/usr/include") 261 | environ_prepend("CPPFLAGS", "-I" + sdkdir + "/usr/include") 262 | environ_prepend("CMAKE_PREFIX_PATH", os.path.join(sdkdir, 'usr'), ':') 263 | environ_prepend("LIBRARY_PATH", sdkdir + "/usr/lib", ':') 264 | # It looks like -isysroot is broken when building on 10.4, causing link 265 | # problems. But we don't really need to set it for 10.4 so just 266 | # skip that. 267 | # 268 | 269 | #It's often necessary to look for things in the SDK when 270 | #developing, and it takes a lot of typing, so define a 271 | #convenience environment variable: 272 | environ_append('SDKDIR', sdkdir) 273 | environ_append('SDKROOT', sdkdir) 274 | 275 | #Apple Documentation says that "-syslibroot" is the arg to pass to the 276 | #linker, but we are using the compiler to control the linker, and 277 | #everything seems to be working correctly. 278 | if not _osx_version < 5.0: 279 | environ_append("CFLAGS", "-isysroot " + sdkdir) 280 | environ_append("CPPFLAGS", "-isysroot " + sdkdir) 281 | environ_append("CXXFLAGS", "-isysroot " + sdkdir) 282 | environ_append("OBJCFLAGS", "-isysroot " + sdkdir) 283 | environ_append("LDFLAGS", "-isysroot " + sdkdir) 284 | 285 | # To pick up cups-config from the right place. 286 | # 287 | os.environ["CUPS_CONFIG"] = os.path.join(sdkdir, 288 | "usr/bin/cups-config") 289 | 290 | #Glib and autoconf-2.63 have issues with endianness 291 | # 292 | if architectures == ["i386"]: 293 | append_autogenargs("glib", "ac_cv_c_bigendian=no") 294 | # The '#' on openssl is to stop jhbuild from appending any more autogen 295 | # arguments such as --disable-Werror; they cause openssl to error out 296 | append_autogenargs("openssl", "darwin-i386-cc #") 297 | elif architectures == ["x86_64"]: 298 | conditions.add('64-bit') 299 | append_autogenargs("glib", "ac_cv_c_bigendian=no") 300 | append_autogenargs("openssl", "darwin64-x86_64-cc #") 301 | elif architectures == ["ppc"]: 302 | append_autogenargs("glib", "ac_cv_c_bigendian=yes") 303 | append_autogenargs("gmp", 'CFLAGS="-force_cpusubtype_ALL $CFLAGS"') 304 | append_autogenargs("openssl", "darwin-ppc-cc #") 305 | 306 | # For unknown reasons, iconv is not picked up correctly without this 307 | # 308 | append_autogenargs('glib', ' --with-libiconv=gnu') 309 | 310 | # If we're building on Snow Leopard for 32-bit, we need to make 311 | # sure that Perl and Python are working in 32-bit mode. 312 | # 313 | if _osx_version >= 6.0 and architectures == ["i386"]: 314 | os.environ["VERSIONER_PERL_PREFER_32_BIT"] = "yes" 315 | os.environ["VERSIONER_PYTHON_PREFER_32_BIT"] = "yes" 316 | 317 | #SDK 10.4 doesn't support gcc4.2. 318 | if xcodeversion == 3.0 or sdk_version == "10.4u": 319 | if xcodeversion > 4.0: 320 | raise EnvironmentError("Can't build for 10.4 on Xcode 4 or later") 321 | os.environ["CC"] = os.path.join(_toolpath, "gcc-4.0") 322 | os.environ["OBJC"] = os.path.join(_toolpath, "gcc-4.0") 323 | os.environ["CXX"] = os.path.join(_toolpath, "g++-4.0") 324 | #Note that the following will use Clang with Xcode 5.0 and 325 | #llvm-gcc-4.2 on Xcode 4.x 326 | elif _osx_version >= 7.0 or xcodeversion > 4.0: 327 | os.environ["CC"] = os.path.join(_toolpath, "gcc") 328 | os.environ["OBJC"] = os.path.join(_toolpath, "gcc") 329 | os.environ["CXX"] = os.path.join(_toolpath, "g++") 330 | else: 331 | os.environ["CC"] = os.path.join(_toolpath, "gcc-4.2") 332 | os.environ["OBJC"] = os.path.join(_toolpath, "gcc-4.2") 333 | os.environ["CXX"] = os.path.join(_toolpath, "g++-4.2") 334 | 335 | os.environ['LD'] = os.path.join(_toolpath, "ld") 336 | 337 | # Set the -arch flags for everything we're building. 338 | # 339 | for arch in architectures: 340 | environ_prepend("CFLAGS", "-arch " + arch) 341 | environ_prepend("CXXFLAGS", "-arch " + arch) 342 | environ_prepend("CPPFLAGS", "-arch " + arch) 343 | environ_prepend("OBJCFLAGS", "-arch " + arch) 344 | environ_prepend("LDFLAGS", "-arch " + arch) 345 | # For intel, set glib's build parameter so that it builds the 346 | # correct atomic asm functions 347 | # 348 | if architectures == ["i386"]: 349 | append_autogenargs("glib", "--build=i486-apple-darwin") 350 | append_autogenargs("gmp", "ABI=32") 351 | append_autogenargs("liboil", "--host=i486-apple-darwin") 352 | append_autogenargs("gnutls", "--host=i486-apple-darwin") 353 | elif architectures == ["x86_64"]: 354 | append_autogenargs("glib", "--build=x86_64-apple-darwin") 355 | append_autogenargs("gmp", "--host=x86_64-apple-darwin ABI=64") 356 | append_autogenargs("liboil", "--host=x86_64-apple-darwin") 357 | append_autogenargs("gnutls", "--host=x86_64-apple-darwin") 358 | 359 | # Tiger has a somewhat messed-up resolv.h, so we need to explicitly 360 | # link libresolv: 361 | if _osx_version < 5.0 or sdk_version.startswith("10.4"): 362 | append_autogenargs("glib", 'LIBS="-lresolv"') 363 | else: 364 | # Tiger's CUPS version is too old 365 | skip.append('cups') 366 | 367 | # Leopard and later have m4 368 | if _osx_version >= 5.0: 369 | skip.append('m4') 370 | 371 | # El Capitan needs bash to work around SIP. If you're using a 372 | # common bootstrap directory (e.g. $HOME/.local) then override 373 | # CONFIG_SHELL in .jhbuildrc-custom after calling setup_sdk(). 374 | config_shell = os.path.join(prefix, 'bin', 'bash') 375 | if _osx_version < 11.0: 376 | skip.append('bash') 377 | skip.append('openssl') # openssl removed in El Capitan 378 | elif os.path.exists(config_shell): 379 | os.environ['CONFIG_SHELL'] = config_shell 380 | 381 | # gettext-fw rebuilds gettext with an in-tree libiconv to get 382 | # around the Apple-provided one not defining _libiconv_init for 383 | # x86_64 384 | append_autogenargs("gettext-fw", "--with-libiconv-prefix=" + prefix) 385 | 386 | environ_append("CFLAGS", "-mmacosx-version-min=" + target) 387 | environ_append("CXXFLAGS", "-mmacosx-version-min=" + target) 388 | environ_append("OBJCFLAGS", "-mmacosx-version-min=" + target) 389 | environ_append("LDFLAGS", "-mmacosx-version-min=" + target) 390 | 391 | #Overcome Python's obnoxious misconfiguration of portable builds 392 | if len(architectures) == 1: 393 | os.environ["BUILDCFLAGS"] = os.environ["CFLAGS"] 394 | #Glib wants to use posix_memalign if it's available, but it's only 395 | #available after 10.6, and there's no weak linking support for it: 396 | if ((target == "10.4" or target == "10.5") 397 | and (sdk_version in ("10.6", "10.7", '10.8', '10.9', 'native') 398 | and (_osx_version >= 6.0))): 399 | append_autogenargs("glib", "ac_cv_compliant_posix_memalign=no") 400 | 401 | append_autogenargs("gnutls", "--disable-guile") 402 | 403 | #Guile doesn't handle optimization well with llvm-gcc 404 | if _osx_version >= 7.0 and xcodeversion > 4.0: 405 | append_autogenargs("guile", 'CFLAGS="$CFLAGS -O1"') 406 | #Defining ARCHFLAGS globally messes up waf, so we need to define 407 | #it here for our two perl modules: 408 | if architectures != ['ppc']: 409 | module_extra_env.update( 410 | {"perl-xml-simple":{"ARCHFLAGS":"-arch i386 -arch x86_64"}, 411 | "perl-xml-parser":{"ARCHFLAGS":"-arch i386 -arch x86_64"}}) 412 | #Xcode 5 uses clang; there's no gcc-llvm anymore. Some packages 413 | #require special arguments or flags to compile: 414 | if xcodeversion >= 5.0: 415 | module_extra_env["pkg-config"] = {'CFLAGS': os.environ['CFLAGS'] + ' -std=gnu89'} 416 | append_autogenargs('libgcrypt', 'CFLAGS="$CFLAGS -fheinous-gnu-extensions"') 417 | module_makeargs['liboil'] = 'CFLAGS="$CFLAGS -DHAVE_SYMBOL_UNDERSCORE -fheinous-gnu-extensions"' 418 | module_extra_env["WebKit"] = {'CXXFLAGS':os.environ['CXXFLAGS'] + 419 | ' -stdlib=libstdc++'} 420 | append_autogenargs('babl', '--disable-sse') 421 | 422 | # openssl doesn't understand DESTDIR, but luckily it has its own mechanism. 423 | module_extra_env['openssl'] = {'INSTALL_PREFIX': os.path.join(prefix, '_jhbuild', 'root-openssl')} 424 | 425 | if xcodeversion >= 4.0 and target in ('10.6', '10.5', '10.4'): 426 | environ_append('LDFLAGS', 427 | '-Wl,-no_function_starts -Wl,-no_version_load_command') 428 | 429 | # Finally when building normally we need to force CFLAGS_FOR_BUILD 430 | # to our current CFLAGS so that everything will link with other 431 | # build products. Note that this will generally break 432 | # cross-compilation, not that it works anyway. 433 | os.environ['CFLAGS_FOR_BUILD'] = os.environ['CFLAGS'] 434 | 435 | # Make sure we don't link against XQuartz whose freetype-config is on PATH 436 | # when XQuartz is installed by removing it from PATH 437 | environ_remove('PATH', '/opt/X11/bin') 438 | return sdkdir 439 | 440 | # This is a convenience function for older .jhbuildrc-customs. 441 | def setup_sdk_10_4(): 442 | print "*** Using setup_sdk_10_4() is deprecated. Use setup_sdk instead. ***" 443 | if _default_arch == "x86_64": 444 | return setup_sdk("10.4", "10.4u", ["i386"]) 445 | return setup_sdk("10.4", "10.4u") 446 | 447 | # For cross-compiling on an intel system. The need to build tool 448 | # packages universal for cross-compilation means that it will take 449 | # longer than necessary on a ppc machine, so just call 450 | # setup_sdk("10.4", "10.4", ["ppc"]) and all will be well (or with "10.5" 451 | # instead of "10.4" if you're building Tiger-incompatable versions). 452 | def setup_ppc_build(): 453 | print "Setup PPC" 454 | _sdkdir = setup_sdk(target="10.4", sdk_version="10.5", architectures=["ppc"]) 455 | 456 | if _sdkdir == None: 457 | raise Exception("Cross-compiling without specifying an SDK is not supported") 458 | 459 | _cflags = '-isysroot ' + _sdkdir + ' -mmacosx-version-min=10.4' 460 | _cxxflags = _cflags 461 | _cppflags = '-I' + prefix + '/include -isysroot ' + _sdkdir 462 | _ldflags = '-L' + prefix + '/lib -Wl,-syslibroot,' + _sdkdir +' -mmacosx-version-min=10.4' 463 | 464 | environ_append('CFLAGS', '-arch ppc') 465 | environ_append('CXXFLAGS', '-arch ppc') 466 | environ_append('OBJCFLAGS', '-arch ppc') 467 | environ_append('LDFLAGS', '-arch ppc') 468 | 469 | _ppc_args = "CFLAGS='" + _cflags + " -arch ppc' CXXFLAGS='" + _cxxflags + " -arch ppc' LDFLAGS='" + _ldflags + " -arch ppc' --build=powerpc-apple-darwin NM=nm" 470 | 471 | _univ_args = "CFLAGS='" + _cflags + " -arch ppc -arch i386' CXXFLAGS='" + _cxxflags + " -arch ppc -arch i386' LDFLAGS='" + _ldflags + " -arch ppc -arch i386'" 472 | 473 | # Some packages need to be build universal so that they'll work in a 474 | # cross-compiled environment: 475 | append_autogenargs("gettext", _univ_args) 476 | append_autogenargs("intltool", _univ_args) 477 | append_autogenargs("expat", _univ_args) 478 | append_autogenargs("gtk-doc", _univ_args) 479 | # Others need to be told explicitly that they're being cross-compiled: 480 | append_autogenargs("glib", _ppc_args + " glib_cv_uscore=no ac_cv_func_posix_getgrgid_r=yes glib_cv_stack_grows=no ac_cv_func_posix_getpwuid_r=yes ac_cv_c_bigendian=yes" ) 481 | 482 | append_autogenargs("gtk", _ppc_args + " --with-gdktarget=quartz --without-libjasper --disable-glibtest gio_can_sniff='yes'") 483 | 484 | append_autogenargs("libgcrypt", _ppc_args ) 485 | append_autogenargs("gnome-keyring", _ppc_args ) 486 | append_autogenargs("WebKit", _ppc_args) 487 | append_autogenargs("OpenSP", _ppc_args) 488 | append_autogenargs("libdbi", _ppc_args) 489 | append_autogenargs("libdbi-drivers", _ppc_args) 490 | 491 | ###### End Function Definitions ####### 492 | 493 | 494 | ##### The following configuration can be overridden in custom files ###### 495 | 496 | # Moduleset to use. You can override this in .jhbuildrc-custom or on 497 | # the command line. 498 | # 499 | moduleset = 'http://git.gnome.org/browse/gtk-osx/plain/modulesets-stable/gtk-osx.modules' 500 | use_local_modulesets = True 501 | 502 | # A list of the modules to build. You can override this in 503 | # .jhbuildrc-custom or on the command line. 504 | # 505 | modules = [ 'meta-gtk-osx-bootstrap', 'meta-gtk-osx-core' ] 506 | 507 | # A list of modules to skip. 508 | # 509 | # Source and installation locations. 510 | # 511 | _root = os.path.expanduser("~/gtk") 512 | checkoutroot = os.path.join(_root, "source") 513 | prefix = os.path.join(_root, "inst") 514 | _exec_prefix = None 515 | tarballdir = None 516 | # Extra arguments to pass to all autogen.sh scripts. 517 | # 518 | autogenargs='' 519 | 520 | # Use the included install-check program if available. It won't update 521 | # timestamps if the header hasn't changed, which speeds up builds. 522 | # 523 | _path = os.path.expanduser('~/.local/bin/install-check') 524 | if os.path.exists(_path): 525 | os.environ['INSTALL'] = _path 526 | 527 | _gtk_osx_prompt_prefix = "JH" 528 | 529 | _gtk_osx_default_build = "" 530 | 531 | #print "Default Architecture %s\n" % _default_arch 532 | 533 | if _osx_version < 4.0: 534 | print "Error: Mac OS X 10.4 or newer is required, exiting." 535 | raise SystemExit 536 | elif _osx_version < 5.0: 537 | # Tiger, we want to use the python version from jhbuild. 538 | _host_tiger = True 539 | else: 540 | # Leopard or newer. 541 | _host_tiger = False 542 | 543 | ###### Import Customizations ###### 544 | 545 | # Import optional user RC for further customization. You can override 546 | # the prefix or default build setup for example, or CFLAGS or 547 | # module_autogenargs, etc. 548 | # 549 | _userrc = os.path.join(os.environ['HOME'], '.jhbuildrc-custom') 550 | if os.path.exists(_userrc): 551 | execfile(_userrc) 552 | 553 | # Allow including different variants depending on the environment 554 | # variable JHB. This can be used to have different setups for SDK 555 | # builds, for example. 556 | # 557 | _build = os.environ.get('JHB', _gtk_osx_default_build) 558 | disable_Werror = False 559 | 560 | ###### Everything Below Uses (and Overrides) customizations! ####### 561 | 562 | # Check and warn if jhbuild is started from within jhbuild, since that 563 | # will mess up environment variables, especially if different build 564 | # setups are used. 565 | # 566 | _old_prefix = os.environ.get('JHBUILD_PREFIX', "") 567 | _old_build = os.environ.get('JHBUILD_CONFIG', "") 568 | _ran_recursively = _old_prefix != "" 569 | if _ran_recursively: 570 | if _old_build != _build: 571 | print "Error: jhbuild is already running with a different build setup, exiting." 572 | raise SystemExit 573 | 574 | print "Warning: jhbuild is started from within a jhbuild session." 575 | 576 | if _build != "": 577 | try: 578 | execfile(os.path.join(os.environ['HOME'], '.jhbuildrc-' + _build)) 579 | except EnvironmentError, e: 580 | print "Couldn't find the file '.jhbuildrc-" + _build + "', exiting." 581 | raise SystemExit 582 | 583 | # The following parameters were set to None at the top of the file; 584 | # they're set here to their default values after processing the 585 | # customizations, but tested to make sure that if they've been 586 | # customized, it will stick. 587 | 588 | # Default location for tarball download is into checkoutroot/pkgs. If 589 | # you do multiple builds with different checkoutroots, you'll want to 590 | # override this to somewhere common (~/.local/pkgs is one alternative) 591 | if tarballdir == None: 592 | tarballdir = os.path.join(checkoutroot, 'pkgs') 593 | # _exec_prefix is used to set $M4 and $LIBTOOLIZE. We set it here to 594 | # prefix if it wasn't over-ridden in .jhbuildrc-custom 595 | if _exec_prefix == None: 596 | _exec_prefix = prefix 597 | 598 | 599 | os.environ['PREFIX'] = prefix # Deprecated, please move to JHBUILD_PREFIX. 600 | os.environ['JHBUILD_PREFIX'] = prefix 601 | os.environ['JHBUILD_SOURCE'] = checkoutroot 602 | 603 | # Some packages go off and find /usr/lib/gm4, which is broken Note the 604 | # use of _exec_prefix here. By default it's prefix, but you can 605 | # override it to somewhere else in jhbuildrc-custom if you like. 606 | #os.environ["M4"] = _exec_prefix + "/bin/m4" 607 | #os.environ['LIBTOOLIZE'] = _exec_prefix + '/bin/libtoolize' 608 | #Some autogens detect that it's a Mac and use glibtoolize if it's 609 | #available. Override this behavior. 610 | if not (os.environ.has_key ("LIBTOOLIZE") and os.environ["LIBTOOLIZE"]): 611 | environ_append('LIBTOOLIZE', os.path.join(prefix, "bin", "libtoolize")) 612 | 613 | 614 | if not _host_tiger: 615 | skip.append('make') 616 | skip.append('subversion') 617 | 618 | # The option "headerpad_max_install_names" is there to leave some room for 619 | # changing the library locations with install_name_tool. Note that GNU 620 | # libtool seems to drop the option if we don't use -W here. 621 | # 622 | environ_append('LDFLAGS', '-Wl,-headerpad_max_install_names') 623 | 624 | # Make sure we find our installed modules, and before other versions. 625 | environ_prepend('LDFLAGS', '-L' + prefix + '/lib') 626 | environ_prepend('CPPFLAGS', '-I' + prefix + '/include') 627 | 628 | # Make sure that ltdl can find our libraries 629 | addpath("LTDL_LIBRARY_PATH", prefix + "/lib") 630 | 631 | # Add additional Perl paths so that our modules can be found. 632 | 633 | prependpath('PERL5LIB', prefix + '/lib/perl5/vendor_perl') 634 | prependpath('PERL5LIB', prefix + '/lib/perl5/site_perl') 635 | 636 | # Point gtk-doc and other xsltproc users to our XML catalog. 637 | # 638 | _pfx_cat_file = os.path.join(prefix, 'etc', 'xml', 'catalog') 639 | if not os.path.exists(_pfx_cat_file): 640 | os.makedirs(os.path.dirname(_pfx_cat_file)) 641 | open(_pfx_cat_file, "w").close() 642 | if 'XML_CATALOG_FILES' in os.environ: 643 | # os.environ['XML_CATALOG_FILES'] += ':' + _pfx_cat_file 644 | pass 645 | else: 646 | os.environ['XML_CATALOG_FILES'] = _pfx_cat_file 647 | 648 | #Freetype has -ansi added by its configure, but uses c99 code 649 | # 650 | append_autogenargs("freetype", 'CFLAGS="$CFLAGS -std=c99"') 651 | 652 | #GConf needs to be built static, overriding the generic autogenargs, 653 | #but including it in the module puts it in front of where autogenargs 654 | #puts --disable-static, so we need the override here. 655 | # 656 | append_autogenargs("gconf", "--enable-static") 657 | 658 | if _build: 659 | if "shell" in sys.argv: 660 | print "Build setup: %s, prefix: %s" % (_build, prefix) 661 | os.environ["JHBUILD_CONFIG"] = _build 662 | else: 663 | if "shell" in sys.argv: 664 | print "Prefix: %s" % (prefix) 665 | 666 | if not _ran_recursively and _gtk_osx_prompt_prefix: 667 | os.environ["JHBUILD_PROMPT"] = "[" + _gtk_osx_prompt_prefix + "] " 668 | 669 | #Bug 766738: Apple's python tries to install extensions in 670 | #/Library/Python, which requires sudo. Change that to the right place 671 | #inside prefix. Note that we need the installed python's version to 672 | #get the right directory name. 673 | 674 | if (not "python" in modules and 675 | not os.path.exists(os.path.join(prefix, 'bin', 'python2'))): 676 | _python_ver = 'python' + '.'.join([str(_x) for _x in sys.version_info[0:2]]) 677 | _python_install_path = os.path.join(prefix, 'lib', 678 | _python_ver, 'site-packages') 679 | append_autogenargs('libxml2', 680 | '--with-python-install-dir=' + _python_install_path) 681 | 682 | # Unset this so we don't mess with the check for not starting 683 | # recursively. 684 | os.unsetenv("JHB") 685 | 686 | if "shell" in sys.argv: 687 | print "Entered jhbuild shell, type 'exit' to return." 688 | -------------------------------------------------------------------------------- /osx_bundle/misc/jhbuildrc-custom: -------------------------------------------------------------------------------- 1 | # This gets copied to $HOME/.jhbuildrc-custom and gets included by the gtk-osx 2 | # provided ``.jhbuildrc`` file 3 | 4 | import os 5 | 6 | checkoutroot = os.path.expanduser("~/jhbuild_checkoutroot") 7 | prefix = os.path.expanduser("~/jhbuild_prefix") 8 | modulesets_dir = os.environ["QL_OSXBUNDLE_MODULESETS_DIR"] 9 | moduleset = ["sdk"] 10 | modules = [] 11 | 12 | interact = True # whether to interact with the user. 13 | quiet_mode = True # whether to display running commands output(Builds) 14 | progress_bar = True # whether to display a progress bar when running in quiet mode 15 | 16 | disable_Werror = False 17 | skip.append("libiconv") 18 | 19 | # Some packages don't work in debug mode 20 | #setup_debug() 21 | 22 | setup_sdk(target="10.9", sdk_version=os.environ.get("JHBUILD_SDK_VERSION", "native")) 23 | 24 | os.environ["GTLS_SYSTEM_CA_FILE"] = os.path.join( 25 | prefix, "lib/python2.7/site-packages/certifi/cacert.pem") 26 | 27 | # Make sure we use the same shell in "jhbuild shell" as during building 28 | if os.environ.get("CONFIG_SHELL"): 29 | os.environ["SHELL"] = os.environ.get("CONFIG_SHELL") 30 | 31 | -------------------------------------------------------------------------------- /osx_bundle/misc/list_content.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | # -*- coding: utf-8 -*- 3 | # Copyright 2015 Christoph Reiter 4 | # 5 | # This program is free software; you can redistribute it and/or modify 6 | # it under the terms of the GNU General Public License as published by 7 | # the Free Software Foundation; either version 2 of the License, or 8 | # (at your option) any later version. 9 | 10 | import os 11 | import sys 12 | from collections import namedtuple 13 | from xml.dom import minidom 14 | 15 | # .py 16 | # takes a jhbuild prefix and an app bundle and lists all the 17 | # files and from which jhbuild package they come from 18 | 19 | 20 | def main(argv): 21 | assert len(argv) == 3 22 | 23 | jhbuild = os.path.join(argv[1], "_jhbuild") 24 | bundle_base = os.path.join(argv[2], "Contents", "Resources") 25 | info = os.path.join(jhbuild, "info") 26 | 27 | Entry = namedtuple("Entry", ["package", "version", "files"]) 28 | entries = {} 29 | 30 | for key in os.listdir(info): 31 | path = os.path.join(info, key) 32 | xmldoc = minidom.parse(path) 33 | item = xmldoc.getElementsByTagName('entry')[0] 34 | package = item.attributes['package'].value 35 | version = item.attributes['version'].value 36 | 37 | entry = Entry(package, version, set()) 38 | entries[key] = entry 39 | 40 | def norm_py(path): 41 | # reduce all paths to their source variant so we can connect 42 | # different variants between the installed state and the 43 | # final one in the bundle (since we compile and delete 44 | # the sources..) 45 | if path.endswith((".pyc", ".pyo")): 46 | return path[:-1] 47 | return path 48 | 49 | manifests = os.path.join(jhbuild, "manifests") 50 | for key in os.listdir(manifests): 51 | path = os.path.join(manifests, key) 52 | 53 | with open(path, "rb") as h: 54 | for file_ in h.read().splitlines(): 55 | entries[key].files.add(norm_py(file_)) 56 | 57 | found = set() 58 | for root, dirs, files in os.walk(bundle_base): 59 | for f in files: 60 | path = os.path.relpath(os.path.join(root, f), bundle_base) 61 | found.add(norm_py(path)) 62 | 63 | for entry in sorted(entries.values(), key=lambda e: e.package): 64 | here = set([p for p in entry.files if p in found]) 65 | if here: 66 | print entry.package, entry.version 67 | found -= here 68 | for p in sorted(here): 69 | print " ", p 70 | 71 | if found: 72 | print "__UNKNOWN_SOURCE__" 73 | for p in sorted(found): 74 | print " ", p 75 | 76 | 77 | if __name__ == '__main__': 78 | main(sys.argv) 79 | -------------------------------------------------------------------------------- /osx_bundle/misc/prune_translations.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | 3 | from __future__ import print_function 4 | 5 | import os 6 | import sys 7 | import shutil 8 | 9 | 10 | if __name__ == "__main__": 11 | ql_locale = sys.argv[1] 12 | main_locale = sys.argv[2] 13 | 14 | print("App locale:", ql_locale) 15 | print("Dist locale:", main_locale) 16 | 17 | assert os.path.exists(ql_locale) 18 | assert os.path.exists(main_locale) 19 | 20 | get_lang = lambda x: x.split("_")[0] 21 | 22 | # get a list of languages which QL has translations for 23 | ql_langs = set() 24 | for entry in os.listdir(ql_locale): 25 | ql_langs.add(get_lang(entry)) 26 | 27 | # delete all gtk+ etc translations which QL doesn't support 28 | for entry in os.listdir(main_locale): 29 | entry_path = os.path.join(main_locale, entry) 30 | if get_lang(entry) not in ql_langs: 31 | print("Pruning", entry) 32 | shutil.rmtree(entry_path) 33 | -------------------------------------------------------------------------------- /osx_bundle/misc/svg2icns.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python2 2 | # -*- coding: utf-8 -*- 3 | # Copyright 2015 Christoph Reiter 4 | # 5 | # This program is free software; you can redistribute it and/or modify 6 | # it under the terms of the GNU General Public License as published by 7 | # the Free Software Foundation; either version 2 of the License, or 8 | # (at your option) any later version. 9 | 10 | """ 11 | ./svg2icns.py source.svg target.icns 12 | """ 13 | 14 | import sys 15 | import struct 16 | 17 | from gi.repository import GdkPixbuf 18 | 19 | 20 | def get_png(svg_path, size): 21 | pixbuf = GdkPixbuf.Pixbuf.new_from_file_at_scale( 22 | svg_path, size, size, True) 23 | return pixbuf.save_to_bufferv("png", ["compression"], ["9"])[1] 24 | 25 | 26 | def get_icon(svg_path, size): 27 | pixbuf = GdkPixbuf.Pixbuf.new_from_file_at_scale( 28 | svg_path, size, size, True) 29 | data = bytearray(pixbuf.get_pixels()) 30 | 31 | channels = pixbuf.get_n_channels() 32 | assert channels == 4 33 | 34 | # https://en.wikipedia.org/wiki/PackBits 35 | # no real compression going on here.. 36 | new_data = bytearray() 37 | for c in xrange(3): 38 | x = 0 39 | for i in xrange(0, len(data), 4): 40 | if x == 0 or x % 128 == 0: 41 | new_data.append(127) 42 | new_data.append(data[i+c]) 43 | x += 1 44 | 45 | return new_data 46 | 47 | 48 | def get_mask(svg_path, size): 49 | pixbuf = GdkPixbuf.Pixbuf.new_from_file_at_scale( 50 | svg_path, size, size, True) 51 | data = bytearray(pixbuf.get_pixels()) 52 | 53 | channels = pixbuf.get_n_channels() 54 | assert channels == 4 55 | 56 | new_data = bytearray() 57 | for i in xrange(0, len(data), 4): 58 | new_data.append(data[i+3]) 59 | 60 | return new_data 61 | 62 | 63 | def get_icns(svg_path): 64 | # https://en.wikipedia.org/wiki/Apple_Icon_Image_format 65 | # Note icp4/5 png don't work under OSX. Maybe Wikipedia is wrong. 66 | 67 | ICONS = [ 68 | (b"is32", 16, "icon"), 69 | (b"s8mk", 16, "mask"), 70 | (b"il32", 32, "icon"), 71 | (b"l8mk", 32, "mask"), 72 | (b"ic08", 256, "png"), 73 | (b"ic09", 512, "png"), 74 | (b"icp6", 64, "png"), 75 | (b"ic07", 128, "png"), 76 | # seems unnecessarily large for now.. 77 | # (b"ic10", 1024, "png"), 78 | (b"ic11", 32, "png"), 79 | (b"ic12", 64, "png"), 80 | (b"ic13", 256, "png"), 81 | (b"ic14", 512, "png"), 82 | ] 83 | 84 | funcs = { 85 | "png": get_png, 86 | "icon": get_icon, 87 | "mask": get_mask, 88 | } 89 | 90 | icons = {} 91 | for name, size, type_ in ICONS: 92 | key = (size, type_) 93 | if key not in icons: 94 | icons[key] = funcs[type_](svg_path, size) 95 | 96 | toc = bytearray(b"TOC ") 97 | toc += struct.pack(">I", 8 + len(ICONS) * 8) 98 | 99 | data = bytearray() 100 | for name, size, type_ in ICONS: 101 | key = (size, type_) 102 | data += name 103 | toc += name 104 | icon = icons[key] 105 | pack_size = struct.pack(">I", 8 + len(icon)) 106 | data += pack_size 107 | toc += pack_size 108 | data += icon 109 | data[0:0] = toc 110 | 111 | header = bytearray() 112 | header += b"icns" 113 | header += struct.pack(">I", 8 + len(data)) 114 | data[0:0] = header 115 | 116 | return data 117 | 118 | 119 | def main(argv): 120 | svg = argv[1] 121 | dest = argv[2] 122 | 123 | with open(dest, "wb") as h: 124 | h.write(get_icns(svg)) 125 | 126 | 127 | if __name__ == "__main__": 128 | main(sys.argv) 129 | -------------------------------------------------------------------------------- /osx_bundle/modulesets/patches/0001-macos-Fix-gdk_quartz_drag_context_get_dragging_info_.patch: -------------------------------------------------------------------------------- 1 | From 5c0d242ea33ec1be60e6b2ad464dd9087692d7ab Mon Sep 17 00:00:00 2001 2 | From: Christoph Reiter 3 | Date: Tue, 27 Feb 2018 19:53:43 +0100 4 | Subject: [PATCH] macos: Fix 5 | gdk_quartz_drag_context_get_dragging_info_libgtk_only symbol export 6 | 7 | The header got included without config.h being included first which resulted in the 8 | wrong _GDK_EXTERN macro being used. As a result some symbols weren't exported 9 | and starting a DnD action would crash in the linker. 10 | 11 | This patch adds config.h includes in all places where clang complained about 12 | _GDK_EXTERN redefinitions. 13 | 14 | See #32 for more info. 15 | --- 16 | gdk/quartz/GdkQuartzNSWindow.c | 1 + 17 | gdk/quartz/GdkQuartzView.c | 1 + 18 | gdk/quartz/gdkdnd-quartz.c | 1 + 19 | 3 files changed, 3 insertions(+) 20 | 21 | diff --git a/gdk/quartz/GdkQuartzNSWindow.c b/gdk/quartz/GdkQuartzNSWindow.c 22 | index 4d68048ce8..c66fea73c8 100644 23 | --- a/gdk/quartz/GdkQuartzNSWindow.c 24 | +++ b/gdk/quartz/GdkQuartzNSWindow.c 25 | @@ -16,6 +16,7 @@ 26 | * License along with this library. If not, see . 27 | */ 28 | 29 | +#include "config.h" 30 | #import "GdkQuartzNSWindow.h" 31 | #include "gdkquartzwindow.h" 32 | #include "gdkdnd-quartz.h" 33 | diff --git a/gdk/quartz/GdkQuartzView.c b/gdk/quartz/GdkQuartzView.c 34 | index 97c60d051c..7237363f75 100644 35 | --- a/gdk/quartz/GdkQuartzView.c 36 | +++ b/gdk/quartz/GdkQuartzView.c 37 | @@ -17,6 +17,7 @@ 38 | * License along with this library. If not, see . 39 | */ 40 | 41 | +#include "config.h" 42 | #import "GdkQuartzView.h" 43 | #include "gdkquartzwindow.h" 44 | #include "gdkprivate-quartz.h" 45 | diff --git a/gdk/quartz/gdkdnd-quartz.c b/gdk/quartz/gdkdnd-quartz.c 46 | index 15b6fed319..b9928acd44 100644 47 | --- a/gdk/quartz/gdkdnd-quartz.c 48 | +++ b/gdk/quartz/gdkdnd-quartz.c 49 | @@ -16,6 +16,7 @@ 50 | * License along with this library. If not, see . 51 | */ 52 | 53 | +#include "config.h" 54 | #include "gdkdnd.h" 55 | #include "gdkquartzdnd.h" 56 | #include "gdkprivate-quartz.h" 57 | -- 58 | 2.16.2 59 | 60 | -------------------------------------------------------------------------------- /osx_bundle/modulesets/patches/berkeleydb-atomic.patch: -------------------------------------------------------------------------------- 1 | --- a/src/dbinc/atomic.h 2013-03-12 14:07:22.000000000 -0400 2 | +++ b/src/dbinc/atomic.h 2013-03-12 14:06:35.000000000 -0400 3 | @@ -144,7 +144,7 @@ 4 | #define atomic_inc(env, p) __atomic_inc(p) 5 | #define atomic_dec(env, p) __atomic_dec(p) 6 | #define atomic_compare_exchange(env, p, o, n) \ 7 | - __atomic_compare_exchange((p), (o), (n)) 8 | + __atomic_compare_exchange_db((p), (o), (n)) 9 | static inline int __atomic_inc(db_atomic_t *p) 10 | { 11 | int temp; 12 | @@ -176,7 +176,7 @@ 13 | * http://gcc.gnu.org/onlinedocs/gcc-4.1.0/gcc/Atomic-Builtins.html 14 | * which configure could be changed to use. 15 | */ 16 | -static inline int __atomic_compare_exchange( 17 | +static inline int __atomic_compare_exchange_db( 18 | db_atomic_t *p, atomic_value_t oldval, atomic_value_t newval) 19 | { 20 | atomic_value_t was; 21 | -------------------------------------------------------------------------------- /osx_bundle/modulesets/patches/bison-secure-snprintf.patch: -------------------------------------------------------------------------------- 1 | With format string strictness, High Sierra also enforces that %n isn't used 2 | in dynamic format strings, but we should just disable its use on darwin in 3 | general. 4 | 5 | --- bison/lib/vasnprintf.c.orig 2017-06-22 15:19:15.000000000 -0700 6 | +++ bison/lib/vasnprintf.c 2017-06-22 15:20:20.000000000 -0700 7 | @@ -4869,7 +4869,7 @@ VASNPRINTF (DCHAR_T *resultbuf, size_t * 8 | #endif 9 | *fbp = dp->conversion; 10 | #if USE_SNPRINTF 11 | -# if !(((__GLIBC__ > 2 || (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 3)) && !defined __UCLIBC__) || ((defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__)) 12 | +# if !defined(__APPLE__) && !(((__GLIBC__ > 2 || (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 3)) && !defined __UCLIBC__) || ((defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__)) 13 | fbp[1] = '%'; 14 | fbp[2] = 'n'; 15 | fbp[3] = '\0'; 16 | -------------------------------------------------------------------------------- /osx_bundle/modulesets/patches/faad2-2.7-ac-config-headers.patch: -------------------------------------------------------------------------------- 1 | diff -Naur faad2-2.7-orig/configure.in faad2-2.7/configure.in 2 | --- faad2-2.7-orig/configure.in 2014-03-11 23:26:03.000000000 -0700 3 | +++ faad2-2.7/configure.in 2014-03-11 23:26:59.000000000 -0700 4 | @@ -25,7 +25,7 @@ 5 | AC_PROG_MAKE_SET 6 | AC_CHECK_PROGS(RPMBUILD, rpmbuild, rpm) 7 | 8 | -AM_CONFIG_HEADER(config.h) 9 | +AC_CONFIG_HEADERS([config.h]) 10 | 11 | AC_ARG_WITH(xmms,[ --with-xmms compile XMMS-1 plugin], 12 | WITHXMMS=$withval, WITHXMMS=no) 13 | -------------------------------------------------------------------------------- /osx_bundle/modulesets/patches/gi-make-shared-library-in-cairo-1.0.gir-an-absolute-pat.patch: -------------------------------------------------------------------------------- 1 | From b828eaad6af03b91fe3437cfe90d86ccbca77b4f Mon Sep 17 00:00:00 2001 2 | From: Christoph Reiter 3 | Date: Wed, 20 Apr 2016 22:41:20 +0200 4 | Subject: [PATCH] make shared-library in cairo-1.0.gir an absolute path like 5 | for all others 6 | 7 | --- 8 | configure.ac | 2 +- 9 | 1 file changed, 1 insertion(+), 1 deletion(-) 10 | 11 | diff --git a/configure.ac b/configure.ac 12 | index 41d3287..8718cca 100644 13 | --- a/configure.ac 14 | +++ b/configure.ac 15 | @@ -150,7 +150,7 @@ AM_CONDITIONAL(HAVE_CAIRO, test x$have_cairo = xyes) 16 | 17 | case "$host" in 18 | *-*-darwin*) 19 | - CAIRO_SHARED_LIBRARY="libcairo-gobject.2.dylib" 20 | + CAIRO_SHARED_LIBRARY="$libdir/libcairo-gobject.2.dylib" 21 | ;; 22 | *-*-mingw*) 23 | CAIRO_SHARED_LIBRARY="libcairo-gobject-2.dll" 24 | -- 25 | 2.8.1 26 | 27 | -------------------------------------------------------------------------------- /osx_bundle/modulesets/patches/glib-networking-gtls-ca-env-var.patch: -------------------------------------------------------------------------------- 1 | diff --git a/tls/gnutls/gtlsbackend-gnutls.c b/tls/gnutls/gtlsbackend-gnutls.c 2 | index 332ca05..e5548a5 100644 3 | --- a/tls/gnutls/gtlsbackend-gnutls.c 4 | +++ b/tls/gnutls/gtlsbackend-gnutls.c 5 | @@ -104,8 +104,10 @@ g_tls_backend_gnutls_real_create_database (GTlsBackendGnutls *self, 6 | GError **error) 7 | { 8 | const gchar *anchor_file = NULL; 9 | + anchor_file = g_getenv ("GTLS_SYSTEM_CA_FILE"); 10 | #ifdef GTLS_SYSTEM_CA_FILE 11 | - anchor_file = GTLS_SYSTEM_CA_FILE; 12 | + if (!anchor_file) 13 | + anchor_file = GTLS_SYSTEM_CA_FILE; 14 | #endif 15 | return g_tls_file_database_new (anchor_file, error); 16 | } 17 | -------------------------------------------------------------------------------- /osx_bundle/modulesets/patches/gtk-export-source-context.patch: -------------------------------------------------------------------------------- 1 | diff --git a/gdk/quartz/gdkdnd-quartz.c b/gdk/quartz/gdkdnd-quartz.c 2 | index b9928acd44..aca4cb1dd8 100644 3 | --- a/gdk/quartz/gdkdnd-quartz.c 4 | +++ b/gdk/quartz/gdkdnd-quartz.c 5 | @@ -28,7 +28,7 @@ G_DEFINE_TYPE (GdkQuartzDragContext, gdk_quartz_drag_context, GDK_TYPE_DRAG_CONT 6 | GdkDragContext *_gdk_quartz_drag_source_context = NULL; 7 | 8 | GdkDragContext * 9 | -gdk_quartz_drag_source_context () 10 | +gdk_quartz_drag_source_context_libgtk_only () 11 | { 12 | return _gdk_quartz_drag_source_context; 13 | } 14 | diff --git a/gdk/quartz/gdkquartzdnd.h b/gdk/quartz/gdkquartzdnd.h 15 | index 1fb4131754..fb578e1b8f 100644 16 | --- a/gdk/quartz/gdkquartzdnd.h 17 | +++ b/gdk/quartz/gdkquartzdnd.h 18 | @@ -48,6 +48,9 @@ GType gdk_quartz_drag_context_get_type (void); 19 | GDK_AVAILABLE_IN_ALL 20 | id gdk_quartz_drag_context_get_dragging_info_libgtk_only (GdkDragContext *context); 21 | 22 | +GDK_AVAILABLE_IN_ALL 23 | +GdkDragContext *gdk_quartz_drag_source_context_libgtk_only (void); 24 | + 25 | G_END_DECLS 26 | 27 | #endif /* __GDK_QUARTZ_DRAG_CONTEXT_H__ */ 28 | diff --git a/gtk/gtkdnd-quartz.c b/gtk/gtkdnd-quartz.c 29 | index 6198986f6d..f9d70e455c 100644 30 | --- a/gtk/gtkdnd-quartz.c 31 | +++ b/gtk/gtkdnd-quartz.c 32 | @@ -65,8 +65,6 @@ static GtkDragSourceInfo *gtk_drag_get_source_info (GdkDragContext *context, 33 | static void gtk_drag_drop_finished (GtkDragSourceInfo *info, 34 | GtkDragResult result); 35 | 36 | -extern GdkDragContext *gdk_quartz_drag_source_context (); /* gdk/quartz/gdkdnd-quartz.c */ 37 | - 38 | struct _GtkDragSourceInfo 39 | { 40 | GtkWidget *source_widget; 41 | @@ -233,7 +231,7 @@ gtk_drag_finish (GdkDragContext *context, 42 | guint32 time) 43 | { 44 | GtkDragSourceInfo *info; 45 | - GdkDragContext* source_context = gdk_quartz_drag_source_context (); 46 | + GdkDragContext* source_context = gdk_quartz_drag_source_context_libgtk_only (); 47 | 48 | if (source_context) 49 | { 50 | @@ -315,7 +313,7 @@ GtkWidget * 51 | gtk_drag_get_source_widget (GdkDragContext *context) 52 | { 53 | GtkDragSourceInfo *info; 54 | - GdkDragContext* real_source_context = gdk_quartz_drag_source_context(); 55 | + GdkDragContext* real_source_context = gdk_quartz_drag_source_context_libgtk_only (); 56 | 57 | if (!real_source_context) 58 | return NULL; 59 | -------------------------------------------------------------------------------- /osx_bundle/modulesets/patches/gtk-gdk-export.patch: -------------------------------------------------------------------------------- 1 | From 2760b020a83e71405fddf83d3b9d320bb58016dd Mon Sep 17 00:00:00 2001 2 | From: Tom Schoonjans 3 | Date: Fri, 16 Feb 2018 12:16:02 +0000 4 | Subject: [PATCH] gdkquartz.h: export pasteboard functions 5 | 6 | --- 7 | gdk/quartz/gdkquartz.h | 3 +++ 8 | 1 file changed, 3 insertions(+) 9 | 10 | diff --git a/gdk/quartz/gdkquartz.h b/gdk/quartz/gdkquartz.h 11 | index be2cb3c..24555d4 100644 12 | --- a/gdk/quartz/gdkquartz.h 13 | +++ b/gdk/quartz/gdkquartz.h 14 | @@ -60,8 +60,11 @@ typedef enum 15 | GDK_AVAILABLE_IN_ALL 16 | GdkOSXVersion gdk_quartz_osx_version (void); 17 | 18 | +GDK_AVAILABLE_IN_ALL 19 | GdkAtom gdk_quartz_pasteboard_type_to_atom_libgtk_only (NSString *type); 20 | +GDK_AVAILABLE_IN_ALL 21 | NSString *gdk_quartz_target_to_pasteboard_type_libgtk_only (const gchar *target); 22 | +GDK_AVAILABLE_IN_ALL 23 | NSString *gdk_quartz_atom_to_pasteboard_type_libgtk_only (GdkAtom atom); 24 | 25 | G_END_DECLS 26 | -- 27 | libgit2 0.26.0 28 | 29 | -------------------------------------------------------------------------------- /osx_bundle/modulesets/patches/gtk3-fix-build.patch: -------------------------------------------------------------------------------- 1 | diff --git a/gtk/gtkclipboard-quartz.c b/gtk/gtkclipboard-quartz.c 2 | index fec31f5..2b0b098 100644 3 | --- a/gtk/gtkclipboard-quartz.c 4 | +++ b/gtk/gtkclipboard-quartz.c 5 | @@ -1253,3 +1253,12 @@ gtk_clipboard_get_selection (GtkClipboard *clipboard) 6 | 7 | return clipboard->selection; 8 | } 9 | + 10 | +GtkClipboard * 11 | +gtk_clipboard_get_default (GdkDisplay *display) 12 | +{ 13 | + g_return_val_if_fail (display != NULL, NULL); 14 | + g_return_val_if_fail (GDK_IS_DISPLAY (display), NULL); 15 | + 16 | + return gtk_clipboard_get_for_display (display, GDK_SELECTION_CLIPBOARD); 17 | +} 18 | -------------------------------------------------------------------------------- /osx_bundle/modulesets/patches/libbs2b-no-bs2bconvert.diff: -------------------------------------------------------------------------------- 1 | diff -Nur libbs2b-3.1.0/configure.ac libbs2b-3.1.0_mod/configure.ac 2 | --- libbs2b-3.1.0/configure.ac 2009-06-04 20:17:02.000000000 +0200 3 | +++ libbs2b-3.1.0_mod/configure.ac 2015-08-16 15:21:15.000000000 +0200 4 | @@ -5,7 +5,7 @@ 5 | AC_INIT([libbs2b], [3.1.0], [boris_mikhaylov@users.sourceforge.net]) 6 | AC_CONFIG_AUX_DIR([build-aux]) 7 | AM_INIT_AUTOMAKE([1.10.1 -Wall foreign subdir-objects 8 | - dist-zip dist-bzip2 dist-lzma]) 9 | + dist-zip dist-bzip2]) 10 | AC_CONFIG_SRCDIR([src/bs2b.h]) 11 | 12 | # Checks for programs. 13 | @@ -14,11 +14,6 @@ 14 | AC_PROG_LIBTOOL 15 | PKG_PROG_PKG_CONFIG 16 | 17 | -# Checks for libraries. 18 | -PKG_CHECK_EXISTS([sndfile], [], [ 19 | - AC_MSG_ERROR(Please install libsndfile.) 20 | -]) 21 | - 22 | # Checks for header files. 23 | AC_CHECK_HEADERS([fcntl.h malloc.h string.h]) 24 | 25 | diff -Nur libbs2b-3.1.0/src/Makefile.am libbs2b-3.1.0_mod/src/Makefile.am 26 | --- libbs2b-3.1.0/src/Makefile.am 2009-03-20 15:13:53.000000000 +0100 27 | +++ libbs2b-3.1.0_mod/src/Makefile.am 2015-08-16 15:17:18.000000000 +0200 28 | @@ -2,7 +2,6 @@ 29 | libbs2b.la 30 | 31 | bin_PROGRAMS = \ 32 | - bs2bconvert \ 33 | bs2bstream 34 | 35 | 36 | @@ -24,15 +23,6 @@ 37 | bs2b.c \ 38 | bs2bclass.cpp 39 | 40 | -bs2bconvert_LDADD = \ 41 | - libbs2b.la 42 | - 43 | -bs2bconvert_LDFLAGS = \ 44 | - -lsndfile 45 | - 46 | -bs2bconvert_SOURCES = \ 47 | - bs2bconvert.c 48 | - 49 | bs2bstream_LDADD = \ 50 | libbs2b.la 51 | 52 | -------------------------------------------------------------------------------- /osx_bundle/modulesets/patches/pixman-clang5.patch: -------------------------------------------------------------------------------- 1 | --- pixman-0.34.0/test/utils-prng.c.bak 2018-02-01 00:34:15.757691302 +0100 2 | +++ pixman-0.34.0/test/utils-prng.c 2018-02-01 00:36:38.285690995 +0100 3 | @@ -199,12 +199,24 @@ 4 | } 5 | else 6 | { 7 | + 8 | +#ifndef __has_builtin 9 | +#define __has_builtin(x) 0 10 | +#endif 11 | + 12 | #ifdef HAVE_GCC_VECTOR_EXTENSIONS 13 | +# if !defined(__clang__) || __has_builtin(__builtin_shuffle) 14 | const uint8x16 bswap_shufflemask = 15 | { 16 | 3, 2, 1, 0, 7, 6, 5, 4, 11, 10, 9, 8, 15, 14, 13, 12 17 | }; 18 | randdata.vb = __builtin_shuffle (randdata.vb, bswap_shufflemask); 19 | +# elif __has_builtin(__builtin_shufflevector) 20 | + randdata.vb = __builtin_shufflevector(randdata.vb, randdata.vb, 3, 2, 1, 0, 7, 6, 5, 4, 11, 10, 9, 8, 15, 14, 13, 12); 21 | +# else 22 | +# error "GCC_VECTOR_EXTENSION is defined, but neither __builtin_shuffle nor __builtin_shufflevector is supported!" 23 | +# endif 24 | + 25 | store_rand_128_data (buf, &randdata, aligned); 26 | buf += 16; 27 | #else 28 | -------------------------------------------------------------------------------- /osx_bundle/modulesets/patches/pybsddb-autogen.patch: -------------------------------------------------------------------------------- 1 | --- a/autogen.sh 1969-12-31 19:00:00.000000000 -0500 2 | +++ b/autogen.sh 2018-01-29 02:45:57.000000000 -0500 3 | @@ -0,0 +1,21 @@ 4 | +#!/bin/bash 5 | + 6 | +PREFIX=$1 7 | +DHACK='${DESTDIR}' 8 | + 9 | +echo "#!/bin/bash" > configure 10 | + 11 | +cat >Makefile <platform 20 | diff --git a/configure.ac b/configure.ac 21 | --- a/configure.ac 22 | +++ b/configure.ac 23 | @@ -1216,6 +1216,8 @@ 24 | export MACOSX_DEPLOYMENT_TARGET 25 | EXPORT_MACOSX_DEPLOYMENT_TARGET='' 26 | 27 | + LDFLAGS="${LDFLAGS} -Wl,-search_paths_first" 28 | + 29 | if test "${enable_universalsdk}"; then 30 | UNIVERSAL_ARCH_FLAGS="" 31 | if test "$UNIVERSAL_ARCHS" = "32-bit" ; then 32 | -------------------------------------------------------------------------------- /osx_bundle/modulesets/patches/python2-setup.py-disabled_modules.diff: -------------------------------------------------------------------------------- 1 | --- a/setup.py 2013-05-20 03:35:48.000000000 +1000 2 | +++ b/setup.py 2013-05-20 03:37:54.000000000 +1000 3 | @@ -33,7 +33,7 @@ 4 | COMPILED_WITH_PYDEBUG = ('--with-pydebug' in sysconfig.get_config_var("CONFIG_ARGS")) 5 | 6 | # This global variable is used to hold the list of modules to be disabled. 7 | -disabled_module_list = [] 8 | +disabled_module_list = ['_tkinter', 'gdbm'] 9 | 10 | def add_dir_to_list(dirlist, dir): 11 | """Add the directory 'dir' to the list 'dirlist' (at the front) if 12 | -------------------------------------------------------------------------------- /osx_bundle/modulesets/patches/python2-setup.py-remove-hardcoded.diff: -------------------------------------------------------------------------------- 1 | --- a/setup.py 2013-11-12 12:57:03.000000000 +0200 2 | +++ b/setup.py 2013-11-12 13:03:25.000000000 +0200 3 | @@ -436,10 +436,6 @@ 4 | os.unlink(tmpfile) 5 | 6 | def detect_modules(self): 7 | - # Ensure that /usr/local is always used 8 | - if not cross_compiling: 9 | - add_dir_to_list(self.compiler.library_dirs, '/usr/local/lib') 10 | - add_dir_to_list(self.compiler.include_dirs, '/usr/local/include') 11 | if cross_compiling: 12 | self.add_gcc_paths() 13 | self.add_multiarch_paths() 14 | @@ -784,10 +780,7 @@ 15 | depends=['socketmodule.h'], 16 | libraries=math_libs) ) 17 | # Detect SSL support for the socket module (via _ssl) 18 | - search_for_ssl_incs_in = [ 19 | - '/usr/local/ssl/include', 20 | - '/usr/contrib/ssl/include/' 21 | - ] 22 | + search_for_ssl_incs_in = [] 23 | ssl_incs = find_file('openssl/ssl.h', inc_dirs, 24 | search_for_ssl_incs_in 25 | ) 26 | @@ -797,9 +790,7 @@ 27 | if krb5_h: 28 | ssl_incs += krb5_h 29 | ssl_libs = find_library_file(self.compiler, 'ssl',lib_dirs, 30 | - ['/usr/local/ssl/lib', 31 | - '/usr/contrib/ssl/lib/' 32 | - ] ) 33 | + [] ) 34 | 35 | if (ssl_incs is not None and 36 | ssl_libs is not None): 37 | @@ -920,34 +911,7 @@ 38 | 39 | # construct a list of paths to look for the header file in on 40 | # top of the normal inc_dirs. 41 | - db_inc_paths = [ 42 | - '/usr/include/db4', 43 | - '/usr/local/include/db4', 44 | - '/opt/sfw/include/db4', 45 | - '/usr/include/db3', 46 | - '/usr/local/include/db3', 47 | - '/opt/sfw/include/db3', 48 | - # Fink defaults (http://fink.sourceforge.net/) 49 | - '/sw/include/db4', 50 | - '/sw/include/db3', 51 | - ] 52 | - # 4.x minor number specific paths 53 | - for x in gen_db_minor_ver_nums(4): 54 | - db_inc_paths.append('/usr/include/db4%d' % x) 55 | - db_inc_paths.append('/usr/include/db4.%d' % x) 56 | - db_inc_paths.append('/usr/local/BerkeleyDB.4.%d/include' % x) 57 | - db_inc_paths.append('/usr/local/include/db4%d' % x) 58 | - db_inc_paths.append('/pkg/db-4.%d/include' % x) 59 | - db_inc_paths.append('/opt/db-4.%d/include' % x) 60 | - # MacPorts default (http://www.macports.org/) 61 | - db_inc_paths.append('/opt/local/include/db4%d' % x) 62 | - # 3.x minor number specific paths 63 | - for x in gen_db_minor_ver_nums(3): 64 | - db_inc_paths.append('/usr/include/db3%d' % x) 65 | - db_inc_paths.append('/usr/local/BerkeleyDB.3.%d/include' % x) 66 | - db_inc_paths.append('/usr/local/include/db3%d' % x) 67 | - db_inc_paths.append('/pkg/db-3.%d/include' % x) 68 | - db_inc_paths.append('/opt/db-3.%d/include' % x) 69 | + db_inc_paths = [] 70 | 71 | if cross_compiling: 72 | db_inc_paths = [] 73 | -------------------------------------------------------------------------------- /osx_bundle/modulesets/patches/python2-test_grammar.py-typo.patch: -------------------------------------------------------------------------------- 1 | diff --git a/Lib/test/test_grammar.py b/Lib/test/test_grammar.py 2 | --- a/Lib/test/test_grammar.py 3 | +++ b/Lib/test/test_grammar.py 4 | @@ -77,8 +77,8 @@ 5 | 6 | def test_float_exponent_tokenization(self): 7 | # See issue 21642. 8 | - self.assertEqual(1 if 1else 0, 1) 9 | - self.assertEqual(1 if 0else 0, 0) 10 | + self.assertEqual(1 if 1 else 0, 1) 11 | + self.assertEqual(1 if 0 else 0, 0) 12 | self.assertRaises(SyntaxError, eval, "0 if 1Else 0") 13 | 14 | def testStringLiterals(self): 15 | -------------------------------------------------------------------------------- /osx_bundle/modulesets/sdk.modules: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 7 | 9 | 11 | 13 | 15 | 17 | 19 | 20 | 21 | 23 | 25 | 27 | 29 | 31 | 33 | 34 | 36 | 38 | 40 | 42 | 44 | 46 | 48 | 50 | 52 | 54 | 56 | 58 | 60 | 61 | 63 | 65 | 67 | 69 | 71 | 73 | 74 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | 98 | 99 | 100 | 101 | 102 | 103 | 104 | 105 | 106 | 107 | 109 | 111 | 112 | 113 | 115 | 118 | 119 | 120 | 121 | 124 | 125 | 126 | 127 | 129 | 130 | 131 | 132 | 134 | 135 | 136 | 137 | 138 | 139 | 140 | 141 | 144 | 145 | 146 | 147 | 148 | 149 | 151 | 153 | 154 | 155 | 156 | 159 | 160 | 161 | 162 | 163 | 164 | 165 | 168 | 169 | 170 | 171 | 174 | 175 | 176 | 177 | 178 | 181 | 182 | 183 | 184 | 185 | 186 | 188 | 191 | 192 | 193 | 195 | 198 | 199 | 200 | 202 | 205 | 206 | 207 | 208 | 209 | 210 | 212 | 215 | 216 | 217 | 218 | 219 | 220 | 221 | 222 | 223 | 224 | 225 | 226 | 227 | 230 | 231 | 232 | 233 | 235 | 236 | 237 | 238 | 239 | 240 | 241 | 242 | 243 | 244 | 246 | 247 | 248 | 250 | 252 | 253 | 254 | 255 | 256 | 257 | 258 | 259 | 260 | 262 | 264 | 265 | 266 | 267 | 268 | 269 | 270 | 272 | 275 | 276 | 277 | 279 | 283 | 284 | 285 | 286 | 287 | 291 | 292 | 293 | 294 | 295 | 296 | 297 | 300 | 304 | 305 | 306 | 307 | 308 | 309 | 310 | 312 | 314 | 315 | 316 | 317 | 318 | 319 | 320 | 321 | 322 | 323 | 324 | 327 | 328 | 329 | 330 | 333 | 334 | 335 | 336 | 337 | 338 | 339 | 341 | 342 | 343 | 345 | 348 | 349 | 350 | 351 | 352 | 353 | 355 | 358 | 359 | 360 | 361 | 362 | 363 | 364 | 365 | 366 | 367 | 370 | 371 | 372 | 373 | 374 | 375 | 376 | 377 | 378 | 381 | 382 | 383 | 384 | 385 | 386 | 387 | 388 | 389 | 390 | 395 | 397 | 398 | 399 | 401 | 404 | 405 | 406 | 407 | 408 | 409 | 410 | 411 | 412 | 413 | 414 | 415 | 416 | 417 | 419 | 422 | 423 | 424 | 427 | 430 | 431 | 432 | 433 | 434 | 435 | 436 | 438 | 440 | 441 | 442 | 443 | 444 | 445 | 446 | 447 | 448 | 449 | 450 | 451 | 453 | 454 | 455 | 456 | 457 | 458 | 459 | 461 | 463 | 464 | 465 | 466 | 467 | 468 | 469 | 470 | 471 | 472 | 473 | 474 | 475 | 476 | 477 | 478 | 479 | 481 | 482 | 483 | 484 | 486 | 489 | 490 | 491 | 492 | 495 | 496 | 497 | 498 | 499 | 500 | 501 | 503 | 504 | 505 | 506 | 507 | 508 | 509 | 510 | 511 | 513 | 514 | 515 | 516 | 517 | 518 | 519 | 520 | 521 | 522 | 524 | 525 | 526 | 527 | 528 | 529 | 530 | 531 | 532 | 533 | 534 | 535 | 537 | 538 | 539 | 540 | 541 | 542 | 543 | 544 | 545 | 546 | 547 | 550 | 551 | 552 | 553 | 554 | 555 | 556 | 557 | 558 | 559 | 560 | 565 | 566 | 567 | 568 | 571 | 572 | 573 | 574 | 575 | 576 | 577 | 578 | 579 | 580 | 585 | 586 | 587 | 588 | 589 | 590 | 591 | 594 | 595 | 596 | 597 | 598 | 599 | 600 | 601 | 602 | 603 | 604 | 609 | 610 | 611 | 612 | 613 | 614 | 615 | 619 | 620 | 621 | 622 | 623 | 624 | 625 | 629 | 630 | 631 | 632 | 633 | 634 | 635 | 639 | 640 | 641 | 642 | 643 | 644 | 645 | 649 | 650 | 651 | 652 | 653 | 654 | 655 | 659 | 660 | 661 | 662 | 663 | 664 | 665 | 669 | 670 | 671 | 672 | 673 | 674 | 675 | 679 | 680 | 681 | 682 | 683 | 684 | 685 | 690 | 691 | 692 | 693 | 694 | 695 | 696 | 697 | 698 | 699 | 703 | 704 | 705 | 706 | 707 | 708 | 709 | 710 | 714 | 715 | 716 | 717 | 718 | 719 | 720 | 721 | 722 | 727 | 728 | 729 | 730 | 733 | 734 | 735 | 736 | 737 | 738 | 739 | 741 | 742 | 743 | 744 | 745 | 746 | 747 | 750 | 751 | 752 | 753 | 754 | 755 | 756 | 760 | 761 | 762 | 763 | 764 | 765 | 766 | 771 | 772 | 773 | 774 | 775 | 776 | 777 | 782 | 783 | 784 | 785 | 786 | 787 | 788 | 789 | 794 | 795 | 796 | 797 | 798 | 799 | 800 | 801 | 802 | 807 | 808 | 809 | 810 | 811 | 812 | 813 | 814 | 815 | 817 | 820 | 821 | 822 | 823 | 824 | 825 | 826 | 827 | 828 | 829 | 830 | 832 | 833 | 834 | 835 | 836 | 837 | 838 | 839 | 840 | 841 | 842 | 843 | 844 | 845 | 848 | 849 | 850 | 851 | 922 | 925 | 926 | 927 | 928 | 929 | 930 | 931 | 932 | 933 | 934 | 935 | 936 | 937 | 938 | 942 | 943 | 944 | 945 | 946 | 948 | 949 | 950 | 951 | 952 | 955 | 956 | 957 | 958 | 960 | 962 | 963 | 964 | 965 | 966 | 967 | 968 | 969 | 971 | 973 | 974 | 975 | 976 | 977 | 978 | 979 | 980 | 981 | 982 | 985 | 986 | 987 | 988 | 990 | 991 | 992 | 993 | 995 | 996 | 997 | 998 | 999 | 1000 | 1001 | 1004 | 1005 | 1006 | 1007 | 1008 | 1011 | 1012 | 1013 | 1014 | 1015 | 1016 | 1018 | 1021 | 1022 | 1023 | 1024 | 1026 | 1028 | 1029 | 1030 | 1031 | 1032 | 1033 | 1036 | 1037 | 1038 | 1040 | 1043 | 1044 | 1045 | 1046 | 1047 | 1048 | 1049 | 1050 | 1051 | 1053 | 1056 | 1057 | 1058 | 1059 | 1060 | 1061 | 1062 | 1063 | 1064 | 1065 | 1066 | 1068 | 1071 | 1072 | 1073 | 1074 | 1075 | 1076 | 1077 | 1078 | 1079 | 1080 | 1082 | 1085 | 1086 | 1087 | 1089 | 1093 | 1094 | 1095 | 1096 | 1097 | 1098 | 1099 | 1100 | 1103 | 1104 | 1105 | 1106 | 1107 | 1108 | 1110 | 1113 | 1114 | 1115 | 1116 | 1117 | 1118 | 1119 | 1120 | 1122 | 1125 | 1126 | 1127 | 1128 | 1131 | 1132 | 1133 | 1134 | 1135 | 1136 | 1137 | 1139 | 1142 | 1143 | 1144 | 1146 | 1149 | 1150 | 1151 | 1152 | 1154 | 1155 | 1156 | 1157 | 1159 | 1162 | 1163 | 1164 | 1165 | 1166 | 1167 | 1169 | 1170 | 1173 | 1174 | 1175 | 1176 | 1177 | 1181 | 1185 | 1186 | 1187 | 1188 | 1189 | 1190 | 1191 | 1192 | 1193 | 1194 | -------------------------------------------------------------------------------- /rm_links.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # Windows 4 | rm build_win32_installer.sh build_win32_sdk.sh clean_win32.sh 2> /dev/null 5 | 6 | # OSX 7 | rm bootstrap_osx.sh build_osx_sdk.sh clean_osx.sh 2> /dev/null 8 | 9 | exit 0 10 | -------------------------------------------------------------------------------- /win_installer/README.rst: -------------------------------------------------------------------------------- 1 | =================== 2 | Windows SDK Builder 3 | =================== 4 | 5 | Requirements 6 | ------------ 7 | 8 | Building this SDK requires an MSYS2_ environment. Please run all commands in 9 | the MSYS2 MinGW (32/64)bit command prompt. Also, both your application and this 10 | SDK should be located inside MSYS2 native home directory, instead of MSYS2 11 | mapping to Windows directory, i.e. they should be in ~, instead of /c/. 12 | 13 | .. _MSYS2: http://www.msys2.org/ 14 | 15 | SDK Environment 16 | --------------- 17 | 18 | The SDK relies on MSYS2 pacman package manager to fetch and install binary 19 | dependencies. By default, it installs GTK3, GStreamer (with plugins) and NSIS 20 | to do this, you can specify more dependencies by changing your `Target project 21 | configuration`_ 22 | 23 | In order to set up the SDK, you should run build_win32_sdk.sh from within your 24 | target project directory:: 25 | 26 | cd myapp/installer 27 | /path/to/sdk/win_installer/build_win32_sdk.sh 28 | 29 | Afterwards, all the dependencies will be included in the _build_root directory. 30 | This includes a completely separate pacman root from your MSYS2 environment, 31 | which means that the SDK will *not* disturb your environment at all. 32 | 33 | In order to clean up the SDK:: 34 | 35 | cd myapp/installer 36 | /path/to/sdk/win_installer/clean_win32.sh 37 | 38 | 39 | Target project configuration 40 | ---------------------------- 41 | 42 | You must define a project.config and place it in your target directory. An 43 | example project.config is as follows:: 44 | 45 | # The binary dependencies for your application that should be installed by pacman 46 | TARGET_DOWNLOAD_PKGS="make git tar" 47 | 48 | Optional files: 49 | 50 | * requirements.txt 51 | 52 | A `requirements.txt` file contains python dependencies to download + install. 53 | If you require a wheel or some other package that cannot be downloaded using 54 | pip, install it with pacman instead. 55 | 56 | Target project build script 57 | --------------------------- 58 | 59 | After the SDK has been set up, and you have defined your project configuration, 60 | you can use build_win32_installer.sh in order to create an installer.You must define a _build.sh in your project directory, which will be called by 61 | build_win32_installer.sh once all the dependencies have been installed. 62 | 63 | For convenience, NSIS has been installed in the SDK environment. 64 | 65 | Some useful utility functions available in your _build.sh: 66 | 67 | * `package_installer`: Package your application using NSIS. Arg 1: your NSI file. 68 | 69 | * `build_python`: Run your python script using the SDK bundled python. 70 | 71 | * `build_pip`: Run pip using the SDK bundled pip. 72 | 73 | * `build_pacman`: Run pacman using the SDK build root. 74 | 75 | Bundling your application 76 | ------------------------- 77 | 78 | There are a lot of different ways to create a 'frozen' version of your 79 | application, but we highly recommend using pyinstaller. You can run it 80 | like this in your _build.sh file:: 81 | 82 | build_python -m pyinstaller -w myapp.py 83 | 84 | pyinstaller has the necessary hooks to detect GTK/GST dependencies and 85 | properly package them inside your application. 86 | 87 | Troubleshooting 88 | --------------- 89 | 90 | The bash scripts aren't always as robust as one would like, so if you need to 91 | figure out what's going wrong, you can make the scripts more verbose by 92 | setting the GTK_SDK_VERBOSE environment variable, for example:: 93 | 94 | GTK_SDK_VERBOSE=1 ./build_win32_sdk.sh 95 | 96 | Known bugs 97 | ---------- 98 | 99 | On OSX, the git for windows installer runs rebase.exe and it crashes. But, 100 | just ignore it and it's probably ok too. 101 | -------------------------------------------------------------------------------- /win_installer/_base.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # Copyright 2013-2015 Christoph Reiter 3 | # Modified 2015 Dustin Spicuzza 4 | # 5 | # This program is free software; you can redistribute it and/or modify 6 | # it under the terms of the GNU General Public License version 2 as 7 | # published by the Free Software Foundation. 8 | 9 | function catch_sigint { 10 | echo "Caught kill signal, exiting..." 11 | exit 1 12 | } 13 | 14 | trap catch_sigint SIGINT; 15 | 16 | # Data directory for program that is getting packaged 17 | TARGET=$(pwd) 18 | SDK_PLATFORM="win32" 19 | 20 | # 21 | # Valdiate project configuration 22 | # 23 | 24 | [ -f project.config ] || (echo "project.config not found! Are you calling this from the target directory and is the target project setup properly?" && exit 1) 25 | source project.config 26 | 27 | if [ -z "$BASEDIR" ]; then 28 | echo "Cannot source _base.sh without setting BASEDIR variable" 29 | exit 1 30 | fi 31 | 32 | SDK_DATA="$BASEDIR"/data 33 | SDK_MISC="$BASEDIR"/misc 34 | 35 | source "$SDK_DATA"/sdk.config 36 | 37 | ARCH="${ARCH:-i686}" 38 | PYTHON_VERSION="3" 39 | 40 | PYTHON_ID="python${PYTHON_VERSION}" 41 | if [ "${ARCH}" = "x86_64" ]; then 42 | MINGW="mingw64" 43 | else 44 | MINGW="mingw32" 45 | fi 46 | 47 | function set_build_root { 48 | BUILD_ROOT="$1" 49 | MINGW_ROOT="${BUILD_ROOT}/${MINGW}" 50 | } 51 | set_build_root "${TARGET}/_build_root" 52 | 53 | function build_pacman { 54 | pacman --root "${BUILD_ROOT}" "$@" 55 | } 56 | 57 | 58 | function build_pip { 59 | "${BUILD_ROOT}"/"${MINGW}"/bin/"${PYTHON_ID}".exe -m pip "$@" 60 | } 61 | 62 | function build_python { 63 | "${BUILD_ROOT}"/"${MINGW}"/bin/"${PYTHON_ID}".exe "$@" 64 | } 65 | 66 | function build_makensis { 67 | "${BUILD_ROOT}"/"${MINGW}"/bin/makensis.exe "$@" 68 | } 69 | 70 | function create_root { 71 | mkdir -p "${BUILD_ROOT}" 72 | 73 | mkdir -p "${BUILD_ROOT}"/var/lib/pacman 74 | mkdir -p "${BUILD_ROOT}"/var/log 75 | mkdir -p "${BUILD_ROOT}"/tmp 76 | 77 | mkdir -p "${BUILD_ROOT}"/home 78 | 79 | build_pacman --noconfirm -Syu 80 | build_pacman --noconfirm -S base 81 | } 82 | 83 | function install_deps { 84 | if [ -n "$1" ]; then 85 | build_pacman --noconfirm -S --needed $1 86 | fi 87 | } 88 | 89 | function install_pydeps { 90 | # Without this hack, pip will look into the user's home dir and uninstall 91 | # current local packages if old versions of them collide with the user's 92 | # requirements.txt 93 | export PYTHONUSERBASE="${BUILD_ROOT}/home" 94 | # Since we need pywin32_ctypes to install *before* PyInstaller for Exaile, 95 | # we will iterate over the requirements file and install one by one, which 96 | # guarantees the order 97 | while IFS='' read -r line; do 98 | if [ ! -z "$line" ]; then build_pip install $line; fi 99 | done < "$1" 100 | } 101 | 102 | # 103 | # Utility functions for building installers 104 | # 105 | # Arg 1: installer NSI path 106 | function package_installer { 107 | build_makensis $1 108 | } 109 | 110 | # 111 | # Utility function to init the SDK environment, essentially adding the build 112 | # root bin dirs to PATH 113 | # 114 | function init_env { 115 | export PATH="${BUILD_ROOT}"/"${MINGW}"/bin/:"${BUILD_ROOT}"/usr/bin/:$PATH 116 | } 117 | 118 | # Arg 1: directory that contains your translations (*.mo files) 119 | # Arg 2: directory where your frozen exe is 120 | function prune_translations { 121 | local PROJECT_LOCALE="$1" 122 | local DIST="$2" 123 | 124 | MAIN_LOCALE="$DIST"/share/locale 125 | build_python "$SDK_MISC"/prune_translations.py "$PROJECT_LOCALE" "$MAIN_LOCALE" 126 | } 127 | 128 | -------------------------------------------------------------------------------- /win_installer/build_win32_installer.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # Copyright 2013, 2014 Christoph Reiter 3 | # Modified 2015 Dustin Spicuzza 4 | # 5 | # This program is free software; you can redistribute it and/or modify 6 | # it under the terms of the GNU General Public License version 2 as 7 | # published by the Free Software Foundation. 8 | 9 | set -e 10 | 11 | if [ ! -z "$GTK_SDK_VERBOSE" ]; then 12 | set -x 13 | fi 14 | 15 | BASEDIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" 16 | source "$BASEDIR"/_base.sh 17 | 18 | install_deps "$TARGET_DOWNLOAD_PKGS" 19 | install_pydeps "$TARGET"/requirements.txt 20 | 21 | # This should actually build your installer 22 | source "$TARGET"/_build.sh 23 | -------------------------------------------------------------------------------- /win_installer/build_win32_sdk.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # Copyright 2013, 2014 Christoph Reiter 3 | # Modified 2015 Dustin Spicuzza 4 | # 5 | # This program is free software; you can redistribute it and/or modify 6 | # it under the terms of the GNU General Public License version 2 as 7 | # published by the Free Software Foundation. 8 | 9 | set -e 10 | 11 | if [ ! -z "$GTK_SDK_VERBOSE" ]; then 12 | set -x 13 | fi 14 | BASEDIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" 15 | source "$BASEDIR"/_base.sh 16 | 17 | [[ -d "${BUILD_ROOT}" ]] && (echo "${BUILD_ROOT} already exists"; exit 1) 18 | 19 | create_root 20 | 21 | install_deps "$SDK_DOWNLOAD_PKGS" 22 | # This module cannot work under MSYS2 and triggers setuptools bug: 23 | # https://github.com/pypa/setuptools/issues/1118 24 | if [ -f "${BUILD_ROOT}/mingw32/lib/python2.7/distutils/msvc9compiler.py" ]; then 25 | echo 'raise ImportError' > "${BUILD_ROOT}/mingw32/lib/python2.7/distutils/msvc9compiler.py" 26 | fi 27 | 28 | install_pydeps "$SDK_DATA"/requirements.txt 29 | -------------------------------------------------------------------------------- /win_installer/clean_win32.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # Copyright 2014 Christoph Reiter 3 | # 4 | # This program is free software; you can redistribute it and/or modify 5 | # it under the terms of the GNU General Public License version 2 as 6 | # published by the Free Software Foundation. 7 | 8 | if [ ! -z "$GTK_SDK_VERBOSE" ]; then 9 | set -x 10 | fi 11 | 12 | BASEDIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" 13 | source "$BASEDIR"/_base.sh 14 | echo "${BUILD_ROOT}" 15 | rm -rf "${BUILD_ROOT}" 16 | 17 | [ -f _clean.sh ] && source _clean.sh 18 | -------------------------------------------------------------------------------- /win_installer/data/requirements.txt: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /win_installer/data/sdk.config: -------------------------------------------------------------------------------- 1 | # 2 | # Packages to download 3 | # 4 | SDK_DOWNLOAD_PKGS="\ 5 | mingw-w64-i686-nsis \ 6 | mingw-w64-i686-python3-gobject \ 7 | mingw-w64-i686-python3-cairo \ 8 | mingw-w64-i686-python3-pip \ 9 | mingw-w64-i686-gtk3 \ 10 | mingw-w64-i686-gdk-pixbuf2 \ 11 | mingw-w64-i686-gstreamer \ 12 | mingw-w64-i686-gst-plugins-base \ 13 | mingw-w64-i686-gst-plugins-good \ 14 | mingw-w64-i686-gst-plugins-bad \ 15 | mingw-w64-i686-gst-libav \ 16 | mingw-w64-i686-gst-plugins-ugly \ 17 | mingw-w64-i686-librsvg \ 18 | mingw-w64-i686-libdiscid \ 19 | --assume-installed mingw-w64-i686-opencv" 20 | -------------------------------------------------------------------------------- /win_installer/misc/prune_translations.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | 3 | from __future__ import print_function 4 | 5 | import os 6 | import sys 7 | import shutil 8 | 9 | 10 | if __name__ == "__main__": 11 | ql_locale = sys.argv[1] 12 | main_locale = sys.argv[2] 13 | 14 | print("App locale:", ql_locale) 15 | print("Dist locale:", main_locale) 16 | 17 | assert os.path.exists(ql_locale) 18 | assert os.path.exists(main_locale) 19 | 20 | get_lang = lambda x: x.split("_")[0] 21 | 22 | # get a list of languages which QL has translations for 23 | ql_langs = set() 24 | for entry in os.listdir(ql_locale): 25 | ql_langs.add(get_lang(entry)) 26 | 27 | # delete all gtk+ etc translations which QL doesn't support 28 | for entry in os.listdir(main_locale): 29 | entry_path = os.path.join(main_locale, entry) 30 | if get_lang(entry) not in ql_langs: 31 | print("Pruning", entry) 32 | shutil.rmtree(entry_path) 33 | --------------------------------------------------------------------------------