From 940e158249038067d3e57eb733cce0ff795b99ed Mon Sep 17 00:00:00 2001 From: FiliusPatris Date: Wed, 9 Jun 2021 23:40:15 +0200 Subject: [PATCH 1/2] New package: bazel-4.1.0 --- ...6dd026e90336e80616a8c1004a79a2f8640c.patch | 40 +++++++++++++++++++ srcpkgs/bazel/template | 28 +++++++++++++ 2 files changed, 68 insertions(+) create mode 100644 srcpkgs/bazel/patches/bcce6dd026e90336e80616a8c1004a79a2f8640c.patch create mode 100644 srcpkgs/bazel/template diff --git a/srcpkgs/bazel/patches/bcce6dd026e90336e80616a8c1004a79a2f8640c.patch b/srcpkgs/bazel/patches/bcce6dd026e90336e80616a8c1004a79a2f8640c.patch new file mode 100644 index 000000000000..88f69b76def9 --- /dev/null +++ b/srcpkgs/bazel/patches/bcce6dd026e90336e80616a8c1004a79a2f8640c.patch @@ -0,0 +1,40 @@ +From bcce6dd026e90336e80616a8c1004a79a2f8640c Mon Sep 17 00:00:00 2001 +From: philwo +Date: Thu, 20 May 2021 08:13:09 -0700 +Subject: [PATCH] Add the TEMP_FAILURE_RETRY macro to linux-sandbox-pid1.cc. + +This allows us to build Bazel on Linux systems which use a C standard library that does not include this macro, like Alpine Linux (which uses musl). + +Fixes #12460. + +PiperOrigin-RevId: 374873483 +--- + src/main/tools/linux-sandbox-pid1.cc | 13 +++++++++++++ + 1 file changed, 13 insertions(+) + +diff --git a/src/main/tools/linux-sandbox-pid1.cc b/src/main/tools/linux-sandbox-pid1.cc +index 5c9c53cb9cd2..5e7c64a7ac7b 100644 +--- a/src/main/tools/linux-sandbox-pid1.cc ++++ b/src/main/tools/linux-sandbox-pid1.cc +@@ -49,6 +49,19 @@ + #include + #endif + ++#ifndef TEMP_FAILURE_RETRY ++// Some C standard libraries like musl do not define this macro, so we'll ++// include our own version for compatibility. ++#define TEMP_FAILURE_RETRY(exp) \ ++ ({ \ ++ decltype(exp) _rc; \ ++ do { \ ++ _rc = (exp); \ ++ } while (_rc == -1 && errno == EINTR); \ ++ _rc; \ ++ }) ++#endif // TEMP_FAILURE_RETRY ++ + #include "src/main/tools/linux-sandbox-options.h" + #include "src/main/tools/linux-sandbox.h" + #include "src/main/tools/logging.h" + + diff --git a/srcpkgs/bazel/template b/srcpkgs/bazel/template new file mode 100644 index 000000000000..1d26a136b0aa --- /dev/null +++ b/srcpkgs/bazel/template @@ -0,0 +1,28 @@ +# Template file for 'bazel' +pkgname=bazel +version=4.1.0 +revision=3 +create_wrksrc=yes +makedepends="which zip unzip openjdk11 python3" +depends="openjdk11" +short_desc="Fast, scalable, multi-language and extensible build system" +maintainer="TobTobXX " +license="Apache-2.0" +homepage="https://bazel.build/" +distfiles="https://github.com/bazelbuild/bazel/releases/download/${version}/bazel-${version}-dist.zip" +checksum=f377d755c96a50f6bd2f423562598d822f43356783330a0b780ad442864d6eeb + +patch_args=-Np1 + +# Stripping breaks the binary: +# https://github.com/bazelbuild/bazel/issues/600#issuecomment-156456154 +nostrip=yes + +# Instructions for bootstrapping bazel are here: +# https://docs.bazel.build/versions/4.1.0/install-compile-source.html#bootstrap-bazel +do_build() { + env EXTRA_BAZEL_ARGS="--host_javabase=@local_jdk//:jdk" bash ./compile.sh +} +do_install() { + vbin output/bazel +} From c0bbd21ee36a35de94b65c7e6ed003b83be8b6bb Mon Sep 17 00:00:00 2001 From: FiliusPatris Date: Thu, 10 Jun 2021 23:28:26 +0200 Subject: [PATCH 2/2] anki: update to 2.1.44. --- srcpkgs/anki/patches/fix_mpv_args.patch | 29 ---------------- srcpkgs/anki/patches/local-nodejs.diff | 46 +++++++++++++++++++++++++ srcpkgs/anki/template | 22 ++++++------ 3 files changed, 56 insertions(+), 41 deletions(-) delete mode 100644 srcpkgs/anki/patches/fix_mpv_args.patch create mode 100644 srcpkgs/anki/patches/local-nodejs.diff diff --git a/srcpkgs/anki/patches/fix_mpv_args.patch b/srcpkgs/anki/patches/fix_mpv_args.patch deleted file mode 100644 index 96dec5eceaf0..000000000000 --- a/srcpkgs/anki/patches/fix_mpv_args.patch +++ /dev/null @@ -1,29 +0,0 @@ ---- ./anki/mpv.py -+++ ./anki/mpv.py -@@ -104,9 +104,9 @@ - """ - self.argv = [self.executable] - self.argv += self.default_argv -- self.argv += ["--input-ipc-server", self._sock_filename] -+ self.argv += ["--input-ipc-server="+self._sock_filename] - if self.window_id is not None: -- self.argv += ["--wid", str(self.window_id)] -+ self.argv += ["--wid="+str(self.window_id)] - - def _start_process(self): - """Start the mpv process. - ---- ./anki/sound.py -+++ ./anki/sound.py -@@ -123,10 +123,7 @@ - - def setMpvConfigBase(base): - mpvConfPath = os.path.join(base, "mpv.conf") -- MpvManager.default_argv += [ -- "--no-config", -- "--include="+mpvConfPath, -- ] -+ MpvManager.default_argv += ["--include="+mpvConfPath] - - mpvManager = None - diff --git a/srcpkgs/anki/patches/local-nodejs.diff b/srcpkgs/anki/patches/local-nodejs.diff new file mode 100644 index 000000000000..21f3b15de1df --- /dev/null +++ b/srcpkgs/anki/patches/local-nodejs.diff @@ -0,0 +1,46 @@ +diff --git a/defs.bzl b/defs.bzl +index eff3d9df2..fb2e9f7fe 100644 +--- a/defs.bzl ++++ b/defs.bzl +@@ -41,7 +41,15 @@ def setup_deps(): + python_runtime = "@python//:python", + ) + +- node_repositories(package_json = ["@net_ankiweb_anki//ts:package.json"]) ++ native.local_repository( ++ name = "local_node", ++ path = "local_node", ++ ) ++ ++ node_repositories( ++ package_json = ["@net_ankiweb_anki//ts:package.json"], ++ vendored_node = "@local_node//:node", ++ ) + + yarn_install( + name = "npm", +diff --git a/local_node/BUILD.bazel b/local_node/BUILD.bazel +new file mode 100644 +index 000000000..aa0c473ae +--- /dev/null ++++ b/local_node/BUILD.bazel +@@ -0,0 +1 @@ ++exports_files(["node/bin/node"] + glob(["node/lib/node_modules/**"])) +diff --git a/local_node/WORKSPACE b/local_node/WORKSPACE +new file mode 100644 +index 000000000..e69de29bb +diff --git a/local_node/node/bin/node b/local_node/node/bin/node +new file mode 120000 +index 000000000..d7b371472 +--- /dev/null ++++ b/local_node/node/bin/node +@@ -0,0 +1 @@ ++/usr/bin/node +\ No newline at end of file +diff --git a/local_node/node/lib/node_modules b/local_node/node/lib/node_modules +new file mode 120000 +index 000000000..23dd0736e +--- /dev/null ++++ b/local_node/node/lib/node_modules +@@ -0,0 +1 @@ ++/usr/lib/node_modules diff --git a/srcpkgs/anki/template b/srcpkgs/anki/template index 55976fbd26eb..d3e60a53fbe2 100644 --- a/srcpkgs/anki/template +++ b/srcpkgs/anki/template @@ -1,21 +1,19 @@ # Template file for 'anki' pkgname=anki -version=2.1.15 -revision=4 -build_style=gnu-makefile -depends="python3-PyQt5-webengine python3-requests python3-SQLAlchemy - python3-PyAudio python3-mpv python3-Markdown python3-send2trash - python3-BeautifulSoup4 python3-decorator python3-jsonschema" +version=2.1.44 +revision=1 +makedepends="bazel python3-devel nodejs cargo python3-PyQt5" +depends="" short_desc="Spaced repetition flashcard program" maintainer="Steve Prybylski " license="AGPL-3.0-or-later" homepage="https://apps.ankiweb.net" -changelog="https://apps.ankiweb.net/docs/changes.html" -distfiles="https://apps.ankiweb.net/downloads/archive/anki-$version-source.tgz" -checksum=5a53760164c77d619f55107a13099cffe620566a7f610b61b6c4b52487f3bb89 +changelog="https://changes.ankiweb.net/" +distfiles="https://github.com/ankitects/anki/archive/refs/tags/${version}.tar.gz" +checksum=c24c87aac042b3ac803ea22669091730a48b575ee9d9939672d46caf6d3287b5 -python_version=3 +patch_args=-Np1 -post_install() { - vlicense LICENSE +do_install() { + exit 1 }