Closed doronbehar closed 1 year ago
FlatPak also uses a tarball, please check their repo. for example here: https://github.com/flathub/eu.betterbird.Betterbird/blob/master/apply-patches.sh
We also have a build from source script that works, see: https://github.com/Betterbird/thunderbird-patches/blob/main/build/build-one-off.sh
It's a little abandoned since we had trouble setting up the environment with ./mach bootstrap
.
I copy pasted some of their code and it seems that all betterbird patches fail to apply on my thunderbird source tarball :/ The flatpack URL and Nixpkgs' URL for the source tarball seem the same...
Here's an example for a reject:
--- toolkit/mozapps/installer/windows/nsis/makensis.mk
+++ toolkit/mozapps/installer/windows/nsis/makensis.mk
@@ -57,16 +57,18 @@ CUSTOM_UI = \
$(INSTALL) $(addprefix $(MOZILLA_DIR)/other-licenses/nsis/,$(CUSTOM_UI)) $(CONFIG_DIR)
cd $(CONFIG_DIR) && $(MAKENSISU) $(MAKENSISU_FLAGS) installer.nsi
ifdef MOZ_STUB_INSTALLER
cd $(CONFIG_DIR) && $(MAKENSISU) $(MAKENSISU_FLAGS) stub.nsi
endif
ifdef ZIP_IN
installer:: $(CONFIG_DIR)/setup.exe $(ZIP_IN)
+ @echo 'Signing.'
+ $(PYTHON3) $(topsrcdir)/browser/installer/windows/sign.py
@echo 'Packaging $(WIN32_INSTALLER_OUT).'
$(NSINSTALL) -D '$(ABS_DIST)/$(PKG_INST_PATH)'
$(PYTHON3) $(MOZILLA_DIR)/mach repackage installer \
-o '$(ABS_DIST)/$(PKG_INST_PATH)$(PKG_INST_BASENAME).exe' \
--package-name '$(MOZ_PKG_DIR)' \
--package '$(ZIP_IN)' \
--tag $(topsrcdir)/$(MOZ_BUILD_APP)/installer/windows/app.tag \
--setupexe $(CONFIG_DIR)/setup.exe \
I don't understand why it gets rejected, perhaps it's a tabs vs spaces issue? Nixpkgs' tarball has in that text file:
installer:: $(CONFIG_DIR)/setup.exe $(ZIP_IN)
@echo 'Packaging $(WIN32_INSTALLER_OUT).'
$(NSINSTALL) -D '$(ABS_DIST)/$(PKG_INST_PATH)'
$(PYTHON3) $(MOZILLA_DIR)/mach repackage installer \
-o '$(ABS_DIST)/$(PKG_INST_PATH)$(PKG_INST_BASENAME).exe' \
--package-name '$(MOZ_PKG_DIR)' \
--package '$(ZIP_IN)' \
That patch patches a Windows file, it has CRLF. No idea why the patches don't apply to the tarball source, they applied for us last we tried and also FlatPak doesn't appear to have an issue.
The patches have git format, we and FlatPak use git apply
, not patch
.
When applying patches manually with patch
, it never finds the files to
patch in our experience.
I think there is nothing we will action. That said, feel free to continue the discussion here.
That's so weird, I ran git init
and replaced patch
with git apply
and it worked... Thanks for the help anyway. Perhaps it'd be worth mentioning that flathub script for reference in the README. It was rather hard to construct it myself.
But we have our own script https://github.com/Betterbird/thunderbird-patches/blob/main/build/build-one-off.sh which also works, modulo the ./mach bootstrap
issue. It work perfectly fine on a machine which already has the right environment set up.
But we have our own script
main
/build/build-one-off.sh which also works, modulo the./mach bootstrap
issue. It work perfectly fine on a machine which already has the right environment set up.
That script indeed applies patches by reading the series files. Focusing the conversation on the README, that script is not discoverable.
On a side note, that script doesn't help us as is to compile betterbird on NixOS. Because our own build scripts take care of many Nix specific details which scripts such as this can't ever take care of. It still helps as a reference for the Nix user.
that script is not discoverable.
Fair enough, but it's in the build directory and everyone is invited to browser all the code. Anyway, case closed.
Hello,
This software looks promising. I'm looking into building and packaging this to NixOS. The way things are organized now are terrifically uncomfortable for us in Nixpkgs. We do have the ability comfortably add patches manually via a bash script in our build recipe. However, reading
./build.sh
, I'm not sure what is the recommended order of patches to use.What makes things uncomfortable for us now, is the reliance on mercurial, and the usage of
.hg/patches
. Here on Nixpkgs, we use a release source tarball of thunderbird. I'm also sure you'll agree with me, that getting this tarball is less expensive then cloning the source with mercurial, at least in terms of internet and disk usage.I tried to guess and emulate what these
series
files strive to do, with:Where
${betterbird-102-patches}
is the location of this repo's source.The issue is, that some patches fail to apply, and I'm using the git tag 102.9.1-bb32 of this source and
thunderbird 102.9.1.source.tar.xz
release By Mozilla.I have had two ideas which either might help me, and thus help any Nix user in the future:
Helping Nix will help users who experience difficulties with deployment / build support, if this will get into Nixpkgs eventually. Than, running betterbird will require (with Nix installed) only running a command similar to this:
EDIT
Full link to Nixpkgs' build recipe, with my betterbird addition:
https://github.com/NixOS/nixpkgs/blob/f8794dbfe2ebb4419a0facac1501c1dbb8531223/pkgs/applications/networking/mailreaders/thunderbird/packages.nix#L59-L97
And a print of the failing patch applying log:
``` qxwg5c5yazfm6gf-bash-5.2-p15/bin/sh"zf2kqzzs7f4hn60rjsp8i-source/102/branding/01-branding.patch copying patch /nix/store/am6skxi1f73zf2kqzzs7f4hn60rjsp8i-source/102/branding/02-branding.patch copying patch /nix/store/am6skxi1f73zf2kqzzs7f4hn60rjsp8i-source/102/branding/03-branding-mac.patch copying patch /nix/store/am6skxi1f73zf2kqzzs7f4hn60rjsp8i-source/102/branding/03-branding.patch copying patch /nix/store/am6skxi1f73zf2kqzzs7f4hn60rjsp8i-source/102/branding/04-branding.patch copying patch /nix/store/am6skxi1f73zf2kqzzs7f4hn60rjsp8i-source/102/branding/05-branding.patch copying patch /nix/store/am6skxi1f73zf2kqzzs7f4hn60rjsp8i-source/102/branding/06-branding.patch copying patch /nix/store/am6skxi1f73zf2kqzzs7f4hn60rjsp8i-source/102/branding/07-branding.patch copying patch /nix/store/am6skxi1f73zf2kqzzs7f4hn60rjsp8i-source/102/branding/08-branding-m-c.patch to thu nderbird's comm/ directorym6skxi1f73zf2kqzzs7f4hn60rjsp8i-source/102/branding/08a-branding-m-c.patch copying patch /nix/store/am6skxi1f73zf2kqzzs7f4hn60rjsp8i-source/102/branding/09-branding-m-c.patch to thu nderbird's comm/ directorym6skxi1f73zf2kqzzs7f4hn60rjsp8i-source/102/bugs/1455429-fix-drag-msg-to-folder-m ac.patchpatch /nix/store/am6skxi1f73zf2kqzzs7f4hn60rjsp8i-source/102/bugs/1528297-fix-pop3-delete-on-serve r.patch patch /nix/store/am6skxi1f73zf2kqzzs7f4hn60rjsp8i-source/102/bugs/1554188-close-databases-during-s earch.patchch /nix/store/am6skxi1f73zf2kqzzs7f4hn60rjsp8i-source/102/bugs/1554188-close-databases-during-s copying patch /nix/store/am6skxi1f73zf2kqzzs7f4hn60rjsp8i-source/102/bugs/1562737-body-search-encrypted.patch copying patch /nix/store/am6skxi1f73zf2kqzzs7f4hn60rjsp8i-source/102/bugs/1563452-serialise-shouldnt-break-attributes-m-c.patch to thunderbird's comm/ directory copying patch /nix/store/am6skxi1f73zf2kqzzs7f4hn60rjsp8i-source/102/bugs/1605305-origin-header-m-c.patch copying patch /nix/store/am6skxi1f73zf2kqzzs7f4hn60rjsp8i-source/102/bugs/1676825-save-composition.patch copying patch /nix/store/am6skxi1f73zf2kqzzs7f4hn60rjsp8i-source/102/bugs/1680425-dont-overwrite-subject.patch copying patch /nix/store/am6skxi1f73zf2kqzzs7f4hn60rjsp8i-source/102/bugs/1727874-show-tray-icon-always.patch copying patch /nix/store/am6skxi1f73zf2kqzzs7f4hn60rjsp8i-source/102/bugs/1728778-reestablish-movemail.patch copying patch /nix/store/am6skxi1f73zf2kqzzs7f4hn60rjsp8i-source/102/bugs/1729221-ignore_missing_mdc.patch copying patch /nix/store/am6skxi1f73zf2kqzzs7f4hn60rjsp8i-source/102/bugs/1737245-forward-charset-detect.patch copying patch /nix/store/am6skxi1f73zf2kqzzs7f4hn60rjsp8i-source/102/bugs/1739609-more-charset-issues.patch copying patch /nix/store/am6skxi1f73zf2kqzzs7f4hn60rjsp8i-source/102/bugs/1740956-detached-attachment-location.patch copying patch /nix/store/am6skxi1f73zf2kqzzs7f4hn60rjsp8i-source/102/bugs/1744709-save-double-click-download.patch copying patch /nix/store/am6skxi1f73zf2kqzzs7f4hn60rjsp8i-source/102/bugs/1745130-improve-imap-error-handling-part2.patch copying patch /nix/store/am6skxi1f73zf2kqzzs7f4hn60rjsp8i-source/102/bugs/1746749-get-feed-as-html.patch copying patch /nix/store/am6skxi1f73zf2kqzzs7f4hn60rjsp8i-source/102/bugs/1751160-news-folder-notify-alt.patch copying patch /nix/store/am6skxi1f73zf2kqzzs7f4hn60rjsp8i-source/102/bugs/1751160-news-folder-notify.patch copying patch /nix/store/am6skxi1f73zf2kqzzs7f4hn60rjsp8i-source/102/bugs/1760365-image-copy-no-filename.patch copying patch /nix/store/am6skxi1f73zf2kqzzs7f4hn60rjsp8i-source/102/bugs/1762043-fix-startup-incomplete.patch copying patch /nix/store/am6skxi1f73zf2kqzzs7f4hn60rjsp8i-source/102/bugs/1764842-threaded-view-reversal.patch copying patch /nix/store/am6skxi1f73zf2kqzzs7f4hn60rjsp8i-source/102/bugs/1766578-fix-null-status-text.patch copying patch /nix/store/am6skxi1f73zf2kqzzs7f4hn60rjsp8i-source/102/bugs/1773259-ROOT_CLIP_CHAIN-cbindgen-m-c.patch to thunderbird's comm/ directory copying patch /nix/store/am6skxi1f73zf2kqzzs7f4hn60rjsp8i-source/102/bugs/1775376-fix-dict-edit-draft.patch copying patch /nix/store/am6skxi1f73zf2kqzzs7f4hn60rjsp8i-source/102/bugs/1777788-fix-dialog-resizing-m-c.patch to thunderbird's comm/ directory copying patch /nix/store/am6skxi1f73zf2kqzzs7f4hn60rjsp8i-source/102/bugs/1777788-fix-dialog-size.patch copying patch /nix/store/am6skxi1f73zf2kqzzs7f4hn60rjsp8i-source/102/bugs/1782415-catch-errors-nntp.patch copying patch /nix/store/am6skxi1f73zf2kqzzs7f4hn60rjsp8i-source/102/bugs/1783001-dont-close-spellcheck-menu-2-m-c.patch to thunderbird's comm/ directory copying patch /nix/store/am6skxi1f73zf2kqzzs7f4hn60rjsp8i-source/102/bugs/1783001-dont-close-spellcheck-menu-m-c.patch to thunderbird's comm/ directory copying patch /nix/store/am6skxi1f73zf2kqzzs7f4hn60rjsp8i-source/102/bugs/1783517-password-dialogue-cancel.patch copying patch /nix/store/am6skxi1f73zf2kqzzs7f4hn60rjsp8i-source/102/bugs/1786162-dont-downgrade-when-size-present.patch copying patch /nix/store/am6skxi1f73zf2kqzzs7f4hn60rjsp8i-source/102/bugs/1790291-fix-drag-from-MPE.patch copying patch /nix/store/am6skxi1f73zf2kqzzs7f4hn60rjsp8i-source/102/bugs/1790619-send-progress-width.patch copying patch /nix/store/am6skxi1f73zf2kqzzs7f4hn60rjsp8i-source/102/bugs/1791130-fix-smime-slowness.patch copying patch /nix/store/am6skxi1f73zf2kqzzs7f4hn60rjsp8i-source/102/bugs/1793313-redownload-news-with-dot.patch copying patch /nix/store/am6skxi1f73zf2kqzzs7f4hn60rjsp8i-source/102/bugs/1794117-update-status-nntp.patch copying patch /nix/store/am6skxi1f73zf2kqzzs7f4hn60rjsp8i-source/102/bugs/1794180-release-notes-in-ext-browser.patch copying patch /nix/store/am6skxi1f73zf2kqzzs7f4hn60rjsp8i-source/102/bugs/1801286-await-quit-before-offline.patch copying patch /nix/store/am6skxi1f73zf2kqzzs7f4hn60rjsp8i-source/102/bugs/1802685-nntp-search-on-server.patch copying patch /nix/store/am6skxi1f73zf2kqzzs7f4hn60rjsp8i-source/102/bugs/1805558-fix-SMIME-signature-failures.patch copying patch /nix/store/am6skxi1f73zf2kqzzs7f4hn60rjsp8i-source/102/bugs/1812386-optimise-FindURLStart-End-after-backout-m-c.patch copying patch /nix/store/am6skxi1f73zf2kqzzs7f4hn60rjsp8i-source/102/bugs/1812386-optimise-FindURLStart-End-m-c.patch copying patch /nix/store/am6skxi1f73zf2kqzzs7f4hn60rjsp8i-source/102/bugs/1813346-fix-tree-subscribe.patch copying patch /nix/store/am6skxi1f73zf2kqzzs7f4hn60rjsp8i-source/102/bugs/1816343-command-line-file-url.patch copying patch /nix/store/am6skxi1f73zf2kqzzs7f4hn60rjsp8i-source/102/bugs/1820504-optimise-grapheme-m-c.patch to thunderbird's comm/ directory copying patch /nix/store/am6skxi1f73zf2kqzzs7f4hn60rjsp8i-source/102/bugs/1824624-progress-dialog-retry.patch copying patch /nix/store/am6skxi1f73zf2kqzzs7f4hn60rjsp8i-source/102/bugs/188988-Gloda-search-encrypted.patch copying patch /nix/store/am6skxi1f73zf2kqzzs7f4hn60rjsp8i-source/102/bugs/230684-insert-menu-plaintext.patch copying patch /nix/store/am6skxi1f73zf2kqzzs7f4hn60rjsp8i-source/102/bugs/297852-grouping-search-term-fluent.patch copying patch /nix/store/am6skxi1f73zf2kqzzs7f4hn60rjsp8i-source/102/bugs/297852-grouping-search-term.patch copying patch /nix/store/am6skxi1f73zf2kqzzs7f4hn60rjsp8i-source/102/bugs/350825-commas-detached-attachment.patch copying patch /nix/store/am6skxi1f73zf2kqzzs7f4hn60rjsp8i-source/102/bugs/359303-dont-replace-NBSP-m-c.patch to thunderbird's comm/ directory copying patch /nix/store/am6skxi1f73zf2kqzzs7f4hn60rjsp8i-source/102/bugs/532712-insert-NBSP-m-c.patch to thunderbird's comm/ directory copying patch /nix/store/am6skxi1f73zf2kqzzs7f4hn60rjsp8i-source/102/bugs/532712-insert-NBSP.patch copying patch /nix/store/am6skxi1f73zf2kqzzs7f4hn60rjsp8i-source/102/bugs/561328-clear-searching-status-when-messages-loaded.patch copying patch /nix/store/am6skxi1f73zf2kqzzs7f4hn60rjsp8i-source/102/bugs/589008-move-multiple-imap-folders.patch copying patch /nix/store/am6skxi1f73zf2kqzzs7f4hn60rjsp8i-source/102/bugs/668491-thread-selected-open-in-conv.patch copying patch /nix/store/am6skxi1f73zf2kqzzs7f4hn60rjsp8i-source/102/bugs/683809-QFB-untagged-fluent.patch copying patch /nix/store/am6skxi1f73zf2kqzzs7f4hn60rjsp8i-source/102/bugs/683809-QFB-untagged.patch copying patch /nix/store/am6skxi1f73zf2kqzzs7f4hn60rjsp8i-source/102/bugs/697031-make-thread-pane-address-display-configurable.patch copying patch /nix/store/am6skxi1f73zf2kqzzs7f4hn60rjsp8i-source/102/bugs/799040-fix-unread-in-ignored-thread.patch copying patch /nix/store/am6skxi1f73zf2kqzzs7f4hn60rjsp8i-source/102/bugs/backout-bug-1512647-1745113-ScanTXT-slow-m-c.patch copying patch /nix/store/am6skxi1f73zf2kqzzs7f4hn60rjsp8i-source/102/bugs/backout-bug-1730429-lost-style-m-c.patch to thunderbird's comm/ directory copying patch /nix/store/am6skxi1f73zf2kqzzs7f4hn60rjsp8i-source/102/bugs/backout-bug-1775093-temp-fix-for-missing-string.patch copying patch /nix/store/am6skxi1f73zf2kqzzs7f4hn60rjsp8i-source/102/features/01-feature-activity-manager-in-tab.patch copying patch /nix/store/am6skxi1f73zf2kqzzs7f4hn60rjsp8i-source/102/features/02-feature-Windows-systray-tooltip.patch copying patch /nix/store/am6skxi1f73zf2kqzzs7f4hn60rjsp8i-source/102/features/03-feature-biff-server.patch copying patch /nix/store/am6skxi1f73zf2kqzzs7f4hn60rjsp8i-source/102/features/04-feature-multiline-tree-all-off-m-c.patch to thunderbird's comm/ directory copying patch /nix/store/am6skxi1f73zf2kqzzs7f4hn60rjsp8i-source/102/features/04-feature-multiline-tree-all-off.patch copying patch /nix/store/am6skxi1f73zf2kqzzs7f4hn60rjsp8i-source/102/features/04-feature-multiline-tree-allow-grouping-m-c.patch to thunderbird's comm/ directory copying patch /nix/store/am6skxi1f73zf2kqzzs7f4hn60rjsp8i-source/102/features/04-feature-multiline-tree-allow-grouping.patch copying patch /nix/store/am6skxi1f73zf2kqzzs7f4hn60rjsp8i-source/102/features/04-feature-multiline-tree-allow-threading-m-c.patch to thunderbird's comm/ directory copying patch /nix/store/am6skxi1f73zf2kqzzs7f4hn60rjsp8i-source/102/features/04-feature-multiline-tree-allow-threading.patch copying patch /nix/store/am6skxi1f73zf2kqzzs7f4hn60rjsp8i-source/102/features/04-feature-multiline-tree-dummy-rows-css.patch copying patch /nix/store/am6skxi1f73zf2kqzzs7f4hn60rjsp8i-source/102/features/04-feature-multiline-tree-m-c.patch to thunderbird's comm/ directory copying patch /nix/store/am6skxi1f73zf2kqzzs7f4hn60rjsp8i-source/102/features/04-feature-multiline-tree.patch copying patch /nix/store/am6skxi1f73zf2kqzzs7f4hn60rjsp8i-source/102/features/05-feature-default-buttons.patch copying patch /nix/store/am6skxi1f73zf2kqzzs7f4hn60rjsp8i-source/102/features/07-feature-open-news-article-by-ID.patch copying patch /nix/store/am6skxi1f73zf2kqzzs7f4hn60rjsp8i-source/102/features/08-feature-startup-folder-fluent.patch copying patch /nix/store/am6skxi1f73zf2kqzzs7f4hn60rjsp8i-source/102/features/08-feature-startup-folder.patch copying patch /nix/store/am6skxi1f73zf2kqzzs7f4hn60rjsp8i-source/102/features/09-feature-attach-recent.patch copying patch /nix/store/am6skxi1f73zf2kqzzs7f4hn60rjsp8i-source/102/features/10-feature-more-chars-insert-char-symb.patch copying patch /nix/store/am6skxi1f73zf2kqzzs7f4hn60rjsp8i-source/102/features/11-feature-automatic-plain-or-html.patch copying patch /nix/store/am6skxi1f73zf2kqzzs7f4hn60rjsp8i-source/102/features/12-feature-linux-systray-betterbird.patch copying patch /nix/store/am6skxi1f73zf2kqzzs7f4hn60rjsp8i-source/102/features/12-feature-linux-systray-compile.patch copying patch /nix/store/am6skxi1f73zf2kqzzs7f4hn60rjsp8i-source/102/features/12-feature-linux-systray-example.patch copying patch /nix/store/am6skxi1f73zf2kqzzs7f4hn60rjsp8i-source/102/features/12-feature-linux-systray-no-root.patch copying patch /nix/store/am6skxi1f73zf2kqzzs7f4hn60rjsp8i-source/102/features/12-feature-linux-systray-tooltip.patch copying patch /nix/store/am6skxi1f73zf2kqzzs7f4hn60rjsp8i-source/102/features/12-feature-linux-systray.patch copying patch /nix/store/am6skxi1f73zf2kqzzs7f4hn60rjsp8i-source/102/features/13-feature-linux-minimise-to-tray.patch copying patch /nix/store/am6skxi1f73zf2kqzzs7f4hn60rjsp8i-source/102/features/14-feature-regexp-searchterm.patch copying patch /nix/store/am6skxi1f73zf2kqzzs7f4hn60rjsp8i-source/102/features/15-feature-short-date-entry.patch copying patch /nix/store/am6skxi1f73zf2kqzzs7f4hn60rjsp8i-source/102/features/16-feature-limit-plaintext-URL-ScanTXT-m-c.patch to thunderbird's comm/ directory copying patch /nix/store/am6skxi1f73zf2kqzzs7f4hn60rjsp8i-source/102/features/17-feature-improved-send-progress.patch copying patch /nix/store/am6skxi1f73zf2kqzzs7f4hn60rjsp8i-source/102/misc/01-misc-account-provisioner.patch copying patch /nix/store/am6skxi1f73zf2kqzzs7f4hn60rjsp8i-source/102/misc/02-misc-user-agent-string.patch copying patch /nix/store/am6skxi1f73zf2kqzzs7f4hn60rjsp8i-source/102/misc/03-misc-update-check.patch copying patch /nix/store/am6skxi1f73zf2kqzzs7f4hn60rjsp8i-source/102/misc/04-misc-missing-fluent-strings-m-c.patch to thunderbird's comm/ directory copying patch /nix/store/am6skxi1f73zf2kqzzs7f4hn60rjsp8i-source/102/misc/05-misc-no-langpack-download.patch copying patch /nix/store/am6skxi1f73zf2kqzzs7f4hn60rjsp8i-source/102/misc/06-misc-no-quirks-mode-message-m-c.patch to thunderbird's comm/ directory copying patch /nix/store/am6skxi1f73zf2kqzzs7f4hn60rjsp8i-source/102/misc/07-misc-details-notification-incompatible-link-m-c.patch to thunderbird's comm/ directory copying patch /nix/store/am6skxi1f73zf2kqzzs7f4hn60rjsp8i-source/102/misc/08-misc-disable-TB-langpacks-m-c.patch to thunderbird's comm/ directory copying patch /nix/store/am6skxi1f73zf2kqzzs7f4hn60rjsp8i-source/102/misc/08-misc-eoy-appeal-bb-url.patch copying patch /nix/store/am6skxi1f73zf2kqzzs7f4hn60rjsp8i-source/102/misc/99-misc-release-set-version.patch applying patch 08-branding-m-c.patch patching file sign.py can't find file to patch at input line 45 Perhaps you should have used the -p or --strip option? The text leading up to this was: -------------------------- |diff --git a/toolkit/mozapps/installer/windows/nsis/makensis.mk b/toolkit/mozapps/installer/windows/nsis/makensis.mk |--- a/toolkit/mozapps/installer/windows/nsis/makensis.mk |+++ b/toolkit/mozapps/installer/windows/nsis/makensis.mk -------------------------- File to patch: Skip this patch? [y] Skipping patch. 1 out of 1 hunk ignored ```