Skip to content

Commit 7ba5511

Browse files
Add custom fields (branch on org repo) (#106)
* Add custom fields * Add custom field fallbacks * Add missing newlines * Fix packaged file moving * Fix placeholder license * Fix packaged file moving again * Fix build parameters not set on run * Undo typo * Rename function * Remove unnecessary re-init of variables Co-authored-by: jld3103 <[email protected]>
1 parent 64678bd commit 7ba5511

34 files changed

+470
-408
lines changed
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
#application-name: "{{.applicationName}}" # Uncomment to modify this value.
2+
#executable-name: "{{.executableName}}" # Uncomment to modify this value. Only lowercase a-z, numbers, underscores and no spaces
3+
#package-name: "{{.packageName}}" # Uncomment to modify this value. Only lowercase a-z, numbers and no underscores or spaces
4+
license: "" # MANDATORY: Fill in your SPDX license name: https://spdx.org/licenses
15
target: lib/main_desktop.dart
26
branch: "" # Change to "@latest" to download the latest go-flutter version on every build
37
# cache-path: "/home/YOURUSERNAME/.cache/" # https://github.com/go-flutter-desktop/go-flutter/issues/184

assets/packaging/README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
# packaging
2+
The template files in the subdirectories are only copied on init and then executed on build.

assets/packaging/darwin-bundle/Info.plist.tmpl.tmpl renamed to assets/packaging/darwin-bundle/Info.plist.tmpl

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
<key>CFBundleDevelopmentRegion</key>
66
<string>English</string>
77
<key>CFBundleExecutable</key>
8-
<string>{{.projectName}}</string>
8+
<string>{{.executableName}}</string>
99
<key>CFBundleGetInfoString</key>
1010
<string>{{.description}}</string>
1111
<key>CFBundleIconFile</key>
@@ -15,20 +15,20 @@
1515
<key>CFBundleInfoDictionaryVersion</key>
1616
<string>6.0</string>
1717
<key>CFBundleLongVersionString</key>
18-
<string>{{`{{.version}}`}}</string>
18+
<string>{{.version}}</string>
1919
<key>CFBundleName</key>
20-
<string>{{.projectName}}</string>
20+
<string>{{.applicationName}}</string>
2121
<key>CFBundlePackageType</key>
2222
<string>APPL</string>
2323
<key>CFBundleShortVersionString</key>
24-
<string>{{`{{.version}}`}}</string>
24+
<string>{{.version}}</string>
2525
<key>CFBundleSignature</key>
26-
<string>????</string>
26+
<string>{{.organizationName}}.{{.packageName}}</string>
2727
<key>CFBundleVersion</key>
28-
<string>{{`{{.version}}`}}</string>
28+
<string>{{.version}}</string>
2929
<key>CSResourcesFileMapped</key>
3030
<true/>
3131
<key>NSHumanReadableCopyright</key>
3232
<string></string>
3333
</dict>
34-
</plist>
34+
</plist>
Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
<?xml version="1.0" encoding="utf-8"?>
22
<installer-gui-script minSpecVersion="1">
3-
<title>{{.projectName}}</title>
4-
<background alignment="topleft" file="root/Applications/{{.projectName}}.app/Contents/MacOS/assets/icon.png"/>
3+
<title>{{.applicationName}}</title>
4+
<background alignment="topleft" file="root/Applications/{{.applicationName}} {{.version}}.app/Contents/MacOS/assets/icon.png"/>
55
<choices-outline>
66
<line choice="choiceBase"/>
77
</choices-outline>
88
<choice id="choiceBase" title="base">
99
<pkg-ref id="{{.organizationName}}.base.pkg"/>
1010
</choice>
11-
<pkg-ref id="{{.organizationName}}.base.pkg" version="{{`{{.version}}`}}" auth="Root">#base.pkg</pkg-ref>
11+
<pkg-ref id="{{.organizationName}}.base.pkg" version="{{.version}}" auth="Root">#base.pkg</pkg-ref>
1212
</installer-gui-script>
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
<pkg-info format-version="2" identifier="{{.organizationName}}.base.pkg" version="{{.version}}" install-location="/" auth="root">
2+
<bundle-version>
3+
<bundle id="{{.organizationName}}" CFBundleIdentifier="{{.organizationName}}.{{.packageName}}" path="./Applications/{{.applicationName}} {{.version}}.app" CFBundleVersion="{{.version}}"/>
4+
</bundle-version>
5+
</pkg-info>

assets/packaging/darwin-pkg/PackageInfo.tmpl.tmpl

Lines changed: 0 additions & 5 deletions
This file was deleted.
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
#!/bin/sh
22
cd "$(dirname "$0")"
3-
exec ./build/{{.projectName}}
3+
exec ./build/{{.executableName}}
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
Package: {{.strippedProjectName}}
1+
Package: {{.packageName}}
22
Architecture: amd64
33
Maintainer: @{{.author}}
44
Priority: optional
5-
Version: {{`{{.version}}`}}
5+
Version: {{.version}}
66
Description: {{.description}}

assets/packaging/linux-pkg/PKGBUILD.tmpl.tmpl renamed to assets/packaging/linux-pkg/PKGBUILD.tmpl

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
1-
pkgname={{.projectName}}
2-
pkgver={{`{{.version}}`}}
3-
pkgrel={{`{{.release}}`}}
1+
pkgname={{.packageName}}
2+
pkgver={{.version}}
3+
pkgrel={{.release}}
44
pkgdesc="{{.description}}"
55
arch=("x86_64")
6-
license=('FIXME')
6+
license=('{{.license}}')
77

88
package() {
99
mkdir -p $pkgdir/
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
Name: {{.packageName}}
2+
Version: {{.version}}
3+
Release: {{.release}}
4+
Summary: {{.description}}
5+
License: {{.license}}
6+
7+
%description
8+
{{.description}}
9+
10+
%install
11+
mkdir -p $RPM_BUILD_ROOT%{_bindir}
12+
mkdir -p $RPM_BUILD_ROOT/usr/lib/{{.packageName}}
13+
mkdir -p $RPM_BUILD_ROOT%{_datadir}/applications
14+
cp -R $RPM_BUILD_DIR/{{.packageName}}-{{.version}}-{{.release}}.x86_64/* $RPM_BUILD_ROOT
15+
chmod 0755 $RPM_BUILD_ROOT%{_bindir}/{{.executableName}}
16+
chmod 0755 $RPM_BUILD_ROOT%{_datadir}/applications/{{.executableName}}.desktop
17+
18+
%files
19+
%{_bindir}/{{.executableName}}
20+
/usr/lib/{{.packageName}}/
21+
%{_datadir}/applications/{{.executableName}}.desktop

0 commit comments

Comments
 (0)