Github messages for voidlinux
 help / color / mirror / Atom feed
* [PR PATCH] New package: bazel-4.1.0
@ 2021-06-09 22:13 Filius-Patris
  2021-06-10  0:40 ` [PR REVIEW] " ericonr
                   ` (9 more replies)
  0 siblings, 10 replies; 11+ messages in thread
From: Filius-Patris @ 2021-06-09 22:13 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 2041 bytes --]

There is a new pull request by Filius-Patris against master on the void-packages repository

https://github.com/Filius-Patris/void-packages master
https://github.com/void-linux/void-packages/pull/31382

New package: bazel-4.1.0
<!-- Mark items with [x] where applicable -->

#### General
- [x] This is a new package and it conforms to the [quality requirements](https://github.com/void-linux/void-packages/blob/master/Manual.md#quality-requirements)

#### Have the results of the proposed changes been tested?
- [ ] I use the packages affected by the proposed changes on a regular basis and confirm this PR works for me
- [x] I generally don't use the affected packages but briefly tested this PR

### Comments
I don't really know anything about bazel. I just wanted to add it because anki uses it as build system in the newer updates.
Officially, Java is said to be an [optional dependency](https://docs.bazel.build/versions/4.1.0/install-ubuntu.html#step-3-install-a-jdk-optional), however besides `bazel --version`, nothing really seems to work without java. Should I add it as a dependency? (Might be stupid question, I'm new ;P).


<!--
If GitHub CI cannot be used to validate the build result (for example, if the
build is likely to take several hours), make sure to
[skip CI](https://github.com/void-linux/void-packages/blob/master/CONTRIBUTING.md#continuous-integration).
When skipping CI, uncomment and fill out the following section.
Note: for builds that are likely to complete in less than 2 hours, it is not
acceptable to skip CI.
-->
<!-- 
#### Does it build and run successfully? 
(Please choose at least one native build and, if supported, at least one cross build. More are better.)
- [ ] I built this PR locally for my native architecture, (ARCH-LIBC)
- [ ] I built this PR locally for these architectures (if supported. mark crossbuilds):
  - [ ] aarch64-musl
  - [ ] armv7l
  - [ ] armv6l-musl
-->


A patch file from https://github.com/void-linux/void-packages/pull/31382.patch is attached

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-master-31382.patch --]
[-- Type: text/x-diff, Size: 3906 bytes --]

From 718b806498c3754df6661c669afb4c1b2513f1e4 Mon Sep 17 00:00:00 2001
From: FiliusPatris <filiuspatrisapps@gmail.com>
Date: Wed, 9 Jun 2021 23:40:15 +0200
Subject: [PATCH] New package: bazel-4.1.0

---
 ...6dd026e90336e80616a8c1004a79a2f8640c.patch | 40 +++++++++++++++++++
 ...6e90336e80616a8c1004a79a2f8640c.patch.args |  1 +
 srcpkgs/bazel/template                        | 30 ++++++++++++++
 3 files changed, 71 insertions(+)
 create mode 100644 srcpkgs/bazel/patches/bcce6dd026e90336e80616a8c1004a79a2f8640c.patch
 create mode 100644 srcpkgs/bazel/patches/bcce6dd026e90336e80616a8c1004a79a2f8640c.patch.args
 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 <philwo@google.com>
+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 <linux/fs.h>
+ #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/patches/bcce6dd026e90336e80616a8c1004a79a2f8640c.patch.args b/srcpkgs/bazel/patches/bcce6dd026e90336e80616a8c1004a79a2f8640c.patch.args
new file mode 100644
index 000000000000..daa0cbeb2c76
--- /dev/null
+++ b/srcpkgs/bazel/patches/bcce6dd026e90336e80616a8c1004a79a2f8640c.patch.args
@@ -0,0 +1 @@
+-p1
diff --git a/srcpkgs/bazel/template b/srcpkgs/bazel/template
new file mode 100644
index 000000000000..984ccdb91841
--- /dev/null
+++ b/srcpkgs/bazel/template
@@ -0,0 +1,30 @@
+# Template file for 'bazel'
+pkgname=bazel
+version=4.1.0
+revision=3
+#archs="i686 x86_64"
+#wrksrc=
+create_wrksrc=yes
+#build_style=
+hostmakedepends=""
+makedepends="which zip unzip openjdk11 python3"
+depends=""
+short_desc="A fast, scalable, multi-language and extensible build system"
+maintainer="TobTobXX <filiuspatrisapps@gmail.com>"
+license="Apache-2.0"
+homepage="https://bazel.build/"
+distfiles="https://github.com/bazelbuild/bazel/releases/download/${version}/bazel-${version}-dist.zip"
+checksum=f377d755c96a50f6bd2f423562598d822f43356783330a0b780ad442864d6eeb
+
+# 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
+}

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [PR REVIEW] New package: bazel-4.1.0
  2021-06-09 22:13 [PR PATCH] New package: bazel-4.1.0 Filius-Patris
  2021-06-10  0:40 ` [PR REVIEW] " ericonr
@ 2021-06-10  0:40 ` ericonr
  2021-06-10  7:02 ` [PR PATCH] [Updated] [WIP] " Filius-Patris
                   ` (7 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: ericonr @ 2021-06-10  0:40 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 199 bytes --]

New review comment by ericonr on void-packages repository

https://github.com/void-linux/void-packages/pull/31382#discussion_r648771796

Comment:
Please clean up the commented out / empty variables.

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [PR REVIEW] New package: bazel-4.1.0
  2021-06-09 22:13 [PR PATCH] New package: bazel-4.1.0 Filius-Patris
@ 2021-06-10  0:40 ` ericonr
  2021-06-10  0:40 ` ericonr
                   ` (8 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: ericonr @ 2021-06-10  0:40 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 190 bytes --]

New review comment by ericonr on void-packages repository

https://github.com/void-linux/void-packages/pull/31382#discussion_r648771909

Comment:
Just add `patch_args=-Np1` to the template.

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [PR PATCH] [Updated] [WIP] New package: bazel-4.1.0
  2021-06-09 22:13 [PR PATCH] New package: bazel-4.1.0 Filius-Patris
  2021-06-10  0:40 ` [PR REVIEW] " ericonr
  2021-06-10  0:40 ` ericonr
@ 2021-06-10  7:02 ` Filius-Patris
  2021-06-10  7:41 ` fosslinux
                   ` (6 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: Filius-Patris @ 2021-06-10  7:02 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 2103 bytes --]

There is an updated pull request by Filius-Patris against master on the void-packages repository

https://github.com/Filius-Patris/void-packages master
https://github.com/void-linux/void-packages/pull/31382

[WIP] New package: bazel-4.1.0
<!-- Mark items with [x] where applicable -->

#### General
- [x] This is a new package and it conforms to the [quality requirements](https://github.com/void-linux/void-packages/blob/master/Manual.md#quality-requirements)

#### Have the results of the proposed changes been tested?
- [ ] I use the packages affected by the proposed changes on a regular basis and confirm this PR works for me
- [x] I generally don't use the affected packages but briefly tested this PR

#### Comments
I don't really know anything about bazel. I just wanted to add it because anki uses it as build system in the newer updates.

Officially, Java is said to be an [optional dependency](https://docs.bazel.build/versions/4.1.0/install-ubuntu.html#step-3-install-a-jdk-optional), however besides `bazel --version`, nothing really seems to work without java. Should I add it as a dependency? (Might be stupid question, I'm new ;P).

#### WIP: I'm gonna try to compile anki too.


<!--
If GitHub CI cannot be used to validate the build result (for example, if the
build is likely to take several hours), make sure to
[skip CI](https://github.com/void-linux/void-packages/blob/master/CONTRIBUTING.md#continuous-integration).
When skipping CI, uncomment and fill out the following section.
Note: for builds that are likely to complete in less than 2 hours, it is not
acceptable to skip CI.
-->
<!-- 
#### Does it build and run successfully? 
(Please choose at least one native build and, if supported, at least one cross build. More are better.)
- [ ] I built this PR locally for my native architecture, (ARCH-LIBC)
- [ ] I built this PR locally for these architectures (if supported. mark crossbuilds):
  - [ ] aarch64-musl
  - [ ] armv7l
  - [ ] armv6l-musl
-->


A patch file from https://github.com/void-linux/void-packages/pull/31382.patch is attached

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-master-31382.patch --]
[-- Type: text/x-diff, Size: 3386 bytes --]

From 940e158249038067d3e57eb733cce0ff795b99ed Mon Sep 17 00:00:00 2001
From: FiliusPatris <filiuspatrisapps@gmail.com>
Date: Wed, 9 Jun 2021 23:40:15 +0200
Subject: [PATCH] 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 <philwo@google.com>
+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 <linux/fs.h>
+ #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 <filiuspatrisapps@gmail.com>"
+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
+}

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [WIP] New package: bazel-4.1.0
  2021-06-09 22:13 [PR PATCH] New package: bazel-4.1.0 Filius-Patris
                   ` (2 preceding siblings ...)
  2021-06-10  7:02 ` [PR PATCH] [Updated] [WIP] " Filius-Patris
@ 2021-06-10  7:41 ` fosslinux
  2021-06-10  7:42 ` fosslinux
                   ` (5 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: fosslinux @ 2021-06-10  7:41 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 2143 bytes --]

New comment by fosslinux on void-packages repository

https://github.com/void-linux/void-packages/pull/31382#issuecomment-858391644

Comment:
I have attempted this in the past. Your bazel template looks sane.

Bazel is not sane. Neither is anki, has a stupid mix of nodejs, bazel, python and rust.

Here's my template thus far, not for the latest version yet:
```
# Template file for 'anki'
pkgname=anki
version=2.1.42
revision=1
hostmakedepends="bazel python3-pip git protobuf rust cargo rsync"
makedepends="protobuf-devel glib-devel python3-PyQt5-webengine"
depends="python3-PyQt5-webengine python3-requests python3-SQLAlchemy
 python3-PyAudio python3-mpv python3-Markdown python3-send2trash
 python3-BeautifulSoup4 python3-decorator python3-jsonschema
 python3-protobuf python3-Flask-Cors python3-waitress"
short_desc="Spaced repetition flashcard program"
maintainer="fosslinux <fosslinux@aussies.space>"
license="AGPL-3.0-or-later"
homepage="https://apps.ankiweb.net"
changelog="https://apps.ankiweb.net/docs/changes.html"
distfiles="https://github.com/ankitects/anki/archive/${version}.tar.gz"
checksum=a23e1ad9cc9d2ec2031810c847ae15efcd315123c7e0c3b3def40bd6d451d9c9
python_version=3
patch_args="-Np1"

do_build() {
        # Bazel dies on ccache
        if [ "$CROSS_BUILD" ]; then
                export CC="$(command -v ${XBPS_CROSS_TRIPLET}-gcc)"
        else
                export CC="$(command -v gcc)"
        fi
        export PYTHON_SITE_PACKAGES="${XBPS_CROSS_BASE}/${py3_sitelib}"

        bazel build -c opt dist --jobs=1
        bsdtar -xf bazel-bin/dist.tar
}

do_install() {
        # I dislike bazel
        PIP_CONFIG_FILE=/dev/null TMPDIR=/tmp python3 -m pip install --isolated --root=${DESTDIR} --prefix=/usr --ignore-installed --no-deps bazel-dist/*.whl

        vbin qt/runanki.py anki
        vinstall qt/linux/anki.desktop 644 usr/share/applications
        vinstall qt/linux/anki.png 644 usr/share/pixmaps
        vinstall qt/linux/anki.xpm 644 usr/share/pixmaps
        vman qt/linux/anki.1

        vlicense LICENSE
}
```

Haven't worked on it for a while.

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [WIP] New package: bazel-4.1.0
  2021-06-09 22:13 [PR PATCH] New package: bazel-4.1.0 Filius-Patris
                   ` (3 preceding siblings ...)
  2021-06-10  7:41 ` fosslinux
@ 2021-06-10  7:42 ` fosslinux
  2021-06-10 21:29 ` [PR PATCH] [Updated] " Filius-Patris
                   ` (4 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: fosslinux @ 2021-06-10  7:42 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 2296 bytes --]

New comment by fosslinux on void-packages repository

https://github.com/void-linux/void-packages/pull/31382#issuecomment-858391644

Comment:
I have attempted this in the past. Your bazel template looks sane.

Bazel is not sane. Neither is anki, has a stupid mix of nodejs, bazel, python and rust.

Here's my template thus far, not for the latest version yet:
```
# Template file for 'anki'
pkgname=anki
version=2.1.42
revision=1
hostmakedepends="bazel python3-pip git protobuf rust cargo rsync"
makedepends="protobuf-devel glib-devel python3-PyQt5-webengine"
depends="python3-PyQt5-webengine python3-requests python3-SQLAlchemy
 python3-PyAudio python3-mpv python3-Markdown python3-send2trash
 python3-BeautifulSoup4 python3-decorator python3-jsonschema
 python3-protobuf python3-Flask-Cors python3-waitress"
short_desc="Spaced repetition flashcard program"
maintainer="fosslinux <fosslinux@aussies.space>"
license="AGPL-3.0-or-later"
homepage="https://apps.ankiweb.net"
changelog="https://apps.ankiweb.net/docs/changes.html"
distfiles="https://github.com/ankitects/anki/archive/${version}.tar.gz"
checksum=a23e1ad9cc9d2ec2031810c847ae15efcd315123c7e0c3b3def40bd6d451d9c9
python_version=3
patch_args="-Np1"

do_build() {
        # Bazel dies on ccache
        if [ "$CROSS_BUILD" ]; then
                export CC="$(command -v ${XBPS_CROSS_TRIPLET}-gcc)"
        else
                export CC="$(command -v gcc)"
        fi
        export PYTHON_SITE_PACKAGES="${XBPS_CROSS_BASE}/${py3_sitelib}"

        bazel build -c opt dist --jobs=1
        bsdtar -xf bazel-bin/dist.tar
}

do_install() {
        # I dislike bazel
        PIP_CONFIG_FILE=/dev/null TMPDIR=/tmp python3 -m pip install --isolated --root=${DESTDIR} --prefix=/usr --ignore-installed --no-deps bazel-dist/*.whl

        vbin qt/runanki.py anki
        vinstall qt/linux/anki.desktop 644 usr/share/applications
        vinstall qt/linux/anki.png 644 usr/share/pixmaps
        vinstall qt/linux/anki.xpm 644 usr/share/pixmaps
        vman qt/linux/anki.1

        vlicense LICENSE
}
```

Haven't worked on it for a while.

Cross is still broken IIRC.  Mutlicore building is broken last I checked. Musl is broken (you may need a patch for bazel for musl which I have also).

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [PR PATCH] [Updated] [WIP] New package: bazel-4.1.0
  2021-06-09 22:13 [PR PATCH] New package: bazel-4.1.0 Filius-Patris
                   ` (4 preceding siblings ...)
  2021-06-10  7:42 ` fosslinux
@ 2021-06-10 21:29 ` Filius-Patris
  2021-06-11  9:22 ` Filius-Patris
                   ` (3 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: Filius-Patris @ 2021-06-10 21:29 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 2102 bytes --]

There is an updated pull request by Filius-Patris against master on the void-packages repository

https://github.com/Filius-Patris/void-packages master
https://github.com/void-linux/void-packages/pull/31382

[WIP] New package: bazel-4.1.0
<!-- Mark items with [x] where applicable -->

#### General
- [x] This is a new package and it conforms to the [quality requirements](https://github.com/void-linux/void-packages/blob/master/Manual.md#quality-requirements)

#### Have the results of the proposed changes been tested?
- [ ] I use the packages affected by the proposed changes on a regular basis and confirm this PR works for me
- [x] I generally don't use the affected packages but briefly tested this PR

#### Comments
I don't really know anything about bazel. I just wanted to add it because anki uses it as build system in the newer updates.

Officially, Java is said to be an [optional dependency](https://docs.bazel.build/versions/4.1.0/install-ubuntu.html#step-3-install-a-jdk-optional), however besides `bazel --version`, nothing really seems to work without java. Should I add it as a dependency? (Might be stupid question, I'm new ;P).

#### WIP: I'm gonna try to update anki too.


<!--
If GitHub CI cannot be used to validate the build result (for example, if the
build is likely to take several hours), make sure to
[skip CI](https://github.com/void-linux/void-packages/blob/master/CONTRIBUTING.md#continuous-integration).
When skipping CI, uncomment and fill out the following section.
Note: for builds that are likely to complete in less than 2 hours, it is not
acceptable to skip CI.
-->
<!-- 
#### Does it build and run successfully? 
(Please choose at least one native build and, if supported, at least one cross build. More are better.)
- [ ] I built this PR locally for my native architecture, (ARCH-LIBC)
- [ ] I built this PR locally for these architectures (if supported. mark crossbuilds):
  - [ ] aarch64-musl
  - [ ] armv7l
  - [ ] armv6l-musl
-->


A patch file from https://github.com/void-linux/void-packages/pull/31382.patch is attached

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-master-31382.patch --]
[-- Type: text/x-diff, Size: 7900 bytes --]

From 940e158249038067d3e57eb733cce0ff795b99ed Mon Sep 17 00:00:00 2001
From: FiliusPatris <filiuspatrisapps@gmail.com>
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 <philwo@google.com>
+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 <linux/fs.h>
+ #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 <filiuspatrisapps@gmail.com>"
+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 <filiuspatrisapps@gmail.com>
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 <sa.prybylx@gmail.com>"
 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
 }

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [WIP] New package: bazel-4.1.0
  2021-06-09 22:13 [PR PATCH] New package: bazel-4.1.0 Filius-Patris
                   ` (5 preceding siblings ...)
  2021-06-10 21:29 ` [PR PATCH] [Updated] " Filius-Patris
@ 2021-06-11  9:22 ` Filius-Patris
  2021-06-11 15:39 ` [PR PATCH] [Updated] " Filius-Patris
                   ` (2 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: Filius-Patris @ 2021-06-11  9:22 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 335 bytes --]

New comment by Filius-Patris on void-packages repository

https://github.com/void-linux/void-packages/pull/31382#issuecomment-859432112

Comment:
Hey sorry to ask for support here, but how can I stop xbps-src from building bazel from source? Every so often it build bazel from source instead of using the already built binary package.

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [PR PATCH] [Updated] [WIP] New package: bazel-4.1.0
  2021-06-09 22:13 [PR PATCH] New package: bazel-4.1.0 Filius-Patris
                   ` (6 preceding siblings ...)
  2021-06-11  9:22 ` Filius-Patris
@ 2021-06-11 15:39 ` Filius-Patris
  2021-06-11 15:39 ` Filius-Patris
  2021-06-11 15:56 ` Filius-Patris
  9 siblings, 0 replies; 11+ messages in thread
From: Filius-Patris @ 2021-06-11 15:39 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 2102 bytes --]

There is an updated pull request by Filius-Patris against master on the void-packages repository

https://github.com/Filius-Patris/void-packages master
https://github.com/void-linux/void-packages/pull/31382

[WIP] New package: bazel-4.1.0
<!-- Mark items with [x] where applicable -->

#### General
- [x] This is a new package and it conforms to the [quality requirements](https://github.com/void-linux/void-packages/blob/master/Manual.md#quality-requirements)

#### Have the results of the proposed changes been tested?
- [ ] I use the packages affected by the proposed changes on a regular basis and confirm this PR works for me
- [x] I generally don't use the affected packages but briefly tested this PR

#### Comments
I don't really know anything about bazel. I just wanted to add it because anki uses it as build system in the newer updates.

Officially, Java is said to be an [optional dependency](https://docs.bazel.build/versions/4.1.0/install-ubuntu.html#step-3-install-a-jdk-optional), however besides `bazel --version`, nothing really seems to work without java. Should I add it as a dependency? (Might be stupid question, I'm new ;P).

#### WIP: I'm gonna try to update anki too.


<!--
If GitHub CI cannot be used to validate the build result (for example, if the
build is likely to take several hours), make sure to
[skip CI](https://github.com/void-linux/void-packages/blob/master/CONTRIBUTING.md#continuous-integration).
When skipping CI, uncomment and fill out the following section.
Note: for builds that are likely to complete in less than 2 hours, it is not
acceptable to skip CI.
-->
<!-- 
#### Does it build and run successfully? 
(Please choose at least one native build and, if supported, at least one cross build. More are better.)
- [ ] I built this PR locally for my native architecture, (ARCH-LIBC)
- [ ] I built this PR locally for these architectures (if supported. mark crossbuilds):
  - [ ] aarch64-musl
  - [ ] armv7l
  - [ ] armv6l-musl
-->


A patch file from https://github.com/void-linux/void-packages/pull/31382.patch is attached

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-master-31382.patch --]
[-- Type: text/x-diff, Size: 3386 bytes --]

From 940e158249038067d3e57eb733cce0ff795b99ed Mon Sep 17 00:00:00 2001
From: FiliusPatris <filiuspatrisapps@gmail.com>
Date: Wed, 9 Jun 2021 23:40:15 +0200
Subject: [PATCH] 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 <philwo@google.com>
+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 <linux/fs.h>
+ #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 <filiuspatrisapps@gmail.com>"
+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
+}

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [WIP] New package: bazel-4.1.0
  2021-06-09 22:13 [PR PATCH] New package: bazel-4.1.0 Filius-Patris
                   ` (7 preceding siblings ...)
  2021-06-11 15:39 ` [PR PATCH] [Updated] " Filius-Patris
@ 2021-06-11 15:39 ` Filius-Patris
  2021-06-11 15:56 ` Filius-Patris
  9 siblings, 0 replies; 11+ messages in thread
From: Filius-Patris @ 2021-06-11 15:39 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 335 bytes --]

New comment by Filius-Patris on void-packages repository

https://github.com/void-linux/void-packages/pull/31382#issuecomment-859432112

Comment:
Hey sorry to ask for support here, but how can I stop xbps-src from building bazel from source? Every so often it build bazel from source instead of using the already built binary package.

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [WIP] New package: bazel-4.1.0
  2021-06-09 22:13 [PR PATCH] New package: bazel-4.1.0 Filius-Patris
                   ` (8 preceding siblings ...)
  2021-06-11 15:39 ` Filius-Patris
@ 2021-06-11 15:56 ` Filius-Patris
  9 siblings, 0 replies; 11+ messages in thread
From: Filius-Patris @ 2021-06-11 15:56 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 816 bytes --]

New comment by Filius-Patris on void-packages repository

https://github.com/void-linux/void-packages/pull/31382#issuecomment-859678213

Comment:
Hey there. I think I'm hopping distros, away from void for the time being. Thus I retracted my progress so far concerning building anki itself (@fosslinux's template is more complete than mine anyway).

A couple of remarks:
 - I forgot to search for currently open PRs before opening this one. This PR supersedes #24978 and the latter could probably be closed.
 - Should you need me to change anything about the PR, just ping me, I still have a live image ready.
 - Made and built on x86_64-musl. Might work on other archs too, as it truly bootstraps the codebase, but didn't dig into how cross compiling works.

Thanks for the experience, loved my stay on void.

^ permalink raw reply	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2021-06-11 15:56 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-06-09 22:13 [PR PATCH] New package: bazel-4.1.0 Filius-Patris
2021-06-10  0:40 ` [PR REVIEW] " ericonr
2021-06-10  0:40 ` ericonr
2021-06-10  7:02 ` [PR PATCH] [Updated] [WIP] " Filius-Patris
2021-06-10  7:41 ` fosslinux
2021-06-10  7:42 ` fosslinux
2021-06-10 21:29 ` [PR PATCH] [Updated] " Filius-Patris
2021-06-11  9:22 ` Filius-Patris
2021-06-11 15:39 ` [PR PATCH] [Updated] " Filius-Patris
2021-06-11 15:39 ` Filius-Patris
2021-06-11 15:56 ` Filius-Patris

Github messages for voidlinux

This inbox may be cloned and mirrored by anyone:

	git clone --mirror http://inbox.vuxu.org/voidlinux-github

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V1 voidlinux-github voidlinux-github/ http://inbox.vuxu.org/voidlinux-github \
		voidlinux-github@inbox.vuxu.org
	public-inbox-index voidlinux-github

Example config snippet for mirrors.
Newsgroup available over NNTP:
	nntp://inbox.vuxu.org/vuxu.github.voidlinux


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git