Uniform Type Identifier (UTI) | com.apple.package |
---|---|
UTI conformation | public.directory |
Container for | documents, bundles |
BSD (4.4 Lite) operating system from UC Berkeley and others for Mac OS X and/or Mac OS X Server: All advertising materials mentioning features or use of this software must include the following acknowledgement: 'This product includes software developed. Mac OS X Leopard (version 10.5) is the sixth major release of Mac OS X (now named macOS), Apple's desktop and server operating system for Macintosh computers. Leopard was released on October 26, 2007 as the successor of Mac OS X 10.4 Tiger, and is available in two editions: a desktop version suitable for personal computers, and a server version, Mac OS X Server.
In the Apple macOS operating system, a package is a file system directory that is normally displayed to the user by the Finder as if it were a single file. [1] Such a directory may be the top-level of a directory tree of objects stored as files, or it may be other archives of files or objects for various purposes, such as installer packages, or backup archives.
Definition[edit]
The package is a common file system abstraction used by Apple operating systems, such as macOS and iOS. It is a directory that may contain a hierarchy of files or objects that represent a preserved, organized state. A package is displayed to users like a single file in the Finder application to avoid being changed by the user. However, the content of packages may be accessed through special keyboard and mouse combination events. For this purpose, the control-click, or right-click, menu displays a directive Show Package Contents.[1]
Some documents may be represented as packages:[2]
- Rich Text Format documents with images, which carry the .rtfd extension;
- Dashboard widgets;
- Partially downloaded files in Safari, which carry the .download extension;
- Final Cut Pro X Camera Archives, which contain multiple QuickTime videos and carry the .fcarch extension;
- project files in GarageBand, Keynote, Pages, Numbers, iMovie and Xcode;
- Installer packages.
The Uniform Type Identifier (UTI) for a package is com.apple.package.[3]
Bundles[edit]
A package that has a standardized structure for storing executable code and its associated resources, is called a bundle.
See also[edit]
References[edit]
- ^ ab'About Bundles'. Bundle Programming Guide. Apple, Inc. Retrieved 2011-03-16.
- ^'Document Packages'. Bundle Programming Guide. Apple, Inc. Retrieved 2011-03-16.
- ^'System-Declared Uniform Type Identifiers'. Uniform Type Identifiers Reference. Apple, Inc. Retrieved 2011-03-16.
Retrieved from 'https://en.wikipedia.org/w/index.php?title=Package_(macOS)&oldid=975977940'
Table Of Contents
- Creating packages for OS X
- Using PyInstaller and Homebrew
- Additional Libraries
- Using the Kivy SDK
- To include other frameworks
- Using PyInstaller and Homebrew
Note
This guide describes multiple ways for packaging Kivy applications.Packaging with PyInstaller is recommended for general use.
Using PyInstaller and Homebrew¶
Note
Package your app on the oldest OS X version you want to support.
Complete guide¶
- Install Homebrew
- Pc for mac games. Install Python:NoteTo use Python 3,
brewinstallpython3
and replacepip
withpip3
in the guide below. - (Re)install your dependencies with
--build-bottle
to make sure they canbe used on other machines:NoteIf your project depends on GStreamer or other additional libraries(re)install them with--build-bottle
as describedbelow. - Install Cython and Kivy:
- Install PyInstaller:
- Package your app using the path to your main.py:NoteThis will not yet copy additional image or sound files. You would need toadapt the created
.spec
file for that.
Buy Os X
Editing the spec file¶
The specs file is named touchtracer.spec and is located in the directorywhere you ran the pyinstaller command.
You need to change the COLLECT() call to add the data of touchtracer(touchtracer.kv, particle.png, …). Change the line to add a Tree()object. This Tree will search and add every file found in the touchtracerdirectory to your final package. Your COLLECT section should look somethinglike this:
This will add the required hooks so that PyInstaller gets the required Kivyfiles. We are done. Your spec is ready to be executed.
Build the spec and create a DMG¶
- Open a console.
- Go to the PyInstaller directory, and build the spec:
- Run:
- You will now have a Touchtracer.dmg available in the dist directory.
Additional Libraries¶
GStreamer¶
If your project depends on GStreamer:
![Packaging Packaging](https://s-media-cache-ak0.pinimg.com/736x/1d/a8/28/1da82806b66b1fe1a6c95a9c3c1a3fbb--photoshop-illustrator-illustrator-tutorials.jpg)
Note
If your Project needs Ogg Vorbis support be sure to add the
--with-libvorbis
option to the command above.If you are using Python from Homebrew you will also need the following stepuntil this pull requestgets merged:
Using PyInstaller without Homebrew¶
First install Kivy and its dependencies without using Homebrew as mentioned herehttp://kivy.org/docs/installation/installation.html#development-version.
Once you have kivy and its deps installed, you need to install PyInstaller.
Let’s assume we use a folder like testpackaging:
Create a file named touchtracer.spec in this directory and add the followingcode to it:
Change the paths with your relevant paths:
Then run the following command:
Replace touchtracer with your app where appropriate.This will give you a <yourapp>.app in the dist/ folder.
Using Buildozer¶
pip install git+http://github.com/kivy/buildozercd /to/where/I/Want/to/packagebuildozer init
Note
Packaging Kivy applications with the following method must be done insideOS X, 32-bit platforms are no longer supported.
Edit the buildozer.spec and add the details for your app.Dependencies can be added to the requirements= section.
By default the kivy version specified in the requirements is ignored. Mixmeister fusion for mac crack.
If you have a Kivy.app at /Applications/Kivy.app then that is used,for packaging. Otherwise the latest build from kivy.org using Kivymaster will be downloaded and used.
If you want to package for python 3.x.x simply download the packagenamed Kivy3.7z from the download section of kivy.org and extract itto Kivy.app in /Applications, then run:
Once the app is packaged, you might want to remove unneededpackages like gstreamer, if you don’t need video support.Same logic applies for other things you do not use, just reducethe package to its minimal state that is needed for the app to run.
As an example we are including the showcase example packaged usingthis method for both Python 2 (9.xMB) and 3 (15.xMB), you can find thepackages here:https://drive.google.com/drive/folders/0B1WO07-OL50_alFzSXJUajBFdnc .
That’s it. Enjoy!
Buildozer right now uses the Kivy SDK to package your app.If you want to control more details about your app than buildozercurrently offers then you can use the SDK directly, as detailed in thesection below.
Using the Kivy SDK¶
Note
Kivy.app is not available for download at the moment. For details,see this issue.
Note
Packaging Kivy applications with the following method must be done insideOS X, 32-bit platforms are no longer supported.
Since version 1.9.0, Kivy is released for the OS X platform in aself-contained, portable distribution.
Apps can be packaged and distributed with the Kivy SDK using the methoddescribed below, making it easier to include frameworks like SDL2 andGStreamer.
![Mac Mac](/uploads/1/1/9/5/119529267/195540011.jpg)
- Make sure you have the unmodified Kivy SDK (Kivy.app) from the download page.
- Run the following commands:
Note
This step above is important, you have to make sure to preserve the pathsand permissions. A command like
cp-rf
will copy but make the appunusable and lead to error later on.- Now all you need to do is to include your compiled app in the Kivy.appby running the following command:
Where <app_folder_name> is the name of your app.
This copies Kivy.app to <app_folder_name>.app and includes a compiled copyof your app into this package.
- That’s it, your self-contained package is ready to be deployed!You can now further customize your app as described bellow.
Installing modules¶
Kivy package on osx uses its own virtual env that is activated when you runyour app using kivy command.To install any module you need to install the module like so:
Where are the modules/files installed?¶
Inside the portable venv within the app at:
If you install a module that installs a binary for example like kivy-gardenThat binary will be only available from the venv above, as in after you do:
The garden lib will be only available when you activate this env.
source /Applications/Kivy.app/Contents/Resources/venv/bin/activategarden install mapviewdeactivate
To install binary files¶
Just copy the binary to the Kivy.app/Contents/Resources/venv/bin/ directory.
To include other frameworks¶
Kivy.app comes with SDL2 and Gstreamer frameworks provided.To include frameworks other than the ones provided do the following:
Do not forget to replace <Framework_name> with your framework.This tool osxrelocator essentially changes the path for thelibs in the framework such that they are relative to the executablewithin the .app, making the Framework portable with the .app.
Shrinking the app size¶
The app has a considerable size right now, however the unneeded parts can beremoved from the package.
For example if you don’t use GStreamer, simply remove it fromYourApp.app/Contents/Frameworks.Similarly you can remove the examples folder from/Applications/Kivy.app/Contents/Resources/kivy/examples/ or kivy/tools,kivy/docs etc.
This way the package can be made to only include the parts that are needed foryour app.
Adjust settings¶
Icons and other settings of your app can be changed by editingYourApp/Contents/info.plist to suit your needs.
Create a DMG¶
To make a DMG of your app use the following command:
Note the lack of / at the end.This should give you a compressed dmg that will further shrink the size of yourdistributed app.
Packaging For Mac Os X 10.8
« Kivy on Android | Create a package for IOS » |