From ef270f9d73203c1b19c6163ce4d4257a52bfb605 Mon Sep 17 00:00:00 2001 From: Jack Hill Date: Tue, 2 Jan 2024 11:54:46 -0500 Subject: gnu: openssh: Fix build on ppc64le. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * gnu/packages/ssh.scm (openssh)[source]: Use 'openssh-gcc-13-ppc64le-fzero-call-used-regs.patch'. * gnu/packages/patches/openssh-gcc-13-ppc64le-fzero-call-used-regs.patch: New file. * gnu/local.mk (dist_patch_DATA): Add it. Reported-by: Marcel van der Boom . Change-Id: I41b1350b2cdd1487a8fd69b13b64f63c0dc166c9 Signed-off-by: Ludovic Courtès --- gnu/local.mk | 1 + 1 file changed, 1 insertion(+) (limited to 'gnu/local.mk') diff --git a/gnu/local.mk b/gnu/local.mk index bb78815a59..d2e2843372 100644 --- a/gnu/local.mk +++ b/gnu/local.mk @@ -1754,6 +1754,7 @@ dist_patch_DATA = \ %D%/packages/patches/openjdk-15-xcursor-no-dynamic.patch \ %D%/packages/patches/openjdk-21-fix-rpath.patch \ %D%/packages/patches/openmpi-mtl-priorities.patch \ + %D%/packages/patches/openssh-gcc-13-ppc64le-fzero-call-used-regs.patch \ %D%/packages/patches/openssh-trust-guix-store-directory.patch \ %D%/packages/patches/openresolv-restartcmd-guix.patch \ %D%/packages/patches/openrgb-unbundle-hueplusplus.patch \ -- cgit v1.2.3 From 65d021a95032bc2dff81c19158fe9eeeb46f89d4 Mon Sep 17 00:00:00 2001 From: Ricardo Wurmus Date: Thu, 11 Jan 2024 13:34:33 +0100 Subject: gnu: python-scikit-bio: Update to 0.5.9. * gnu/packages/bioinformatics.scm (python-scikit-bio): Update to 0.5.9. [source]: Add patch. [arguments]: Disable one test via #:test-flags; adjust 'compatibility phase; update 'check phase. [propagated-inputs]: Remove python-cachecontrol, python-lockfile, and python-scikit-learn; add python-requests. * gnu/packages/patches/python-scikit-bio-1887.patch: New file. * gnu/local.mk (dist_patch_DATA): Add it. Change-Id: Ie57b0256cf695e5ea088545cd2102335303a93e7 --- gnu/local.mk | 1 + gnu/packages/bioinformatics.scm | 39 +++----- gnu/packages/patches/python-scikit-bio-1887.patch | 109 ++++++++++++++++++++++ 3 files changed, 122 insertions(+), 27 deletions(-) create mode 100644 gnu/packages/patches/python-scikit-bio-1887.patch (limited to 'gnu/local.mk') diff --git a/gnu/local.mk b/gnu/local.mk index d2e2843372..ed4e82772e 100644 --- a/gnu/local.mk +++ b/gnu/local.mk @@ -1926,6 +1926,7 @@ dist_patch_DATA = \ %D%/packages/patches/python-robotframework-atest.patch \ %D%/packages/patches/python-robotframework-source-date-epoch.patch \ %D%/packages/patches/python-robotframework-sshlibrary-rf5-compat.patch \ + %D%/packages/patches/python-scikit-bio-1887.patch \ %D%/packages/patches/python-scikit-optimize-1148.patch \ %D%/packages/patches/python-scikit-optimize-1150.patch \ %D%/packages/patches/python-typing-inspect-fix.patch \ diff --git a/gnu/packages/bioinformatics.scm b/gnu/packages/bioinformatics.scm index c05ca19022..462dd54bc9 100644 --- a/gnu/packages/bioinformatics.scm +++ b/gnu/packages/bioinformatics.scm @@ -4732,58 +4732,43 @@ (define-public python-schema-salad (define-public python-scikit-bio (package (name "python-scikit-bio") - (version "0.5.7") + (version "0.5.9") (source (origin (method url-fetch) (uri (pypi-uri "scikit-bio" version)) (sha256 (base32 - "1a8xbp3vrw8wfpm3pa2nb4rcar0643iqnb043ifwqbqyc86clhv3")))) + "0429060pkyq1pm19zb2n1la7czh7b633mp4a4h01j8zfigf49q3s")) + (patches (search-patches "python-scikit-bio-1887.patch")))) (build-system pyproject-build-system) (arguments (list + ;; Accuracy problem + #:test-flags '(list "-k" "not test_fisher_alpha") #:phases '(modify-phases %standard-phases - ;; See https://github.com/biocore/scikit-bio/pull/1826 (add-after 'unpack 'compatibility (lambda _ - (substitute* "skbio/sequence/tests/test_sequence.py" - (("def test_concat_strict_many") - "def _do_not_test_concat_strict_many")) - (substitute* "skbio/stats/distance/_mantel.py" - (("from scipy.stats import PearsonRConstantInputWarning") - "from scipy.stats import ConstantInputWarning") - (("from scipy.stats import PearsonRNearConstantInputWarning") - "from scipy.stats import NearConstantInputWarning") - (("from scipy.stats import SpearmanRConstantInputWarning") "") - (("warnings.warn\\(PearsonRConstantInputWarning\\(\\)\\)") - "warnings.warn(ConstantInputWarning())") - (("warnings.warn\\(PearsonRNearConstantInputWarning\\(\\)\\)") - "warnings.warn(NearConstantInputWarning())") - (("warnings.warn\\(SpearmanRConstantInputWarning\\(\\)\\)") - "warnings.warn(ConstantInputWarning())")) - (substitute* "skbio/diversity/alpha/tests/test_base.py" - (("self.assertEqual\\(pielou_e") - "self.assertAlmostEqual(pielou_e")))) + (substitute* "skbio/diversity/__init__.py" + ((", numeric_only=True") "")))) (add-before 'check 'build-extensions (lambda _ ;; Cython extensions have to be built before running the tests. (invoke "python3" "setup.py" "build_ext" "--inplace"))) (replace 'check - (lambda* (#:key tests? #:allow-other-keys) - (when tests? (invoke "python3" "-m" "skbio.test"))))))) + (lambda* (#:key tests? test-flags #:allow-other-keys) + (when tests? + (apply invoke "python3" "-m" "skbio.test" test-flags))))))) (propagated-inputs - (list python-cachecontrol - python-decorator + (list python-decorator python-h5py python-hdmedians python-ipython - python-lockfile python-matplotlib python-natsort python-numpy python-pandas - python-scikit-learn + python-requests python-scipy)) (native-inputs (list python-coverage python-pytest)) diff --git a/gnu/packages/patches/python-scikit-bio-1887.patch b/gnu/packages/patches/python-scikit-bio-1887.patch new file mode 100644 index 0000000000..7ee7518128 --- /dev/null +++ b/gnu/packages/patches/python-scikit-bio-1887.patch @@ -0,0 +1,109 @@ +From 290da0472e3a0af01b242cd1d3dd6a24588db0e5 Mon Sep 17 00:00:00 2001 +From: qiyunzhu +Date: Sat, 4 Nov 2023 12:59:54 -0700 +Subject: [PATCH 1/2] removed kulsinski + +--- + CHANGELOG.md | 6 ++++++ + ci/aarch64.conda_requirements.txt | 2 +- + ci/conda_requirements.txt | 2 +- + setup.py | 2 +- + skbio/diversity/_driver.py | 2 -- + 5 files changed, 9 insertions(+), 5 deletions(-) + +diff --git a/CHANGELOG.md b/CHANGELOG.md +index 0ce69c2c6..cd9adea6c 100644 +--- a/CHANGELOG.md ++++ b/CHANGELOG.md +@@ -2,6 +2,12 @@ + + ## Version 0.5.10 + ++### Features ++* SciPy 1.11+ is now supported. ++ ++### Backward-incompatible changes [experimental] ++* Beta diversity metric `kulsinski` was removed. This was motivated by that SciPy replaced this distance metric with `kulczynski1` in version 1.11 (see SciPy issue [#2009](https://github.com/scipy/scipy/issues/2009)), and that both metrics do not return 0 on two identical vectors. ++ + ### Bug fixes + + * Re-enabled OpenMP support, which has been mistakenly disabled in 0.5.8 ([#1874](https://github.com/biocore/scikit-bio/pull/1874)) +diff --git a/ci/aarch64.conda_requirements.txt b/ci/aarch64.conda_requirements.txt +index a329bc666..3564f4c3c 100644 +--- a/ci/aarch64.conda_requirements.txt ++++ b/ci/aarch64.conda_requirements.txt +@@ -5,5 +5,5 @@ matplotlib >= 1.4.3 + natsort >= 4.0.3 + numpy >= 1.9.2 + pandas >= 1.5.0 +-scipy <= 1.10.1 ++scipy >= 1.9.0 + h5py >= 3.6.0 +diff --git a/ci/conda_requirements.txt b/ci/conda_requirements.txt +index 4402e4ebb..0f1bd715c 100644 +--- a/ci/conda_requirements.txt ++++ b/ci/conda_requirements.txt +@@ -5,6 +5,6 @@ matplotlib >= 1.4.3 + natsort >= 4.0.3 + numpy >= 1.9.2 + pandas >= 1.5.0 +-scipy <= 1.10.1 ++scipy >= 1.9.0 + h5py >= 3.6.0 + hdmedians >= 0.14.1 +diff --git a/setup.py b/setup.py +index 36600e427..fa4d5e0a7 100644 +--- a/setup.py ++++ b/setup.py +@@ -221,7 +221,7 @@ def check_bin(ccbin, source, allow_dash): + 'natsort >= 4.0.3', + 'numpy >= 1.9.2', + 'pandas >= 1.5.0', +- 'scipy <= 1.10.1', ++ 'scipy >= 1.9.0', + 'h5py >= 3.6.0', + 'hdmedians >= 0.14.1', + ], +diff --git a/skbio/diversity/_driver.py b/skbio/diversity/_driver.py +index 016020743..1a792efb6 100644 +--- a/skbio/diversity/_driver.py ++++ b/skbio/diversity/_driver.py +@@ -296,7 +296,6 @@ def partial_beta_diversity(metric, counts, ids, id_pairs, validate=True, + "dice", + "hamming", + "jaccard", +- "kulsinski", + "mahalanobis", + "manhattan", # aliases to "cityblock" in beta_diversity + "matching", +@@ -314,7 +313,6 @@ def partial_beta_diversity(metric, counts, ids, id_pairs, validate=True, + _qualitative_beta_metrics = [ + "dice", + "jaccard", +- "kulsinski", + "matching", + "rogerstanimoto", + "russellrao", + +From 9dd9c6dd68a015f1159f884c57878b8a00fad14c Mon Sep 17 00:00:00 2001 +From: Qiyun Zhu +Date: Tue, 7 Nov 2023 22:42:10 -0700 +Subject: [PATCH 2/2] fixing numpy exception + +--- + skbio/stats/tests/test_composition.py | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/skbio/stats/tests/test_composition.py b/skbio/stats/tests/test_composition.py +index 90921be5b..e720a594f 100644 +--- a/skbio/stats/tests/test_composition.py ++++ b/skbio/stats/tests/test_composition.py +@@ -1222,7 +1222,7 @@ def test_ancom_fail_alpha(self): + ancom(self.table1, self.cats1, alpha=1.1) + + def test_ancom_fail_multiple_groups(self): +- with self.assertRaises(TypeError): ++ with self.assertRaises((TypeError, np.AxisError)): + ancom(self.table4, self.cats4, + significance_test=scipy.stats.ttest_ind) + -- cgit v1.2.3 From b8085c9240d0202a759eaaae531b2c1b01bef035 Mon Sep 17 00:00:00 2001 From: Ricardo Wurmus Date: Tue, 16 Jan 2024 14:16:10 +0100 Subject: gnu: python-pyls-black: Fix build. * gnu/packages/patches/python-pyls-black-41.patch: New patch. * gnu/local.mk (dist_patch_DATA): Add it. * gnu/packages/python-xyz.scm (python-pyls-black)[source]: Add patch. [build-system]: Use pyproject-build-system. [arguments]: Disable one failing test. Change-Id: I14b2982644e58c0b43d76838febc6dfceb220b15 --- gnu/local.mk | 1 + gnu/packages/patches/python-pyls-black-41.patch | 45 +++++++++++++++++++++++++ gnu/packages/python-xyz.scm | 7 ++-- 3 files changed, 51 insertions(+), 2 deletions(-) create mode 100644 gnu/packages/patches/python-pyls-black-41.patch (limited to 'gnu/local.mk') diff --git a/gnu/local.mk b/gnu/local.mk index ed4e82772e..34bed91fc3 100644 --- a/gnu/local.mk +++ b/gnu/local.mk @@ -1796,6 +1796,7 @@ dist_patch_DATA = \ %D%/packages/patches/python-random2-getrandbits-test.patch \ %D%/packages/patches/python-poppler-qt5-fix-build.patch \ %D%/packages/patches/python-pyreadstat-link-libiconv.patch \ + %D%/packages/patches/python-pyls-black-41.patch \ %D%/packages/patches/python-pypdf-annotate-tests-appropriately.patch \ %D%/packages/patches/python-pytorch2-system-libraries.patch \ %D%/packages/patches/python-sip-include-dirs.patch \ diff --git a/gnu/packages/patches/python-pyls-black-41.patch b/gnu/packages/patches/python-pyls-black-41.patch new file mode 100644 index 0000000000..5a1ebd2f54 --- /dev/null +++ b/gnu/packages/patches/python-pyls-black-41.patch @@ -0,0 +1,45 @@ +From ada6a999e4f5cca21a2133e449f4576dbe9a64d2 Mon Sep 17 00:00:00 2001 +From: Isaac Dadzie <4581114+idadzie@users.noreply.github.com> +Date: Fri, 4 Feb 2022 21:18:37 +0000 +Subject: [PATCH] Add support for black 22.1.0 + +Make changes to support black 22.1.0, which changed the return type +of 'find_project_root' to a tuple. + +Resolves: #40 +--- + pyls_black/plugin.py | 8 +++++++- + setup.cfg | 2 +- + 2 files changed, 8 insertions(+), 2 deletions(-) + +diff --git a/pyls_black/plugin.py b/pyls_black/plugin.py +index dc5d482..e4f4d98 100644 +--- a/pyls_black/plugin.py ++++ b/pyls_black/plugin.py +@@ -73,7 +73,13 @@ def load_config(filename: str) -> Dict: + + root = black.find_project_root((filename,)) + +- pyproject_filename = root / "pyproject.toml" ++ # Note: find_project_root returns a tuple in 22.1.0+ ++ try: ++ # Keeping this to not break backward compatibility. ++ pyproject_filename = root / "pyproject.toml" ++ except TypeError: ++ _root, _ = root ++ pyproject_filename = _root / "pyproject.toml" + + if not pyproject_filename.is_file(): + return defaults +diff --git a/setup.cfg b/setup.cfg +index 036cec2..57fbe4f 100644 +--- a/setup.cfg ++++ b/setup.cfg +@@ -1,6 +1,6 @@ + [metadata] + name = pyls-black +-version = 0.4.7 ++version = 0.4.8 + author = Rupert Bedford + author_email = rupert@rupertb.com + description = Black plugin for the Python Language Server diff --git a/gnu/packages/python-xyz.scm b/gnu/packages/python-xyz.scm index a806166569..e486a73023 100644 --- a/gnu/packages/python-xyz.scm +++ b/gnu/packages/python-xyz.scm @@ -2666,6 +2666,7 @@ (define-public python-pyls-black (file-name (git-file-name name version)) (sha256 (base32 "0bkhfnlik89j3yamr20br4wm8975f20v33wabi2nyxvj10whr5dj")) + (patches (search-patches "python-pyls-black-41.patch")) ;; Patch to work with python-lsp-server. Taken from ;; . (modules '((guix build utils))) @@ -2681,9 +2682,11 @@ (define-public python-pyls-black "pylsp_format_range") (("from pyls([ \\.])" _ char) (string-append "from pylsp" char))))))) - (build-system python-build-system) + (build-system pyproject-build-system) (arguments - `(#:test-target "pytest")) + (list + #:test-flags + '(list "-k" "not test_load_config_target_version"))) (propagated-inputs (list python-black python-lsp-server python-tomli)) (native-inputs -- cgit v1.2.3 From 3e3975275bbab84d58f7740e9680b265769aa580 Mon Sep 17 00:00:00 2001 From: Herman Rimm Date: Thu, 18 Jan 2024 17:11:02 +0100 Subject: gnu: u-boot: Update to 2024.01. * gnu/packages/bootloaders.scm (u-boot): Update to 2024.01. [source]: Remove patman patch, add build-without-libcrypto patch. * gnu/packages/patches/u-boot-allow-disabling-openssl.patch: Remove upstreamed diffs. * gnu/packages/patches/u-boot-build-without-libcrypto.patch: Add file. * gnu/packages/patches/u-boot-patman-change-id.patch: Delete file. * gnu/local.mk (dist_patch_DATA): Add patch, remove patch. Change-Id: I5a21d4cd645449ff669f17cdabe5313870bec46f Signed-off-by: Vagrant Cascadian --- gnu/local.mk | 2 +- gnu/packages/bootloaders.scm | 12 +- .../patches/u-boot-allow-disabling-openssl.patch | 64 +----- .../patches/u-boot-build-without-libcrypto.patch | 123 +++++++++++ gnu/packages/patches/u-boot-patman-change-id.patch | 232 --------------------- 5 files changed, 134 insertions(+), 299 deletions(-) create mode 100644 gnu/packages/patches/u-boot-build-without-libcrypto.patch delete mode 100644 gnu/packages/patches/u-boot-patman-change-id.patch (limited to 'gnu/local.mk') diff --git a/gnu/local.mk b/gnu/local.mk index 34bed91fc3..96faa813c9 100644 --- a/gnu/local.mk +++ b/gnu/local.mk @@ -2096,8 +2096,8 @@ dist_patch_DATA = \ %D%/packages/patches/tuxpaint-stamps-path.patch \ %D%/packages/patches/twinkle-bcg729.patch \ %D%/packages/patches/u-boot-allow-disabling-openssl.patch \ + %D%/packages/patches/u-boot-build-without-libcrypto.patch \ %D%/packages/patches/u-boot-nintendo-nes-serial.patch \ - %D%/packages/patches/u-boot-patman-change-id.patch \ %D%/packages/patches/u-boot-rockchip-inno-usb.patch \ %D%/packages/patches/ucx-tcp-iface-ioctl.patch \ %D%/packages/patches/ultrastar-deluxe-no-freesans.patch \ diff --git a/gnu/packages/bootloaders.scm b/gnu/packages/bootloaders.scm index c73a0e665d..986f0ac035 100644 --- a/gnu/packages/bootloaders.scm +++ b/gnu/packages/bootloaders.scm @@ -716,22 +716,26 @@ (define %u-boot-allow-disabling-openssl-patch ;; https://lists.denx.de/pipermail/u-boot/2021-October/462728.html (search-patch "u-boot-allow-disabling-openssl.patch")) +(define %u-boot-build-without-libcrypto-patch + ;; Upstream commit to fix Amlogic builds in u-boot 2024.01. + (search-patch "u-boot-build-without-libcrypto.patch")) + (define u-boot (package (name "u-boot") - (version "2023.10") + (version "2024.01") (source (origin (patches (list %u-boot-rockchip-inno-usb-patch - %u-boot-allow-disabling-openssl-patch - (search-patch "u-boot-patman-change-id.patch"))) + %u-boot-build-without-libcrypto-patch + %u-boot-allow-disabling-openssl-patch)) (method url-fetch) (uri (string-append "https://ftp.denx.de/pub/u-boot/" "u-boot-" version ".tar.bz2")) (sha256 (base32 - "0039rravvjq9yi41645fynycw4c869px024xfc0n212f05pnq3p0")))) + "1czmpszalc6b8cj9j7q6cxcy19lnijv3916w3dag6yr3xpqi35mr")))) (build-system gnu-build-system) (native-inputs (list bison diff --git a/gnu/packages/patches/u-boot-allow-disabling-openssl.patch b/gnu/packages/patches/u-boot-allow-disabling-openssl.patch index 708ed81e93..9201f9a51d 100644 --- a/gnu/packages/patches/u-boot-allow-disabling-openssl.patch +++ b/gnu/packages/patches/u-boot-allow-disabling-openssl.patch @@ -8,7 +8,8 @@ This reverts commit b4f3cc2c42d97967a3a3c8796c340f6b07ecccac. Addendum 2022-12-08, Ricardo Wurmus: This patch has been updated to introduce CONFIG_FIT_PRELOAD to remove fit_pre_load_data, which depends on openssl. -Addendum 2023-10-17, Herman Rimm: Update patch for u-boot v2023.10. +Addendum 2024-01-18, Herman Rimm: Patch updated to leave out upstreamed +diffs with CONFIG_FIT_PRELOAD. diff --git a/tools/kwbimage.c b/tools/kwbimage.c index 4dce495ff0..976174ae77 100644 @@ -145,64 +146,3 @@ index 4dce495ff0..976174ae77 100644 /* Calculate and set the header checksum */ main_hdr->checksum = image_checksum8(main_hdr, headersz); ---- a/tools/image-host.c -+++ b/tools/image-host.c -@@ -14,8 +14,10 @@ - #include - #include - -+#ifdef CONFIG_FIT_PRELOAD - #include - #include -+#endif - - /** - * fit_set_hash_value - set hash value in requested has node -@@ -1119,6 +1121,7 @@ static int fit_config_add_verification_data(const char *keydir, - return 0; - } - -+#ifdef CONFIG_FIT_PRELOAD - /* - * 0) open file (open) - * 1) read certificate (PEM_read_X509) -@@ -1227,6 +1230,7 @@ int fit_pre_load_data(const char *keydir, void *keydest, void *fit) - out: - return ret; - } -+#endif - - int fit_cipher_data(const char *keydir, void *keydest, void *fit, - const char *comment, int require_keys, ---- a/tools/fit_image.c -+++ b/tools/fit_image.c -@@ -61,9 +61,10 @@ static int fit_add_file_data(struct image_tool_params *params, size_t size_inc, - ret = fit_set_timestamp(ptr, 0, time); - } - -+#ifdef CONFIG_FIT_PRELOAD - if (!ret) - ret = fit_pre_load_data(params->keydir, dest_blob, ptr); -- -+#endif - if (!ret) { - ret = fit_cipher_data(params->keydir, dest_blob, ptr, - params->comment, ---- a/include/image.h -+++ b/include/image.h -@@ -1182,6 +1182,7 @@ int fit_image_hash_get_value(const void *fit, int noffset, uint8_t **value, - - int fit_set_timestamp(void *fit, int noffset, time_t timestamp); - -+#ifdef CONFIG_FIT_PRELOAD - /** - * fit_pre_load_data() - add public key to fdt blob - * -@@ -1196,6 +1197,7 @@ int fit_set_timestamp(void *fit, int noffset, time_t timestamp); - * < 0, on failure - */ - int fit_pre_load_data(const char *keydir, void *keydest, void *fit); -+#endif - - int fit_cipher_data(const char *keydir, void *keydest, void *fit, - const char *comment, int require_keys, diff --git a/gnu/packages/patches/u-boot-build-without-libcrypto.patch b/gnu/packages/patches/u-boot-build-without-libcrypto.patch new file mode 100644 index 0000000000..d56588941c --- /dev/null +++ b/gnu/packages/patches/u-boot-build-without-libcrypto.patch @@ -0,0 +1,123 @@ +From 03e598263e3878b6f5d58f5525577903edadc644 Mon Sep 17 00:00:00 2001 +From: Paul-Erwan Rio +Date: Thu, 21 Dec 2023 08:26:11 +0100 +Subject: [PATCH] tools: fix build without LIBCRYPTO support + +Commit cb9faa6f98ae ("tools: Use a single target-independent config to +enable OpenSSL") introduced a target-independent configuration to build +crypto features in host tools. + +But since commit 2c21256b27d7 ("hash: Use Kconfig to enable hashing in +host tools and SPL") the build without OpenSSL is broken, due to FIT +signature/encryption features. Add missing conditional compilation +tokens to fix this. + +Signed-off-by: Paul-Erwan Rio +Tested-by: Alexander Dahl +Cc: Simon Glass +Reviewed-by: Tom Rini +Reviewed-by: Simon Glass +--- + include/image.h | 2 +- + tools/Kconfig | 1 + + tools/fit_image.c | 2 +- + tools/image-host.c | 4 ++++ + tools/mkimage.c | 5 +++-- + 5 files changed, 10 insertions(+), 4 deletions(-) + +diff --git a/include/image.h b/include/image.h +index 432ec927b1..21de70f0c9 100644 +--- a/include/image.h ++++ b/include/image.h +@@ -1465,7 +1465,7 @@ int calculate_hash(const void *data, int data_len, const char *algo, + * device + */ + #if defined(USE_HOSTCC) +-# if defined(CONFIG_FIT_SIGNATURE) ++# if CONFIG_IS_ENABLED(FIT_SIGNATURE) + # define IMAGE_ENABLE_SIGN 1 + # define FIT_IMAGE_ENABLE_VERIFY 1 + # include +diff --git a/tools/Kconfig b/tools/Kconfig +index f8632cd59d..f01ed783e6 100644 +--- a/tools/Kconfig ++++ b/tools/Kconfig +@@ -51,6 +51,7 @@ config TOOLS_FIT_RSASSA_PSS + Support the rsassa-pss signature scheme in the tools builds + + config TOOLS_FIT_SIGNATURE ++ depends on TOOLS_LIBCRYPTO + def_bool y + help + Enable signature verification of FIT uImages in the tools builds +diff --git a/tools/fit_image.c b/tools/fit_image.c +index 71e031c855..beef1fa86e 100644 +--- a/tools/fit_image.c ++++ b/tools/fit_image.c +@@ -61,7 +61,7 @@ static int fit_add_file_data(struct image_tool_params *params, size_t size_inc, + ret = fit_set_timestamp(ptr, 0, time); + } + +- if (!ret) ++ if (CONFIG_IS_ENABLED(FIT_SIGNATURE) && !ret) + ret = fit_pre_load_data(params->keydir, dest_blob, ptr); + + if (!ret) { +diff --git a/tools/image-host.c b/tools/image-host.c +index ca4950312f..90bc9f905f 100644 +--- a/tools/image-host.c ++++ b/tools/image-host.c +@@ -14,8 +14,10 @@ + #include + #include + ++#if CONFIG_IS_ENABLED(FIT_SIGNATURE) + #include + #include ++#endif + + /** + * fit_set_hash_value - set hash value in requested has node +@@ -1131,6 +1133,7 @@ static int fit_config_add_verification_data(const char *keydir, + return 0; + } + ++#if CONFIG_IS_ENABLED(FIT_SIGNATURE) + /* + * 0) open file (open) + * 1) read certificate (PEM_read_X509) +@@ -1239,6 +1242,7 @@ int fit_pre_load_data(const char *keydir, void *keydest, void *fit) + out: + return ret; + } ++#endif + + int fit_cipher_data(const char *keydir, void *keydest, void *fit, + const char *comment, int require_keys, +diff --git a/tools/mkimage.c b/tools/mkimage.c +index 6dfe3e1d42..ac62ebbde9 100644 +--- a/tools/mkimage.c ++++ b/tools/mkimage.c +@@ -115,7 +115,7 @@ static void usage(const char *msg) + " -B => align size in hex for FIT structure and header\n" + " -b => append the device tree binary to the FIT\n" + " -t => update the timestamp in the FIT\n"); +-#ifdef CONFIG_FIT_SIGNATURE ++#if CONFIG_IS_ENABLED(FIT_SIGNATURE) + fprintf(stderr, + "Signing / verified boot options: [-k keydir] [-K dtb] [ -c ] [-p addr] [-r] [-N engine]\n" + " -k => set directory containing private keys\n" +@@ -130,8 +130,9 @@ static void usage(const char *msg) + " -o => algorithm to use for signing\n"); + #else + fprintf(stderr, +- "Signing / verified boot not supported (CONFIG_FIT_SIGNATURE undefined)\n"); ++ "Signing / verified boot not supported (CONFIG_TOOLS_FIT_SIGNATURE undefined)\n"); + #endif ++ + fprintf(stderr, " %s -V ==> print version information and exit\n", + params.cmdname); + fprintf(stderr, "Use '-T list' to see a list of available image types\n"); +-- +2.41.0 + diff --git a/gnu/packages/patches/u-boot-patman-change-id.patch b/gnu/packages/patches/u-boot-patman-change-id.patch deleted file mode 100644 index 354aee2755..0000000000 --- a/gnu/packages/patches/u-boot-patman-change-id.patch +++ /dev/null @@ -1,232 +0,0 @@ -Upstream status: https://patchwork.ozlabs.org/project/uboot/patch/20231013030633.7191-1-maxim.cournoyer@gmail.com/ - -From f83a5e07b0934e38cbee923e0c5b7fc0a890926c Mon Sep 17 00:00:00 2001 -From: Maxim Cournoyer -Date: Thu, 12 Oct 2023 17:04:25 -0400 -Subject: [PATCH] patman: Add a 'keep_change_id' setting - -A Change-Id can be useful for traceability purposes, and some projects -may wish to have them preserved. This change makes it configurable -via a new 'keep_change_id' setting. - -Series-version: 2 -Series-changes: 2 -- Add missing argument to send parser ---- - tools/patman/__main__.py | 2 ++ - tools/patman/control.py | 12 +++++++++--- - tools/patman/patchstream.py | 17 ++++++++++++----- - tools/patman/patman.rst | 11 ++++++----- - tools/patman/test_checkpatch.py | 16 ++++++++++++++++ - 5 files changed, 45 insertions(+), 13 deletions(-) - -diff --git a/tools/patman/__main__.py b/tools/patman/__main__.py -index 8eba5d3486..197ac1aad1 100755 ---- a/tools/patman/__main__.py -+++ b/tools/patman/__main__.py -@@ -103,6 +103,8 @@ send.add_argument('--no-signoff', action='store_false', dest='add_signoff', - default=True, help="Don't add Signed-off-by to patches") - send.add_argument('--smtp-server', type=str, - help="Specify the SMTP server to 'git send-email'") -+send.add_argument('--keep-change-id', action='store_true', -+ help='Preserve Change-Id tags in patches to send.') - - send.add_argument('patchfiles', nargs='*') - -diff --git a/tools/patman/control.py b/tools/patman/control.py -index 916ddf8fcf..b292da9dc2 100644 ---- a/tools/patman/control.py -+++ b/tools/patman/control.py -@@ -16,11 +16,14 @@ from patman import gitutil - from patman import patchstream - from u_boot_pylib import terminal - -+ - def setup(): - """Do required setup before doing anything""" - gitutil.setup() - --def prepare_patches(col, branch, count, start, end, ignore_binary, signoff): -+ -+def prepare_patches(col, branch, count, start, end, ignore_binary, signoff, -+ keep_change_id=False): - """Figure out what patches to generate, then generate them - - The patch files are written to the current directory, e.g. 0001_xxx.patch -@@ -35,6 +38,7 @@ def prepare_patches(col, branch, count, start, end, ignore_binary, signoff): - end (int): End patch to use (0=last one in series, 1=one before that, - etc.) - ignore_binary (bool): Don't generate patches for binary files -+ keep_change_id (bool): Preserve the Change-Id tag. - - Returns: - Tuple: -@@ -59,11 +63,12 @@ def prepare_patches(col, branch, count, start, end, ignore_binary, signoff): - branch, start, to_do, ignore_binary, series, signoff) - - # Fix up the patch files to our liking, and insert the cover letter -- patchstream.fix_patches(series, patch_files) -+ patchstream.fix_patches(series, patch_files, keep_change_id) - if cover_fname and series.get('cover'): - patchstream.insert_cover_letter(cover_fname, series, to_do) - return series, cover_fname, patch_files - -+ - def check_patches(series, patch_files, run_checkpatch, verbose, use_tree): - """Run some checks on a set of patches - -@@ -166,7 +171,8 @@ def send(args): - col = terminal.Color() - series, cover_fname, patch_files = prepare_patches( - col, args.branch, args.count, args.start, args.end, -- args.ignore_binary, args.add_signoff) -+ args.ignore_binary, args.add_signoff, -+ keep_change_id=args.keep_change_id) - ok = check_patches(series, patch_files, args.check_patch, - args.verbose, args.check_patch_use_tree) - -diff --git a/tools/patman/patchstream.py b/tools/patman/patchstream.py -index f91669a940..e2e2a83e67 100644 ---- a/tools/patman/patchstream.py -+++ b/tools/patman/patchstream.py -@@ -68,6 +68,7 @@ STATE_PATCH_SUBJECT = 1 # In patch subject (first line of log for a commit) - STATE_PATCH_HEADER = 2 # In patch header (after the subject) - STATE_DIFFS = 3 # In the diff part (past --- line) - -+ - class PatchStream: - """Class for detecting/injecting tags in a patch or series of patches - -@@ -76,7 +77,7 @@ class PatchStream: - unwanted tags or inject additional ones. These correspond to the two - phases of processing. - """ -- def __init__(self, series, is_log=False): -+ def __init__(self, series, is_log=False, keep_change_id=False): - self.skip_blank = False # True to skip a single blank line - self.found_test = False # Found a TEST= line - self.lines_after_test = 0 # Number of lines found after TEST= -@@ -86,6 +87,7 @@ class PatchStream: - self.section = [] # The current section...END section - self.series = series # Info about the patch series - self.is_log = is_log # True if indent like git log -+ self.keep_change_id = keep_change_id # True to keep Change-Id tags - self.in_change = None # Name of the change list we are in - self.change_version = 0 # Non-zero if we are in a change list - self.change_lines = [] # Lines of the current change -@@ -452,6 +454,8 @@ class PatchStream: - - # Detect Change-Id tags - elif change_id_match: -+ if self.keep_change_id: -+ out = [line] - value = change_id_match.group(1) - if self.is_log: - if self.commit.change_id: -@@ -763,7 +767,7 @@ def get_metadata_for_test(text): - pst.finalise() - return series - --def fix_patch(backup_dir, fname, series, cmt): -+def fix_patch(backup_dir, fname, series, cmt, keep_change_id=False): - """Fix up a patch file, by adding/removing as required. - - We remove our tags from the patch file, insert changes lists, etc. -@@ -776,6 +780,7 @@ def fix_patch(backup_dir, fname, series, cmt): - fname (str): Filename to patch file to process - series (Series): Series information about this patch set - cmt (Commit): Commit object for this patch file -+ keep_change_id (bool): Keep the Change-Id tag. - - Return: - list: A list of errors, each str, or [] if all ok. -@@ -783,7 +788,7 @@ def fix_patch(backup_dir, fname, series, cmt): - handle, tmpname = tempfile.mkstemp() - outfd = os.fdopen(handle, 'w', encoding='utf-8') - infd = open(fname, 'r', encoding='utf-8') -- pst = PatchStream(series) -+ pst = PatchStream(series, keep_change_id=keep_change_id) - pst.commit = cmt - pst.process_stream(infd, outfd) - infd.close() -@@ -795,7 +800,7 @@ def fix_patch(backup_dir, fname, series, cmt): - shutil.move(tmpname, fname) - return cmt.warn - --def fix_patches(series, fnames): -+def fix_patches(series, fnames, keep_change_id=False): - """Fix up a list of patches identified by filenames - - The patch files are processed in place, and overwritten. -@@ -803,6 +808,7 @@ def fix_patches(series, fnames): - Args: - series (Series): The Series object - fnames (:type: list of str): List of patch files to process -+ keep_change_id (bool): Keep the Change-Id tag. - """ - # Current workflow creates patches, so we shouldn't need a backup - backup_dir = None #tempfile.mkdtemp('clean-patch') -@@ -811,7 +817,8 @@ def fix_patches(series, fnames): - cmt = series.commits[count] - cmt.patch = fname - cmt.count = count -- result = fix_patch(backup_dir, fname, series, cmt) -+ result = fix_patch(backup_dir, fname, series, cmt, -+ keep_change_id=keep_change_id) - if result: - print('%d warning%s for %s:' % - (len(result), 's' if len(result) > 1 else '', fname)) -diff --git a/tools/patman/patman.rst b/tools/patman/patman.rst -index 038b651ee8..a8b317eed6 100644 ---- a/tools/patman/patman.rst -+++ b/tools/patman/patman.rst -@@ -371,11 +371,12 @@ Series-process-log: sort, uniq - Separate each tag with a comma. - - Change-Id: -- This tag is stripped out but is used to generate the Message-Id -- of the emails that will be sent. When you keep the Change-Id the -- same you are asserting that this is a slightly different version -- (but logically the same patch) as other patches that have been -- sent out with the same Change-Id. -+ This tag is used to generate the Message-Id of the emails that -+ will be sent. When you keep the Change-Id the same you are -+ asserting that this is a slightly different version (but logically -+ the same patch) as other patches that have been sent out with the -+ same Change-Id. The Change-Id tag line is removed from outgoing -+ patches, unless the `keep_change_id` settings is set to `True`. - - Various other tags are silently removed, like these Chrome OS and - Gerrit tags:: -diff --git a/tools/patman/test_checkpatch.py b/tools/patman/test_checkpatch.py -index a8bb364e42..59a53ef8ca 100644 ---- a/tools/patman/test_checkpatch.py -+++ b/tools/patman/test_checkpatch.py -@@ -160,6 +160,22 @@ Signed-off-by: Simon Glass - - rc = os.system('diff -u %s %s' % (inname, expname)) - self.assertEqual(rc, 0) -+ os.remove(inname) -+ -+ # Test whether the keep_change_id settings works. -+ inhandle, inname = tempfile.mkstemp() -+ infd = os.fdopen(inhandle, 'w', encoding='utf-8') -+ infd.write(data) -+ infd.close() -+ -+ patchstream.fix_patch(None, inname, series.Series(), com, -+ keep_change_id=True) -+ -+ with open(inname, 'r') as f: -+ content = f.read() -+ self.assertIn( -+ 'Change-Id: I80fe1d0c0b7dd10aa58ce5bb1d9290b6664d5413', -+ content) - - os.remove(inname) - os.remove(expname) - -base-commit: f9a47ac8d97da2b3aaf463f268a9a872a8d921df --- -2.41.0 - -- cgit v1.2.3 From 33f12b7dcd41c3d1ba1bd1a6301c5512ac194cee Mon Sep 17 00:00:00 2001 From: Maxim Cournoyer Date: Fri, 19 Jan 2024 10:55:42 -0500 Subject: gnu/local.mk: Sort Emacs patches and fix 2044 year in copyright notice. * gnu/local.mk: Correct 2044 copyright year. (dist_patch_DATA): Sort emacs patches. Change-Id: Ib9669bb1d7fb2556d6d809d62624981fa66d27f3 --- gnu/local.mk | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'gnu/local.mk') diff --git a/gnu/local.mk b/gnu/local.mk index 96faa813c9..7b2be0f007 100644 --- a/gnu/local.mk +++ b/gnu/local.mk @@ -19,8 +19,8 @@ # Copyright © 2018 Amirouche Boubekki # Copyright © 2018, 2019, 2020, 2021, 2022 Oleg Pykhalov # Copyright © 2018 Stefan Stefanović -# Copyright © 2018, 2020, 2021, 2022, 2023 Maxim Cournoyer -# Copyright © 2019, 2020, 2021, 2022, 2044 Guillaume Le Vaillant +# Copyright © 2018, 2020, 2021, 2022, 2023, 2024 Maxim Cournoyer +# Copyright © 2019, 2020, 2021, 2022, 2024 Guillaume Le Vaillant # Copyright © 2019, 2020 John Soo # Copyright © 2019 Jonathan Brielmaier # Copyright © 2019 Evan Straw @@ -1113,25 +1113,25 @@ dist_patch_DATA = \ %D%/packages/patches/emacs-deferred-fix-number-of-arguments.patch \ %D%/packages/patches/emacs-elpy-dup-test-name.patch \ %D%/packages/patches/emacs-exec-path.patch \ - %D%/packages/patches/emacs-git-email-missing-parens.patch \ %D%/packages/patches/emacs-fix-scheme-indent-function.patch \ - %D%/packages/patches/emacs-json-reformat-fix-tests.patch \ + %D%/packages/patches/emacs-git-email-missing-parens.patch \ %D%/packages/patches/emacs-helpful-fix-tests.patch \ %D%/packages/patches/emacs-highlight-stages-add-gexp.patch \ + %D%/packages/patches/emacs-json-reformat-fix-tests.patch \ + %D%/packages/patches/emacs-kv-fix-tests.patch \ %D%/packages/patches/emacs-lispy-fix-thread-last-test.patch \ %D%/packages/patches/emacs-native-comp-driver-options.patch \ %D%/packages/patches/emacs-next-exec-path.patch \ %D%/packages/patches/emacs-next-native-comp-driver-options.patch \ %D%/packages/patches/emacs-pasp-mode-quote-file-names.patch \ + %D%/packages/patches/emacs-pgtk-super-key-fix.patch \ %D%/packages/patches/emacs-polymode-fix-lexical-variable-error.patch \ %D%/packages/patches/emacs-telega-path-placeholder.patch \ %D%/packages/patches/emacs-telega-test-env.patch \ %D%/packages/patches/emacs-wordnut-require-adaptive-wrap.patch \ + %D%/packages/patches/emacs-xelb-ignore-length-element.patch \ %D%/packages/patches/emacs-yasnippet-fix-empty-snippet-next.patch \ %D%/packages/patches/emacs-yasnippet-fix-tests.patch \ - %D%/packages/patches/emacs-kv-fix-tests.patch \ - %D%/packages/patches/emacs-pgtk-super-key-fix.patch \ - %D%/packages/patches/emacs-xelb-ignore-length-element.patch \ %D%/packages/patches/enblend-enfuse-reproducible.patch \ %D%/packages/patches/enjarify-setup-py.patch \ %D%/packages/patches/enlightenment-fix-setuid-path.patch \ -- cgit v1.2.3 From d6170e03e39075c3f781e790ab2f7c4caab25358 Mon Sep 17 00:00:00 2001 From: Maxim Cournoyer Date: Fri, 19 Jan 2024 14:15:35 -0500 Subject: gnu: emacs-shx: Fix test failure. * gnu/packages/patches/emacs-shx-byte-compilation-test.patch: New patch. * gnu/local.mk (dist_patch_DATA): Register it. * gnu/packages/emacs-xyz.scm (emacs-shx): Apply it. Change-Id: I6d8edd3b50f99f1c4cd495216caf9648dfee4ea3 --- gnu/local.mk | 1 + gnu/packages/emacs-xyz.scm | 5 +++- .../patches/emacs-shx-byte-compilation-test.patch | 35 ++++++++++++++++++++++ 3 files changed, 40 insertions(+), 1 deletion(-) create mode 100644 gnu/packages/patches/emacs-shx-byte-compilation-test.patch (limited to 'gnu/local.mk') diff --git a/gnu/local.mk b/gnu/local.mk index 7b2be0f007..3d1afd4555 100644 --- a/gnu/local.mk +++ b/gnu/local.mk @@ -1126,6 +1126,7 @@ dist_patch_DATA = \ %D%/packages/patches/emacs-pasp-mode-quote-file-names.patch \ %D%/packages/patches/emacs-pgtk-super-key-fix.patch \ %D%/packages/patches/emacs-polymode-fix-lexical-variable-error.patch \ + %D%/packages/patches/emacs-shx-byte-compilation-test.patch \ %D%/packages/patches/emacs-telega-path-placeholder.patch \ %D%/packages/patches/emacs-telega-test-env.patch \ %D%/packages/patches/emacs-wordnut-require-adaptive-wrap.patch \ diff --git a/gnu/packages/emacs-xyz.scm b/gnu/packages/emacs-xyz.scm index 7ab6015336..75aaafde21 100644 --- a/gnu/packages/emacs-xyz.scm +++ b/gnu/packages/emacs-xyz.scm @@ -8296,7 +8296,10 @@ (define-public emacs-shx (commit commit))) (file-name (git-file-name name version)) (sha256 - (base32 "1wkqnc5n8if8fsh7f3bdr5nzn6dbj1nzdxlmnz8nflmx4g32fp6v")))) + (base32 + "1wkqnc5n8if8fsh7f3bdr5nzn6dbj1nzdxlmnz8nflmx4g32fp6v")) + (patches + (search-patches "emacs-shx-byte-compilation-test.patch")))) (build-system emacs-build-system) (arguments (list diff --git a/gnu/packages/patches/emacs-shx-byte-compilation-test.patch b/gnu/packages/patches/emacs-shx-byte-compilation-test.patch new file mode 100644 index 0000000000..b0f4714a6c --- /dev/null +++ b/gnu/packages/patches/emacs-shx-byte-compilation-test.patch @@ -0,0 +1,35 @@ +From 6e8cb6f2175cd5c108de615a970a27877adfaea0 Mon Sep 17 00:00:00 2001 +From: Maxim Cournoyer +Date: Fri, 19 Jan 2024 10:49:51 -0500 +Subject: [PATCH] tests: Fix byte-compilation test. + +* test/shx-test.el (shx-test-unit-byte-compile): Simply assert on the +return value of byte-compile-file, which is non-nil when there are no +errors. + +Fixes: +--- + test/shx-test.el | 4 +--- + 1 file changed, 1 insertion(+), 3 deletions(-) + +diff --git a/test/shx-test.el b/test/shx-test.el +index e18cefb..ed5aee3 100644 +--- a/test/shx-test.el ++++ b/test/shx-test.el +@@ -83,10 +83,8 @@ Example: + "Test byte-compilation against the shx.el file." + (ignore-errors (kill-buffer "*Compile-Log*")) + (let ((file (replace-regexp-in-string ".elc$" ".el" (symbol-file 'shx-mode)))) +- (byte-compile-file file) + (shx-test-assert "shx.el passes byte-compilation" +- (with-current-buffer (get-buffer-create "*Compile-Log*") +- (<= (- (point-max) (point)) 3))))) ++ (byte-compile-file file)))) + + (defun shx-test-unit-declare-function () + "Test `declare-function'." + +base-commit: b99d16f36bc278d668d8428c4bc9af77064c336a +-- +2.41.0 + -- cgit v1.2.3 From 9b65b60b976c215ccf4e619c90b90e907ff82bf4 Mon Sep 17 00:00:00 2001 From: Nicolas Goaziou Date: Mon, 22 Jan 2024 09:32:57 +0100 Subject: gnu: notmuch: Update to 0.38.2. * gnu/packages/mail.scm (notmuch): Update to 0.38.2. * gnu/packages/patches/notmuch-emacs-test-output.patch: Delete file. * gnu/local.mk (dist_patch_DATA): Apply file deletion. Change-Id: I60d0487f2258ed5ef8602de7a624686c5f012a4f --- gnu/local.mk | 1 - gnu/packages/mail.scm | 7 +- .../patches/notmuch-emacs-test-output.patch | 89 ---------------------- 3 files changed, 2 insertions(+), 95 deletions(-) delete mode 100644 gnu/packages/patches/notmuch-emacs-test-output.patch (limited to 'gnu/local.mk') diff --git a/gnu/local.mk b/gnu/local.mk index 3d1afd4555..b8f3da7591 100644 --- a/gnu/local.mk +++ b/gnu/local.mk @@ -1713,7 +1713,6 @@ dist_patch_DATA = \ %D%/packages/patches/network-manager-meson.patch \ %D%/packages/patches/nginx-socket-cloexec.patch \ %D%/packages/patches/nnpack-system-libraries.patch \ - %D%/packages/patches/notmuch-emacs-test-output.patch \ %D%/packages/patches/nsis-env-passthru.patch \ %D%/packages/patches/nss-getcwd-nonnull.patch \ %D%/packages/patches/nss-increase-test-timeout.patch \ diff --git a/gnu/packages/mail.scm b/gnu/packages/mail.scm index 4466e5e6d9..4fe3673a72 100644 --- a/gnu/packages/mail.scm +++ b/gnu/packages/mail.scm @@ -1373,17 +1373,14 @@ (define-public notifymuch (define-public notmuch (package (name "notmuch") - (version "0.37") + (version "0.38.2") (source (origin (method url-fetch) (uri (string-append "https://notmuchmail.org/releases/notmuch-" version ".tar.xz")) (sha256 - (base32 "1xl64xh0ijfkx265lcj9cqv1wkzha8gsn9jn4fw4xgvqigr6sxhf")) - (patches - ;; Output for some tests varies slightly in Emacs 29. - (search-patches "notmuch-emacs-test-output.patch")))) + (base32 "0zll3s39s065pl9228xpklkjklllkyb3bf1szh0fw0rbfkjfp0jj")))) (build-system gnu-build-system) (arguments (list diff --git a/gnu/packages/patches/notmuch-emacs-test-output.patch b/gnu/packages/patches/notmuch-emacs-test-output.patch deleted file mode 100644 index 3c6d472d6b..0000000000 --- a/gnu/packages/patches/notmuch-emacs-test-output.patch +++ /dev/null @@ -1,89 +0,0 @@ -From e9e779ead4d703ad423e46c23abd0c9afd7d5ed2 Mon Sep 17 00:00:00 2001 -From: Arjan Adriaanse -Date: Tue, 15 Aug 2023 00:00:05 +0200 -Subject: [PATCH] test: fix expected output for Emacs 29 - ---- - test/T453-emacs-reply.sh | 1 - - test/T454-emacs-dont-reply-names.sh | 9 +++------ - .../notmuch-reply-duplicate-4 | 1 - - 3 files changed, 3 insertions(+), 8 deletions(-) - -diff --git a/test/T453-emacs-reply.sh b/test/T453-emacs-reply.sh -index 0a27d066..de400b85 100755 ---- a/test/T453-emacs-reply.sh -+++ b/test/T453-emacs-reply.sh -@@ -17,7 +17,6 @@ cat < EXPECTED - From: Notmuch Test Suite - To: Antoine Beaupré - Subject: Re: bug: "no top level messages" crash on Zen email loops --In-Reply-To: <874llc2bkp.fsf@curie.anarc.at> - Fcc: MAIL_DIR/sent - --text follows this line-- - Antoine Beaupré writes: -diff --git a/test/T454-emacs-dont-reply-names.sh b/test/T454-emacs-dont-reply-names.sh -index 3a770177..9ed4f18b 100755 ---- a/test/T454-emacs-dont-reply-names.sh -+++ b/test/T454-emacs-dont-reply-names.sh -@@ -17,13 +17,12 @@ test_emacs '(let ((message-dont-reply-to-names "notmuchmail\\|noreply\\|harvard" - (test-visible-output "OUTPUT-FULL.raw"))' - - notmuch_dir_sanitize < OUTPUT-FULL.raw > OUTPUT-FULL --head -6 OUTPUT-FULL > OUTPUT -+head -5 OUTPUT-FULL > OUTPUT - - cat < EXPECTED - From: Notmuch Test Suite - To: Mikhail Gusarov - Subject: Re: [notmuch] Working with Maildir storage? --In-Reply-To: <20091117203301.GV3165@dottiness.seas.harvard.edu> - Fcc: MAIL_DIR/sent - --text follows this line-- - EOF -@@ -38,14 +37,13 @@ test_emacs '(let ((message-dont-reply-to-names - (test-visible-output "OUTPUT-FULL-PRED.raw"))' - - notmuch_dir_sanitize < OUTPUT-FULL-PRED.raw > OUTPUT-FULL-PRED --head -7 OUTPUT-FULL-PRED > OUTPUT-PRED -+head -6 OUTPUT-FULL-PRED > OUTPUT-PRED - - cat < EXPECTED-PRED - From: Notmuch Test Suite - To: Lars Kellogg-Stedman - Cc: notmuch@notmuchmail.org - Subject: Re: [notmuch] Working with Maildir storage? --In-Reply-To: <20091117203301.GV3165@dottiness.seas.harvard.edu> - Fcc: MAIL_DIR/sent - --text follows this line-- - EOF -@@ -59,14 +57,13 @@ test_emacs '(let ((message-dont-reply-to-names nil)) - (test-visible-output "OUTPUT-FULL-NIL.raw"))' - - notmuch_dir_sanitize < OUTPUT-FULL-NIL.raw > OUTPUT-FULL-NIL --head -7 OUTPUT-FULL-NIL > OUTPUT-NIL -+head -6 OUTPUT-FULL-NIL > OUTPUT-NIL - - cat < EXPECTED-NIL - From: Notmuch Test Suite - To: Lars Kellogg-Stedman , Mikhail Gusarov - Cc: notmuch@notmuchmail.org - Subject: Re: [notmuch] Working with Maildir storage? --In-Reply-To: <20091117203301.GV3165@dottiness.seas.harvard.edu> - Fcc: MAIL_DIR/sent - --text follows this line-- - EOF -diff --git a/test/emacs-reply.expected-output/notmuch-reply-duplicate-4 b/test/emacs-reply.expected-output/notmuch-reply-duplicate-4 -index 836f77b1..44b8c7a6 100644 ---- a/test/emacs-reply.expected-output/notmuch-reply-duplicate-4 -+++ b/test/emacs-reply.expected-output/notmuch-reply-duplicate-4 -@@ -1,7 +1,6 @@ - From: Notmuch Test Suite - To: Sean Whitton , 916811@bugs.debian.org, 916805@bugs.debian.org, 916807@bugs.debian.org, 916808@bugs.debian.org, 916809@bugs.debian.org, 916811@bugs.debian.org, 916867@bugs.debian.org, 916869@bugs.debian.org, 916872@bugs.debian.org, 916875@bugs.debian.org, 916876@bugs.debian.org - Subject: Re: [Pkg-emacsen-addons] Bug#916811: Increase severity to 'serious' --In-Reply-To: <87r2ecrr6x.fsf@zephyr.silentflame.com> - Fcc: MAIL_DIR/sent - --text follows this line-- - Sean Whitton writes: --- -2.41.0 - -- cgit v1.2.3 From e479920cfd4208407d10939881a438f19ef289f7 Mon Sep 17 00:00:00 2001 From: Maxim Cournoyer Date: Wed, 24 Jan 2024 09:50:41 -0500 Subject: gnu: emacs-yasnippet: Update to 0.14.0-0.297546f. * gnu/packages/emacs-xyz.scm (emacs-yasnippet): Update to 0.14.0-0.297546f. Remove fix-tests patch. * gnu/packages/patches/emacs-yasnippet-fix-tests.patch: Delete file. * gnu/local.mk (dist_patch_DATA): De-register it. Change-Id: I3fda2bb3d879d88f06f9d814b6c8d835d9eafc9f --- gnu/local.mk | 1 - gnu/packages/emacs-xyz.scm | 65 +++++------ .../patches/emacs-yasnippet-fix-tests.patch | 127 --------------------- 3 files changed, 33 insertions(+), 160 deletions(-) delete mode 100644 gnu/packages/patches/emacs-yasnippet-fix-tests.patch (limited to 'gnu/local.mk') diff --git a/gnu/local.mk b/gnu/local.mk index b8f3da7591..c20e93390d 100644 --- a/gnu/local.mk +++ b/gnu/local.mk @@ -1132,7 +1132,6 @@ dist_patch_DATA = \ %D%/packages/patches/emacs-wordnut-require-adaptive-wrap.patch \ %D%/packages/patches/emacs-xelb-ignore-length-element.patch \ %D%/packages/patches/emacs-yasnippet-fix-empty-snippet-next.patch \ - %D%/packages/patches/emacs-yasnippet-fix-tests.patch \ %D%/packages/patches/enblend-enfuse-reproducible.patch \ %D%/packages/patches/enjarify-setup-py.patch \ %D%/packages/patches/enlightenment-fix-setuid-path.patch \ diff --git a/gnu/packages/emacs-xyz.scm b/gnu/packages/emacs-xyz.scm index ad8c72e97d..7d3e2dc17e 100644 --- a/gnu/packages/emacs-xyz.scm +++ b/gnu/packages/emacs-xyz.scm @@ -17919,39 +17919,40 @@ (define-public emacs-tempel-collection (license license:gpl3+)))) (define-public emacs-yasnippet - (package - (name "emacs-yasnippet") - (version "0.14.0") - (source - (origin - (method git-fetch) - (uri (git-reference - (url "https://github.com/joaotavora/yasnippet") - (commit version))) - (file-name (git-file-name name version)) - (sha256 - (base32 "0via9dzw8m5lzymg1h78xkwjssh39zr3g6ccyamlf1rjzjsyxknv")) - (patches - (search-patches "emacs-yasnippet-fix-empty-snippet-next.patch" - "emacs-yasnippet-fix-tests.patch")))) - (build-system emacs-build-system) - (arguments - `(#:tests? #t - #:test-command '("emacs" "--batch" - "-l" "yasnippet-tests.el" - "-f" "ert-run-tests-batch-and-exit") - #:phases - (modify-phases %standard-phases - ;; Set HOME, otherwise test-rebindings fails. - (add-before 'check 'set-home - (lambda _ - (setenv "HOME" (getcwd)) - #t))))) - (home-page "https://github.com/joaotavora/yasnippet") - (synopsis "Yet another snippet extension for Emacs") - (description "YASnippet is a template system for Emacs. It allows you to + ;; The latest release is more than 5 years old, has test problems. + (let ((revision "0") + (commit "297546f0853a6a51f5b05e954d0c6aea8caa5ec2")) + (package + (name "emacs-yasnippet") + (version (git-version "0.14.0" revision commit)) + (source + (origin + (method git-fetch) + (uri (git-reference + (url "https://github.com/joaotavora/yasnippet") + (commit commit))) + (file-name (git-file-name name version)) + (sha256 + (base32 "0b1fdigwjshfim6zyzkn2wa6k8xd4qlafrf7zgj5bsx6alrzac8v")) + (patches + (search-patches "emacs-yasnippet-fix-empty-snippet-next.patch")))) + (build-system emacs-build-system) + (arguments + `(#:tests? #t + #:test-command '("emacs" "--batch" + "-l" "yasnippet-tests.el" + "-f" "ert-run-tests-batch-and-exit") + #:phases + (modify-phases %standard-phases + ;; Set HOME, otherwise test-rebindings fails. + (add-before 'check 'set-home + (lambda _ + (setenv "HOME" (getcwd))))))) + (home-page "https://github.com/joaotavora/yasnippet") + (synopsis "Yet another snippet extension for Emacs") + (description "YASnippet is a template system for Emacs. It allows you to type an abbreviation and automatically expand it into function templates.") - (license license:gpl3+))) + (license license:gpl3+)))) (define-public emacs-yasnippet-snippets (package diff --git a/gnu/packages/patches/emacs-yasnippet-fix-tests.patch b/gnu/packages/patches/emacs-yasnippet-fix-tests.patch deleted file mode 100644 index 5995b0afa4..0000000000 --- a/gnu/packages/patches/emacs-yasnippet-fix-tests.patch +++ /dev/null @@ -1,127 +0,0 @@ -From 904a058fcf4e1f4985e03f8551eec282ca12ccb5 Mon Sep 17 00:00:00 2001 -From: Philipp Stephani -Date: Mon, 6 Dec 2021 18:50:10 +0100 -Subject: [PATCH] Unbreak unit tests under Emacs 28. -MIME-Version: 1.0 -Content-Type: text/plain; charset=UTF-8 -Content-Transfer-Encoding: 8bit - -- Emacs 28 has a new mode ‘lisp-data-mode’ for Lisp data. -- A test that was temporarily broken passes again. -- The default for ‘org-adapt-indentation’ has changed. -- buffer-list may be called with arguments when native-comp is enabled. - -2023-08-19 Liliana Marie Prikler - - * delete-numberless-inner-snippet-issue-562: Correct value in - looking-at. ---- - yasnippet-tests.el | 45 ++++++++++++++++++++++++++++----------------- - 1 file changed, 28 insertions(+), 17 deletions(-) - -diff --git a/yasnippet-tests.el b/yasnippet-tests.el -index f7ca2bb..7618ab7 100644 ---- a/yasnippet-tests.el -+++ b/yasnippet-tests.el -@@ -1,6 +1,6 @@ - ;;; yasnippet-tests.el --- some yasnippet tests -*- lexical-binding: t -*- - --;; Copyright (C) 2012-2015, 2017-2018 Free Software Foundation, Inc. -+;; Copyright (C) 2012-2015, 2017-2018, 2021 Free Software Foundation, Inc. - - ;; Author: João Távora - ;; Keywords: emulations, convenience -@@ -289,7 +289,7 @@ attention to case differences." - (should (looking-at "testblable")) - (ert-simulate-command '(yas-next-field-or-maybe-expand)) - (ert-simulate-command '(yas-skip-and-clear-field)) -- (should (looking-at "ble")) -+ (should (looking-at "blable")) - (should (null (yas-active-snippets))))) - - (ert-deftest delete-nested-simple-field-issue-824 () -@@ -556,16 +556,19 @@ XXXXX ------------------------")))) - (yas-mock-insert "foo bar") - (ert-simulate-command '(yas-next-field)) - (goto-char (point-min)) -- (let ((expected (with-temp-buffer -- (insert (format (concat "* Test foo bar\n" -- " " org-property-format "\n" -- " " org-property-format "\n" -- " " org-property-format) -- ":PROPERTIES:" "" -- ":ID:" "foo bar-after" -- ":END:" "")) -- (delete-trailing-whitespace) -- (buffer-string)))) -+ ;; The default value of `org-adapt-indentation' changed between Org-mode 9.4 -+ ;; and 9.5, so force a specific value. -+ (let* ((org-adapt-indentation nil) -+ (expected (with-temp-buffer -+ (insert (format (concat "* Test foo bar\n" -+ org-property-format "\n" -+ org-property-format "\n" -+ org-property-format) -+ ":PROPERTIES:" "" -+ ":ID:" "foo bar-after" -+ ":END:" "")) -+ (delete-trailing-whitespace) -+ (buffer-string)))) - ;; Some org-mode versions leave trailing whitespace, some don't. - (delete-trailing-whitespace) - (should (equal expected (buffer-string)))))) -@@ -1195,11 +1198,11 @@ hello ${1:$(when (stringp yas-text) (funcall func yas-text))} foo${1:$$(concat \ - (let ((saved-sym (make-symbol "yas--buffer-list"))) - `(let ((,saved-sym (symbol-function 'buffer-list))) - (cl-letf (((symbol-function 'buffer-list) -- (lambda () -+ (lambda (&rest args) - (cl-remove-if (lambda (buf) - (with-current-buffer buf - (eq major-mode 'lisp-interaction-mode))) -- (funcall ,saved-sym))))) -+ (funcall ,saved-sym args))))) - ,@body)))) - - -@@ -1356,7 +1359,9 @@ hello ${1:$(when (stringp yas-text) (funcall func yas-text))} foo${1:$$(concat \ - ,@(if (fboundp 'prog-mode) - '(prog-mode)) - emacs-lisp-mode -- lisp-interaction-mode)) -+ lisp-interaction-mode -+ ;; `lisp-data-mode' doesn't exist prior to Emacs 28. -+ ,@(and (fboundp 'lisp-data-mode) '(lisp-data-mode)))) - (observed (yas--modes-to-activate))) - (should (equal major-mode (car observed))) - (should (equal (sort expected #'string<) (sort observed #'string<)))))))) -@@ -1384,7 +1389,11 @@ hello ${1:$(when (stringp yas-text) (funcall func yas-text))} foo${1:$$(concat \ - '(prog-mode)) - emacs-lisp-mode - and-also-this-one -- lisp-interaction-mode)) -+ lisp-interaction-mode -+ ;; `lisp-data-mode' doesn't exist prior to -+ ;; Emacs 28. -+ ,@(and (fboundp 'lisp-data-mode) -+ '(lisp-data-mode)))) - (observed (yas--modes-to-activate))) - (should (equal expected-first - (cl-subseq observed 0 (length expected-first)))) -@@ -1657,9 +1666,11 @@ TODO: be meaner" - "Test expansion of snippets in org source blocks." - ;; org 9+ no longer runs fontification for text-mode, so our hacks - ;; don't work. Note that old ert doesn't have skipping, so we have -- ;; to expect failure instead. -+ ;; to expect failure instead. Starting with Org-mode 9.5 this seems -+ ;; to work again. - :expected-result (if (and (fboundp 'org-in-src-block-p) -- (version< (org-version) "9")) -+ (or (version< (org-version) "9") -+ (version<= "9.5" (org-version)))) - :passed :failed) - (let ((text-mode-hook #'yas-minor-mode)) - (do-yas-org-native-tab-in-source-block "text"))) --- -2.37.2 - -- cgit v1.2.3 From da3e6aea0a750246e8a9120d62441c3df65faff0 Mon Sep 17 00:00:00 2001 From: Efraim Flashner Date: Wed, 24 Jan 2024 16:12:07 +0200 Subject: gnu: range-v3: Update to 0.12.0. * gnu/packages/cpp.scm (range-v3): Update to 0.12.0. [source]: Remove patch. * gnu/packages/patches/range-v3-build-with-gcc10.patch: Remove file. * gnu/local.mk (dist_patch_DATA): Remove it. Change-Id: I078937f9aff0da31ede8d472d8739e48bb775c55 --- gnu/local.mk | 1 - gnu/packages/cpp.scm | 7 +- .../patches/range-v3-build-with-gcc10.patch | 122 --------------------- 3 files changed, 3 insertions(+), 127 deletions(-) delete mode 100644 gnu/packages/patches/range-v3-build-with-gcc10.patch (limited to 'gnu/local.mk') diff --git a/gnu/local.mk b/gnu/local.mk index c20e93390d..43d02ee793 100644 --- a/gnu/local.mk +++ b/gnu/local.mk @@ -1957,7 +1957,6 @@ dist_patch_DATA = \ %D%/packages/patches/qtwayland-cleanup-callbacks.patch \ %D%/packages/patches/ragel-char-signedness.patch \ %D%/packages/patches/randomjungle-disable-static-build.patch \ - %D%/packages/patches/range-v3-build-with-gcc10.patch \ %D%/packages/patches/raptor2-heap-overflow.patch \ %D%/packages/patches/ratpoints-sturm_and_rp_private.patch \ %D%/packages/patches/ratpoison-shell.patch \ diff --git a/gnu/packages/cpp.scm b/gnu/packages/cpp.scm index eeb4e6bf7b..44175231af 100644 --- a/gnu/packages/cpp.scm +++ b/gnu/packages/cpp.scm @@ -25,7 +25,7 @@ ;;; Copyright © 2021 jgart ;;; Copyright © 2021 Julien Lepiller ;;; Copyright © 2021 Disseminate Dissent -;;; Copyright © 2022, 2023 Efraim Flashner +;;; Copyright © 2022-2024 Efraim Flashner ;;; Copyright © 2022 muradm ;;; Copyright © 2022 Attila Lendvai ;;; Copyright © 2022 Arun Isaac @@ -187,7 +187,7 @@ (define-public asmjit (define-public range-v3 (package (name "range-v3") - (version "0.11.0") + (version "0.12.0") (source (origin (method git-fetch) @@ -195,9 +195,8 @@ (define-public range-v3 (url "https://github.com/ericniebler/range-v3.git") (commit version))) (file-name (git-file-name name version)) - (patches (search-patches "range-v3-build-with-gcc10.patch")) (sha256 - (base32 "18230bg4rq9pmm5f8f65j444jpq56rld4fhmpham8q3vr1c1bdjh")))) + (base32 "0r85s5rmp5ixmik2y5y4w760pa38j1sg9hbr1fss2flibzvrf53d")))) (build-system cmake-build-system) (arguments (list diff --git a/gnu/packages/patches/range-v3-build-with-gcc10.patch b/gnu/packages/patches/range-v3-build-with-gcc10.patch deleted file mode 100644 index a5d5b33523..0000000000 --- a/gnu/packages/patches/range-v3-build-with-gcc10.patch +++ /dev/null @@ -1,122 +0,0 @@ -From 0487cca29e352e8f16bbd91fda38e76e39a0ed28 Mon Sep 17 00:00:00 2001 -From: Louis Dionne -Date: Tue, 15 Jun 2021 14:40:01 -0400 -Subject: [PATCH] Work around broken integration with latest libc++. (#1635) - -* Work around broken integration with latest libc++. - -In newer versions of libc++, the base template of std::iterator_traits -provides a member typedef called __primary_template which is an alias -to the std::iterator_traits specialization itself. This fix works with -both the old version of libc++ and the new one. - -Fixes issue #1633. - -* Fix is_std_iterator_traits_specialized_v on MSVC - -It used to pretend that std::iterator_traits is a user-defined -specialization, which isn't the case. This is due to MSVC's -iterator_traits specialization not posing as the base template. ---- - include/std/detail/associated_types.hpp | 22 +++++++++++----- - test/CMakeLists.txt | 1 + - test/bug1633.cpp | 34 +++++++++++++++++++++++++ - 3 files changed, 51 insertions(+), 6 deletions(-) - create mode 100644 test/bug1633.cpp - -diff --git a/include/std/detail/associated_types.hpp b/include/std/detail/associated_types.hpp -index b642166d4..449a3f91c 100644 ---- a/include/std/detail/associated_types.hpp -+++ b/include/std/detail/associated_types.hpp -@@ -265,11 +265,22 @@ namespace ranges - template - char is_std_iterator_traits_specialized_impl_(void *); - #elif defined(_LIBCPP_VERSION) -- template -- char ( -- &is_std_iterator_traits_specialized_impl_(std::__iterator_traits *))[2]; -+ // In older versions of libc++, the base template inherits from std::__iterator_traits. -+ template class IteratorTraitsBase, typename I, bool B> -+ char (&libcpp_iterator_traits_base_impl(IteratorTraitsBase *))[2]; -+ template class IteratorTraitsBase, typename I> -+ char libcpp_iterator_traits_base_impl(void *); -+ -+ // In newer versions, the base template has only one template parameter and provides the -+ // __primary_template typedef which aliases the iterator_traits specialization. -+ template class, typename I> -+ char (&libcpp_iterator_traits_base_impl(typename std::iterator_traits::__primary_template *))[2]; -+ template class, typename I> -+ char libcpp_iterator_traits_base_impl(void *); -+ - template -- char is_std_iterator_traits_specialized_impl_(void *); -+ auto is_std_iterator_traits_specialized_impl_(std::iterator_traits* traits) -+ -> decltype(libcpp_iterator_traits_base_impl(traits)); - #elif defined(_MSVC_STL_VERSION) - template - char (&is_std_iterator_traits_specialized_impl_( -@@ -287,14 +298,13 @@ namespace ranges - RANGES_INLINE_VAR constexpr bool is_std_iterator_traits_specialized_v = - 1 == sizeof(is_std_iterator_traits_specialized_impl_( - static_cast *>(nullptr))); -- -+#endif - // The standard iterator_traits specialization(s) do not count - // as user-specialized. This will no longer be necessary in C++20. - // This helps with `T volatile*` and `void *`. - template - RANGES_INLINE_VAR constexpr bool is_std_iterator_traits_specialized_v = - false; --#endif - } // namespace detail - /// \endcond - } // namespace ranges -diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt -index 889f314af..2c2b7c09c 100644 ---- a/test/CMakeLists.txt -+++ b/test/CMakeLists.txt -@@ -19,3 +19,4 @@ rv3_add_test(test.bug474 bug474 bug474.cpp) - rv3_add_test(test.bug566 bug566 bug566.cpp) - rv3_add_test(test.bug1322 bug1322 bug1322.cpp) - rv3_add_test(test.bug1335 bug1335 bug1335.cpp) -+rv3_add_test(test.bug1633 bug1633 bug1633.cpp) -diff --git a/test/bug1633.cpp b/test/bug1633.cpp -new file mode 100644 -index 000000000..be52420ad ---- /dev/null -+++ b/test/bug1633.cpp -@@ -0,0 +1,34 @@ -+// Range v3 library -+// -+// Use, modification and distribution is subject to the -+// Boost Software License, Version 1.0. (See accompanying -+// file LICENSE_1_0.txt or copy at -+// http://www.boost.org/LICENSE_1_0.txt) -+// -+// Project home: https://github.com/ericniebler/range-v3 -+ -+#include -+#include -+#include -+ -+struct X { }; -+ -+namespace std { -+ template<> struct iterator_traits { }; -+} -+ -+struct Y { -+ using difference_type = std::ptrdiff_t; -+ using value_type = int; -+ using pointer = int*; -+ using reference = int&; -+ using iterator_category = std::forward_iterator_tag; -+}; -+ -+static_assert(ranges::detail::is_std_iterator_traits_specialized_v, ""); -+static_assert(!ranges::detail::is_std_iterator_traits_specialized_v, ""); -+static_assert(!ranges::detail::is_std_iterator_traits_specialized_v, ""); -+ -+int main() -+{ -+} -- cgit v1.2.3 From f027a6c22c6cefe10cdd46821168bc9261111d5b Mon Sep 17 00:00:00 2001 From: Andreas Enge Date: Thu, 25 Jan 2024 12:29:30 +0100 Subject: gnu: s7: Compile with flint@3. * gnu/packages/patches/s7-flint-3.patch: New file. * gnu/local.mk (dist_patch_DATA): Register file. * gnu/packages/lisp.scm (s7-bootstrap)[source]: Add patch. [inputs]: Remove arb. Change-Id: I06bac9d850977b8ee769e629f1b64411a8dc3247 --- gnu/local.mk | 3 ++- gnu/packages/lisp.scm | 10 ++++++---- gnu/packages/patches/s7-flint-3.patch | 31 +++++++++++++++++++++++++++++++ 3 files changed, 39 insertions(+), 5 deletions(-) create mode 100644 gnu/packages/patches/s7-flint-3.patch (limited to 'gnu/local.mk') diff --git a/gnu/local.mk b/gnu/local.mk index 43d02ee793..9eac0cae1a 100644 --- a/gnu/local.mk +++ b/gnu/local.mk @@ -1,6 +1,6 @@ # GNU Guix --- Functional package management for GNU # Copyright © 2012-2024 Ludovic Courtès -# Copyright © 2013, 2014, 2015, 2016, 2017, 2018, 2019, 2020, 2022, 2023 Andreas Enge +# Copyright © 2013, 2014, 2015, 2016, 2017, 2018, 2019, 2020, 2022, 2023, 2024 Andreas Enge # Copyright © 2016 Mathieu Lirzin # Copyright © 2013, 2014, 2015, 2016, 2017, 2018, 2019, 2020, 2021 Mark H Weaver # Copyright © 2016 Chris Marusich @@ -2003,6 +2003,7 @@ dist_patch_DATA = \ %D%/packages/patches/rust-wl-clipboard-rs-newer-wl.patch \ %D%/packages/patches/rw-igraph-0.10.patch \ %D%/packages/patches/rxvt-unicode-fix-cursor-position.patch \ + %D%/packages/patches/s7-flint-3.patch \ %D%/packages/patches/sbc-fix-build-non-x86.patch \ %D%/packages/patches/sbcl-aserve-add-HTML-5-elements.patch \ %D%/packages/patches/sbcl-aserve-fix-rfe12668.patch \ diff --git a/gnu/packages/lisp.scm b/gnu/packages/lisp.scm index 8e614b7d90..29d5ddebdc 100644 --- a/gnu/packages/lisp.scm +++ b/gnu/packages/lisp.scm @@ -25,7 +25,8 @@ ;;; Copyright © 2022 ( ;;; Copyright © 2023 Zheng Junjie <873216071@qq.com> ;;; Copyright © 2023 Yovan Naumovski -;;; Copyright © 2023 Andrew Kravchuk +;;; Copyright © 2024 Andreas Enge ;;; ;;; This file is part of GNU Guix. ;;; @@ -1502,7 +1503,8 @@ (define-public s7-bootstrap (file-name (git-file-name name version)) (sha256 (base32 - "0fiw8lb7rswglixvn271la2q2hgwszrf2ckykhr6jjxdvmb9a7d0")))) + "0fiw8lb7rswglixvn271la2q2hgwszrf2ckykhr6jjxdvmb9a7d0")) + (patches (search-patches "s7-flint-3.patch")))) (build-system gnu-build-system) (arguments (list #:tests? #f ;no tests in bootstrap @@ -1533,7 +1535,7 @@ (define-public s7-bootstrap (invoke #$(cc-for-target) "libarb_s7.c" "-I." "-O2" "-g" "-shared" "-o" "libarb_s7.so" - "-larb" "-lflint" "-lmpc" "-fPIC") + "-lflint" "-lmpc" "-fPIC") (display "[BUILD] libnotcurses_s7.so\n") (invoke #$(cc-for-target) "notcurses_s7.c" "-I." "-O2" "-g" @@ -1572,7 +1574,7 @@ (define-public s7-bootstrap (install-file "s7.c" share) (install-file "s7.h" inc) (install-file "s7.html" doc))))))) - (inputs (list arb flint mpc notcurses)) + (inputs (list flint mpc notcurses)) (home-page "https://ccrma.stanford.edu/software/snd/snd/s7.html") (synopsis "Scheme interpreter intended as an extension language") (description diff --git a/gnu/packages/patches/s7-flint-3.patch b/gnu/packages/patches/s7-flint-3.patch new file mode 100644 index 0000000000..49f47adda1 --- /dev/null +++ b/gnu/packages/patches/s7-flint-3.patch @@ -0,0 +1,31 @@ +From bd54bd42c5933e4c571dcfd6a8afac8e52cf7366 Mon Sep 17 00:00:00 2001 +From: Andreas Enge +Date: Thu, 25 Jan 2024 12:13:18 +0100 +Subject: [PATCH] Adapt libarb_s7.c to FLINT 3. + +--- + libarb_s7.c | 8 ++++---- + 1 file changed, 4 insertions(+), 4 deletions(-) + +diff --git a/libarb_s7.c b/libarb_s7.c +index 7413ccc..d9e0084 100644 +--- a/libarb_s7.c ++++ b/libarb_s7.c +@@ -6,10 +6,10 @@ + #include + #include + +-#include +-#include +-#include +-#include ++#include ++#include ++#include ++#include + + #define WITH_GMP 1 + #include "s7.h" +-- +2.41.0 + -- cgit v1.2.3 From ff9d8420cf8bf0b0f0ceb4210966f821a0447858 Mon Sep 17 00:00:00 2001 From: Andreas Enge Date: Thu, 25 Jan 2024 14:41:30 +0100 Subject: gnu: python-flint: Update to 0.5.0 and build with flint@3. * gnu/packages/patches/python-flint-includes.patch: Remove file. * gnu/local.mk (dist_patch_DATA): Unregister file. * gnu/packages/algebra.scm (python-flint): Update to 0.5.0. [source]: Drop patch. [inputs]: Drop arb. [native-inputs]: Use python-cython-3. Change-Id: I5fa9b201efff76e16f957aee0ebcd453ea823e69 --- gnu/local.mk | 1 - gnu/packages/algebra.scm | 9 +- gnu/packages/patches/python-flint-includes.patch | 131 ----------------------- 3 files changed, 4 insertions(+), 137 deletions(-) delete mode 100644 gnu/packages/patches/python-flint-includes.patch (limited to 'gnu/local.mk') diff --git a/gnu/local.mk b/gnu/local.mk index 9eac0cae1a..ab63bd5881 100644 --- a/gnu/local.mk +++ b/gnu/local.mk @@ -1910,7 +1910,6 @@ dist_patch_DATA = \ %D%/packages/patches/python-piexif-fix-tests-with-pillow-7.2.patch \ %D%/packages/patches/python-pillow-CVE-2022-45199.patch \ %D%/packages/patches/python-pyfakefs-remove-bad-test.patch \ - %D%/packages/patches/python-flint-includes.patch \ %D%/packages/patches/python-libxml2-utf8.patch \ %D%/packages/patches/python-memcached-syntax-warnings.patch \ %D%/packages/patches/python-mox3-python3.6-compat.patch \ diff --git a/gnu/packages/algebra.scm b/gnu/packages/algebra.scm index 43047a9b32..5fd8d0f106 100644 --- a/gnu/packages/algebra.scm +++ b/gnu/packages/algebra.scm @@ -494,7 +494,7 @@ (define-public arb (define-public python-flint (package (name "python-flint") - (version "0.3.0") + (version "0.5.0") (source (origin (method git-fetch) (uri (git-reference @@ -503,15 +503,14 @@ (define-public python-flint (file-name (git-file-name name version)) (sha256 (base32 - "1v0anazbj1cfi68nl2j6dbd31kgkc1563xmr0zk5xk3xj78569pw")) - (patches (search-patches "python-flint-includes.patch")))) + "10370kqik6q6vdqrqv3gbznsyaxbgqb3rbrff4alpw0sqr5s07c7")))) (build-system python-build-system) (native-inputs - (list python-cython)) + (list python-cython-3)) (propagated-inputs (list python-numpy)) (inputs - (list arb flint)) + (list flint)) (synopsis "Python module wrapping ARB and FLINT") (description "Python-flint is a Python extension module wrapping FLINT diff --git a/gnu/packages/patches/python-flint-includes.patch b/gnu/packages/patches/python-flint-includes.patch deleted file mode 100644 index c0cfe94a04..0000000000 --- a/gnu/packages/patches/python-flint-includes.patch +++ /dev/null @@ -1,131 +0,0 @@ -The following patch, authored by Andreas Enge, looks for the flint include -files in the correct subdirectory. - -diff -u -r python-flint-old/src/flint.pxd python-flint-new/src/flint.pxd ---- python-flint-old/src/flint.pxd 2019-03-19 10:26:11.055748626 +0100 -+++ python-flint-new/src/flint.pxd 2019-03-19 10:35:23.269341203 +0100 -@@ -27,7 +27,7 @@ - - ctypedef long fmpz_struct - --cdef extern from "flint.h": -+cdef extern from "flint/flint.h": - ctypedef void * flint_rand_t - void flint_randinit(flint_rand_t state) - void flint_randclear(flint_rand_t state) -@@ -35,7 +35,7 @@ - long flint_get_num_threads() - void flint_cleanup() - --cdef extern from "nmod_vec.h": -+cdef extern from "flint/nmod_vec.h": - ctypedef struct nmod_t: - mp_limb_t n - mp_limb_t ninv -@@ -47,7 +47,7 @@ - mp_limb_t nmod_mul(mp_limb_t a, mp_limb_t b, nmod_t mod) - mp_limb_t nmod_div(mp_limb_t a, mp_limb_t b, nmod_t mod) - --cdef extern from "nmod_poly.h": -+cdef extern from "flint/nmod_poly.h": - ctypedef struct nmod_poly_struct: - mp_ptr coeffs - long alloc -@@ -129,7 +129,7 @@ - void nmod_poly_factor_init(nmod_poly_factor_t fac) - void nmod_poly_factor_clear(nmod_poly_factor_t fac) - --cdef extern from "nmod_mat.h": -+cdef extern from "flint/nmod_mat.h": - ctypedef struct nmod_mat_struct: - mp_limb_t * entries - long r -@@ -178,7 +178,7 @@ - long nmod_mat_rref(nmod_mat_t A) - long nmod_mat_nullspace(nmod_mat_t X, nmod_mat_t A) - --cdef extern from "fmpz.h": -+cdef extern from "flint/fmpz.h": - ctypedef fmpz_struct fmpz_t[1] - int COEFF_IS_MPZ(fmpz_struct v) - void fmpz_init(fmpz_t op) -@@ -268,7 +268,7 @@ - void fmpz_rfac_uiui(fmpz_t r, ulong x, ulong n) - void fmpz_primorial(fmpz_t res, ulong n) - --cdef extern from "fmpz_factor.h": -+cdef extern from "flint/fmpz_factor.h": - ctypedef struct fmpz_factor_struct: - int sign - fmpz_struct * p -@@ -280,7 +280,7 @@ - void fmpz_factor_clear(fmpz_factor_t factor) - void fmpz_factor(fmpz_factor_t factor, fmpz_t n) - --cdef extern from "fmpz_poly.h": -+cdef extern from "flint/fmpz_poly.h": - ctypedef struct fmpz_poly_struct: - fmpz_struct * coeffs - long alloc -@@ -390,14 +390,14 @@ - void fmpz_poly_cos_minpoly(fmpz_poly_t, ulong) - void fmpz_poly_swinnerton_dyer(fmpz_poly_t, ulong) - --cdef extern from "fmpz_poly_factor.h": -+cdef extern from "flint/fmpz_poly_factor.h": - void fmpz_poly_factor_init(fmpz_poly_factor_t fac) - void fmpz_poly_factor_clear(fmpz_poly_factor_t fac) - void fmpz_poly_factor_zassenhaus(fmpz_poly_factor_t fac, fmpz_poly_t G) - void fmpz_poly_factor(fmpz_poly_factor_t fac, fmpz_poly_t G) - void fmpz_poly_factor_squarefree(fmpz_poly_factor_t fac, fmpz_poly_t G) - --cdef extern from "fmpz_mat.h": -+cdef extern from "flint/fmpz_mat.h": - ctypedef struct fmpz_mat_struct: - fmpz_struct * entries - long r -@@ -448,7 +448,7 @@ - void fmpz_mat_snf(fmpz_mat_t S, const fmpz_mat_t A) - int fmpz_mat_is_in_snf(const fmpz_mat_t A) - --cdef extern from "fmpz_lll.h": -+cdef extern from "flint/fmpz_lll.h": - ctypedef struct fmpz_lll_struct: - double delta - double eta -@@ -461,7 +461,7 @@ - void fmpz_lll(fmpz_mat_t B, fmpz_mat_t U, const fmpz_lll_t fl) - - --cdef extern from "fmpq.h": -+cdef extern from "flint/fmpq.h": - ctypedef struct fmpq_struct: - fmpz_struct num - fmpz_struct den -@@ -506,7 +506,7 @@ - void fmpq_next_signed_minimal(fmpq_t res, fmpq_t x) - void fmpq_harmonic_ui(fmpq_t res, ulong n) - --cdef extern from "fmpq_poly.h": -+cdef extern from "flint/fmpq_poly.h": - ctypedef struct fmpq_poly_struct: - fmpz_struct * coeffs - fmpz_t den -@@ -620,7 +620,7 @@ - void fmpq_poly_compose_series(fmpq_poly_t res, fmpq_poly_t poly1, fmpq_poly_t poly2, long n) - void fmpq_poly_revert_series(fmpq_poly_t res, fmpq_poly_t poly1, long n) - --cdef extern from "fmpq_mat.h": -+cdef extern from "flint/fmpq_mat.h": - ctypedef struct fmpq_mat_struct: - fmpq_struct * entries - long r -@@ -672,7 +672,7 @@ - long fmpq_mat_rref(fmpq_mat_t B, fmpq_mat_t A) - void fmpq_mat_transpose(fmpq_mat_t B, fmpq_mat_t A) - --cdef extern from "arith.h": -+cdef extern from "flint/arith.h": - void arith_number_of_partitions(fmpz_t res, ulong n) - int arith_moebius_mu(fmpz_t n) - void arith_divisor_sigma(fmpz_t v, fmpz_t n, ulong k) -- cgit v1.2.3 From 78bdf4f9993c47956270adefca24991b2221752f Mon Sep 17 00:00:00 2001 From: Michal Atlas Date: Fri, 24 Nov 2023 17:07:14 +0000 Subject: gnu: Add cl-rpcq. * gnu/packages/quantum.scm: New file. (cl-rpcq, sbcl-rpcq): New variables. * gnu/local.mk (GNU_SYSTEM_MODULES): Register "quantum.scm". Change-Id: Ic893ad22ffb7a3bf9aa5e841fcf4c14bf3a23b2f Co-authored-by: Guillaume Le Vaillant --- gnu/local.mk | 1 + gnu/packages/quantum.scm | 68 ++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 69 insertions(+) create mode 100644 gnu/packages/quantum.scm (limited to 'gnu/local.mk') diff --git a/gnu/local.mk b/gnu/local.mk index ab63bd5881..041e2f1b7b 100644 --- a/gnu/local.mk +++ b/gnu/local.mk @@ -543,6 +543,7 @@ GNU_SYSTEM_MODULES = \ %D%/packages/toys.scm \ %D%/packages/tryton.scm \ %D%/packages/qt.scm \ + %D%/packages/quantum.scm \ %D%/packages/racket.scm \ %D%/packages/radio.scm \ %D%/packages/ragel.scm \ diff --git a/gnu/packages/quantum.scm b/gnu/packages/quantum.scm new file mode 100644 index 0000000000..c0658daae4 --- /dev/null +++ b/gnu/packages/quantum.scm @@ -0,0 +1,68 @@ +;;; GNU Guix --- Functional package management for GNU +;;; Copyright © 2024 Michal Atlas +;;; Copyright © 2024 Guillaume Le Vaillant +;;; +;;; This file is part of GNU Guix. +;;; +;;; GNU Guix is free software; you can redistribute it and/or modify it +;;; under the terms of the GNU General Public License as published by +;;; the Free Software Foundation; either version 3 of the License, or (at +;;; your option) any later version. +;;; +;;; GNU Guix is distributed in the hope that it will be useful, but +;;; WITHOUT ANY WARRANTY; without even the implied warranty of +;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +;;; GNU General Public License for more details. +;;; +;;; You should have received a copy of the GNU General Public License +;;; along with GNU Guix. If not, see . + +(define-module (gnu packages quantum) + #:use-module (gnu packages) + #:use-module (gnu packages lisp-check) + #:use-module (gnu packages lisp-xyz) + #:use-module (guix build-system asdf) + #:use-module (guix gexp) + #:use-module (guix git-download) + #:use-module ((guix licenses) #:prefix license:) + #:use-module (guix packages)) + +(define-public sbcl-rpcq + (package + (name "sbcl-rpcq") + (version "3.10.0") + (source + (origin + (method git-fetch) + (uri (git-reference + (url "https://github.com/rigetti/rpcq") + (commit (string-append "v" version)))) + (file-name (git-file-name "cl-rpcq" version)) + (sha256 + (base32 "1bvppxlacvp0pfdbpn7ls1zxd127jacl225ds7lph5s8f8cyvf17")))) + (build-system asdf-build-system/sbcl) + (native-inputs (list sbcl-fiasco)) + (inputs + (list sbcl-alexandria + sbcl-bordeaux-threads + sbcl-cl-messagepack + sbcl-cl-ppcre + sbcl-cl-syslog + sbcl-flexi-streams + sbcl-local-time + sbcl-parse-float + sbcl-pzmq + sbcl-trivial-backtrace + sbcl-uuid + sbcl-yason)) + (synopsis "RPC framework for Rigetti Quantum Cloud Services") + (description + "This package provides the asynchronous RPC client-server framework and +message specification for Rigetti Quantum Cloud Services (QCS). It implements +an efficient transport protocol by using ZeroMQ (ZMQ) sockets and MessagePack +(msgpack) serialization.") + (home-page "https://github.com/rigetti/rpcq") + (license license:asl2.0))) + +(define-public cl-rpcq + (sbcl-package->cl-source-package sbcl-rpcq)) -- cgit v1.2.3 From 2f67528edd2d7669b441f61cb36d1b0f4f60bdb9 Mon Sep 17 00:00:00 2001 From: Giacomo Leidi Date: Sun, 28 Jan 2024 16:37:16 +0100 Subject: home: Add home-dotfiles-service. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * gnu/home/service/dotfiles.scm: New file; * gnu/local.mk (GNU_SYSTEM_MODULES): Add it. * po/guix/POTFILES.in: Add it. * doc/guix.texi (Essential Home Services): Document it. Change-Id: I6769169cfacefc3842faa5b31bee081c56c28743 Co-authored-by: Ludovic Courtès --- doc/guix.texi | 108 +++++++++++++++++++++++++++++++++++++ gnu/home/services/dotfiles.scm | 117 +++++++++++++++++++++++++++++++++++++++++ gnu/local.mk | 1 + po/guix/POTFILES.in | 1 + 4 files changed, 227 insertions(+) create mode 100644 gnu/home/services/dotfiles.scm (limited to 'gnu/local.mk') diff --git a/doc/guix.texi b/doc/guix.texi index c458befb76..dee14e3bb7 100644 --- a/doc/guix.texi +++ b/doc/guix.texi @@ -44216,6 +44216,114 @@ to use alternative services to implement more advanced use cases like read-only home. Feel free to experiment and share your results. @end defvar +It is often the case that Guix Home users already have a setup for versioning +their user configuration files (also known as @emph{dotfiles}) in a single +directory, and some way of automatically deploy changes to their user home. + +The @code{home-dotfiles-service-type} from @code{(gnu home services dotfiles)} +is designed to ease the way into using Guix Home for this kind of users, +allowing them to point the service to their dotfiles directory, which must +follow the layout suggested by +@uref{https://www.gnu.org/software/stow/, GNU Stow}, +and have their dotfiles automatically deployed to their user home, without +migrating them to Guix native configurations. + +The dotfiles directory layout is expected to be structured as follows. Please +keep in mind that it is advisable to keep your dotfiles directories under +version control, for example in the same repository where you'd track your +Guix Home configuration. + +@example +~$ tree -a ./dotfiles/ +dotfiles/ +├── git +│ └── .gitconfig +├── gpg +│ └── .gnupg +│ ├── gpg-agent.conf +│ └── gpg.conf +├── guile +│ └── .guile +├── guix +│ └── .config +│ └── guix +│ └── channels.scm +├── nix +│ ├── .config +│ │ └── nixpkgs +│ │ └── config.nix +│ └── .nix-channels +├── tmux +│ └── .tmux.conf +└── vim + └── .vimrc + +13 directories, 10 files +@end example + +For an informal specification please refer to the Stow manual +(@pxref{Top,,, stow, Introduction}). A suitable configuration would then +be: + +@lisp +(home-environment + ;; @dots{} + (services + (service home-dotfiles-service-type + (home-dotfiles-configuration + (directories (list "./dotfiles")))))) +@end lisp + +The expected home directory state would then be: + +@example +. +├── .config +│ ├── guix +│ │ └── channels.scm +│ └── nixpkgs +│ └── config.nix +├── .gitconfig +├── .gnupg +│ ├── gpg-agent.conf +│ └── gpg.conf +├── .guile +├── .nix-channels +├── .tmux.conf +└── .vimrc +@end example + +@defvar home-dotfiles-service-type +Return a service which is very similiar to @code{home-files-service-type} +(and actually extends it), but designed to ease the way into using Guix +Home for users that already track their dotfiles under some kind of version +control. This service allows users to point Guix Home to their dotfiles +directory and have their files automatically deployed to their home directory +just like Stow would, without migrating all of their dotfiles to Guix native +configurations. +@end defvar + +@deftp {Data Type} home-dotfiles-configuration +Available @code{home-dotfiles-configuration} fields are: + +@table @asis +@item @code{source-directory} (default: @code{(current-source-directory)}) +The path where dotfile directories are resolved. By default dotfile directories +are resolved relative the source location where +@code{home-dotfiles-configuration} appears. + +@item @code{directories} (type: list-of-strings) +The list of dotfiles directories where @code{home-dotfiles-service-type} will +look for application dotfiles. + +@item @code{exclude} (default: @code{'(".*~" ".*\\.swp" "\\.git" "\\.gitignore")}) +The list of file patterns @code{home-dotfiles-service-type} will exclude while +visiting each one of the @code{directories}. + +@end table + +@end deftp + @defvar home-xdg-configuration-files-service-type The service is very similar to @code{home-files-service-type} (and actually extends it), but used for defining files, which will go to diff --git a/gnu/home/services/dotfiles.scm b/gnu/home/services/dotfiles.scm new file mode 100644 index 0000000000..6a740c42ce --- /dev/null +++ b/gnu/home/services/dotfiles.scm @@ -0,0 +1,117 @@ +;;; GNU Guix --- Functional package management for GNU +;;; Copyright © 2024 Ludovic Courtès +;;; Copyright © 2024 Giacomo Leidi +;;; +;;; This file is part of GNU Guix. +;;; +;;; GNU Guix is free software; you can redistribute it and/or modify it +;;; under the terms of the GNU General Public License as published by +;;; the Free Software Foundation; either version 3 of the License, or (at +;;; your option) any later version. +;;; +;;; GNU Guix is distributed in the hope that it will be useful, but +;;; WITHOUT ANY WARRANTY; without even the implied warranty of +;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +;;; GNU General Public License for more details. +;;; +;;; You should have received a copy of the GNU General Public License +;;; along with GNU Guix. If not, see . + +(define-module (gnu home services dotfiles) + #:use-module (gnu home services) + #:use-module (gnu services) + #:autoload (guix build utils) (find-files) + #:use-module (guix gexp) + #:use-module (guix records) + #:use-module ((guix utils) #:select (current-source-directory)) + #:use-module (srfi srfi-1) + #:use-module (ice-9 ftw) + #:use-module (ice-9 regex) + #:export (home-dotfiles-service-type + home-dotfiles-configuration + home-dotfiles-configuration? + home-dotfiles-configuration-source-directory + home-dotfiles-configuration-directories + home-dotfiles-configuration-excluded)) + +(define %home-dotfiles-excluded + '(".*~" + ".*\\.swp" + "\\.git" + "\\.gitignore")) + +(define-record-type* + home-dotfiles-configuration make-home-dotfiles-configuration + home-dotfiles-configuration? + (source-directory home-dotfiles-configuration-source-directory + (default (current-source-directory)) + (innate)) + (directories home-dotfiles-configuration-directories ;list of strings + (default '())) + (excluded home-dotfiles-configuration-excluded ;list of strings + (default %home-dotfiles-excluded))) + +(define (import-dotfiles directory files) + "Return a list of objects compatible with @code{home-files-service-type}'s +value. Each object is a pair where the first element is the relative path +of a file and the second is a gexp representing the file content. Objects are +generated by recursively visiting DIRECTORY and mapping its contents to the +user's home directory, excluding files that match any of the patterns in EXCLUDED." + (define (strip file) + (string-drop file (+ 1 (string-length directory)))) + + (define (format file) + ;; Remove from FILE characters that cannot be used in the store. + (string-append + "home-dotfiles-" + (string-map (lambda (chr) + (if (and (char-set-contains? char-set:ascii chr) + (char-set-contains? char-set:graphic chr) + (not (memv chr '(#\. #\/ #\space)))) + chr + #\-)) + file))) + + (map (lambda (file) + (let ((stripped (strip file))) + (list stripped + (local-file file (format stripped) + #:recursive? #t)))) + files)) + +(define (home-dotfiles-configuration->files config) + "Return a list of objects compatible with @code{home-files-service-type}'s +value, generated following GNU Stow's algorithm for each of the +directories in CONFIG, excluding files that match any of the patterns configured." + (define excluded + (home-dotfiles-configuration-excluded config)) + (define exclusion-rx + (make-regexp (string-append "^.*(" (string-join excluded "|") ")$"))) + + (define (directory-contents directory) + (find-files directory + (lambda (file stat) + (not (regexp-exec exclusion-rx + (basename file)))))) + + (define (resolve directory) + ;; Resolve DIRECTORY relative to the 'source-directory' field of CONFIG. + (if (string-prefix? "/" directory) + directory + (in-vicinity (home-dotfiles-configuration-source-directory config) + directory))) + + (append-map (lambda (directory) + (let* ((directory (resolve directory)) + (contents (directory-contents directory))) + (import-dotfiles directory contents))) + (home-dotfiles-configuration-directories config))) + +(define-public home-dotfiles-service-type + (service-type (name 'home-dotfiles) + (extensions + (list (service-extension home-files-service-type + home-dotfiles-configuration->files))) + (default-value (home-dotfiles-configuration)) + (description "Files that will be put in the user's home directory +following GNU Stow's algorithm, and further processed during activation."))) diff --git a/gnu/local.mk b/gnu/local.mk index 041e2f1b7b..5e0a058848 100644 --- a/gnu/local.mk +++ b/gnu/local.mk @@ -96,6 +96,7 @@ GNU_SYSTEM_MODULES = \ %D%/home/services.scm \ %D%/home/services/desktop.scm \ %D%/home/services/dict.scm \ + %D%/home/services/dotfiles.scm \ %D%/home/services/symlink-manager.scm \ %D%/home/services/fontutils.scm \ %D%/home/services/gnupg.scm \ diff --git a/po/guix/POTFILES.in b/po/guix/POTFILES.in index 154ad4e530..d13e19619d 100644 --- a/po/guix/POTFILES.in +++ b/po/guix/POTFILES.in @@ -14,6 +14,7 @@ gnu/services/samba.scm gnu/services/version-control.scm gnu/home/services.scm gnu/home/services/desktop.scm +gnu/home/services/dotfiles.scm gnu/home/services/fontutils.scm gnu/home/services/gnupg.scm gnu/home/services/guix.scm -- cgit v1.2.3 From e3942c7589966206d1d8b4246eddee753f1c4818 Mon Sep 17 00:00:00 2001 From: Sharlatan Hellseher Date: Tue, 16 Jan 2024 22:00:38 +0000 Subject: gnu: Add (gnu packages golang-crypto) module. * gnu/packages/golang-crypto.scm: New file. * gnu/local.mk: Add to gnu/packages/golang-crypto.scm scope. Change-Id: I92a110f31a74c5a54c59ee2a0f17373915be1b35 --- gnu/local.mk | 1 + gnu/packages/golang-crypto.scm | 43 ++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 44 insertions(+) create mode 100644 gnu/packages/golang-crypto.scm (limited to 'gnu/local.mk') diff --git a/gnu/local.mk b/gnu/local.mk index 5e0a058848..2a88db9f6d 100644 --- a/gnu/local.mk +++ b/gnu/local.mk @@ -308,6 +308,7 @@ GNU_SYSTEM_MODULES = \ %D%/packages/gobby.scm \ %D%/packages/golang.scm \ %D%/packages/golang-check.scm \ + %D%/packages/golang-crypto.scm \ %D%/packages/golang-web.scm \ %D%/packages/gperf.scm \ %D%/packages/gpodder.scm \ diff --git a/gnu/packages/golang-crypto.scm b/gnu/packages/golang-crypto.scm new file mode 100644 index 0000000000..38ccc5ffe9 --- /dev/null +++ b/gnu/packages/golang-crypto.scm @@ -0,0 +1,43 @@ +;;; GNU Guix --- Functional package management for GNU +;;; +;;; This file is part of GNU Guix. +;;; +;;; GNU Guix is free software; you can redistribute it and/or modify it +;;; under the terms of the GNU General Public License as published by +;;; the Free Software Foundation; either version 3 of the License, or (at +;;; your option) any later version. +;;; +;;; GNU Guix is distributed in the hope that it will be useful, but +;;; WITHOUT ANY WARRANTY; without even the implied warranty of +;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +;;; GNU General Public License for more details. +;;; +;;; You should have received a copy of the GNU General Public License +;;; along with GNU Guix. If not, see . + +(define-module (gnu packages golang-crypto) + #:use-module ((guix licenses) #:prefix license:) + #:use-module (guix build-system go) + #:use-module (guix gexp) + #:use-module (guix git-download) + #:use-module (guix packages) + #:use-module (guix utils) + #:use-module (gnu packages) + #:use-module (gnu packages golang) + #:use-module (gnu packages golang-check)) + +;;; Commentary: +;;; +;;; Golang modules (libraries) related to Cryptography: encryption algorithms, +;;; hashing functions, TLS, key management, digital signatures, password +;;; hashing etc. +;;; +;;; Please: Try to add new module packages in alphabetic order. +;;; +;;; Code: + +;;; +;;; Avoid adding new packages to the end of this file. To reduce the chances +;;; of a merge conflict, place them above by existing packages with similar +;;; functionality or similar names. +;;; -- cgit v1.2.3 From 2c5293afffa39d5d4aaec248a1973c7f62b1a0b4 Mon Sep 17 00:00:00 2001 From: Maxim Cournoyer Date: Sun, 28 Jan 2024 20:46:03 -0500 Subject: gnu: lugaru: Apply patch fixing sound. * gnu/packages/patches/lugaru-fix-sound.patch: New file. * gnu/local.mk (dist_patch_DATA): Register it. * gnu/packages/games.scm (lugaru) [source]: Update source URL. Apply patch. [arguments]: Use gexps. [inputs]: Remove labels and sort. Change-Id: Iebefc9fc43d3473e51c8c732539e6aa2f14d9f5f --- gnu/local.mk | 1 + gnu/packages/games.scm | 37 ++++++++++++++--------------- gnu/packages/patches/lugaru-fix-sound.patch | 32 +++++++++++++++++++++++++ 3 files changed, 51 insertions(+), 19 deletions(-) create mode 100644 gnu/packages/patches/lugaru-fix-sound.patch (limited to 'gnu/local.mk') diff --git a/gnu/local.mk b/gnu/local.mk index 2a88db9f6d..16058ac784 100644 --- a/gnu/local.mk +++ b/gnu/local.mk @@ -1646,6 +1646,7 @@ dist_patch_DATA = \ %D%/packages/patches/lua-liblua-so.patch \ %D%/packages/patches/lua-5.4-pkgconfig.patch \ %D%/packages/patches/lua-5.4-liblua-so.patch \ + %D%/packages/patches/lugaru-fix-sound.patch \ %D%/packages/patches/luit-posix.patch \ %D%/packages/patches/mactelnet-remove-init.patch \ %D%/packages/patches/mailutils-variable-lookup.patch \ diff --git a/gnu/packages/games.scm b/gnu/packages/games.scm index c6aa873ac7..06ba868f35 100644 --- a/gnu/packages/games.scm +++ b/gnu/packages/games.scm @@ -72,7 +72,7 @@ ;;; Copyright © 2022 Roman Riabenko ;;; Copyright © 2022, 2023 zamfofex ;;; Copyright © 2022 Gabriel Arazas -;;; Copyright © 2022 Maxim Cournoyer +;;; Copyright © 2022, 2024 Maxim Cournoyer ;;; Copyright © 2022 Hendursaga ;;; Copyright © 2022 Parnikkapore ;;; Copyright © 2023 Zheng Junjie <873216071@qq.com> @@ -7199,27 +7199,26 @@ (define-public lugaru (version "1.2") (source (origin (method url-fetch) - (uri (string-append "https://bitbucket.org/osslugaru/lugaru/downloads/" - "lugaru-" version ".tar.xz")) + (uri (string-append "https://github.com/osslugaru/lugaru/releases" + "/download/" version + "/lugaru-" version ".tar.xz")) (sha256 - (base32 - "15zgcshy22q51rm72zi6y9z7qlgnz5iw3gczjdlir4bqmxy4gspk")))) + (base32 "15zgcshy22q51rm72zi6y9z7qlgnz5iw3gczjdlir4bqmxy4gspk")) + (patches + (search-patches "lugaru-fix-sound.patch")))) (build-system cmake-build-system) (arguments - `(#:configure-flags - (list "-DSYSTEM_INSTALL=ON") - ;; no test target - #:tests? #f)) - (native-inputs - (list pkg-config)) + (list #:configure-flags #~(list "-DSYSTEM_INSTALL=ON") + #:tests? #f)) ;no test suite + (native-inputs (list pkg-config)) (inputs - `(("sdl2" ,sdl2) - ("glu" ,glu) - ("libjpeg" ,libjpeg-turbo) - ("libpng" ,libpng) - ("openal" ,openal) - ("vorbis" ,libvorbis) - ("zlib" ,zlib))) + (list glu + libjpeg-turbo + libpng + libvorbis + openal + sdl2 + zlib)) (home-page "https://osslugaru.gitlab.io") (synopsis "Cross-platform third-person action game") (description "Lugaru is a third-person action game. The main character, @@ -7228,7 +7227,7 @@ (define-public lugaru a far-reaching conspiracy involving the corrupt leaders of the rabbit republic and the starving wolves from a nearby den. Turner takes it upon himself to fight against their plot and save his fellow rabbits from slavery.") - (license (list license:gpl2+ ; code + (license (list license:gpl2+ ; code ;; assets: license:cc-by-sa3.0 license:cc-by-sa4.0)))) diff --git a/gnu/packages/patches/lugaru-fix-sound.patch b/gnu/packages/patches/lugaru-fix-sound.patch new file mode 100644 index 0000000000..742908c977 --- /dev/null +++ b/gnu/packages/patches/lugaru-fix-sound.patch @@ -0,0 +1,32 @@ +From 3adfb088eed81fc2c9e40ac55018378d4975f469 Mon Sep 17 00:00:00 2001 +From: Maxim Cournoyer +Date: Sun, 28 Jan 2024 19:50:51 -0500 +Subject: [PATCH] audio: Look extension from right, not left. + +* Source/Audio/openal_wrapper.cpp (decode_to_pcm): Find extension from +the right (strrchr), not from the left, to avoid eagerly truncating a +file name. + +Fixes: https://gitlab.com/osslugaru/lugaru/-/issues/124#note_1746570172 +--- + Source/Audio/openal_wrapper.cpp | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/Source/Audio/openal_wrapper.cpp b/Source/Audio/openal_wrapper.cpp +index cc4fc36..072fcb8 100644 +--- a/Source/Audio/openal_wrapper.cpp ++++ b/Source/Audio/openal_wrapper.cpp +@@ -316,7 +316,7 @@ static void* decode_to_pcm(const char* _fname, ALenum& format, ALsizei& size, AL + // !!! FIXME: if it's not Ogg, we don't have a decoder. I'm lazy. :/ + char* fname = (char*)alloca(strlen(_fname) + 16); + strcpy(fname, _fname); +- char* ptr = strchr(fname, '.'); ++ char* ptr = strrchr(fname, '.'); + if (ptr) { + *ptr = '\0'; + } + +base-commit: 6a58b62858d9c3c3630abf00bf43075f65a09d38 +-- +2.41.0 + -- cgit v1.2.3 From a4e75305e29318f19cf7e23e21778006d3f64e30 Mon Sep 17 00:00:00 2001 From: Ricardo Wurmus Date: Tue, 30 Jan 2024 15:06:24 +0100 Subject: gnu: r-sapa: Patch call of dstebz routine. * gnu/packages/patches/r-sapa-lapack.patch: New patch. * gnu/local.mk (dist_patch_DATA): Add it. * gnu/packages/cran.scm (r-sapa)[source]: Add it. Change-Id: I17354c4e8b3a0f322e17c9a1e17bc37c93630105 --- gnu/local.mk | 1 + gnu/packages/cran.scm | 4 +++- gnu/packages/patches/r-sapa-lapack.patch | 23 +++++++++++++++++++++++ 3 files changed, 27 insertions(+), 1 deletion(-) create mode 100644 gnu/packages/patches/r-sapa-lapack.patch (limited to 'gnu/local.mk') diff --git a/gnu/local.mk b/gnu/local.mk index 16058ac784..4f868ca53e 100644 --- a/gnu/local.mk +++ b/gnu/local.mk @@ -1969,6 +1969,7 @@ dist_patch_DATA = \ %D%/packages/patches/renpy-use-system-fribidi.patch \ %D%/packages/patches/reposurgeon-add-missing-docbook-files.patch \ %D%/packages/patches/r-httpuv-1.6.6-unvendor-libuv.patch \ + %D%/packages/patches/r-sapa-lapack.patch \ %D%/packages/patches/ri-li-modernize_cpp.patch \ %D%/packages/patches/ripperx-missing-file.patch \ %D%/packages/patches/rpcbind-CVE-2017-8779.patch \ diff --git a/gnu/packages/cran.scm b/gnu/packages/cran.scm index e544a467a5..0685049641 100644 --- a/gnu/packages/cran.scm +++ b/gnu/packages/cran.scm @@ -62,6 +62,7 @@ (define-module (gnu packages cran) #:use-module (guix utils) #:use-module (guix build-system gnu) #:use-module (guix build-system r) + #:use-module (gnu packages) #:use-module (gnu packages algebra) #:use-module (gnu packages autotools) #:use-module (gnu packages base) @@ -11144,7 +11145,8 @@ (define-public r-sapa (uri (cran-uri "sapa" version)) (sha256 (base32 - "0kj681rd4c2lvqr926lb6f4qwp281x5274dg6vbk8pf5y7s0qlpc")))) + "0kj681rd4c2lvqr926lb6f4qwp281x5274dg6vbk8pf5y7s0qlpc")) + (patches (search-patches "r-sapa-lapack.patch")))) (build-system r-build-system) (propagated-inputs (list r-ifultools r-splus2r)) diff --git a/gnu/packages/patches/r-sapa-lapack.patch b/gnu/packages/patches/r-sapa-lapack.patch new file mode 100644 index 0000000000..1911b133c5 --- /dev/null +++ b/gnu/packages/patches/r-sapa-lapack.patch @@ -0,0 +1,23 @@ +From 5eb1faf8ee2eac3057ef55c99dd3083242559b9e Mon Sep 17 00:00:00 2001 +From: dbpercival +Date: Sat, 8 Jul 2023 16:26:35 -0700 +Subject: [PATCH] Update sapa_lapack.c + +Stephen's suggested change +--- + src/sapa_lapack.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/src/sapa_lapack.c b/src/sapa_lapack.c +index eff4851..a520e33 100644 +--- a/src/sapa_lapack.c ++++ b/src/sapa_lapack.c +@@ -102,7 +102,7 @@ SEXP R_sapa_dpss(SEXP nsample, SEXP ntaper, SEXP bandwidth) + ISPLIT, + WORK1, + IWORK1, +- &INFO); ++ &INFO FCONE FCONE); + // if (INFO != 0) + // error(_("error code %d from LAPACK routine '%s'"), info, "dstebz"); + -- cgit v1.2.3 From 376bba6030cd418bf26c55422b15f4d22138ddaa Mon Sep 17 00:00:00 2001 From: Sharlatan Hellseher Date: Mon, 29 Jan 2024 23:53:50 +0000 Subject: gnu: Add (gnu packages golang-xyz) module. * gnu/packages/golang-xyz.scm: New file. * gnu/local.mk: Add to gnu/packages/golang-xyz.scm scope. Change-Id: I25e434de1adc29c2f08146f040755287c63632d6 --- gnu/local.mk | 1 + gnu/packages/golang-xyz.scm | 39 +++++++++++++++++++++++++++++++++++++++ 2 files changed, 40 insertions(+) create mode 100644 gnu/packages/golang-xyz.scm (limited to 'gnu/local.mk') diff --git a/gnu/local.mk b/gnu/local.mk index 4f868ca53e..0d6e47ceae 100644 --- a/gnu/local.mk +++ b/gnu/local.mk @@ -310,6 +310,7 @@ GNU_SYSTEM_MODULES = \ %D%/packages/golang-check.scm \ %D%/packages/golang-crypto.scm \ %D%/packages/golang-web.scm \ + %D%/packages/golang-xyz.scm \ %D%/packages/gperf.scm \ %D%/packages/gpodder.scm \ %D%/packages/gps.scm \ diff --git a/gnu/packages/golang-xyz.scm b/gnu/packages/golang-xyz.scm new file mode 100644 index 0000000000..c2484aae6b --- /dev/null +++ b/gnu/packages/golang-xyz.scm @@ -0,0 +1,39 @@ +;;; GNU Guix --- Functional package management for GNU +;;; +;;; This file is part of GNU Guix. +;;; +;;; GNU Guix is free software; you can redistribute it and/or modify it +;;; under the terms of the GNU General Public License as published by +;;; the Free Software Foundation; either version 3 of the License, or (at +;;; your option) any later version. +;;; +;;; GNU Guix is distributed in the hope that it will be useful, but +;;; WITHOUT ANY WARRANTY; without even the implied warranty of +;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +;;; GNU General Public License for more details. +;;; +;;; You should have received a copy of the GNU General Public License +;;; along with GNU Guix. If not, see . + +(define-module (gnu packages golang-xyz) + #:use-module ((guix licenses) #:prefix license:) + #:use-module (guix build-system go) + #:use-module (guix gexp) + #:use-module (guix git-download) + #:use-module (guix packages) + #:use-module (guix utils) + #:use-module (gnu packages)) + +;;; Commentary: +;;; +;;; Nomad Golang modules (libraries) are welcome here. +;;; +;;; Please: Try to add new module packages in alphabetic order. +;;; +;;; Code: + +;;; +;;; Avoid adding new packages to the end of this file. To reduce the chances +;;; of a merge conflict, place them above by existing packages with similar +;;; functionality or similar names. +;;; -- cgit v1.2.3 From 8f9bc4e95273638654a1ecff4f6101b5db833ee4 Mon Sep 17 00:00:00 2001 From: Clément Lassieur Date: Wed, 17 Jan 2024 12:56:03 +0100 Subject: gnu: torbrowser: Stop inheriting Icecat. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * gnu/local.mk (GNU_SYSTEM_MODULES): Add packages/tor-browsers.scm. * gnu/packages/gnupg.scm: Remove fix for dependency loop (fixed because we use a new file). * gnu/packages/tor-browsers.scm (mozilla-locale, mozilla-locales, %torbrowser-locales, %moz-build-date, %torbrowser-version, %torbrowser-firefox-version, translation-base-browser, translation-tor-browser, torbrowser-assets, torbrowser): New variables. (make-torbrowser): New procedure, which is a merge of ‘make-torbrowser’ (from tor.scm) with ‘icecat-minimal’ (from gnuzilla.scm). * gnu/packages/tor.scm (%moz-build-date, %torbrowser-version, %torbrowser-firefox-version, %torbrowser-locales, translation-base-browser, translation-tor-browser, torbrowser-assets, torbrowser): Remove variables. Change-Id: I5fcf73e53fe4481a18e13cdeb3515c3dc4430090 --- gnu/local.mk | 3 +- gnu/packages/gnupg.scm | 3 +- gnu/packages/tor-browsers.scm | 840 ++++++++++++++++++++++++++++++++++++++++++ gnu/packages/tor.scm | 462 ----------------------- 4 files changed, 844 insertions(+), 464 deletions(-) create mode 100644 gnu/packages/tor-browsers.scm (limited to 'gnu/local.mk') diff --git a/gnu/local.mk b/gnu/local.mk index 0d6e47ceae..fbdb285695 100644 --- a/gnu/local.mk +++ b/gnu/local.mk @@ -13,7 +13,7 @@ # Copyright © 2016-2023 Efraim Flashner # Copyright © 2016, 2017, 2018, 2019, 2020, 2021, 2022, 2023 Jan (janneke) Nieuwenhuizen # Copyright © 2017, 2018, 2019, 2020 Tobias Geerinckx-Rice -# Copyright © 2017, 2018, 2023 Clément Lassieur +# Copyright © 2017, 2018, 2023, 2024 Clément Lassieur # Copyright © 2017, 2020 Mathieu Othacehe # Copyright © 2017, 2018, 2019 Gábor Boskovits # Copyright © 2018 Amirouche Boubekki @@ -633,6 +633,7 @@ GNU_SYSTEM_MODULES = \ %D%/packages/tls.scm \ %D%/packages/tmux.scm \ %D%/packages/toolkits.scm \ + %D%/packages/tor-browsers.scm \ %D%/packages/tor.scm \ %D%/packages/tree-sitter.scm \ %D%/packages/tv.scm \ diff --git a/gnu/packages/gnupg.scm b/gnu/packages/gnupg.scm index a6ba57d7f3..171eea6600 100644 --- a/gnu/packages/gnupg.scm +++ b/gnu/packages/gnupg.scm @@ -71,6 +71,7 @@ (define-module (gnu packages gnupg) #:use-module (gnu packages swig) #:use-module (gnu packages texinfo) #:use-module (gnu packages tls) + #:use-module (gnu packages tor) #:use-module (gnu packages web) #:use-module (gnu packages xorg) #:use-module (gnu packages xdisorg) @@ -1129,7 +1130,7 @@ (define-public parcimonie perl-try-tiny perl-type-tiny perl-types-path-tiny - (@ (gnu packages tor) torsocks))) ;avoid dependency loop + torsocks)) (native-inputs (list perl-file-which perl-gnupg-interface diff --git a/gnu/packages/tor-browsers.scm b/gnu/packages/tor-browsers.scm new file mode 100644 index 0000000000..fbae549224 --- /dev/null +++ b/gnu/packages/tor-browsers.scm @@ -0,0 +1,840 @@ +;;; GNU Guix --- Functional package management for GNU +;;; Copyright © 2013, 2015 Andreas Enge +;;; Copyright © 2013-2022 Ludovic Courtès +;;; Copyright © 2014, 2015, 2016, 2017, 2018, 2019, 2020, 2021, 2022, 2023 Mark H Weaver +;;; Copyright © 2015 Sou Bunnbu +;;; Copyright © 2016, 2017, 2018, 2019, 2021 Efraim Flashner +;;; Copyright © 2016 Alex Griffin +;;; Copyright © 2017, 2023, 2024 Clément Lassieur +;;; Copyright © 2017, 2018 Nikita +;;; Copyright © 2017, 2018, 2020 Tobias Geerinckx-Rice +;;; Copyright © 2018, 2020 Ricardo Wurmus +;;; Copyright © 2019 Ivan Petkov +;;; Copyright © 2020 Oleg Pykhalov +;;; Copyright © 2020 Jakub Kądziołka +;;; Copyright © 2019, 2020 Adrian Malacoda +;;; Copyright © 2020-2023 Jonathan Brielmaier +;;; Copyright © 2020, 2022 Marius Bakke +;;; Copyright © 2021 Brice Waegeneire +;;; Copyright © 2021 Maxime Devos +;;; Copyright © 2021, 2022, 2023 Maxim Cournoyer +;;; Copyright © 2021 Baptiste Strazzul +;;; Copyright © 2022 SeerLite +;;; Copyright © 2024 Aleksandr Vityazev +;;; Copyright © 2020, 2021 André Batista +;;; +;;; This file is part of GNU Guix. +;;; +;;; GNU Guix is free software; you can redistribute it and/or modify it +;;; under the terms of the GNU General Public License as published by +;;; the Free Software Foundation; either version 3 of the License, or (at +;;; your option) any later version. +;;; +;;; GNU Guix is distributed in the hope that it will be useful, but +;;; WITHOUT ANY WARRANTY; without even the implied warranty of +;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +;;; GNU General Public License for more details. +;;; +;;; You should have received a copy of the GNU General Public License +;;; along with GNU Guix. If not, see . + +(define-module (gnu packages tor-browsers) + #:use-module ((guix licenses) #:prefix license:) + #:use-module (gnu packages assembly) + #:use-module (gnu packages base) + #:use-module (gnu packages browser-extensions) + #:use-module (gnu packages compression) + #:use-module (gnu packages cups) + #:use-module (gnu packages fontutils) + #:use-module (gnu packages gl) + #:use-module (gnu packages glib) + #:use-module (gnu packages gnome) + #:use-module (gnu packages golang) + #:use-module (gnu packages gtk) + #:use-module (gnu packages hunspell) + #:use-module (gnu packages image) + #:use-module (gnu packages kerberos) + #:use-module (gnu packages libcanberra) + #:use-module (gnu packages libevent) + #:use-module (gnu packages libffi) + #:use-module (gnu packages linux) + #:use-module (gnu packages llvm) + #:use-module (gnu packages m4) + #:use-module (gnu packages node) + #:use-module (gnu packages nss) + #:use-module (gnu packages pciutils) + #:use-module (gnu packages perl) + #:use-module (gnu packages pkg-config) + #:use-module (gnu packages pulseaudio) + #:use-module (gnu packages python) + #:use-module (gnu packages rust) + #:use-module (gnu packages rust-apps) + #:use-module (gnu packages sqlite) + #:use-module (gnu packages tor) + #:use-module (gnu packages video) + #:use-module (gnu packages xdisorg) + #:use-module (gnu packages xorg) + #:use-module (gnu packages) + #:use-module (guix build-system cargo) + #:use-module (guix build-system copy) + #:use-module (guix build-system gnu) + #:use-module (guix build-system mozilla) + #:use-module (guix download) + #:use-module (guix gexp) + #:use-module (guix git-download) + #:use-module (guix hg-download) + #:use-module (guix packages) + #:use-module (ice-9 regex) + #:use-module (guix utils)) + +(define (mozilla-locale locale changeset hash-string) + (origin + (method hg-fetch) + (uri (hg-reference + (url (string-append "https://hg.mozilla.org/l10n-central/" + locale)) + (changeset changeset))) + (file-name (string-append "mozilla-locale-" locale)) + (sha256 (base32 hash-string)))) + +(define-syntax-rule (mozilla-locales (hash-string changeset locale) ...) + #~(list (cons #$locale #$(mozilla-locale locale changeset hash-string)) + ...)) + +;; See tor-browser-build/rbm.conf for the list. +;; See browser/locales/l10n-changesets.json for the changeset. +;; See update-mozilla-locales in gnuzilla.scm to automate updating changeset. +(define %torbrowser-locales + (mozilla-locales + ;; sha256 changeset locale + ;;--------------------------------------------------------------------------- + ("14wnjv13alaj04pd8i8ysillbr3ic2jqa867rbj5ncz8h4hxxfxc" "4c7e24ef78bd" "ar") + ("0mcc15n3p7yk4zdbr3na2fm7wq2184mbcrkk3cvppkl6p4k8654d" "24d50653ab5c" "ca") + ("0ray22hdb3nrv2yi5z98cvbmpk9kpsv96a8wzad5dr4sxy44ii0d" "0d96b6b04bfb" "cs") + ("0is7qbykv2pj0z9ll9r35vwjp0x29vmfr10yjl3s0amfaqzjqpqc" "0a0b774407cc" "da") + ("0yq7m4v7d7ayg90m66j73mflrnp709qw9n7skhpsl9h1wbhrd7q7" "633986260777" "de") + ("19g2ha32syq6rjcyl4ypmy7sc9w7xkvrpkic5lfc2yja6ll9116p" "e2f2d1541e38" "el") + ("018qi9zn24kzfcidsj9lbqfg5n97r295yr8fs953nyfdbim9jsfv" "accf5e4506c0" "es-ES") + ("11prhmh2cp95dpv6z0k479mb11zbfm541bvigs3gnkh3nazjvc8q" "37aa71d77cb6" "fa") + ("1lv9l98q88ixb0ph970yzphahgzbl97x0w069bkxa54kblkv1ch1" "dc40a4fd5d0e" "fi") + ("0wx4k7mwhvpv5w0wa4y5pca2q3jac62jv804nxqnfwh1bvi90wv0" "415c1f0e84bd" "fr") + ("17j68a6rbaphfcq38mgz6s1076fyy92fk0ldw8igql6gd85qjlaa" "d271f275cf48" "ga-IE") + ("0b7qdayljb4ryyqgalvi626lzg238gyn03m3a2f7afs9zi6px526" "46f8d7c031a6" "he") + ("14xbrzvc09fcp7qzllb65nis27hkg9pg5615y29xzwiz4g090my1" "086ac0260d6b" "hu") + ("0q5s4iz02xgmbw6nnpg6xg4pwz7n55nvxb9mj8vqdakq3faybbd5" "f03a6b3069a5" "id") + ("1lwklx3nkm56420xc3kbg892jm2b6202sjw33nvv766sm9hbvcap" "5c4b61165e1d" "is") + ("1n7l5idw9399n8ih1r1d6m8vzpzhwmnxmr9i7jvygkdc8d6adp1k" "07d5e1ff5f9b" "it") + ("1w6nw9cd92p1ndy82wwlq9xizyq3i8rq0nj7118gbxbx368mk2kj" "e6f9db9ce3e6" "ja") + ("1js99gbyc1dj33xc425wb08s1aw3bfznaacrqhw3l42yw1g1ghy4" "a15eb9feea2c" "ka") + ("116a8s0k2yvijy7qf0xpqm5w66gdzs32jhc06364sdar5v34lyhh" "805b85981696" "ko") + ("1yrjrhmmd0b810kxryja1j1md3rr2zpn1j9cbg05dgp5s8i89psk" "943a26276832" "lt") + ("08zccz7gflzpr20y0hvhmdsiz6ncags39kh83cay5ivchyib5qbi" "fbef80de5499" "mk") + ("100k4ibpwys9i4ghi5xvmgwr9api67ngav2hvb613rj6hdfd57f7" "20ec0915ec35" "ms") + ("0kk3cjlpghbi7j3ndb2s0c7g838fzd2mpzg01bp0cra8lzd0n2ac" "4ab6f0d05aa6" "my") + ("1i3r2ici95mazw07m2mrf192fc6bfa3x6j3c2pcc1zg7z9srihgh" "561b0cd86ec1" "nb-NO") + ("1c0m8jhn52h1dif5bswrdwrlzppgga01y61wlii4aaaw15imd6yd" "2a55df0cc389" "nl") + ("1gssvg306b80drp7kvc35kvcxwldb5sga0bapaxhv362irq1nya8" "a64a7dab01c4" "pl") + ("1dzh13x85a7src8szbrq5pjmrbak4isln9xdwjk7a1yq4g9h7jgs" "33bf2a9f4c49" "pt-BR") + ("0jx9y7fv44wxqapmcgr924wgb1l5cm95bgpmnhnjchp1zpmyfdl5" "a367feeadd33" "ro") + ("09x2jirf04kgc118a70z0xrb3msbm7vr4f41ig4xrwf2s5b816r3" "528b76d6aaca" "ru") + ("02y898f0ncjwka474r9lw361b0kywx1w56hj09i7im4j5jrsjnh1" "fa28d9d79cd3" "sq") + ("1cyimbd42aaq2amyhdbbx26jwsns77lsfl8g9a70bsjlpwzwzryg" "cc8e8962e59c" "sv-SE") + ("03mqrvcal7i172gf9239q9fnynfp5kg9b3r1w8gr9iz7rkr22gw5" "d361502c559e" "th") + ("12srgqkqwaidcwbz0y7zr59165f7aq5k5s3b81ql7ixdbwia91pm" "f6173aca4762" "tr") + ("1d91gfx5p6wyb455syw0b57wxl1sd4b4kcdvfk92pb050rqaqfgv" "c5ad4d4f70eb" "uk") + ("1dj8q2jw60a184f018jyldl51rfmvz1cndz3kbw0cc5l5sli7hwr" "0e75c226763d" "vi") + ("1dl2dpif4wwrlpx7zkz5qf8kk4vhxyf63016xcfpbhxizqqwc1ki" "df2d025ed631" "zh-CN") + ("1c63ngff9lsc1x3pi6lnkyxw19gdc65yc67p7alzvrka3cv292ia" "11f8d68148a4" "zh-TW"))) + +;; We copy the official build id, which can be found there: +;; https://aus1.torproject.org/torbrowser/update_3/release/. +(define %moz-build-date "20240115174022") + +;; To find the last version, look at https://www.torproject.org/download/. +(define %torbrowser-version "13.0.9") + +;; To find the last Firefox version, browse +;; https://archive.torproject.org/tor-package-archive/torbrowser/<%torbrowser-version> +;; There should be only one archive that starts with +;; "src-firefox-tor-browser-". +(define %torbrowser-firefox-version "115.7.0esr-13.0-1-build1") + +;; See tor-browser-build/projects/translation/config. +(define translation-base-browser + (origin + (method git-fetch) + (uri (git-reference + (url "https://gitlab.torproject.org/tpo/translation.git") + (commit "cbd9b6c415ec2edb99237ef67ccd4f033a7b9c2a"))) + (file-name "translation-base-browser") + (sha256 + (base32 + "103dj1zzc68gxzjxwcpc4sbc6qca4zg8kkhdivzpq37ma07sp9sf")))) + +;; See tor-browser-build/projects/translation/config. +(define translation-tor-browser + (origin + (method git-fetch) + (uri (git-reference + (url "https://gitlab.torproject.org/tpo/translation.git") + (commit "767ab5111f065b82151275775af5ecf7a529ef48"))) + (file-name "translation-tor-browser") + (sha256 + (base32 + "034s0ivbama497xq0904q8p6d7n2f2aa2vn2jcs9g4bvmhgwicw4")))) + +(define torbrowser-assets + ;; This is a prebuilt Torbrowser from which we take the assets we need. + (package + (name "torbrowser-assets") + (version %torbrowser-version) + (source + (origin + (method url-fetch) + (uri + (string-append + "https://archive.torproject.org/tor-package-archive/torbrowser/" + version "/tor-browser-linux-x86_64-" version ".tar.xz")) + (sha256 + (base32 + "0j143r24xzmq38nd5z1xqsa9zp35lws9rvlj6hb9xn3dnl67gh59")))) + (arguments + (list + #:install-plan + ''(("Browser" "." #:include-regexp + ("^\\./TorBrowser/Data/Tor/torrc-defaults" + "^\\./fonts/" + "^\\./fontconfig/fonts.conf"))))) + (build-system copy-build-system) + (home-page "https://www.torproject.org") + (synopsis "Tor Browser assets") + (description "This package contains fonts and configuration files for Tor +Browser.") + (license license:silofl1.1))) + +(define* (make-torbrowser #:key + moz-app-name + moz-app-remotingname + branding-directory + assets + locales + base-browser-version) + (package + (name "torbrowser") + (version %torbrowser-version) + (source + (origin + (method url-fetch) + (uri + (string-append + "https://archive.torproject.org/tor-package-archive/torbrowser/" + version "/src-firefox-tor-browser-" %torbrowser-firefox-version + ".tar.xz")) + (sha256 + (base32 + "0h05js9j1drzw5q98nlphsmvlp1k2a71z5jd06xk6pz29w6322pw")))) + (build-system mozilla-build-system) + (inputs + (list go-gitlab-torproject-org-tpo-anti-censorship-pluggable-transports-lyrebird + tor-client + alsa-lib + bzip2 + cups + dbus-glib + gdk-pixbuf + glib + gtk+ + ;; UNBUNDLE-ME! graphite2 + cairo + pango + freetype + ;; UNBUNDLE-ME! harfbuzz + libcanberra + libgnome + libjpeg-turbo + libpng-apng + ;; UNBUNDLE-ME! libogg + ;; UNBUNDLE-ME! libtheora ; wants theora-1.2, not yet released + ;; UNBUNDLE-ME! libvorbis + libxft + libevent + libxinerama + libxscrnsaver + libxcomposite + libxt + libffi + ;; Support for FFmpeg 6 was only added in version 112 (see: + ;; https://bugzilla.mozilla.org/show_bug.cgi?id=1819374). + ffmpeg-5 + libvpx + (force (@@ (gnu packages gnuzilla) icu4c-73-promise)) + pixman + pulseaudio + mesa + pciutils + mit-krb5 + hunspell + libnotify + nspr + ;; UNBUNDLE-ME! nss (pending upgrade of 'nss' to 3.90 or later) + shared-mime-info + sqlite + eudev + unzip + zip + zlib)) + (native-inputs + (list + rust + `(,rust "cargo") + rust-cbindgen-0.24 + llvm-15 + clang-15 + perl + node-lts + python-wrapper + yasm + nasm ; XXX FIXME: only needed on x86_64 and i686 + pkg-config + m4 + which)) + (arguments + (list + #:tests? #f ;not worth the cost + + ;; Some dynamic lib was determined at runtime, so rpath check may fail. + #:validate-runpath? #f + + #:configure-flags + #~(list + "--without-relative-data-dir" ;store is read-only + "--disable-base-browser-update" + ;; Default is "default", which is the same as "nightly". + "--enable-update-channel=release" + ;; This is useless right now but it might be used in the future. + ;; (See nsAppFileLocationProvider.cpp.) + (string-append "--with-user-appdir=." #$moz-app-name) + (string-append "--with-branding=" #$branding-directory) + (string-append "--prefix=" #$output) + (string-append "--with-base-browser-version=" + #$base-browser-version) + + "--enable-application=browser" + "--with-distribution-id=org.gnu" + "--enable-geckodriver" + ;; Do not require addons in the global app or system directories to + ;; be signed by Mozilla. + "--with-unsigned-addon-scopes=app,system" + "--allow-addon-sideload" + + "--enable-pulseaudio" + + "--disable-tests" + "--disable-updater" + "--disable-crashreporter" + ;; The --disable-eme option is not available on aarch64. + #$(if (target-aarch64?) "" "--disable-eme") + + ;; Building with debugging symbols takes ~5GiB, so disable it. + "--disable-debug" + "--disable-debug-symbols" + + "--enable-rust-simd" + "--enable-release" + "--enable-optimize" + "--enable-strip" + "--disable-elf-hack" + + ;; Clang is needed to build Stylo, Mozilla's new CSS engine. We must + ;; specify the clang paths manually, because otherwise the Mozilla + ;; build system looks in the directories returned by llvm-config + ;; --bindir and llvm-config --libdir, which return paths in the llvm + ;; package where clang is not found. + (string-append "--with-clang-path=" + (search-input-file %build-inputs "bin/clang")) + (string-append "--with-libclang-path=" + (dirname (search-input-file %build-inputs + "lib/libclang.so"))) + + ;; Hack to work around missing "unofficial" branding in icecat. + "--enable-official-branding" + + ;; TODO: Add support for wasm sandboxed libraries. + "--without-wasm-sandboxed-libraries" + + ;; Avoid bundled libraries. + "--with-system-jpeg" ;must be libjpeg-turbo + "--with-system-png" ;must be libpng-apng + "--with-system-zlib" + ;; UNBUNDLE-ME! "--with-system-bz2" + ;; UNBUNDLE-ME! "--with-system-libevent" + ;; UNBUNDLE-ME! "--with-system-ogg" + ;; UNBUNDLE-ME! "--with-system-vorbis" + ;; UNBUNDLE-ME! "--with-system-theora" ; wants theora-1.2, not yet released + ;; UNBUNDLE-ME! "--with-system-libvpx" + "--with-system-icu" + "--with-system-nspr" + ;; UNBUNDLE-ME! "--with-system-nss" ; pending upgrade of 'nss' to 3.90 + + ;; UNBUNDLE-ME! "--with-system-harfbuzz" + ;; UNBUNDLE-ME! "--with-system-graphite2" + "--enable-system-pixman" + "--enable-system-ffi" + ;; UNBUNDLE-ME! "--enable-system-sqlite" + ) + + #:imported-modules %cargo-utils-modules ;for `generate-all-checksums' + + #:modules `((ice-9 ftw) + (ice-9 match) + (srfi srfi-1) + (srfi srfi-26) + (rnrs bytevectors) + (rnrs io ports) + (guix elf) + (guix build gremlin) + ,@%gnu-build-system-modules) + #:phases + #~(modify-phases %standard-phases + (add-after 'unpack 'apply-guix-specific-patches + (lambda _ + (for-each + (lambda (file) (invoke "patch" "--force" "-p1" "-i" file)) + '(#$(local-file + (search-patch "icecat-compare-paths.patch")) + #$(local-file + (search-patch "icecat-use-system-wide-dir.patch")))))) + (add-after 'apply-guix-specific-patches 'remove-bundled-libraries + (lambda _ + ;; Remove bundled libraries that we don't use, since they may + ;; contain unpatched security flaws, they waste disk space and + ;; memory, and may cause confusion. + (for-each (lambda (file) + (format #t "deleting '~a'...~%" file) + (delete-file-recursively file)) + '( ;; FIXME: Removing the bundled icu breaks configure. + ;; * The bundled icu headers are used in some places. + ;; * The version number is taken from the bundled copy. + ;;"intl/icu" + ;; + ;; FIXME: A script from the bundled nspr is used. + ;;"nsprpub" + ;; + ;; FIXME: Some of the bundled NSS sources are used + ;; to build third_party/prio. + ;;"security/nss" + ;; + ;; TODO: Use more system media libraries. See: + ;; + ;; * libtheora: esr60 wants v1.2, not yet released. + ;; * soundtouch: avoiding the bundled library would + ;; result in some loss of functionality. There's + ;; also an issue with exception handling + ;; configuration. It seems that this is needed in + ;; some moz.build: + ;; DEFINES['ST_NO_EXCEPTION_HANDLING'] = 1 + ;; * libopus + ;; * speex + ;; + "modules/freetype2" + ;; "media/libjpeg" ; needed for now, because media/libjpeg/moz.build is referenced from config/external/moz.build + ;; UNBUNDLE-ME! "modules/zlib" + ;; UNBUNDLE-ME! "ipc/chromium/src/third_party/libevent" + ;; UNBUNDLE-ME! "media/libvpx" + ;; UNBUNDLE-ME! "media/libogg" + ;; UNBUNDLE-ME! "media/libvorbis" + ;; UNBUNDLE-ME! "media/libtheora" ; wants theora-1.2, not yet released + ;; UNBUNDLE-ME! "media/libtremor" + ;; UNBUNDLE-ME! "gfx/harfbuzz" + ;; UNBUNDLE-ME! "gfx/graphite2" + "js/src/ctypes/libffi" + ;; UNBUNDLE-ME! "db/sqlite3" + )))) + (add-after 'remove-bundled-libraries 'fix-ffmpeg-runtime-linker + (lambda* (#:key inputs #:allow-other-keys) + ;; Arrange to load libavcodec.so by its absolute file name. + (substitute* "dom/media/platforms/ffmpeg/FFmpegRuntimeLinker.cpp" + (("libavcodec\\.so") + (search-input-file inputs "lib/libavcodec.so"))))) + (add-after 'fix-ffmpeg-runtime-linker 'build-sandbox-whitelist + (lambda* (#:key inputs #:allow-other-keys) + (define (runpath-of lib) + (call-with-input-file lib + (compose elf-dynamic-info-runpath + elf-dynamic-info + parse-elf + get-bytevector-all))) + (define (runpaths-of-input label) + (let* ((dir (string-append (assoc-ref inputs label) "/lib")) + (libs (find-files dir "\\.so$"))) + (append-map runpath-of libs))) + ;; Populate the sandbox read-path whitelist as needed by ffmpeg. + (let* ((whitelist + (map (cut string-append <> "/") + (delete-duplicates + `(,(string-append (assoc-ref inputs "shared-mime-info") + "/share/mime") + ,@(append-map runpaths-of-input + '("mesa" "ffmpeg")))))) + (whitelist-string (string-join whitelist ","))) + (with-output-to-file "whitelist.txt" + (lambda () + (display whitelist-string)))))) + (add-after 'patch-source-shebangs 'patch-cargo-checksums + (lambda _ + (use-modules (guix build cargo-utils)) + (let ((null-hash "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855")) + (for-each (lambda (file) + (format #t "patching checksums in ~a~%" file) + (substitute* file + (("^checksum = \".*\"") + (string-append "checksum = \"" null-hash "\"")))) + (find-files "." "Cargo.lock$")) + (for-each generate-all-checksums + '("services" + "js" + "third_party/rust" + "dom/media" + "dom/webauthn" + "toolkit" + "gfx" + "storage" + "modules" + "xpcom/rust" + "media" + "mozglue/static/rust" + "netwerk" + "remote" + "intl" + "servo" + "security/manager/ssl" + "build"))))) + (add-after 'patch-cargo-checksums 'remove-cargo-frozen-flag + (lambda _ + ;; Remove --frozen flag from cargo invokation, otherwise it'll + ;; complain that it's not able to change Cargo.lock. + ;; https://bugzilla.mozilla.org/show_bug.cgi?id=1726373 + (substitute* "build/RunCbindgen.py" + (("\"--frozen\",") "")))) + (delete 'bootstrap) + (add-before 'configure 'setenv + (lambda _ + (setenv "CONFIG_SHELL" (which "bash")) + ;; Install location is prefix/lib/$MOZ_APP_NAME. Also + ;; $MOZ_APP_NAME is the executable name. Default is + ;; "firefox". + (setenv "MOZ_APP_NAME" #$moz-app-name) + ;; Profile location (relative to "~/."). Default is + ;; lower($MOZ_APP_VENDOR/$MOZ_APP_BASENAME), which is: + ;; ~/.tor project/firefox. + (setenv "MOZ_APP_PROFILE" #$(in-vicinity + moz-app-name "browser")) + ;; WM_CLASS (default is "$MOZ_APP_NAME-$MOZ_UPDATE_CHANNEL"). + (setenv "MOZ_APP_REMOTINGNAME" #$moz-app-remotingname) + ;; Persistent state directory for the build system (default is + ;; $HOME/.mozbuild). + (setenv "MOZBUILD_STATE_PATH" + (in-vicinity (getcwd) ".mozbuild")) + (setenv "MOZ_CHROME_MULTILOCALE" + (string-join (map car #$locales))) + ;; Make build reproducible. + (setenv "MOZ_BUILD_DATE" #$%moz-build-date))) + (add-before 'configure 'mozconfig + (lambda* (#:key configure-flags #:allow-other-keys) + (with-output-to-file "mozconfig" + (lambda () + (format #t ". $topsrcdir/mozconfig-linux-x86_64~%") + (for-each (lambda (flag) + (format #t "ac_add_options ~a~%" flag)) + configure-flags))))) + ;; See tor-browser-build/projects/firefox/build. + (add-before 'configure 'copy-firefox-locales + (lambda _ + (let ((l10ncentral ".mozbuild/l10n-central")) + (mkdir-p l10ncentral) + (for-each + (lambda (lang) + (copy-recursively (cdr lang) + (in-vicinity l10ncentral + (car lang)))) + #$locales)))) + (add-after 'copy-firefox-locales 'copy-basebrowser-locales + (lambda _ + (let ((l10ncentral ".mozbuild/l10n-central")) + ;; Temporary copy so that we can use ‘mv’ to mimic + ;; tor-browser-build/projects/firefox/build. + (copy-recursively #$translation-base-browser + "translation-base-browser") + (for-each + (lambda (lang) + (system + (format + #f (string-join + '("mv" + "translation-base-browser/~a/base-browser.ftl" + "~a/~a/browser/browser/")) + lang l10ncentral lang)) + (system + (format + #f (string-join + '("mv" + "translation-base-browser/~a/*" + "~a/~a/browser/chrome/browser/")) + lang l10ncentral lang))) + (map car #$locales))))) + (add-after 'copy-basebrowser-locales 'copy-torbrowser-locales + (lambda _ + (let ((l10ncentral ".mozbuild/l10n-central")) + ;; Temporary copy so that we can use ‘mv’ to mimic + ;; tor-browser-build/projects/firefox/build. + (copy-recursively #$translation-tor-browser + "translation-tor-browser") + (for-each + (lambda (lang) + (system + (format + #f (string-join + '("mv" + "translation-tor-browser/~a/tor-browser.ftl" + "~a/~a/browser/browser/")) + lang l10ncentral lang)) + (system + (format + #f (string-join + '("mv" + "translation-tor-browser/~a/cryptoSafetyPrompt.properties" + "~a/~a/browser/chrome/browser/")) + lang l10ncentral lang)) + (system + (format + #f (string-join + '("mv" + "translation-tor-browser/~a" + "toolkit/torbutton/chrome/locale/")) + lang)) + (let ((port (open-file "toolkit/torbutton/jar.mn" "a"))) + (format port "% locale torbutton ~a %locale/~a/~%" + lang lang) + (format port " locale/~a/ (chrome/locale/~a/*)~%" + lang lang) + (close port))) + (map car #$locales))))) + (replace 'configure + (lambda _ + (invoke "./mach" "configure"))) + (add-before 'build 'fix-addons-placeholder + (lambda _ + (substitute* + "toolkit/locales/en-US/toolkit/about/aboutAddons.ftl" + (("addons.mozilla.org") "gnuzilla.gnu.org")))) + (add-before 'build 'add-bridges ;see deploy.sh + (lambda _ + (let ((port (open-file + "browser/app/profile/000-tor-browser.js" "a"))) + (display + "#include ../../../tools/torbrowser/bridges.js" port) + (newline port) + (close port)))) + (replace 'build + (lambda* (#:key (make-flags '()) (parallel-build? #t) + #:allow-other-keys) + (apply invoke "./mach" "build" + ;; mach will use a wide parallel build if possible by + ;; default, so reign it in if requested. + `(,(string-append + "-j" (number->string (if parallel-build? + (parallel-job-count) + 1))) + ,@make-flags)))) + ;; See tor-browser-build/projects/firefox/build. + (add-after 'build 'build-locales + (lambda _ + (system (string-join '("./mach package-multi-locale --locales" + "en-US $MOZ_CHROME_MULTILOCALE"))))) + (add-after 'build-locales 'neutralise-store-references + (lambda _ + ;; Mangle the store references to compilers & other build tools in + ;; about:buildconfig, reducing IceCat's closure by 1 GiB on x86-64. + (let* ((obj-dir (match (scandir "." (cut string-prefix? "obj-" <>)) + ((dir) dir))) + (file (string-append + obj-dir + "/dist/bin/chrome/toolkit/content/global/buildconfig.html"))) + (substitute* file + (("[0-9a-df-np-sv-z]{32}" hash) + (string-append (string-take hash 8) + "" + (string-drop hash 8))))))) + (replace 'install + (lambda* (#:key outputs #:allow-other-keys) + (invoke "./mach" "install") + ;; The geckodriver binary is not installed by the above, for some + ;; reason. Use 'find-files' to avoid having to deal with the + ;; system/architecture-specific file name. + (install-file (first (find-files "." "geckodriver")) + (string-append #$output "/bin")))) + (add-after 'install 'wrap-program + (lambda* (#:key inputs #:allow-other-keys) + (let* ((gtk #$(this-package-input "gtk+")) + (gtk-share (string-append gtk "/share")) + (fonts.conf (format #f "~a/lib/~a/fontconfig/fonts.conf" + #$output #$moz-app-name)) + (ld-libs '#$(cons + (file-append + (this-package-input "libcanberra") + "/lib/gtk-3.0/modules") + (map (lambda (label) + (file-append (this-package-input label) "/lib")) + '("libpng-apng" + "libxscrnsaver" + "mesa" + "pciutils" + "mit-krb5" + "eudev" + "pulseaudio" + ;; For the integration of native notifications + ;; (same reason as icedove) + "libnotify"))))) + (wrap-program (format #f "~a/lib/~a/~a" + #$output #$moz-app-name #$moz-app-name) + `("XDG_DATA_DIRS" prefix (,gtk-share)) + ;; The following line is commented out because the icecat + ;; package on guix has been observed to be unstable when + ;; using wayland, and the bundled extensions stop working. + ;; `("MOZ_ENABLE_WAYLAND" = ("1")) + `("LD_LIBRARY_PATH" prefix ,ld-libs) + `("FONTCONFIG_FILE" prefix (,fonts.conf)))))) + (add-after 'wrap-program 'install-desktop-entry + (lambda _ + (let ((apps (in-vicinity #$output "share/applications"))) + (mkdir-p apps) + (make-desktop-entry-file + (string-append apps "/" #$moz-app-name ".desktop") + #:name #$moz-app-remotingname + #:exec (format #f "~a/bin/~a %u" #$output #$moz-app-name) + #:categories '("Network" "WebBrowser" "Security") + #:startup-w-m-class #$moz-app-remotingname + #:icon #$moz-app-name)))) + (add-after 'install-desktop-entry 'install-icons + (lambda* (#:key inputs #:allow-other-keys) + (for-each + (lambda (size) + (let ((oldpath (string-append + #$branding-directory "/default" size ".png")) + (newpath (string-append + #$output "/share/icons/hicolor/" size "x" + size "/apps/" #$moz-app-name ".png"))) + (mkdir-p (dirname newpath)) + (copy-file oldpath newpath))) + '("16" "22" "24" "32" "48" "64" "128" "256")))) + (add-after 'install 'deploy-fonts + (lambda* (#:key inputs #:allow-other-keys) + (let ((lib (string-append #$output "/lib/" #$moz-app-name))) + ;; Fonts + (copy-recursively (in-vicinity #$assets "fontconfig") + (in-vicinity lib "fontconfig")) + (substitute* (in-vicinity lib "fontconfig/fonts.conf") + (("fonts") + (format #f "~a" (in-vicinity lib "fonts")))) + (delete-file-recursively (in-vicinity lib "fonts")) + (copy-recursively (in-vicinity #$assets "fonts") + (in-vicinity lib "fonts"))))) + (add-after 'deploy-fonts 'deploy-tor-assets + (lambda* (#:key inputs #:allow-other-keys) + (let ((lib (in-vicinity #$output "lib/torbrowser")) + (tor #$(this-package-input "tor-client"))) + ;; TorBrowser/Data/Tor/torrc-defaults + (copy-recursively (in-vicinity #$assets "TorBrowser") + (in-vicinity lib "TorBrowser")) + (substitute* + (in-vicinity lib "TorBrowser/Data/Tor/torrc-defaults") + (("exec ./TorBrowser/Tor/PluggableTransports/lyrebird") + (string-append + "exec " (search-input-file inputs "bin/lyrebird")))) + ;; The geoip and geoip6 files are in the same directory as + ;; torrc-defaults. (See TorProcess.sys.mjs.) + (mkdir-p (in-vicinity lib "TorBrowser/Data/Tor")) + (copy-file (in-vicinity tor "share/tor/geoip6") + (in-vicinity lib "TorBrowser/Data/Tor/geoip6")) + (copy-file (in-vicinity tor "share/tor/geoip") + (in-vicinity lib "TorBrowser/Data/Tor/geoip"))))) + (add-after 'install 'autoconfig + (lambda* (#:key inputs #:allow-other-keys) + (let ((lib (string-append #$output "/lib/" #$moz-app-name)) + (config-file (string-append #$moz-app-name ".cfg"))) + (with-output-to-file (in-vicinity + lib "defaults/pref/autoconfig.js") + (lambda () + (format #t "// first line must be a comment~%") + (format #t "pref(~s, ~s);~%" + "general.config.filename" config-file) + (format #t "pref(~s, ~a);~%" + "general.config.obscure_value" "0"))) + (with-output-to-file (in-vicinity lib config-file) + (lambda () + (format #t "// first line must be a comment~%") + ;; Required for Guix packaged extensions + ;; SCOPE_PROFILE=1, SCOPE_APPLICATION=4, SCOPE_SYSTEM=8 + ;; Default is 5. + (format #t "pref(~s, ~a);~%" + "extensions.enabledScopes" "13") + (format #t "pref(~s, ~s);~%" + "security.sandbox.content.read_path_whitelist" + (call-with-input-file "whitelist.txt" + get-string-all)) + ;; Add-ons pannel (see settings.js in Icecat source). + (format #t "pref(~s, ~s);~%" + "extensions.getAddons.search.browseURL" + "https://gnuzilla.gnu.org/mozzarella") + (format #t "pref(~s, ~s);~%" + "extensions.getAddons.get.url" + "https://gnuzilla.gnu.org/mozzarella") + (format #t "pref(~s, ~s);~%" + "extensions.getAddons.link.url" + "https://gnuzilla.gnu.org/mozzarella") + (format #t "pref(~s, ~s);~%" + "extensions.getAddons.discovery.api_url" + "https://gnuzilla.gnu.org/mozzarella") + (format #t "pref(~s, ~s);~%" + "extensions.getAddons.langpacks.url" + "https://gnuzilla.gnu.org/mozzarella") + (format #t "pref(~s, ~s);~%" + "lightweightThemes.getMoreURL" + "https://gnuzilla.gnu.org/mozzarella")))))) + (add-after 'autoconfig 'autoconfig-tor + (lambda* (#:key inputs #:allow-other-keys) + (let ((lib (in-vicinity #$output "lib/torbrowser")) + (config-file (string-append #$moz-app-name ".cfg"))) + (let ((port (open-file (in-vicinity lib config-file) "a"))) + (format port "pref(~s, ~s);~%" + "extensions.torlauncher.torrc-defaults_path" + (in-vicinity + lib "TorBrowser/Data/Tor/torrc-defaults")) + (format port "pref(~s, ~s);~%" + "extensions.torlauncher.tor_path" + (search-input-file inputs "bin/tor")) + (close port)))))))) + (propagated-inputs + (list noscript/icecat)) + (native-search-paths + (list (search-path-specification + (variable "ICECAT_SYSTEM_DIR") + (separator #f) ;single entry + (files '("lib/icecat"))))) + (home-page "https://www.torproject.org") + (synopsis "Anonymous browser derived from Mozilla Firefox") + (description + "Tor Browser is the Tor Project version of Firefox browser. It is the +only recommended way to anonymously browse the web that is supported by the +project. It modifies Firefox in order to avoid many know application level +attacks on the privacy of Tor users.") + (license license:mpl2.0))) ;And others, see + ;toolkit/content/license.html + +(define-public torbrowser + (make-torbrowser #:moz-app-name "torbrowser" + #:moz-app-remotingname "Tor Browser" + #:branding-directory "browser/branding/tb-release" + #:assets torbrowser-assets + #:locales %torbrowser-locales + #:base-browser-version %torbrowser-version)) diff --git a/gnu/packages/tor.scm b/gnu/packages/tor.scm index 8cbf8f5f8c..4b356b6cc1 100644 --- a/gnu/packages/tor.scm +++ b/gnu/packages/tor.scm @@ -13,7 +13,6 @@ ;;; Copyright © 2021-2023 Danial Behzadi ;;; Copyright © 2022 Maxim Cournoyer ;;; Copyright © 2022 Jim Newsome -;;; Copyright © 2023, 2024 Clément Lassieur ;;; ;;; This file is part of GNU Guix. ;;; @@ -37,16 +36,11 @@ (define-module (gnu packages tor) #:use-module (guix utils) #:use-module (guix download) #:use-module (guix git-download) - #:use-module (guix hg-download) - #:use-module (guix build-system copy) #:use-module (guix build-system gnu) - #:use-module (guix build-system mozilla) #:use-module (guix build-system python) #:use-module (guix build-system pyproject) #:use-module (gnu packages) #:use-module (gnu packages base) - #:use-module (gnu packages bash) - #:use-module (gnu packages browser-extensions) #:use-module (gnu packages libevent) #:use-module (gnu packages linux) #:use-module (gnu packages check) @@ -54,8 +48,6 @@ (define-module (gnu packages tor) #:use-module (gnu packages pcre) #:use-module (gnu packages freedesktop) #:use-module (gnu packages glib) - #:use-module (gnu packages golang) - #:use-module (gnu packages gnuzilla) #:use-module (gnu packages pkg-config) #:use-module (gnu packages python) #:use-module (gnu packages python-check) @@ -491,457 +483,3 @@ (define-public tractor the onion proxy and sets up proxy in user session, so you don't have to mess up with TOR on your system anymore.") (license license:gpl3+))) - -(define (mozilla-locale locale changeset hash-string) - (origin - (method hg-fetch) - (uri (hg-reference - (url (string-append "https://hg.mozilla.org/l10n-central/" - locale)) - (changeset changeset))) - (file-name (string-append "mozilla-locale-" locale)) - (sha256 (base32 hash-string)))) - -(define-syntax-rule (mozilla-locales (hash-string changeset locale) ...) - #~(list (cons #$locale #$(mozilla-locale locale changeset hash-string)) - ...)) - -;; See tor-browser-build/rbm.conf for the list. -;; See browser/locales/l10n-changesets.json for the changeset. -;; See update-mozilla-locales in gnuzilla.scm to automate updating changeset. -(define %torbrowser-locales - (mozilla-locales - ;; sha256 changeset locale - ;;--------------------------------------------------------------------------- - ("14wnjv13alaj04pd8i8ysillbr3ic2jqa867rbj5ncz8h4hxxfxc" "4c7e24ef78bd" "ar") - ("0mcc15n3p7yk4zdbr3na2fm7wq2184mbcrkk3cvppkl6p4k8654d" "24d50653ab5c" "ca") - ("0ray22hdb3nrv2yi5z98cvbmpk9kpsv96a8wzad5dr4sxy44ii0d" "0d96b6b04bfb" "cs") - ("0is7qbykv2pj0z9ll9r35vwjp0x29vmfr10yjl3s0amfaqzjqpqc" "0a0b774407cc" "da") - ("0yq7m4v7d7ayg90m66j73mflrnp709qw9n7skhpsl9h1wbhrd7q7" "633986260777" "de") - ("19g2ha32syq6rjcyl4ypmy7sc9w7xkvrpkic5lfc2yja6ll9116p" "e2f2d1541e38" "el") - ("018qi9zn24kzfcidsj9lbqfg5n97r295yr8fs953nyfdbim9jsfv" "accf5e4506c0" "es-ES") - ("11prhmh2cp95dpv6z0k479mb11zbfm541bvigs3gnkh3nazjvc8q" "37aa71d77cb6" "fa") - ("1lv9l98q88ixb0ph970yzphahgzbl97x0w069bkxa54kblkv1ch1" "dc40a4fd5d0e" "fi") - ("0wx4k7mwhvpv5w0wa4y5pca2q3jac62jv804nxqnfwh1bvi90wv0" "415c1f0e84bd" "fr") - ("17j68a6rbaphfcq38mgz6s1076fyy92fk0ldw8igql6gd85qjlaa" "d271f275cf48" "ga-IE") - ("0b7qdayljb4ryyqgalvi626lzg238gyn03m3a2f7afs9zi6px526" "46f8d7c031a6" "he") - ("14xbrzvc09fcp7qzllb65nis27hkg9pg5615y29xzwiz4g090my1" "086ac0260d6b" "hu") - ("0q5s4iz02xgmbw6nnpg6xg4pwz7n55nvxb9mj8vqdakq3faybbd5" "f03a6b3069a5" "id") - ("1lwklx3nkm56420xc3kbg892jm2b6202sjw33nvv766sm9hbvcap" "5c4b61165e1d" "is") - ("1n7l5idw9399n8ih1r1d6m8vzpzhwmnxmr9i7jvygkdc8d6adp1k" "07d5e1ff5f9b" "it") - ("1w6nw9cd92p1ndy82wwlq9xizyq3i8rq0nj7118gbxbx368mk2kj" "e6f9db9ce3e6" "ja") - ("1js99gbyc1dj33xc425wb08s1aw3bfznaacrqhw3l42yw1g1ghy4" "a15eb9feea2c" "ka") - ("116a8s0k2yvijy7qf0xpqm5w66gdzs32jhc06364sdar5v34lyhh" "805b85981696" "ko") - ("1yrjrhmmd0b810kxryja1j1md3rr2zpn1j9cbg05dgp5s8i89psk" "943a26276832" "lt") - ("08zccz7gflzpr20y0hvhmdsiz6ncags39kh83cay5ivchyib5qbi" "fbef80de5499" "mk") - ("100k4ibpwys9i4ghi5xvmgwr9api67ngav2hvb613rj6hdfd57f7" "20ec0915ec35" "ms") - ("0kk3cjlpghbi7j3ndb2s0c7g838fzd2mpzg01bp0cra8lzd0n2ac" "4ab6f0d05aa6" "my") - ("1i3r2ici95mazw07m2mrf192fc6bfa3x6j3c2pcc1zg7z9srihgh" "561b0cd86ec1" "nb-NO") - ("1c0m8jhn52h1dif5bswrdwrlzppgga01y61wlii4aaaw15imd6yd" "2a55df0cc389" "nl") - ("1gssvg306b80drp7kvc35kvcxwldb5sga0bapaxhv362irq1nya8" "a64a7dab01c4" "pl") - ("1dzh13x85a7src8szbrq5pjmrbak4isln9xdwjk7a1yq4g9h7jgs" "33bf2a9f4c49" "pt-BR") - ("0jx9y7fv44wxqapmcgr924wgb1l5cm95bgpmnhnjchp1zpmyfdl5" "a367feeadd33" "ro") - ("09x2jirf04kgc118a70z0xrb3msbm7vr4f41ig4xrwf2s5b816r3" "528b76d6aaca" "ru") - ("02y898f0ncjwka474r9lw361b0kywx1w56hj09i7im4j5jrsjnh1" "fa28d9d79cd3" "sq") - ("1cyimbd42aaq2amyhdbbx26jwsns77lsfl8g9a70bsjlpwzwzryg" "cc8e8962e59c" "sv-SE") - ("03mqrvcal7i172gf9239q9fnynfp5kg9b3r1w8gr9iz7rkr22gw5" "d361502c559e" "th") - ("12srgqkqwaidcwbz0y7zr59165f7aq5k5s3b81ql7ixdbwia91pm" "f6173aca4762" "tr") - ("1d91gfx5p6wyb455syw0b57wxl1sd4b4kcdvfk92pb050rqaqfgv" "c5ad4d4f70eb" "uk") - ("1dj8q2jw60a184f018jyldl51rfmvz1cndz3kbw0cc5l5sli7hwr" "0e75c226763d" "vi") - ("1dl2dpif4wwrlpx7zkz5qf8kk4vhxyf63016xcfpbhxizqqwc1ki" "df2d025ed631" "zh-CN") - ("1c63ngff9lsc1x3pi6lnkyxw19gdc65yc67p7alzvrka3cv292ia" "11f8d68148a4" "zh-TW"))) - -;; We copy the official build id, which can be found there: -;; https://aus1.torproject.org/torbrowser/update_3/release/. -(define %moz-build-date "20240115174022") - -;; To find the last version, look at https://www.torproject.org/download/. -(define %torbrowser-version "13.0.9") - -;; To find the last Firefox version, browse -;; https://archive.torproject.org/tor-package-archive/torbrowser/<%torbrowser-version> -;; There should be only one archive that starts with -;; "src-firefox-tor-browser-". -(define %torbrowser-firefox-version "115.7.0esr-13.0-1-build1") - -;; See tor-browser-build/projects/translation/config. -(define translation-base-browser - (origin - (method git-fetch) - (uri (git-reference - (url "https://gitlab.torproject.org/tpo/translation.git") - (commit "cbd9b6c415ec2edb99237ef67ccd4f033a7b9c2a"))) - (file-name "translation-base-browser") - (sha256 - (base32 - "103dj1zzc68gxzjxwcpc4sbc6qca4zg8kkhdivzpq37ma07sp9sf")))) - -;; See tor-browser-build/projects/translation/config. -(define translation-tor-browser - (origin - (method git-fetch) - (uri (git-reference - (url "https://gitlab.torproject.org/tpo/translation.git") - (commit "767ab5111f065b82151275775af5ecf7a529ef48"))) - (file-name "translation-tor-browser") - (sha256 - (base32 - "034s0ivbama497xq0904q8p6d7n2f2aa2vn2jcs9g4bvmhgwicw4")))) - -(define torbrowser-assets - ;; This is a prebuilt Torbrowser from which we take the assets we need. - (package - (name "torbrowser-assets") - (version %torbrowser-version) - (source - (origin - (method url-fetch) - (uri - (string-append - "https://archive.torproject.org/tor-package-archive/torbrowser/" - version "/tor-browser-linux-x86_64-" version ".tar.xz")) - (sha256 - (base32 - "0j143r24xzmq38nd5z1xqsa9zp35lws9rvlj6hb9xn3dnl67gh59")))) - (arguments - (list - #:install-plan - ''(("Browser" "." #:include-regexp - ("^\\./TorBrowser/Data/Tor/torrc-defaults" - "^\\./fonts/" - "^\\./fontconfig/fonts.conf"))))) - (build-system copy-build-system) - (home-page "https://www.torproject.org") - (synopsis "Tor Browser assets") - (description "This package contains fonts and configuration files for Tor -Browser.") - (license license:silofl1.1))) - -(define-public torbrowser - (package - (inherit icecat-minimal) - (name "torbrowser") - (version %torbrowser-version) - (source - (origin - (method url-fetch) - (uri - (string-append - "https://archive.torproject.org/tor-package-archive/torbrowser/" - version "/src-firefox-tor-browser-" %torbrowser-firefox-version - ".tar.xz")) - (sha256 - (base32 - "0h05js9j1drzw5q98nlphsmvlp1k2a71z5jd06xk6pz29w6322pw")))) - (build-system mozilla-build-system) - (arguments - (substitute-keyword-arguments (package-arguments icecat-minimal) - ((#:configure-flags flags '()) - #~(cons* - "--without-relative-data-dir" ;store is read-only - "--disable-base-browser-update" - ;; Default is "default", which is the same as "nightly". - "--enable-update-channel=release" - "--with-user-appdir=.torbrowser" - "--with-branding=browser/branding/tb-release" - (string-append "--prefix=" #$output) - (string-append "--with-base-browser-version=" #$version) - #$flags)) - ((#:phases phases) - #~(modify-phases #$phases - (add-before 'configure 'setenv - (lambda _ - (setenv "CONFIG_SHELL" (which "bash")) - ;; Install location is prefix/lib/$MOZ_APP_NAME. Also - ;; $MOZ_APP_NAME is the executable name. Default is - ;; "firefox". - (setenv "MOZ_APP_NAME" "torbrowser") - ;; Profile location (relative to "~/."). Default is - ;; lower($MOZ_APP_VENDOR/$MOZ_APP_BASENAME), which is: - ;; ~/.tor project/firefox. - (setenv "MOZ_APP_PROFILE" "torbrowser/browser") - ;; WM_CLASS (default is "$MOZ_APP_NAME-$MOZ_UPDATE_CHANNEL"). - (setenv "MOZ_APP_REMOTINGNAME" "Tor Browser") - ;; Persistent state directory for the build system (default is - ;; $HOME/.mozbuild). - (setenv "MOZBUILD_STATE_PATH" - (in-vicinity (getcwd) ".mozbuild")) - (setenv "MOZ_CHROME_MULTILOCALE" - (string-join (map car #$%torbrowser-locales))) - ;; Make build reproducible. - (setenv "MOZ_BUILD_DATE" #$%moz-build-date))) - (add-before 'configure 'mozconfig - (lambda* (#:key configure-flags #:allow-other-keys) - (with-output-to-file "mozconfig" - (lambda () - (format #t ". $topsrcdir/mozconfig-linux-x86_64~%") - (for-each (lambda (flag) - (format #t "ac_add_options ~a~%" flag)) - configure-flags))))) - (replace 'configure - (lambda _ - (invoke "./mach" "configure"))) - ;; See tor-browser-build/projects/firefox/build. - (add-before 'configure 'copy-firefox-locales - (lambda _ - (let ((l10ncentral ".mozbuild/l10n-central")) - (mkdir-p l10ncentral) - (for-each - (lambda (lang) - (copy-recursively (cdr lang) - (in-vicinity l10ncentral (car lang)))) - #$%torbrowser-locales)))) - (add-after 'copy-firefox-locales 'copy-basebrowser-locales - (lambda _ - (let ((l10ncentral ".mozbuild/l10n-central")) - ;; Temporary copy so that we can use ‘mv’ to mimic - ;; tor-browser-build/projects/firefox/build. - (copy-recursively #$translation-base-browser - "translation-base-browser") - (for-each - (lambda (lang) - (system - (format - #f (string-join - '("mv" - "translation-base-browser/~a/base-browser.ftl" - "~a/~a/browser/browser/")) - lang l10ncentral lang)) - (system - (format - #f (string-join - '("mv" - "translation-base-browser/~a/*" - "~a/~a/browser/chrome/browser/")) - lang l10ncentral lang))) - (map car #$%torbrowser-locales))))) - (add-after 'copy-basebrowser-locales 'copy-torbrowser-locales - (lambda _ - (let ((l10ncentral ".mozbuild/l10n-central")) - ;; Temporary copy so that we can use ‘mv’ to mimic - ;; tor-browser-build/projects/firefox/build. - (copy-recursively #$translation-tor-browser - "translation-tor-browser") - (for-each - (lambda (lang) - (system - (format - #f (string-join - '("mv" - "translation-tor-browser/~a/tor-browser.ftl" - "~a/~a/browser/browser/")) - lang l10ncentral lang)) - (system - (format - #f (string-join - '("mv" - "translation-tor-browser/~a/cryptoSafetyPrompt.properties" - "~a/~a/browser/chrome/browser/")) - lang l10ncentral lang)) - (system - (format - #f (string-join - '("mv" - "translation-tor-browser/~a" - "toolkit/torbutton/chrome/locale/")) - lang)) - (let ((port (open-file "toolkit/torbutton/jar.mn" "a"))) - (format port "% locale torbutton ~a %locale/~a/~%" - lang lang) - (format port " locale/~a/ (chrome/locale/~a/*)~%" - lang lang) - (close port))) - (map car #$%torbrowser-locales))))) - (add-before 'build 'fix-addons-placeholder - (lambda _ - (substitute* - "toolkit/locales/en-US/toolkit/about/aboutAddons.ftl" - (("addons.mozilla.org") "gnuzilla.gnu.org")))) - (add-before 'build 'add-bridges ;see deploy.sh - (lambda _ - (let ((port (open-file - "browser/app/profile/000-tor-browser.js" "a"))) - (display - "#include ../../../tools/torbrowser/bridges.js" port) - (newline port) - (close port)))) - ;; See tor-browser-build/projects/firefox/build. - (add-after 'build 'build-locales - (lambda _ - (system (string-join '("./mach package-multi-locale --locales" - "en-US $MOZ_CHROME_MULTILOCALE"))))) - (add-after 'install 'deploy-assets - (lambda* (#:key inputs #:allow-other-keys) - (let ((lib (in-vicinity #$output "lib/torbrowser")) - (tor #$(this-package-input "tor-client"))) - ;; TorBrowser/Data/Tor/torrc-defaults - (copy-recursively (in-vicinity - #$torbrowser-assets "TorBrowser") - (in-vicinity lib "TorBrowser")) - (substitute* - (in-vicinity lib "TorBrowser/Data/Tor/torrc-defaults") - (("exec ./TorBrowser/Tor/PluggableTransports/lyrebird") - (string-append - "exec " (search-input-file inputs "bin/lyrebird")))) - ;; The geoip and geoip6 files are in the same directory as - ;; torrc-defaults. (See TorProcess.sys.mjs.) - (mkdir-p (in-vicinity lib "TorBrowser/Data/Tor")) - (copy-file (in-vicinity tor "share/tor/geoip") - (in-vicinity lib "TorBrowser/Data/Tor/geoip")) - (copy-file (in-vicinity tor "share/tor/geoip6") - (in-vicinity lib "TorBrowser/Data/Tor/geoip6")) - ;; Fonts - (copy-recursively (in-vicinity - #$torbrowser-assets "fontconfig") - (in-vicinity lib "fontconfig")) - (substitute* (in-vicinity lib "fontconfig/fonts.conf") - (("fonts") - (format #f "~a" (in-vicinity lib "fonts")))) - (delete-file-recursively (in-vicinity lib "fonts")) - (copy-recursively (in-vicinity #$torbrowser-assets "fonts") - (in-vicinity lib "fonts"))))) - (replace 'build-sandbox-whitelist - (lambda* (#:key inputs #:allow-other-keys) - (define (runpath-of lib) - (call-with-input-file lib - (compose elf-dynamic-info-runpath - elf-dynamic-info - parse-elf - get-bytevector-all))) - (define (runpaths-of-input label) - (let* ((dir (string-append (assoc-ref inputs label) "/lib")) - (libs (find-files dir "\\.so$"))) - (append-map runpath-of libs))) - ;; Populate the sandbox read-path whitelist as needed by ffmpeg. - (let* ((whitelist - (map (cut string-append <> "/") - (delete-duplicates - `(,(string-append (assoc-ref inputs "shared-mime-info") - "/share/mime") - ,@(append-map runpaths-of-input - '("mesa" "ffmpeg")))))) - (whitelist-string (string-join whitelist ","))) - (with-output-to-file "whitelist.txt" - (lambda () - (display whitelist-string)))))) - (add-after 'install 'autoconfig - (lambda* (#:key inputs #:allow-other-keys) - (let ((lib (in-vicinity #$output "lib/torbrowser")) - (config-file "tor-browser.cfg")) - (with-output-to-file (in-vicinity - lib "defaults/pref/autoconfig.js") - (lambda () - (format #t "// first line must be a comment~%") - (format #t "pref(~s, ~s);~%" - "general.config.filename" config-file) - (format #t "pref(~s, ~a);~%" - "general.config.obscure_value" "0"))) - (with-output-to-file (in-vicinity lib config-file) - (lambda () - (format #t "// first line must be a comment~%") - (format #t "pref(~s, ~s);~%" - "extensions.torlauncher.torrc-defaults_path" - (in-vicinity - lib "TorBrowser/Data/Tor/torrc-defaults")) - (format #t "pref(~s, ~s);~%" - "extensions.torlauncher.tor_path" - (search-input-file inputs "bin/tor")) - ;; Required for Guix packaged extensions - ;; SCOPE_PROFILE=1, SCOPE_APPLICATION=4, SCOPE_SYSTEM=8 - ;; Default is 5. - (format #t "pref(~s, ~a);~%" - "extensions.enabledScopes" "13") - (format #t "pref(~s, ~s);~%" - "security.sandbox.content.read_path_whitelist" - (call-with-input-file "whitelist.txt" - get-string-all)) - ;; Add-ons pannel (see settings.js in Icecat source). - (format #t "pref(~s, ~s);~%" - "extensions.getAddons.search.browseURL" - "https://gnuzilla.gnu.org/mozzarella") - (format #t "pref(~s, ~s);~%" - "extensions.getAddons.get.url" - "https://gnuzilla.gnu.org/mozzarella") - (format #t "pref(~s, ~s);~%" - "extensions.getAddons.link.url" - "https://gnuzilla.gnu.org/mozzarella") - (format #t "pref(~s, ~s);~%" - "extensions.getAddons.discovery.api_url" - "https://gnuzilla.gnu.org/mozzarella") - (format #t "pref(~s, ~s);~%" - "extensions.getAddons.langpacks.url" - "https://gnuzilla.gnu.org/mozzarella") - (format #t "pref(~s, ~s);~%" - "lightweightThemes.getMoreURL" - "https://gnuzilla.gnu.org/mozzarella")))))) - (replace 'wrap-program - (lambda* (#:key inputs #:allow-other-keys) - (let* ((gtk #$(this-package-input "gtk+")) - (gtk-share (string-append gtk "/share")) - (fonts.conf (in-vicinity - #$output - "lib/torbrowser/fontconfig/fonts.conf")) - (ld-libs '#$(cons - (file-append - (this-package-input "libcanberra") - "/lib/gtk-3.0/modules") - (map - (lambda (label) - (file-append - (this-package-input label) "/lib")) - '("libpng-apng" - "libxscrnsaver" - "mesa" - "pciutils" - "mit-krb5" - "eudev" - "pulseaudio" - "libnotify"))))) - (wrap-program - (in-vicinity #$output "lib/torbrowser/torbrowser") - `("XDG_DATA_DIRS" prefix (,gtk-share)) - `("LD_LIBRARY_PATH" prefix ,ld-libs) - `("FONTCONFIG_FILE" prefix (,fonts.conf)))))) - (replace 'install-desktop-entry - (lambda _ - (let ((apps (in-vicinity #$output "share/applications"))) - (mkdir-p apps) - (make-desktop-entry-file - (in-vicinity apps "torbrowser.desktop") - #:name "Tor Browser" - #:exec - (format #f "~a %u" (in-vicinity #$output "bin/torbrowser")) - #:comment - "Tor Browser is +1 for privacy and -1 for mass surveillance" - #:categories '("Network" "WebBrowser" "Security") - #:startup-w-m-class "Tor Browser" - #:icon "tor-browser")))) - (replace 'install-icons - (lambda* (#:key inputs #:allow-other-keys) - (for-each - (lambda (size) - (let ((oldpath (string-append - "browser/branding/tb-release/default" - size ".png")) - (newpath (string-append #$output - "/share/icons/hicolor/" - size "x" size "/apps"))) - (mkdir-p newpath) - (copy-file oldpath - (in-vicinity newpath "tor-browser.png")))) - '("16" "22" "24" "32" "48" "64" "128" "256")))))))) - (inputs - (modify-inputs (package-inputs icecat-minimal) - (append go-gitlab-torproject-org-tpo-anti-censorship-pluggable-transports-lyrebird - tor-client))) - (propagated-inputs - (list noscript/icecat)) - (home-page "https://www.torproject.org") - (synopsis "Anonymous browser derived from Mozilla Firefox") - (description - "Tor Browser is the Tor Project version of Firefox browser. It is the -only recommended way to anonymously browse the web that is supported by the -project. It modifies Firefox in order to avoid many know application level -attacks on the privacy of Tor users.") - (license license:mpl2.0))) ;And others, see - ;toolkit/content/license.html -- cgit v1.2.3