Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(aur): set & force java-environment=17 #848

Merged
merged 1 commit into from
Oct 8, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 13 additions & 10 deletions packages/aur/pkgbuild/PKGBUILD
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ pkgdesc="Command line tool that allows you to manage and synchronize localizatio
url="https://support.crowdin.com/cli-tool/"
license=('MIT')
depends=('java-runtime>=17')
makedepends=('git' 'java-environment>=17' 'grep' 'awk')
conflicts=('crowdin-cli-bin')
_jdkver=17
makedepends=('git' "java-environment=$_jdkver" 'grep' 'awk')
arch=('any')
md5sums=('SKIP' 'b018bcf51df64a8e68450cd7ac0e3838')

Expand All @@ -18,15 +18,18 @@ source=(

build() {
cd "$srcdir/$pkgname"
# archlinux-java status doesn’t show whether it is a jdk or jre
# the user could have installed a jdk17 and a jre17 at the same time
# (eg. jdk17-openjdk and jre17 from AUR)
PATH=$(find /usr/lib/jvm/ -wholename "*$_jdkver*/javac" -print -quit | sed 's/javac//'):$PATH
./gradlew shadowJar
./gradlew properties --no-daemon --console=plain -q | grep "^version:" | awk '{printf $2}' > _pkgBuildVersion
java -cp "build/libs/crowdin-cli-$(cat _pkgBuildVersion).jar" picocli.AutoComplete --force com.crowdin.cli.commands.picocli.RootCommand
java -cp "build/libs/crowdin-cli-$pkgver.jar" picocli.AutoComplete --force com.crowdin.cli.commands.picocli.RootCommand
}

package()
{
cd "$srcdir"
install -Dm 0644 "$srcdir/$pkgname"/build/libs/crowdin-cli-$(cat "$srcdir/$pkgname"/_pkgBuildVersion).jar "$pkgdir"/usr/share/java/$pkgname/crowdin-cli.jar
install -Dm 0755 "$startdir"/crowdin "$pkgdir"/usr/bin/crowdin
install -Dm 0644 "$srcdir/$pkgname"/crowdin_completion "$pkgdir"/usr/share/bash-completion/completions/crowdin
package() {
install -Dm 0755 crowdin "$pkgdir"/usr/bin/crowdin
cd "$srcdir/$pkgname"
install -Dm 0644 build/libs/crowdin-cli-$pkgver.jar "$pkgdir"/usr/share/java/$pkgname/crowdin-cli.jar
install -Dm 0644 crowdin_completion "$pkgdir"/usr/share/bash-completion/completions/crowdin
install -Dm 0644 LICENSE -t "$pkgdir"/usr/share/licenses/$pkgname/
}
Loading