from conans import ConanFile, AutoToolsBuildEnvironment, tools
import os


class LibxauConan(ConanFile):
    name = "libxau"
    version = "1.0.8"
    license = "Custom https://cgit.freedesktop.org/xorg/lib/libXau/tree/COPYING"
    url = "https://github.com/trigger-happy/conan-packages"
    description = "X11 authorisation library"
    settings = "os", "compiler", "build_type", "arch"
    options = {"shared": [True, False]}
    default_options = "shared=False"
    generators = "cmake"

    def source(self):
        pkgLink = 'https://xorg.freedesktop.org/releases/individual/lib/libXau-{version}.tar.bz2'.format(version=self.version)
        self.run("curl -JOL " + pkgLink)
        self.run("tar xf libXau-{version}.tar.bz2".format(version=self.version))

    def build(self):
        envBuild = AutoToolsBuildEnvironment(self)
        installPrefix=os.getcwd()
        with tools.chdir("libXau-{version}".format(version=self.version)):
            with tools.environment_append(envBuild.vars):
                self.run("./configure --prefix={0}".format(installPrefix))
                self.run("make install")

    def package(self):
        self.copy("lib/*", dst=".", keep_path=True)
        self.copy("include/*", dst=".", keep_path=True)

    def package_info(self):
        self.cpp_info.libs = ["Xau"]

@@ -768,105 +768,374 @@
 def 
-build(self):%0A        envBuild = AutoToolsBuildEnvironment(self)%0A        installPrefix=os.getcwd()
+configure(self):%0A        self.requires(%22xproto/7.0.31@trigger-happy/stable%22)%0A        self.options%5B%22xproto/7.0.31%22%5D.shared = self.options.shared%0A%0A    def build(self):%0A        envBuild = AutoToolsBuildEnvironment(self)%0A        installPrefix=os.getcwd()%0A        sharedFlag = %22--disable-shared%22%0A        if self.options.shared:%0A            sharedFlag = %22--enable-shared%22%0A
 %0A   
@@ -1314,16 +1314,20 @@
 efix=%7B0%7D
+ %7B1%7D
 %22.format
@@ -1340,16 +1340,28 @@
 llPrefix
+, sharedFlag
 ))%0A     

Improve libxau package