changeset 161:7c7ee53d550c default tip

Add MacOS signing support with environment variable: CODESIGNIDENTITY.
author Brian Smith <brian@dbsoft.org>
date Sun, 12 Mar 2023 17:10:06 -0500
parents b5bccbefa5f5
children
files src/Makefile.in src/mac/installer.sh
diffstat 2 files changed, 9 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/src/Makefile.in	Mon Jan 02 16:56:04 2023 -0600
+++ b/src/Makefile.in	Sun Mar 12 17:10:06 2023 -0500
@@ -49,7 +49,7 @@
 
 installer: $(TARGET)
 	-chmod +x mac/installer.sh
-	-mac/installer.sh "$(DISPLAYNAME)" "$(TARGET)"
+	-mac/installer.sh "$(DISPLAYNAME)" "$(TARGET)" "$(CODESIGNIDENTITY)"
 	                
 clean: 
 	$(RM) $(OBJECTS) resources.o gresources.c gresources.o $(TARGET)
--- a/src/mac/installer.sh	Mon Jan 02 16:56:04 2023 -0600
+++ b/src/mac/installer.sh	Sun Mar 12 17:10:06 2023 -0500
@@ -2,6 +2,7 @@
 PLATFORM=`uname -s`
 APPNAME=$1
 BINNAME=$2
+IDENTITY=$3
 
 if [ $PLATFORM = "Darwin" ]
 then
@@ -14,7 +15,13 @@
     cp -f $BINNAME "../install/package/$APPNAME.app/Contents/MacOS"
     install_name_tool -change `otool -L $BINNAME | grep libdwindows | cut -d ' ' -f 1 | tr -d '\t'`  @executable_path/libdwindows.dylib "../install/package/$APPNAME.app/Contents/MacOS/$BINNAME"
     install_name_tool -change `otool -L $BINNAME | grep libdwcompat | cut -d ' ' -f 1 | tr -d '\t'` @executable_path/libdwcompat.dylib "../install/package/$APPNAME.app/Contents/MacOS/$BINNAME"
-    codesign -s "-" "../install/package/$APPNAME.app/Contents/MacOS/$BINNAME"
+    if [ -z "$IDENTITY" ]
+    then
+        IDENTITY="-"
+    else
+        echo "Signing code with identity: $IDENTITY"
+    fi
+    codesign --deep -s "$IDENTITY" "../install/package/$APPNAME.app"
     #/Developer/Tools/SetFile -a V "../install/package/$BINNAME.png"
     ln -s /Applications ../install/package/.
     rm -f "../install/$APPNAME.dmg"