acxz / pkgbuilds

PKGBUILDs for Arch Linux
25 stars 46 forks source link

[openni2] missing dependency #172

Closed PKGaspi closed 2 years ago

PKGaspi commented 2 years ago

OpenNi2 requires javac to build but a jdk is not set as a dependency.

acxz commented 2 years ago

Can you post the specific command you are running and the error?

acxz commented 2 years ago

I believe java-environment should take care of the jdk requirement.

PKGaspi commented 2 years ago

I built from aur using yay and it failed mid-compilation. The error was a simple command not found: javac so I installed jdk-openjdk and it compiled without a problem.

I really have no idea about package building in general, but thought it was worth sharing just in case.

acxz commented 2 years ago

Thank you for sharing. I would appreciate it if you can reproduce and post the build log.

PKGaspi commented 2 years ago

I can't seem to reproduce the exact same error I described before... Now I get a generic prepare() error.

==> Starting prepare()...
==> ERROR: A failure occurred in prepare().
    Aborting...
 -> error making: openni2
FAIL: 1

Installing jdk-openjdk back again fixes this.

acxz commented 2 years ago

Here is the build log on my system:

acxz@archard ~/vcs/git/github/acxz/pkgbuilds/openni2 (git)-[master] % yay -S openni2
:: There are 3 providers available for openni2:
:: Repository AUR
    1) openni2 2) openni2-git 3) openni2-libfreenect

Enter a number (default=1): ==> 1
:: There are 3 providers available for java-environment:
:: Repositoryextra
    1) jdk-openjdk 2) jdk11-openjdk 3) jdk8-openjdk

Enter a number (default=1): ==> 1
:: Checking for conflicts...
:: Checking for inner conflicts...
[Repo:5]  java-runtime-common-3-3  jre-openjdk-headless-17.0.1.u12-1  jre-openjdk-17.0.1.u12-1  java-environment-common-3-3  jdk-openjdk-17.0.1.u12-1
[Aur:1]  openni2-2.2.0-1

  1 openni2                          (Build Files Exist)
==> Packages to cleanBuild?
==> [N]one [A]ll [Ab]ort [I]nstalled [No]tInstalled or (1 2 3, 1-3, ^4)
==> A
:: Deleting (1/1): /home/acxz/.cache/yay/openni2
:: (1/1) Downloaded PKGBUILD: openni2
  1 openni2                          (Build Files Exist)
==> Diffs to show?
==> [N]one [A]ll [Ab]ort [I]nstalled [No]tInstalled or (1 2 3, 1-3, ^4)
==> N
:: (1/1) Parsing SRCINFO: openni2
resolving dependencies...
looking for conflicting packages...

Packages (5) java-environment-common-3-3  java-runtime-common-3-3  jdk-openjdk-17.0.1.u12-1  jre-openjdk-17.0.1.u12-1
             jre-openjdk-headless-17.0.1.u12-1

Total Installed Size:  256.20 MiB

:: Proceed with installation? [Y/n] Y
(5/5) checking keys in keyring                                               [--------------------------------------------] 100%
(5/5) checking package integrity                                             [--------------------------------------------] 100%
(5/5) loading package files                                                  [--------------------------------------------] 100%
(5/5) checking for file conflicts                                            [--------------------------------------------] 100%
(5/5) checking available disk space                                          [--------------------------------------------] 100%
:: Processing package changes...
(1/5) installing java-runtime-common                                         [--------------------------------------------] 100%
For the complete set of Java binaries to be available in your PATH,
you need to re-login or source /etc/profile.d/jre.sh
Please note that this package does not support forcing JAVA_HOME as former package java-common did
(2/5) installing jre-openjdk-headless                                        [--------------------------------------------] 100%
Optional dependencies for jre-openjdk-headless
    java-rhino: for some JavaScript support
(3/5) installing jre-openjdk                                                 [--------------------------------------------] 100%
when you use a non-reparenting window manager,
set _JAVA_AWT_WM_NONREPARENTING=1 in /etc/profile.d/jre.sh
Optional dependencies for jre-openjdk
    alsa-lib: for basic sound support [installed]
    gtk2: for the Gtk+ 2 look and feel - desktop usage [installed]
    gtk3: for the Gtk+ 3 look and feel - desktop usage [installed]
(4/5) installing java-environment-common                                     [--------------------------------------------] 100%
(5/5) installing jdk-openjdk                                                 [--------------------------------------------] 100%
:: Running post-transaction hooks...
(1/3) Arming ConditionNeedsUpdate...
(2/3) Updating icon theme caches...
(3/3) Updating the desktop file MIME type cache...
==> Making package: openni2 2.2.0-1 (Wed 23 Feb 2022 02:04:43 PM EST)
==> Retrieving sources...
  -> Downloading v2.2.0-debian.tar.gz...
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100   142  100   142    0     0    971      0 --:--:-- --:--:-- --:--:--   972
100 8341k    0 8341k    0     0  7389k      0 --:--:--  0:00:01 --:--:-- 10.5M
  -> Found 0002-Change-path-of-config-files-to-etc-openni2.patch
  -> Found 0003-Use-system-wide-libjpeg.patch
  -> Found 0005-change-default-ni-drivers-path.patch
  -> Found 0013-Fix-GCC6-compilation.patch
  -> Found 0014-fix-format-overflow-for-GCC7.patch
  -> Found 0015-Initialize-variable-for-gcc7.patch
  -> Found libopenni2.pc
==> Validating source files with sha256sums...
    v2.2.0-debian.tar.gz ... Passed
    0002-Change-path-of-config-files-to-etc-openni2.patch ... Passed
    0003-Use-system-wide-libjpeg.patch ... Passed
    0005-change-default-ni-drivers-path.patch ... Passed
    0013-Fix-GCC6-compilation.patch ... Passed
    0014-fix-format-overflow-for-GCC7.patch ... Passed
    0015-Initialize-variable-for-gcc7.patch ... Passed
    libopenni2.pc ... Passed
 -> java-environment not satisfied, flushing install queue
==> Making package: openni2 2.2.0-1 (Wed 23 Feb 2022 02:04:46 PM EST)
==> Checking runtime dependencies...
==> Checking buildtime dependencies...
==> Retrieving sources...
  -> Found v2.2.0-debian.tar.gz
  -> Found 0002-Change-path-of-config-files-to-etc-openni2.patch
  -> Found 0003-Use-system-wide-libjpeg.patch
  -> Found 0005-change-default-ni-drivers-path.patch
  -> Found 0013-Fix-GCC6-compilation.patch
  -> Found 0014-fix-format-overflow-for-GCC7.patch
  -> Found 0015-Initialize-variable-for-gcc7.patch
  -> Found libopenni2.pc
==> Validating source files with sha256sums...
    v2.2.0-debian.tar.gz ... Passed
    0002-Change-path-of-config-files-to-etc-openni2.patch ... Passed
    0003-Use-system-wide-libjpeg.patch ... Passed
    0005-change-default-ni-drivers-path.patch ... Passed
    0013-Fix-GCC6-compilation.patch ... Passed
    0014-fix-format-overflow-for-GCC7.patch ... Passed
    0015-Initialize-variable-for-gcc7.patch ... Passed
    libopenni2.pc ... Passed
==> Removing existing $srcdir/ directory...
==> Extracting sources...
  -> Extracting v2.2.0-debian.tar.gz with bsdtar
==> Starting prepare()...
patching file Source/Tools/NiViewer/NiViewer.cpp
patching file Source/Core/OniContext.cpp
patching file Source/Core/Makefile
patching file Source/Drivers/OniFile/Makefile
patching file Source/Drivers/PS1080/Makefile
patching file Source/Core/OniContext.cpp
patching file Source/Drivers/PS1080/Formats/XnFormatsMirror.cpp
patching file ThirdParty/GL/glh/glh_glut2.h
patching file ThirdParty/GL/glh/glh_linear.h
patching file Source/Drivers/PS1080/Sensor/XnFrameStreamProcessor.cpp
patching file Source/Drivers/PS1080/Sensor/XnSensorFirmwareParams.cpp
patching file Source/Tools/NiViewer/Device.cpp
==> Sources are ready.
==> Making package: openni2 2.2.0-1 (Wed 23 Feb 2022 02:04:48 PM EST)
==> Checking runtime dependencies...
==> Checking buildtime dependencies...
==> WARNING: Using existing $srcdir/ tree
==> Starting build()...
make -C ThirdParty/PSCommon/XnLib/Source
make -C Source/DepthUtils
make -C Wrappers/java/OpenNI.java

As you can see jdk-openjdk gets installed as it provides java-environment-common which is a dep for openni2.

Can you run yay -Rns java-environment-common and then run yay -S openni2 and paste the build output.

acxz commented 2 years ago

Closing due to inactivity, feel free to update if the error still persists/can be reproduced.

alhirzel commented 2 years ago

I encountered this error, and since I already had the JDK installed, I was scratching my head. Ultimately, I needed to perform the following steps to get openni2 to build:

$ sudo archlinux-java set java-19-openjdk
$ archlinux-java status
Available Java environments:
  java-11-openjdk
  java-19-openjdk (default)

It was previously set to version 11, and setting it to version 19 fixed. I am not familiar with the build process for Java applications/libraries, just wanted to add another breadcrumb to the trail. @acxz

acxz commented 2 years ago

Sweet thanks for this tidbit, hopefully it helps anyone that comes across this issue.