Skip to content

Commit

Permalink
updated for Apple silicon support
Browse files Browse the repository at this point in the history
  • Loading branch information
scriptingosx committed Dec 7, 2020
1 parent 79a460a commit dd333a5
Show file tree
Hide file tree
Showing 6 changed files with 31 additions and 7 deletions.
2 changes: 2 additions & 0 deletions desktoppr.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -195,6 +195,7 @@
ENABLE_HARDENED_RUNTIME = YES;
ENABLE_STRICT_OBJC_MSGSEND = YES;
ENABLE_TESTABILITY = YES;
EXCLUDED_ARCHS = "";
GCC_C_LANGUAGE_STANDARD = gnu11;
GCC_DYNAMIC_NO_PIC = NO;
GCC_NO_COMMON_BLOCKS = YES;
Expand Down Expand Up @@ -262,6 +263,7 @@
ENABLE_HARDENED_RUNTIME = YES;
ENABLE_NS_ASSERTIONS = NO;
ENABLE_STRICT_OBJC_MSGSEND = YES;
EXCLUDED_ARCHS = "";
GCC_C_LANGUAGE_STANDARD = gnu11;
GCC_NO_COMMON_BLOCKS = YES;
GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
Expand Down
6 changes: 3 additions & 3 deletions desktoppr/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,14 @@
<plist version="1.0">
<dict>
<key>BuildNumber</key>
<integer>106</integer>
<integer>109</integer>
<key>CFBundleIdentifier</key>
<string>com.scriptingosx.desktoppr</string>
<key>CFBundleName</key>
<string>desktoppr</string>
<key>CFBundleShortVersionString</key>
<string>0.3</string>
<string>0.4</string>
<key>CFBundleVersion</key>
<string>0.3</string>
<string>0.4</string>
</dict>
</plist>
2 changes: 1 addition & 1 deletion desktoppr/main.swift
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
import Foundation
import AppKit

let version = "0.3"
let version = "0.4"

enum ScreenOption : Equatable {
case all
Expand Down
3 changes: 2 additions & 1 deletion examples/postinstall
Original file line number Diff line number Diff line change
Expand Up @@ -34,10 +34,11 @@ fi

# get the current user
loggedInUser=$(echo "show State:/Users/ConsoleUser" | scutil | awk '/Name :/ { print $3 }')
uid=$(id -u "$loggedInUser")

if [ "$loggedInUser" != "loginwindow" ]; then
# set the desktop for the user
sudo -u "$loggedInUser" "$desktoppr" "$picturepath"
sudo -u "$loggedInUser" launchctl asuser "$uid" "$desktoppr" "$picturepath"
else
echo "no user logged in, no desktop set"
fi
10 changes: 8 additions & 2 deletions pkgAndNotarize.zsh
Original file line number Diff line number Diff line change
Expand Up @@ -83,14 +83,20 @@ identifier=$($plistbuddy -c "print CFBundleIdentifier" "$infoplist")
productname=$($plistbuddy -c "print CFBundleName" "$infoplist")

pkgpath="$builddir/$productname-$version.pkg"
componentpath="$builddir/$productname.pkg"

echo "## building pkg: $pkgpath"

pkgbuild --root "$pkgroot" \
--version "$version" \
--identifier "$identifier" \
--sign "Developer ID Installer: Armin Briegel (JME5BW3F3R)" \
"$pkgpath"
"$componentpath"

productbuild --package "$componentpath" \
--product "$builddir/requirements.plist" \
--sign "Developer ID Installer: Armin Briegel (JME5BW3F3R)" \
"$pkgpath"

# upload for notarization
notarizefile "$pkgpath" "$identifier"
Expand All @@ -102,7 +108,7 @@ xcrun stapler staple "$pkgpath"

# also create a zip archive
zippath="$builddir/$productname-$version.zip"
zip "$zippath" "$pkgroot"/usr/local/bin/desktoppr
zip "$zippath" -j "$pkgroot"/usr/local/bin/desktoppr

# upload zip for notarization
notarizefile "$zippath" "$identifier"
Expand Down
15 changes: 15 additions & 0 deletions requirements.plist
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>os</key>
<array>
<string>10.12</string>
</array>
<key>arch</key>
<array>
<string>x86_64</string>
<string>arm64</string>
</array>
</dict>
</plist>

0 comments on commit dd333a5

Please sign in to comment.