Skip to content

Commit

Permalink
Add arch info to filename of desktop installers (qzind#1033)
Browse files Browse the repository at this point in the history
Add arch info to desktop installers
Closes qzind#1032
  • Loading branch information
tresf authored Oct 23, 2022
1 parent 715743d commit 5f6755c
Show file tree
Hide file tree
Showing 4 changed files with 32 additions and 18 deletions.
26 changes: 13 additions & 13 deletions ant/apple/installer.xml
Original file line number Diff line number Diff line change
@@ -1,14 +1,15 @@
<project name="apple-installer" basedir="../../" xmlns:if="ant:if">
<property file="ant/project.properties"/>
<import file="${basedir}/ant/version.xml"/>
<import file="${basedir}/ant/platform-detect.xml"/>

<!--
################################################################
# Apple Installer #
################################################################
-->

<target name="build-pkg" depends="get-identity,add-certificates,get-version">
<target name="build-pkg" depends="get-identity,add-certificates,get-version,platform-detect">
<echo level="info">Creating installer using pkgbuild</echo>
<!--
#####################################
Expand All @@ -18,6 +19,12 @@

<mkdir dir="${build.dir}/scripts/payload"/>

<!-- Get the os-preferred name for the target architecture -->
<condition property="apple.target.arch" value="arm64">
<isset property="target.arch.aarch64"/>
</condition>
<property name="apple.target.arch" value="x86_64" description="fallback value"/>

<!-- Build app without sandboxing by default-->
<property name="build.sandboxed" value="false"/>
<antcall target="build-app">
Expand Down Expand Up @@ -58,7 +65,7 @@
<arg value="--sign" if:true="${codesign.available}"/>
<arg value="${codesign.activeid}" if:true="${codesign.available}"/>

<arg value="${out.dir}/${project.filename}${build.type}-${build.version}-unbranded.pkg"/>
<arg value="${out.dir}/${project.filename}${build.type}-${build.version}-${apple.target.arch}-unbranded.pkg"/>
</exec>

<!-- Branding for qz only -->
Expand All @@ -71,13 +78,6 @@
<copy file="${basedir}/ant/apple/${pkg.background}" tofile="${out.dir}/resources/background.tiff" failonerror="true"/>

<!-- Create product definition plist that stipulates supported arch -->
<condition property="build.archdef" value="arm64">
<isset property="target.arch.aarch64"/>
</condition>
<condition property="build.archdef" value="x86_64">
<isset property="target.arch.x86_64"/>
</condition>

<copy file="ant/apple/product-def.plist.in" tofile="${build.dir}/product-def.plist">
<filterchain><expandproperties/></filterchain>
</copy>
Expand All @@ -92,7 +92,7 @@
<arg value="--timestamp"/>

<arg value="--package"/>
<arg value="${out.dir}/${project.filename}${build.type}-${build.version}-unbranded.pkg"/>
<arg value="${out.dir}/${project.filename}${build.type}-${build.version}-${apple.target.arch}-unbranded.pkg"/>

<arg value="--product"/>
<arg value="${build.dir}/product-def.plist"/>
Expand Down Expand Up @@ -130,13 +130,13 @@
<arg value="${build.dir}/product-def.plist"/>

<arg value="--package-path"/>
<arg value="${project.filename}${build.type}-${build.version}-unbranded.pkg"/>
<arg value="${project.filename}${build.type}-${build.version}-${apple.target.arch}-unbranded.pkg"/>

<arg value="${out.dir}/${project.filename}${build.type}-${build.version}.pkg"/>
<arg value="${out.dir}/${project.filename}${build.type}-${build.version}-${apple.target.arch}.pkg"/>
</exec>

<!-- Cleanup unbranded version -->
<delete file="${out.dir}/${project.filename}${build.type}-${build.version}-unbranded.pkg"/>
<delete file="${out.dir}/${project.filename}${build.type}-${build.version}-${apple.target.arch}-unbranded.pkg"/>
</target>

<target name="build-dmg" depends="get-identity,add-certificates,get-version">
Expand Down
2 changes: 1 addition & 1 deletion ant/apple/product-def.plist.in
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<dict>
<key>arch</key>
<array>
<string>${build.archdef}</string>
<string>${apple.target.arch}</string>
</array>
</dict>
</plist>
11 changes: 9 additions & 2 deletions ant/linux/installer.xml
Original file line number Diff line number Diff line change
@@ -1,10 +1,17 @@
<project name="linux-installer" basedir="../../">
<property file="ant/project.properties"/>
<import file="${basedir}/ant/version.xml"/>
<import file="${basedir}/ant/platform-detect.xml"/>

<target name="build-run" depends="get-version">
<target name="build-run" depends="get-version,platform-detect">
<echo level="info">Creating installer using makeself</echo>

<!-- Get the os-preferred name for the target architecture -->
<condition property="linux.target.arch" value="arm64">
<isset property="target.arch.aarch64"/>
</condition>
<property name="linux.target.arch" value="x86_64" description="fallback value"/>

<copy file="assets/branding/linux-icon.svg" tofile="${dist.dir}/${project.filename}.svg"/>

<mkdir dir="${build.dir}/scripts"/>
Expand All @@ -30,7 +37,7 @@

<exec executable="makeself" failonerror="true">
<arg value="${dist.dir}"/>
<arg value="${out.dir}/${project.filename}${build.type}-${build.version}.run"/>
<arg value="${out.dir}/${project.filename}${build.type}-${build.version}-${linux.target.arch}.run"/>
<arg value="${project.name} Installer"/>
<arg value="./install"/>
</exec>
Expand Down
11 changes: 9 additions & 2 deletions ant/windows/installer.xml
Original file line number Diff line number Diff line change
@@ -1,9 +1,16 @@
<project name="windows-installer" basedir="../../">
<property file="ant/project.properties"/>
<import file="${basedir}/ant/version.xml"/>
<import file="${basedir}/ant/platform-detect.xml"/>
<property environment="env"/>

<target name="build-exe" depends="get-version">
<target name="build-exe" depends="get-version,platform-detect">
<!-- Get the os-preferred name for the target architecture -->
<condition property="windows.target.arch" value="arm64">
<isset property="target.arch.aarch64"/>
</condition>
<property name="windows.target.arch" value="x86_64" description="fallback value"/>

<!-- Sign Libs and Runtime -->
<fileset dir="${dist.dir}/" id="win.sign.found">
<include name="**/*.dll"/>
Expand Down Expand Up @@ -38,7 +45,7 @@
<!-- Installer (bundles dist/ payload) -->
<antcall target="config-compile-sign">
<param name="nsis.script.in" value="windows-installer.nsi.in"/>
<param name="nsis.outfile" value="${out.dir}/${project.filename}${build.type}-${build.version}.exe"/>
<param name="nsis.outfile" value="${out.dir}/${project.filename}${build.type}-${build.version}-${windows.target.arch}.exe"/>
</antcall>
</target>

Expand Down

0 comments on commit 5f6755c

Please sign in to comment.