Added a 'clean' target to ./build.sh, removed old .nsi generation script.
This commit is contained in:
parent
b7171d2099
commit
08d6d86570
2 changed files with 49 additions and 100 deletions
|
|
@ -31,95 +31,6 @@ if [ $? -ne 0 ]; then exit 1; fi
|
|||
sha256sum.exe librewolf-$pkgver.en-US.win64.zip > librewolf-$pkgver.en-US.win64.zip.sha256sum
|
||||
if [ $? -ne 0 ]; then exit 1; fi
|
||||
|
||||
|
||||
|
||||
function generate_installer() {
|
||||
# generate the .nsi intaller file.
|
||||
cat >artifacts_win.nsi <<END
|
||||
#
|
||||
# Change these values to fit your application...
|
||||
#
|
||||
|
||||
!define APPNAME "LibreWolf" # Full app name, like: "Gtk+ 2.0 Hello World"
|
||||
!define PROGNAME "librewolf" # executable name, like: gtk2hello
|
||||
!define PROG_VERSION "${pkgver}" # the program version, like: 0.3.0
|
||||
!define ICON_NAME "librewolf.ico" # filename of icon to use for this app
|
||||
!define COMPANYNAME "LibreWolf" # Your name, or company (or just the program name)
|
||||
!define ESTIMATED_SIZE 190000 # Estimated size (in KB) of installed program for use in "add or remove programs" / 190 MB
|
||||
|
||||
#
|
||||
# The actual installer/uninstaller, you should not need to change much here below
|
||||
#
|
||||
|
||||
Name "\${PROGNAME}"
|
||||
OutFile "\${PROGNAME}-\${PROG_VERSION}.en-US.win64-setup.exe"
|
||||
InstallDir \$PROGRAMFILES64\\\${APPNAME}
|
||||
RequestExecutionLevel admin
|
||||
|
||||
Page directory
|
||||
Page instfiles
|
||||
|
||||
function .onInit
|
||||
setShellVarContext all
|
||||
functionEnd
|
||||
|
||||
Section "\${PROGNAME}"
|
||||
|
||||
# Copy files
|
||||
SetOutPath \$INSTDIR
|
||||
File /r librewolf\*.*
|
||||
|
||||
# Start Menu
|
||||
createDirectory "\$SMPROGRAMS\\\${COMPANYNAME}"
|
||||
createShortCut "\$SMPROGRAMS\\\${COMPANYNAME}\\\${APPNAME}.lnk" "\$INSTDIR\\\${PROGNAME}.exe" "" "\$INSTDIR\\\${ICON_NAME}"
|
||||
|
||||
# Uninstaller
|
||||
writeUninstaller "\$INSTDIR\uninstall.exe"
|
||||
|
||||
# Registry information for add/remove programs
|
||||
WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\\\${COMPANYNAME} \${APPNAME}" "DisplayName" "\${APPNAME}"
|
||||
WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\\\${COMPANYNAME} \${APPNAME}" "UninstallString" "\$\\"\$INSTDIR\uninstall.exe\$\\""
|
||||
WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\\\${COMPANYNAME} \${APPNAME}" "QuietUninstallString" "\$\\"\$INSTDIR\uninstall.exe\$\\" /S"
|
||||
WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\\\${COMPANYNAME} \${APPNAME}" "InstallLocation" "\$\\"\$INSTDIR\$\\""
|
||||
WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\\\${COMPANYNAME} \${APPNAME}" "DisplayIcon" "\$\\"\$INSTDIR\\\${ICON_NAME}$\\""
|
||||
WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\\\${COMPANYNAME} \${APPNAME}" "Publisher" "\${COMPANYNAME}"
|
||||
WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\\\${COMPANYNAME} \${APPNAME}" "DisplayVersion" "\${PROG_VERSION}"
|
||||
# There is no option for modifying or repairing the install
|
||||
WriteRegDWORD HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\\\${COMPANYNAME} \${APPNAME}" "NoModify" 1
|
||||
WriteRegDWORD HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\\\${COMPANYNAME} \${APPNAME}" "NoRepair" 1
|
||||
# Set the INSTALLSIZE constant (!defined at the top of this script) so Add/Remove Programs can accurately report the size
|
||||
WriteRegDWORD HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\\\${COMPANYNAME} \${APPNAME}" "EstimatedSize" \${ESTIMATED_SIZE}
|
||||
|
||||
SectionEnd
|
||||
|
||||
# Before uninstall, ask for confirmation
|
||||
function un.onInit
|
||||
SetShellVarContext all
|
||||
|
||||
#Verify the uninstaller - last chance to back out
|
||||
MessageBox MB_OKCANCEL "Permanantly remove \${APPNAME}?" IDOK next
|
||||
Abort
|
||||
next:
|
||||
functionEnd
|
||||
|
||||
# Uninstaller
|
||||
section "uninstall"
|
||||
|
||||
# Remove Start Menu launcher
|
||||
delete "\$SMPROGRAMS\\\${COMPANYNAME}\\\${APPNAME}.lnk"
|
||||
# Try to remove the Start Menu folder - this will only happen if it is empty
|
||||
rmDir "\$SMPROGRAMS\\\${COMPANYNAME}"
|
||||
|
||||
# Remove files
|
||||
rmDir /r \$INSTDIR
|
||||
|
||||
# Remove uninstaller information from the registry
|
||||
DeleteRegKey HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\\\${COMPANYNAME} \${APPNAME}"
|
||||
|
||||
sectionEnd
|
||||
END
|
||||
}
|
||||
|
||||
# now to try to make the installer.
|
||||
cp -v common/source_files/browser/branding/librewolf/firefox.ico librewolf/librewolf.ico
|
||||
|
||||
|
|
|
|||
60
build.sh
60
build.sh
|
|
@ -1,4 +1,4 @@
|
|||
#!/usr/bin/bash
|
||||
#!/bin/sh
|
||||
# build.sh - build librewolf on windows
|
||||
# derived from https://gitlab.com/librewolf-community/browser/linux/-/blob/master/PKGBUILD
|
||||
|
||||
|
|
@ -49,8 +49,33 @@ mach_env() {
|
|||
}
|
||||
|
||||
git_subs() {
|
||||
echo "git_subs: begin."
|
||||
git submodule update --recursive
|
||||
git submodule foreach git merge origin master
|
||||
echo "git_subs: done."
|
||||
}
|
||||
|
||||
clean() {
|
||||
echo "clean: begin."
|
||||
|
||||
echo "Deleting previous firefox-${pkgver} ..."
|
||||
rm -rf firefox-$pkgver
|
||||
|
||||
echo "Deleting other cruft ..."
|
||||
rm -rf librewolf
|
||||
rm -f firefox-$pkgver.source.tar.xz
|
||||
rm -f *.patch
|
||||
|
||||
# windows
|
||||
rm -f librewolf-$pkgver.en-US.win64.zip*
|
||||
rm -f librewolf-$pkgver.en-US.win64-setup.exe*
|
||||
rm -f tmp.nsi
|
||||
|
||||
# linux
|
||||
rm -f librewolf-$pkgver.en-US.deb.zip*
|
||||
rm -f librewolf-$pkgver.en-US.rpm.zip*
|
||||
|
||||
echo "clean: done."
|
||||
}
|
||||
|
||||
fetch() {
|
||||
|
|
@ -321,6 +346,10 @@ fi
|
|||
|
||||
done_something=0
|
||||
|
||||
if [[ "$*" == *clean* ]]; then
|
||||
clean
|
||||
done_something=1
|
||||
fi
|
||||
if [[ "$*" == *git_subs* ]]; then
|
||||
git_subs
|
||||
done_something=1
|
||||
|
|
@ -384,28 +413,37 @@ if (( done_something == 0 )); then
|
|||
cat <<EOF
|
||||
Use: ./build.sh fetch extract do_patches build package artifacts_win
|
||||
|
||||
git_subs - update git submodules
|
||||
fetch - fetch the tarball.
|
||||
extract - extract the tarball.
|
||||
do_patches - create a mozconfig, and patch the source.
|
||||
build - the actual build.
|
||||
artifacts_win - build the .zip and NSIS setup.exe installer.
|
||||
artifacts_win - apply .cfg, build the zip file and NSIS setup.exe installer.
|
||||
|
||||
Linux related functions:
|
||||
|
||||
mach_env - create mach build environment.
|
||||
rustup - perform a rustup for this user.
|
||||
deps_deb - install dependencies with apt.
|
||||
deps_rpm - install dependencies with dnf.
|
||||
deps_pkg - install dependencies with pkg.
|
||||
artifacts_deb - create a dist zip file (for debian10).
|
||||
artifacts_rpm - create a dist zip file (for fedora33).
|
||||
artifacts_deb - apply .cfg, create a dist zip file (for debian10).
|
||||
artifacts_rpm - apply .cfg, create a dist zip file (for fedora33).
|
||||
|
||||
If no parameters are given, it prints this help message.
|
||||
Generic utility functionality:
|
||||
|
||||
clean - remove generated cruft.
|
||||
git_subs - update git submodules.
|
||||
mach_env - create mach build environment.
|
||||
rustup - perform a rustup for this user.
|
||||
|
||||
Examples:
|
||||
|
||||
For windows, use:
|
||||
./build.sh fetch extract do_patches build artifacts_win
|
||||
|
||||
For debian, use:
|
||||
sudo ./build.sh deps_deb
|
||||
./build.sh rustup mach_env
|
||||
./build.sh fetch extract do_patches build artifacts_deb
|
||||
|
||||
For debian, use:
|
||||
$ sudo ./build.sh deps_deb
|
||||
$ ./build.sh rustup mach_env fetch extract do_patches build artifacts_deb
|
||||
EOF
|
||||
exit 1
|
||||
fi
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue