Package Details: libselinux 2.7-1

Git Clone URL: https://aur.archlinux.org/libselinux.git (read-only)
Package Base: libselinux
Description: SELinux library and simple utilities
Upstream URL: http://userspace.selinuxproject.org
Keywords: selinux
Licenses: custom
Groups: selinux
Conflicts: selinux-usr-libselinux
Provides: selinux-usr-libselinux=2.7-1
Submitter: Siosm
Maintainer: IooNag
Last Packager: IooNag
Votes: 78
Popularity: 2.473529
First Submitted: 2013-11-03 20:05
Last Updated: 2017-08-11 12:14

Latest Comments

IooNag commented on 2017-06-02 11:48

netrunn3r: if I correctly understand, the issue you report comes from the fact that pkg-config does not use the same Ruby version as the one from your shell environment. However I fail to see the point of building the package with a non-system ruby command. Such a setup would build and install Ruby packages for a Ruby version which is different from the system one (eg. it would put files in the "wrong" system directory, like /usr/lib/ruby/2.3.0/ instead of /usr/lib/ruby/2.4.0/)...

Actually it makes sense to define RUBY=/usr/bin/ruby (and use the full paths for PYTHON definitions too) in the PKGBUILD in order to ensure the package is built with the packaged (system-wide) Ruby. Could you please add "RUBY=/usr/bin/ruby" to these lines:
* make rubywrap
* make DESTDIR="${pkgdir}" USRBINDIR="${pkgdir}"/usr/bin LIBDIR="${pkgdir}"/usr/lib SHLIBDIR="${pkgdir}"/usr/lib install-rubywrap"
... and tell whether this fixed your issue?

netrunn3r commented on 2017-06-02 08:52

I had the same problem which cminus. Problem was with this two lines:
RUBYLIBVER ?= $(shell $(RUBY) -e 'print RUBY_VERSION.split(".")[0..1].join(".")')
RUBYINC ?= $(shell $(PKG_CONFIG) --exists ruby-$(RUBYLIBVER) && $(PKG_CONFIG) --cflags ruby-$(RUBYLIBVER) || $(PKG_CONFIG) --cflags ruby)

First one return wrong version:
[netrunner@nightcity] libselinux $ ruby -e 'print RUBY_VERSION.split(".")[0..1].join(".")'
2.3

Where I have installed 2.4:
[netrunner@nightcity] libselinux $ pacman -Qi ruby
Name : ruby
Version : 2.4.1-3

pkg-config confirm that:
[netrunner@nightcity] libselinux $ pkg-config --exists ruby-2.3 ; echo $?
1
[netrunner@nightcity] libselinux $ pkg-config --exists ruby-2.4 ; echo $?
0

So variable $RUBYINC is empty and my cc looks like that (without /usr/include/ruby-2.4)
cc -march=x86-64 -mtune=generic -O2 -pipe -fstack-protector-strong -I../include -I/usr/include -D_GNU_SOURCE -DDISABLE_RPM -DNO_ANDROID_BACKEND -Wno-error -Wno-unused-variable -Wno-unused-but-set-variable -Wno-unused-parameter -Wno-shadow -Wno-uninitialized -Wno-missing-prototypes -Wno-missing-declarations -fPIC -DSHARED -c -o selinuxswig_ruby_wrap.lo selinuxswig_ruby_wrap.c


This happen because I also have rvm and I had set default ruby version to 2.3:
[netrunner@nightcity] libselinux $ ruby -v
ruby 2.3.3p222 (2016-11-21 revision 56859) [x86_64-linux]
[netrunner@nightcity] libselinux $ rvm list
rvm rubies

=* ruby-2.3.3 [ x86_64 ]

# => - current
# =* - current && default
# * - default

As you see, I don't had 2.4. After installing and setting as default version 2.4:
[netrunner@nightcity] libselinux $ /bin/bash --login # needed for installing ruby with rvm
[netrunner@nightcity] libselinux $ rvm install ruby-2.4.1
(...)
[netrunner@nightcity] libselinux $ rvm list

rvm rubies

* ruby-2.3.3 [ x86_64 ]
=> ruby-2.4.1 [ x86_64 ]

# => - current
# =* - current && default
# * - default
[netrunner@nightcity] libselinux $ rvm --default use 2.4.1

[netrunner@nightcity] libselinux $ rvm list

rvm rubies

ruby-2.3.3 [ x86_64 ]
=* ruby-2.4.1 [ x86_64 ]
# => - current
# =* - current && default
# * - default
[netrunner@nightcity] libselinux $ makepkg # still in login shell

libselinux build successfully.

Maybe use something like that:
pacman -Q ruby | cut -d ' ' -f 2 | cut -d '.' -f 1,2
to get ruby version?

cminus commented on 2017-02-19 22:53

@IooNag..
I am not sure what happened, but it worked and got installed..
PS: I have removed old rvm and let the process continue.. I am not sure how this relates to the system-installed ruby..
Kinda strange

Here there are the current outputs of the lines you requested

Arch% echo $RUBY
# Blank line

Arch% ${RUBY:-ruby} -e 'print RUBY_VERSION.split(".")[0..1].join(".")'
2.4%

Arch% pkg-config --cflags ruby-2.4
-I/usr/include/ruby-2.4.0/x86_64-linux -I/usr/include/ruby-2.4.0

Arch% ls /usr/include/ruby-2.4.0/
ruby ruby.h x86_64-linux




IooNag commented on 2017-02-19 22:05

cminus: what is the compiler line right before your error? Is it "cc -march=x86-64 -mtune=generic -O2 -pipe -fstack-protector-strong -I../include -I/usr/include -D_GNU_SOURCE -DDISABLE_RPM -DNO_ANDROID_BACKEND -Wno-error -Wno-unused-variable -Wno-unused-but-set-variable -Wno-unused-parameter -Wno-shadow -Wno-uninitialized -Wno-missing-prototypes -Wno-missing-declarations -I/usr/include/ruby-2.4.0/x86_64-linux -I/usr/include/ruby-2.4.0 -fPIC -DSHARED -c -o selinuxswig_ruby_wrap.lo selinuxswig_ruby_wrap.c"?

Also I am interested in the result of these commands on your system (the second and the third ones are used by libselinux Makefile to find where Ruby header files are installed):
* echo $RUBY
* ${RUBY:-ruby} -e 'print RUBY_VERSION.split(".")[0..1].join(".")'
* pkg-config --cflags ruby-2.4
* ls /usr/include/ruby-2.4.0/

cminus commented on 2017-02-19 21:50

I have this error and I don't know how to resolve..
Any help will be appreciated.

selinuxswig_ruby_wrap.c:855:18: fatal error: ruby.h: No such file or directory
#include <ruby.h>
^

IooNag commented on 2016-10-20 07:16

chrisbdaemon: pkg-config is in base-devel, which has to be installed before building any AUR package (cf. https://wiki.archlinux.org/index.php/Arch_User_Repository#Getting_started). Hence I won't add it to makedepends.

chrisbdaemon commented on 2016-10-19 19:24

Can pkg-config be added to the list of makedepends as well?

v1rous commented on 2016-02-07 17:50

Not sure if this is helpful or not, but I was able to build and install this package and its dependency libsepol on armv7h (RPi 2).

IooNag commented on 2015-07-23 12:02

Thanks for your comment, but actually it is not libselinux which requires flex to be built but libsepol and libsemanage. I've just added "flex" to their makedepends.

nebulon commented on 2015-07-20 12:02

The package dependencies are missing 'flex' currently.

All comments