···1+#
2+# __________ __ ___.
3+# Open \______ \ ____ ____ | | _\_ |__ _______ ___
4+# Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
5+# Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
6+# Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
7+# \/ \/ \/ \/ \/
8+#
9+# All files in this archive are subject to the GNU General Public License.
10+# See the file COPYING in the source tree root for full license agreement.
11+#
12+# This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
13+# KIND, either express or implied.
14+#
15+16+# This is a separate cmake script, to be invoked as
17+# cmake -P -DURL=<url-to-download> -DOUTDIR=<output-folder>
18+# Downloads the file and store it in OUTDIR, using the file basename as output
19+# filename.
20+# The downloaded file gets its executable flag set.
21+22+function(gettempdir basedir tmpdir)
23+ # Create a random filename in current directory.
24+ # Result stored in tmpdir.
25+ string(RANDOM LENGTH 24 _tmp)
26+ while(EXISTS "${basedir}/${_tmp}.tmp")
27+ string(RANDOM LENGTH 24 _tmp)
28+ endwhile()
29+ set("${tmpdir}" "${basedir}/${_tmp}.tmp" PARENT_SCOPE)
30+endfunction()
31+32+get_filename_component(fname "${URL}" NAME)
33+34+if(EXISTS "${OUTDIR}/${fname}")
35+ message("-- Found ${fname}")
36+else()
37+ message("-- Downloading ${URL} ...")
38+ gettempdir(${OUTDIR} tmp)
39+40+ # cmake CHOWN is 3.19+, thus download to a temporary folder, then copy.
41+ file(DOWNLOAD "${URL}" "${tmp}/${fname}")
42+ file(COPY "${tmp}/${fname}" DESTINATION "${OUTDIR}"
43+ FILE_PERMISSIONS OWNER_EXECUTE OWNER_WRITE OWNER_READ)
44+ file(REMOVE_RECURSE "${tmp}")
45+endif()
46+47+
+8-2
utils/rbutilqt/dmgbuild.cfg
···1# Configuration for creating a dmg with dmgbuild
2# (https://github.com/al45tair/dmgbuild)
034import os
056-files = [ 'RockboxUtility.app' ]
000007background = '#c6d6f5'
8-icon = os.path.join(defines['basepath'], 'rbutilqt/icons/rbutilqt.icns')
9
···1# Configuration for creating a dmg with dmgbuild
2# (https://github.com/al45tair/dmgbuild)
3+# Needs biplist as additional package.
45import os
6+import biplist
78+_appbundle = defines['appbundle']
9+_plist = biplist.readPlist(os.path.join(_appbundle, 'Contents/Info.plist'))
10+_iconfile = os.path.join(_appbundle, 'Contents/Resources', _plist['CFBundleIconFile'])
11+12+files = [ _appbundle ]
13+icon = _iconfile
14background = '#c6d6f5'
015