Repository: conan-io/conan-center-index

Issue:
[package] libxslt/1.1.34: exslt is not linked
libxslt, has been merged in #1558. however i can only use libxslt, but not libexslt:

building gives me:
```
-isystem /home/tim/.conan/data/libxml2/2.9.9/_/_/package/6481b184eb5a051d8c560a91b22634a8b7db4fba/include -isystem /home/tim/.conan/data/libxml2/2.9.9/_/_/package/6481b184eb5a051d8c560a91b22634a8b7db4fba/include/libxml2 -isystem /home/tim/.conan/data/libxslt/1.1.34/_/_/package/b0f6f5566ac0abc354e2ec31cfd778c515c019e9/include -isystem /home/tim/.conan/data/libxslt/1.1.34/_/_/package/b0f6f5566ac0abc354e2ec31cfd778c515c019e9/include/libxslt
```

the linker:
```
/home/tim/.conan/data/libxslt/1.1.34/_/_/package/b0f6f5566ac0abc354e2ec31cfd778c515c019e9/lib/libxslt.a  /home/tim/.conan/data/libxml2/2.9.9/_/_/package/6481b184eb5a051d8c560a91b22634a8b7db4fba/lib/libxml2.a
```

both binaries exist, though:
```
tim@P330:~$ ls -1 /home/tim/.conan/data/libxslt/1.1.34/_/_/package/b0f6f5566ac0abc354e2ec31cfd778c515c019e9/lib/lib*.a  
/home/tim/.conan/data/libxslt/1.1.34/_/_/package/b0f6f5566ac0abc354e2ec31cfd778c515c019e9/lib/libexslt.a
/home/tim/.conan/data/libxslt/1.1.34/_/_/package/b0f6f5566ac0abc354e2ec31cfd778c515c019e9/lib/libxslt.a
```


### Package and Environment Details (include every applicable attribute)
  * Package Name/Version: **libxslt/1.1.34**
  * Operating System+version: **Linux Ubuntu 19.14**
  * Compiler+version: **GCC 9**
  * Conan version: **conan 1.24.0**
  * Python version: **Python 3.7.5**


### Conan profile (output of `conan profile show default` or `conan profile show <profile>` if custom profile is in use)
```
Configuration for profile default:

[settings]
os=Linux
os_build=Linux
arch=x86_64
arch_build=x86_64
compiler=gcc
compiler.version=9
compiler.libcxx=libstdc++11
build_type=Release
[options]
[build_requires]
[env]
```


### Steps to reproduce (Include if Applicable)

build/use `libxslt/1.1.34` from cmake.

### Expected behaviour

in a perfect world, we would have two different cmake targets: `CONAN_PKG::libxslt` and `CONAN_PKG::libexslt`



Discussion:
Interesting, it seems be a case for [components](https://github.com/conan-io/conan/issues/5090)
also, libexslt should be added to self.cpp_info.libs. @timblechmann do you know if it is always compiled on all platforms ?
@ericLemanissier not sure. in my pre-conan world i've been including the sources directly into my project
@ericLemanissier, would you please take a look on #1610 too (icu und pthread are linked on Android)?
No, sorry
No problem, I have the rollback option libxslt 1.33 from bincrafters. 

libxslt/1.33@bincrafters/stable has the same package_info method as libxslt/1.34 on CCI
https://github.com/bincrafters/conan-libxslt/blob/stable/1.1.33/conanfile.py#L161-L170 vs https://github.com/conan-io/conan-center-index/blob/master/recipes/libxslt/all/conanfile.py#L160-L169 so they should have the same libraries. what difference do you notice between the two ?
my remark was about exslt, your comments about failures on android would be better in https://github.com/conan-io/conan-center-index/issues/1610

Resolving patch:
diff --git a/recipes/libxslt/all/conanfile.py b/recipes/libxslt/all/conanfile.py
--- a/recipes/libxslt/all/conanfile.py
+++ b/recipes/libxslt/all/conanfile.py
@@ -158,10 +158,12 @@ def package(self):
                 os.unlink(la)
 
     def package_info(self):
+        self.cpp_info.libs = ['exslt', 'xslt']
         if self._is_msvc:
-            self.cpp_info.libs = ['libxslt' if self.options.shared else 'libxslt_a']
-        else:
-            self.cpp_info.libs = ['xslt']
+            if self.options.shared:
+                self.cpp_info.libs = ['lib%s' % l for l in self.cpp_info.libs]
+            else:
+                self.cpp_info.libs = ['lib%s_a' % l for l in self.cpp_info.libs]
         self.cpp_info.includedirs.append(os.path.join("include", "libxslt"))
         if self.settings.os == "Linux" or self.settings.os == "Macos":
             self.cpp_info.system_libs.append('m')


Test patch: