kaoh / globalplatform

C library + command-line for Open- / GlobalPlatform smart cards
https://kaoh.github.io/globalplatform/
Other
72 stars 30 forks source link

Packaging for AUR #52

Closed micwoj92 closed 3 years ago

micwoj92 commented 3 years ago

Hello, recently I took over maintainership of globalplatform and gpshell AUR packages. When compiling gpshell I had problem building:

-- The C compiler identification is GNU 11.1.0
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: /usr/bin/cc - skipped
-- Detecting C compile features
-- Detecting C compile features - done
CMake Deprecation Warning at CMakeLists.txt:2 (CMAKE_MINIMUM_REQUIRED):
  Compatibility with CMake < 2.8.12 will be removed from a future version of
  CMake.

  Update the VERSION argument <min> value or use a ...<max> suffix to tell
  CMake that the project does not need compatibility with older versions.

CMake Deprecation Warning at CMakeLists.txt:4 (cmake_policy):
  Compatibility with CMake < 2.8.12 will be removed from a future version of
  CMake.

  Update the VERSION argument <min> value or use a ...<max> suffix to tell
  CMake that the project does not need compatibility with older versions.

-- Found PkgConfig: /usr/bin/pkg-config (found version "1.8.0") 
-- Checking for module 'libpcsclite'
--   Found libpcsclite, version 1.9.4
-- Found PCSC: pcsclite  
-- Checking for module 'libglobalplatform'
--   Package 'libglobalplatform', required by 'virtual:world', not found
-- Found GLOBALPLATFORM: /home/micwoj92/build/gpshell/src/globalplatform-3832300cc5ade0439c2757ead1cf04e0e946e903/gpshell/globalplatform/src/libglobalplatform.so  
-- Checking for pandoc
--   Found pandoc
-- Configuring done
-- Generating done
-- Build files have been written to: /home/micwoj92/build/gpshell/src/globalplatform-3832300cc5ade0439c2757ead1cf04e0e946e903/gpshell
make[2]: *** No rule to make target 'globalplatform/src/libglobalplatform.so', needed by 'src/gpshell'.  Stop.
make[2]: *** Waiting for unfinished jobs....
[ 33%] Creating man page ...
[ 66%] Building C object src/CMakeFiles/gpshell.dir/gpshell.c.o
[ 66%] Built target gpshell_manpage
make[1]: *** [CMakeFiles/Makefile2:126: src/CMakeFiles/gpshell.dir/all] Error 2
make: *** [Makefile:156: all] Error 2

I currently fixed that by replacing libglobalplatform with globalplatform using sed, but I think it's not the best solution, you can see the PKGBUILD files for the packages here: https://aur.archlinux.org/cgit/aur.git/tree/PKGBUILD?h=globalplatform https://aur.archlinux.org/cgit/aur.git/tree/PKGBUILD?h=gpshell

Any help/tips appreciated, thanks!

kaoh commented 3 years ago

I will start a virtual box image and looking into this issue.

kaoh commented 3 years ago

So far I could not reproduce this. I did after installing the arch server 64 bit:

pacman -S git openssl doxygen pandoc cmake cmocka zlib graphviz pcsc-lite cmake gcc git
git clone ...
cd globalplatform
cmake .
make
make doc

Can you provide the steps to execute? BTW.: I'm using the master branch,

micwoj92 commented 3 years ago

I had the problems using the PKGBUILDs

git clone https://aur.archlinux.org/globalplatform.git
cd globalplatform && makepkg -si
cd ..
git clone https://aur.archlinux.org/gpshell.git
cd gpshell && makepkg -si

Keep in mind that this builds fine, in order for it to fail you will have to remove the prepare function in second PKGBUILD.

kaoh commented 3 years ago

It seems that the cmake FindGlobalPlatform script is incorrect. The lib prefix is in general incorrect for pkg-config. This becomes only visible when building the library and gpshell separately. I will push an fix for this.

micwoj92 commented 3 years ago

Oh, weird that noone else got this bug in all these years that cmake is used to build.

kaoh commented 3 years ago

Usually I guess everything is built in one run, not separately, so nobody noticed until now.

kaoh commented 3 years ago

Thanks for finding this issue. Please check the latest master and give it a new try. I might also build some new Homebrew and Windows builds tagging it as 2.0.1. If you want to reference from a tag version then this might be helpful, too.

micwoj92 commented 3 years ago

Yes it works, thanks.

If you want to reference from a tag version then this might be helpful, too.

Previously the packages were downloading sources from sourceforge releases but I saw that the source code is no longer posted there. Also there are no tags for the GlobalPlatform itself so I just decided it will be best if both packages were downloading sources from commit that bumped version. https://github.com/kaoh/globalplatform/commit/3832300cc5ade0439c2757ead1cf04e0e946e903

kaoh commented 3 years ago

I have pushed tag 2.1.1. Sourceforge is also still used. The git repo is in sync. Also also drop there new Windows binaries in addition to the release page on GitHub.