Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Updates to GIMP recipe #96

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
56 changes: 56 additions & 0 deletions GIMP/GIMPBundleIDFixer.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
#!/usr/bin/env python
#
# Heavily based upon
# Copyright 2016 Hannes Juutilainen
#
# Copyright 2018 James Nairn
#
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

from autopkglib import Processor, ProcessorError

__all__ = ["GIMPBundleIDFixer"]


class GIMPBundleIDFixer(Processor):
"""Tidies bundleid on given GIMP.app"""
input_variables = {
"bundleid": {
"required": True,
"description": "Bundle ID from GIMP.app",
}
}
output_variables = {
"bundleid": {
"description": "Tidied form of bundleid",
}
}
description = __doc__

def main(self):
bundleid = self.env.get("bundleid")

# Strip illegal chars from bundleid
# Apple docs https://developer.apple.com/library/archive/documentation/CoreFoundation/Conceptual/CFBundles/BundleTypes/BundleTypes.html#//apple_ref/doc/uid/10000123i-CH101-SW1
bundleid = bundleid.strip(':')

self.output("bundleid: {}".format(bundleid))
self.env["bundleid"] = bundleid




if __name__ == "__main__":
processor = GIMPBundleIDFixer()
processor.execute_shell()
11 changes: 10 additions & 1 deletion GIMP/Gimp.pkg.recipe
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@
<key>Arguments</key>
<dict>
<key>source_path</key>
<string>%pathname%/GIMP.app</string>
<string>%pathname%/%app_name%</string>
<key>destination_path</key>
<string>%pkgroot%/Applications/%NAME%.app</string>
</dict>
Expand All @@ -60,6 +60,15 @@
<string>%pkgroot%/Applications/%NAME%.app</string>
</dict>
</dict>
<dict>
<key>Processor</key>
<string>GIMPBundleIDFixer</string>
<key>Arguments</key>
<dict>
<key>bundleid</key>
<string>%bundleid%</string>
</dict>
</dict>
<dict>
<key>Processor</key>
<string>PkgCreator</string>
Expand Down