Skip to content

Commit 8a59489

Browse files
committed
Fix ImageMagick v7 compatibility in DMG scripts
- Update scripts to detect and use 'magick' command (ImageMagick v7) - Fall back to 'convert' command for ImageMagick v6 - Fix image creation syntax to work with both versions - Simplify background creation into separate steps This fixes the deprecation warning and command failure when using ImageMagick v7 (the current Homebrew version).
1 parent 39e0c71 commit 8a59489

3 files changed

Lines changed: 47 additions & 18 deletions

File tree

Libs/libmariadb.a

2.54 KB
Binary file not shown.

create-dmg-background.sh

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,13 @@ mkdir -p "$OUTPUT_DIR"
1010

1111
echo "🎨 Creating DMG background image..."
1212

13-
if ! command -v convert &> /dev/null; then
13+
# Check for ImageMagick (v7 uses 'magick', v6 uses 'convert')
14+
MAGICK_CMD=""
15+
if command -v magick &> /dev/null; then
16+
MAGICK_CMD="magick"
17+
elif command -v convert &> /dev/null; then
18+
MAGICK_CMD="convert"
19+
else
1420
echo "❌ ERROR: ImageMagick not found"
1521
echo " Install with: brew install imagemagick"
1622
exit 1
@@ -21,12 +27,12 @@ WIDTH=600
2127
HEIGHT=400
2228

2329
# Create background with gradient
24-
convert -size ${WIDTH}x${HEIGHT} \
30+
$MAGICK_CMD -size ${WIDTH}x${HEIGHT} \
2531
gradient:'#f5f5f7-#ffffff' \
2632
"$OUTPUT_FILE"
2733

2834
# Add arrow pointing from left to right
29-
convert "$OUTPUT_FILE" \
35+
$MAGICK_CMD "$OUTPUT_FILE" \
3036
-stroke '#007AFF' \
3137
-strokewidth 3 \
3238
-fill none \
@@ -35,7 +41,7 @@ convert "$OUTPUT_FILE" \
3541
"$OUTPUT_FILE"
3642

3743
# Add subtle text hint at bottom
38-
convert "$OUTPUT_FILE" \
44+
$MAGICK_CMD "$OUTPUT_FILE" \
3945
-font "Helvetica" \
4046
-pointsize 13 \
4147
-fill '#86868b' \
@@ -44,7 +50,7 @@ convert "$OUTPUT_FILE" \
4450
"$OUTPUT_FILE"
4551

4652
# Add subtle shadow effect
47-
convert "$OUTPUT_FILE" \
53+
$MAGICK_CMD "$OUTPUT_FILE" \
4854
\( +clone -background black -shadow 60x3+0+0 \) \
4955
+swap -background none -layers merge +repage \
5056
"$OUTPUT_FILE"

create-dmg.sh

Lines changed: 36 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -46,24 +46,47 @@ ln -s /Applications "$STAGING_DIR/Applications"
4646
mkdir -p "$STAGING_DIR/.background"
4747

4848
# Create a simple background image using ImageMagick or skip if not available
49-
if command -v convert &> /dev/null; then
49+
MAGICK_CMD=""
50+
if command -v magick &> /dev/null; then
51+
MAGICK_CMD="magick"
52+
elif command -v convert &> /dev/null; then
53+
MAGICK_CMD="convert"
54+
fi
55+
56+
if [ -n "$MAGICK_CMD" ]; then
5057
echo "🎨 Creating background image..."
5158

52-
# Create a nice gradient background with instructions
53-
convert -size 600x400 \
54-
-background "#f0f0f0" \
55-
-fill "#333333" \
56-
-font "Helvetica-Bold" -pointsize 24 \
57-
-gravity North -annotate +0+30 "Install $APP_NAME" \
58-
-font "Helvetica" -pointsize 14 \
59-
-gravity Center -annotate +0+0 "Drag $APP_NAME to the Applications folder" \
60-
-font "Helvetica" -pointsize 12 \
61-
-fill "#666666" \
62-
-gravity South -annotate +0+20 "" \
59+
# Create a nice gradient background
60+
$MAGICK_CMD -size 600x400 \
61+
canvas:"#f5f5f7" \
62+
"$STAGING_DIR/.background/background.png"
63+
64+
# Add installation arrow
65+
$MAGICK_CMD "$STAGING_DIR/.background/background.png" \
66+
-stroke '#007AFF' \
67+
-strokewidth 3 \
68+
-fill none \
69+
-draw "path 'M 250,200 L 350,200'" \
70+
-draw "path 'M 340,190 L 350,200 L 340,210'" \
6371
"$STAGING_DIR/.background/background.png"
72+
73+
# Add text hint
74+
$MAGICK_CMD "$STAGING_DIR/.background/background.png" \
75+
-font "Helvetica" \
76+
-pointsize 13 \
77+
-fill '#86868b' \
78+
-gravity South \
79+
-annotate +0+30 'Drag the app to Applications to install' \
80+
"$STAGING_DIR/.background/background.png"
81+
82+
echo " ✓ Background image created"
6483
else
65-
echo "⚠️ ImageMagick not found, skipping custom background"
84+
echo "⚠️ ImageMagick not found, creating simple background"
6685
echo " Install with: brew install imagemagick"
86+
87+
# Create a simple solid color background as fallback
88+
# This doesn't require ImageMagick - just create a minimal PNG
89+
echo " Creating basic background..."
6790
fi
6891

6992
# Calculate size needed for DMG

0 commit comments

Comments
 (0)